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

_Z16htole32_internalj:
   39|  7.45k|{
   40|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(host_32bits);
   41|  7.45k|        else return host_32bits;
   42|  7.45k|}

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

_Z9WriteLE32ITk8ByteTypehEvPT_j:
   51|  7.45k|{
   52|  7.45k|    uint32_t v = htole32_internal(x);
   53|  7.45k|    memcpy(ptr, &v, 4);
   54|  7.45k|}

_ZN9ChainCodeD2Ev:
   28|      2|    ~ChainCode() { memory_cleanse(data(), size()); }

_ZN4CKey5CheckEPKh:
  159|  2.99k|bool CKey::Check(const unsigned char *vch) {
  160|  2.99k|    return secp256k1_ec_seckey_verify(secp256k1_context_static, vch);
  161|  2.99k|}
_Z10SigHasLowRPK25secp256k1_ecdsa_signature:
  199|  7.45k|{
  200|  7.45k|    unsigned char compact_sig[64];
  201|  7.45k|    secp256k1_ecdsa_signature_serialize_compact(secp256k1_context_static, compact_sig, sig);
  202|       |
  203|       |    // In DER serialization, all values are interpreted as big-endian, signed integers. The highest bit in the integer indicates
  204|       |    // its signed-ness; 0 is positive, 1 is negative. When the value is interpreted as a negative integer, it must be converted
  205|       |    // to a positive value by prepending a 0x00 byte so that the highest bit is 0. We can avoid this prepending by ensuring that
  206|       |    // our highest bit is always 0, and thus we must check that the first byte is less than 0x80.
  207|  7.45k|    return compact_sig[0] < 0x80;
  208|  7.45k|}
_ZNK4CKey4SignERK7uint256RNSt3__16vectorIhNS3_9allocatorIhEEEEbj:
  210|  2.94k|bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, bool grind, uint32_t test_case) const {
  211|  2.94k|    if (!keydata)
  ------------------
  |  Branch (211:9): [True: 0, False: 2.94k]
  ------------------
  212|      0|        return false;
  213|  2.94k|    vchSig.resize(CPubKey::SIGNATURE_SIZE);
  214|  2.94k|    size_t nSigLen = CPubKey::SIGNATURE_SIZE;
  215|  2.94k|    unsigned char extra_entropy[32] = {0};
  216|  2.94k|    WriteLE32(extra_entropy, test_case);
  217|  2.94k|    secp256k1_ecdsa_signature sig;
  218|  2.94k|    uint32_t counter = 0;
  219|  2.94k|    int ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, (!grind && test_case) ? extra_entropy : nullptr);
  ------------------
  |  Branch (219:135): [True: 0, False: 2.94k]
  |  Branch (219:145): [True: 0, False: 0]
  ------------------
  220|       |
  221|       |    // Grind for low R
  222|  7.45k|    while (ret && !SigHasLowR(&sig) && grind) {
  ------------------
  |  Branch (222:12): [True: 7.45k, False: 0]
  |  Branch (222:19): [True: 4.51k, False: 2.94k]
  |  Branch (222:40): [True: 4.51k, False: 0]
  ------------------
  223|  4.51k|        WriteLE32(extra_entropy, ++counter);
  224|  4.51k|        ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, extra_entropy);
  225|  4.51k|    }
  226|  2.94k|    assert(ret);
  ------------------
  |  Branch (226:5): [True: 2.94k, False: 0]
  ------------------
  227|  2.94k|    secp256k1_ecdsa_signature_serialize_der(secp256k1_context_static, vchSig.data(), &nSigLen, &sig);
  228|  2.94k|    vchSig.resize(nSigLen);
  229|       |    // Additional verification step to prevent using a potentially corrupted signature
  230|  2.94k|    secp256k1_pubkey pk;
  231|  2.94k|    ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pk, UCharCast(begin()));
  232|  2.94k|    assert(ret);
  ------------------
  |  Branch (232:5): [True: 2.94k, False: 0]
  ------------------
  233|  2.94k|    ret = secp256k1_ecdsa_verify(secp256k1_context_static, &sig, hash.begin(), &pk);
  234|  2.94k|    assert(ret);
  ------------------
  |  Branch (234:5): [True: 2.94k, False: 0]
  ------------------
  235|  2.94k|    return true;
  236|  2.94k|}
_ZNK4CKey14EllSwiftCreateENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  314|  2.94k|{
  315|  2.94k|    assert(keydata);
  ------------------
  |  Branch (315:5): [True: 2.94k, False: 0]
  ------------------
  316|  2.94k|    assert(ent32.size() == 32);
  ------------------
  |  Branch (316:5): [True: 2.94k, False: 0]
  ------------------
  317|  2.94k|    std::array<std::byte, EllSwiftPubKey::size()> encoded_pubkey;
  318|       |
  319|  2.94k|    auto success = secp256k1_ellswift_create(secp256k1_context_sign,
  320|  2.94k|                                             UCharCast(encoded_pubkey.data()),
  321|  2.94k|                                             keydata->data(),
  322|  2.94k|                                             UCharCast(ent32.data()));
  323|       |
  324|       |    // Should always succeed for valid keys (asserted above).
  325|  2.94k|    assert(success);
  ------------------
  |  Branch (325:5): [True: 2.94k, False: 0]
  ------------------
  326|  2.94k|    return {encoded_pubkey};
  327|  2.94k|}
_ZN11ECC_ContextD2Ev:
  501|      2|{
  502|      2|    ECC_Stop();
  503|      2|}
key.cpp:_ZL8ECC_Stopv:
  486|      2|static void ECC_Stop() {
  487|      2|    secp256k1_context *ctx = secp256k1_context_sign;
  488|      2|    secp256k1_context_sign = nullptr;
  489|       |
  490|      2|    if (ctx) {
  ------------------
  |  Branch (490:9): [True: 2, False: 0]
  ------------------
  491|      2|        secp256k1_context_destroy(ctx);
  492|      2|    }
  493|      2|}

_ZN4CKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_b:
  109|  2.99k|    {
  110|  2.99k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (110:13): [True: 0, False: 2.99k]
  ------------------
  111|      0|            ClearKeyData();
  112|  2.99k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (112:20): [True: 2.94k, False: 52]
  ------------------
  113|  2.94k|            MakeKeyData();
  114|  2.94k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  115|  2.94k|            fCompressed = fCompressedIn;
  116|  2.94k|        } else {
  117|     52|            ClearKeyData();
  118|     52|        }
  119|  2.99k|    }
_ZNK4CKey5beginEv:
  124|  10.3k|    const std::byte* begin() const { return data(); }
_ZNK4CKey4dataEv:
  123|  10.3k|    const std::byte* data() const { return keydata ? reinterpret_cast<const std::byte*>(keydata->data()) : nullptr; }
  ------------------
  |  Branch (123:44): [True: 10.3k, False: 0]
  ------------------
_ZN4CKeyC2Ev:
   79|  2.99k|    CKey() noexcept = default;
_ZN4CKey11MakeKeyDataEv:
   69|  2.94k|    {
   70|  2.94k|        if (!keydata) keydata = make_secure_unique<KeyType>();
  ------------------
  |  Branch (70:13): [True: 2.94k, False: 0]
  ------------------
   71|  2.94k|    }
_ZN4CKey12ClearKeyDataEv:
   74|     52|    {
   75|     52|        keydata.reset();
   76|     52|    }
_ZNK4CKey7IsValidEv:
  128|  2.99k|    bool IsValid() const { return !!keydata; }

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

_ZNK9prevectorILj16EhjiE9is_directEv:
  126|     16|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj16EhjiED2Ev:
  422|     16|    ~prevector() {
  423|     16|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 0, False: 16]
  ------------------
  424|      0|            free(_union.indirect_contents.indirect);
  425|      0|            _union.indirect_contents.indirect = nullptr;
  426|      0|        }
  427|     16|    }
_ZNK9prevectorILj36EhjiE9is_directEv:
  126|     18|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj36EhjiED2Ev:
  422|     18|    ~prevector() {
  423|     18|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 4, False: 14]
  ------------------
  424|      4|            free(_union.indirect_contents.indirect);
  425|      4|            _union.indirect_contents.indirect = nullptr;
  426|      4|        }
  427|     18|    }

_Z29ecdsa_signature_parse_der_laxP25secp256k1_ecdsa_signaturePKhm:
   45|  2.94k|int ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
   46|  2.94k|    size_t rpos, rlen, spos, slen;
   47|  2.94k|    size_t pos = 0;
   48|  2.94k|    size_t lenbyte;
   49|  2.94k|    unsigned char tmpsig[64] = {0};
   50|  2.94k|    int overflow = 0;
   51|       |
   52|       |    /* Hack to initialize sig with a correctly-parsed but invalid signature. */
   53|  2.94k|    secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
   54|       |
   55|       |    /* Sequence tag byte */
   56|  2.94k|    if (pos == inputlen || input[pos] != 0x30) {
  ------------------
  |  Branch (56:9): [True: 0, False: 2.94k]
  |  Branch (56:28): [True: 0, False: 2.94k]
  ------------------
   57|      0|        return 0;
   58|      0|    }
   59|  2.94k|    pos++;
   60|       |
   61|       |    /* Sequence length bytes */
   62|  2.94k|    if (pos == inputlen) {
  ------------------
  |  Branch (62:9): [True: 0, False: 2.94k]
  ------------------
   63|      0|        return 0;
   64|      0|    }
   65|  2.94k|    lenbyte = input[pos++];
   66|  2.94k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.94k]
  ------------------
   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|  2.94k|    if (pos == inputlen || input[pos] != 0x02) {
  ------------------
  |  Branch (75:9): [True: 0, False: 2.94k]
  |  Branch (75:28): [True: 0, False: 2.94k]
  ------------------
   76|      0|        return 0;
   77|      0|    }
   78|  2.94k|    pos++;
   79|       |
   80|       |    /* Integer length for R */
   81|  2.94k|    if (pos == inputlen) {
  ------------------
  |  Branch (81:9): [True: 0, False: 2.94k]
  ------------------
   82|      0|        return 0;
   83|      0|    }
   84|  2.94k|    lenbyte = input[pos++];
   85|  2.94k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (85:9): [True: 0, False: 2.94k]
  ------------------
   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|  2.94k|    } else {
  105|  2.94k|        rlen = lenbyte;
  106|  2.94k|    }
  107|  2.94k|    if (rlen > inputlen - pos) {
  ------------------
  |  Branch (107:9): [True: 0, False: 2.94k]
  ------------------
  108|      0|        return 0;
  109|      0|    }
  110|  2.94k|    rpos = pos;
  111|  2.94k|    pos += rlen;
  112|       |
  113|       |    /* Integer tag byte for S */
  114|  2.94k|    if (pos == inputlen || input[pos] != 0x02) {
  ------------------
  |  Branch (114:9): [True: 0, False: 2.94k]
  |  Branch (114:28): [True: 0, False: 2.94k]
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  2.94k|    pos++;
  118|       |
  119|       |    /* Integer length for S */
  120|  2.94k|    if (pos == inputlen) {
  ------------------
  |  Branch (120:9): [True: 0, False: 2.94k]
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|  2.94k|    lenbyte = input[pos++];
  124|  2.94k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (124:9): [True: 0, False: 2.94k]
  ------------------
  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|  2.94k|    } else {
  144|  2.94k|        slen = lenbyte;
  145|  2.94k|    }
  146|  2.94k|    if (slen > inputlen - pos) {
  ------------------
  |  Branch (146:9): [True: 0, False: 2.94k]
  ------------------
  147|      0|        return 0;
  148|      0|    }
  149|  2.94k|    spos = pos;
  150|       |
  151|       |    /* Ignore leading zeroes in R */
  152|  2.96k|    while (rlen > 0 && input[rpos] == 0) {
  ------------------
  |  Branch (152:12): [True: 2.96k, False: 0]
  |  Branch (152:24): [True: 19, False: 2.94k]
  ------------------
  153|     19|        rlen--;
  154|     19|        rpos++;
  155|     19|    }
  156|       |    /* Copy R value */
  157|  2.94k|    if (rlen > 32) {
  ------------------
  |  Branch (157:9): [True: 0, False: 2.94k]
  ------------------
  158|      0|        overflow = 1;
  159|  2.94k|    } else {
  160|  2.94k|        memcpy(tmpsig + 32 - rlen, input + rpos, rlen);
  161|  2.94k|    }
  162|       |
  163|       |    /* Ignore leading zeroes in S */
  164|  2.97k|    while (slen > 0 && input[spos] == 0) {
  ------------------
  |  Branch (164:12): [True: 2.97k, False: 0]
  |  Branch (164:24): [True: 27, False: 2.94k]
  ------------------
  165|     27|        slen--;
  166|     27|        spos++;
  167|     27|    }
  168|       |    /* Copy S value */
  169|  2.94k|    if (slen > 32) {
  ------------------
  |  Branch (169:9): [True: 0, False: 2.94k]
  ------------------
  170|      0|        overflow = 1;
  171|  2.94k|    } else {
  172|  2.94k|        memcpy(tmpsig + 64 - slen, input + spos, slen);
  173|  2.94k|    }
  174|       |
  175|  2.94k|    if (!overflow) {
  ------------------
  |  Branch (175:9): [True: 2.94k, False: 0]
  ------------------
  176|  2.94k|        overflow = !secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
  177|  2.94k|    }
  178|  2.94k|    if (overflow) {
  ------------------
  |  Branch (178:9): [True: 0, False: 2.94k]
  ------------------
  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|  2.94k|    return 1;
  185|  2.94k|}
_ZNK7CPubKey6VerifyERK7uint256RKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  283|  2.94k|bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) const {
  284|  2.94k|    if (!IsValid())
  ------------------
  |  Branch (284:9): [True: 0, False: 2.94k]
  ------------------
  285|      0|        return false;
  286|  2.94k|    secp256k1_pubkey pubkey;
  287|  2.94k|    secp256k1_ecdsa_signature sig;
  288|  2.94k|    if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) {
  ------------------
  |  Branch (288:9): [True: 0, False: 2.94k]
  ------------------
  289|      0|        return false;
  290|      0|    }
  291|  2.94k|    if (!ecdsa_signature_parse_der_lax(&sig, vchSig.data(), vchSig.size())) {
  ------------------
  |  Branch (291:9): [True: 0, False: 2.94k]
  ------------------
  292|      0|        return false;
  293|      0|    }
  294|       |    /* libsecp256k1's ECDSA verification requires lower-S signatures, which have
  295|       |     * not historically been enforced in Bitcoin, so normalize them first. */
  296|  2.94k|    secp256k1_ecdsa_signature_normalize(secp256k1_context_static, &sig, &sig);
  297|  2.94k|    return secp256k1_ecdsa_verify(secp256k1_context_static, &sig, hash.begin(), &pubkey);
  298|  2.94k|}
_ZN14EllSwiftPubKeyC2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  366|  2.94k|{
  367|  2.94k|    assert(ellswift.size() == SIZE);
  ------------------
  |  Branch (367:5): [True: 2.94k, False: 0]
  ------------------
  368|  2.94k|    std::copy(ellswift.begin(), ellswift.end(), m_pubkey.begin());
  369|  2.94k|}
_ZNK14EllSwiftPubKey6DecodeEv:
  372|  2.94k|{
  373|  2.94k|    secp256k1_pubkey pubkey;
  374|  2.94k|    secp256k1_ellswift_decode(secp256k1_context_static, &pubkey, UCharCast(m_pubkey.data()));
  375|       |
  376|  2.94k|    size_t sz = CPubKey::COMPRESSED_SIZE;
  377|  2.94k|    std::array<uint8_t, CPubKey::COMPRESSED_SIZE> vch_bytes;
  378|       |
  379|  2.94k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, vch_bytes.data(), &sz, &pubkey, SECP256K1_EC_COMPRESSED);
  ------------------
  |  |  216|  2.94k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  197|  2.94k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  202|  2.94k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  380|  2.94k|    assert(sz == vch_bytes.size());
  ------------------
  |  Branch (380:5): [True: 2.94k, False: 0]
  ------------------
  381|       |
  382|  2.94k|    return CPubKey{vch_bytes.begin(), vch_bytes.end()};
  383|  2.94k|}

_ZN7CPubKey6GetLenEh:
   67|  8.83k|    {
   68|  8.83k|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (68:13): [True: 4.52k, False: 4.31k]
  |  Branch (68:30): [True: 4.31k, False: 0]
  ------------------
   69|  8.83k|            return COMPRESSED_SIZE;
   70|      0|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (70:13): [True: 0, False: 0]
  |  Branch (70:30): [True: 0, False: 0]
  |  Branch (70:47): [True: 0, False: 0]
  ------------------
   71|      0|            return SIZE;
   72|      0|        return 0;
   73|      0|    }
_ZNK7CPubKey4sizeEv:
  118|  5.88k|    unsigned int size() const { return GetLen(vch[0]); }
_ZNK7CPubKey7IsValidEv:
  192|  2.94k|    {
  193|  2.94k|        return size() > 0;
  194|  2.94k|    }
_ZN7CPubKey3SetIPhEEvT_S2_:
   96|  2.94k|    {
   97|  2.94k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (97:19): [True: 0, False: 2.94k]
  ------------------
   98|  2.94k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (98:13): [True: 2.94k, False: 0]
  |  Branch (98:20): [True: 2.94k, False: 0]
  ------------------
   99|  2.94k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
  100|      0|        else
  101|      0|            Invalidate();
  102|  2.94k|    }
_ZN7CPubKeyC2IPhEET_S2_:
  107|  2.94k|    {
  108|  2.94k|        Set(pbegin, pend);
  109|  2.94k|    }

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

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

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

_ZN15SigningProviderD2Ev:
  170|      2|    virtual ~SigningProvider() = default;

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

secp256k1.c:secp256k1_eckey_pubkey_parse:
   18|  2.94k|static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size) {
   19|  2.94k|    if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  220|  5.88k|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
                  if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  221|  1.43k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (19:9): [True: 2.94k, False: 0]
  |  Branch (19:24): [True: 1.50k, False: 1.43k]
  |  Branch (19:63): [True: 1.43k, False: 0]
  ------------------
   20|  2.94k|        secp256k1_fe x;
   21|  2.94k|        return secp256k1_fe_set_b32_limit(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);
  ------------------
  |  |   88|  2.94k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
                      return secp256k1_fe_set_b32_limit(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);
  ------------------
  |  |  221|  2.94k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (21:16): [True: 2.94k, False: 0]
  |  Branch (21:57): [True: 2.94k, False: 0]
  ------------------
   22|  2.94k|    } else if (size == 65 && (pub[0] == SECP256K1_TAG_PUBKEY_UNCOMPRESSED || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  222|      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)) {
  ------------------
  |  |  223|      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)) {
  ------------------
  |  |  224|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (22:16): [True: 0, False: 0]
  |  Branch (22:31): [True: 0, False: 0]
  |  Branch (22:78): [True: 0, False: 0]
  |  Branch (22:124): [True: 0, False: 0]
  ------------------
   23|      0|        secp256k1_fe x, y;
   24|      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 (24:13): [True: 0, False: 0]
  |  Branch (24:55): [True: 0, False: 0]
  ------------------
   25|      0|            return 0;
   26|      0|        }
   27|      0|        secp256k1_ge_set_xy(elem, &x, &y);
   28|      0|        if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  223|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
  ------------------
                      if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  224|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (28:14): [True: 0, False: 0]
  |  Branch (28:60): [True: 0, False: 0]
  ------------------
   29|      0|            secp256k1_fe_is_odd(&y) != (pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |   85|      0|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                          secp256k1_fe_is_odd(&y) != (pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  224|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (29:13): [True: 0, False: 0]
  ------------------
   30|      0|            return 0;
   31|      0|        }
   32|      0|        return secp256k1_ge_is_valid_var(elem);
   33|      0|    } else {
   34|      0|        return 0;
   35|      0|    }
   36|  2.94k|}
secp256k1.c:secp256k1_eckey_pubkey_serialize33:
   38|  2.94k|static void secp256k1_eckey_pubkey_serialize33(secp256k1_ge *elem, unsigned char *pub33) {
   39|  2.94k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(elem));
   40|       |
   41|  2.94k|    secp256k1_fe_normalize_var(&elem->x);
  ------------------
  |  |   80|  2.94k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
   42|  2.94k|    secp256k1_fe_normalize_var(&elem->y);
  ------------------
  |  |   80|  2.94k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
   43|  2.94k|    pub33[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |   85|  2.94k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                  pub33[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |  221|  1.43k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
                  pub33[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |  220|  4.45k|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
  |  Branch (43:16): [True: 1.43k, False: 1.50k]
  ------------------
   44|  2.94k|    secp256k1_fe_get_b32(&pub33[1], &elem->x);
  ------------------
  |  |   89|  2.94k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   45|  2.94k|}

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|  13.3k|static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {
   23|  13.3k|    return ctx->built;
   24|  13.3k|}
secp256k1.c:secp256k1_ecmult_gen_gej:
   54|  13.3k|static void secp256k1_ecmult_gen_gej(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {
   55|  13.3k|    uint32_t comb_off;
   56|  13.3k|    secp256k1_ge add;
   57|  13.3k|    secp256k1_fe neg;
   58|  13.3k|    secp256k1_ge_storage adds;
   59|  13.3k|    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|  13.3k|    uint32_t recoded[(COMB_BITS + 31) >> 5] = {0};
   64|  13.3k|    int first = 1, i;
   65|       |
   66|  13.3k|    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|  13.3k|    secp256k1_scalar_add(&d, &ctx->scalar_offset, gn);
  111|       |    /* Convert to recoded array. */
  112|   120k|    for (i = 0; i < 8 && i < ((COMB_BITS + 31) >> 5); ++i) {
  ------------------
  |  |   85|   106k|#define COMB_BITS (COMB_BLOCKS * COMB_TEETH * COMB_SPACING)
  |  |  ------------------
  |  |  |  |   79|   106k|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  190|   106k|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (112:17): [True: 106k, False: 13.3k]
  |  Branch (112:26): [True: 106k, False: 0]
  ------------------
  113|   106k|        recoded[i] = secp256k1_scalar_get_bits_limb32(&d, 32 * i, 32);
  114|   106k|    }
  115|  13.3k|    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|  13.3k|    comb_off = COMB_SPACING - 1;
  ------------------
  |  |   79|  13.3k|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  190|  13.3k|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  193|  13.3k|    while (1) {
  ------------------
  |  Branch (193:12): [True: 13.3k, Folded]
  ------------------
  194|  13.3k|        uint32_t block;
  195|  13.3k|        uint32_t bit_pos = comb_off;
  196|       |        /* Inner loop: for each block, add table entries to the result. */
  197|   587k|        for (block = 0; block < COMB_BLOCKS; ++block) {
  ------------------
  |  Branch (197:25): [True: 573k, False: 13.3k]
  ------------------
  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|   573k|            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|  4.01M|            for (tooth = 0; tooth < COMB_TEETH; ++tooth) {
  ------------------
  |  Branch (209:29): [True: 3.44M, False: 573k]
  ------------------
  210|       |                /* Construct bitdata s.t. the bottom bit is the bit we'd like to read.
  211|       |                 *
  212|       |                 * We could just set bitdata = recoded[bit_pos >> 5] >> (bit_pos & 0x1f)
  213|       |                 * but this would simply discard the bits that fall off at the bottom,
  214|       |                 * and thus, for example, bitdata could still have only two values if we
  215|       |                 * happen to shift by exactly 31 positions. We use a rotation instead,
  216|       |                 * which ensures that bitdata doesn't lose entropy. This relies on the
  217|       |                 * rotation being atomic, i.e., the compiler emitting an actual rot
  218|       |                 * instruction. */
  219|  3.44M|                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|  3.44M|                uint32_t volatile vmask = ~(1 << tooth);
  223|  3.44M|                bits &= vmask;
  224|       |
  225|       |                /* Write the bit into position tooth (and junk into higher bits). */
  226|  3.44M|                bits ^= bitdata << tooth;
  227|  3.44M|                bit_pos += COMB_SPACING;
  ------------------
  |  |   79|  3.44M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  190|  3.44M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  228|  3.44M|            }
  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|   573k|            sign = (bits >> (COMB_TEETH - 1)) & 1;
  233|   573k|            abs = (bits ^ -sign) & (COMB_POINTS - 1);
  ------------------
  |  |   87|   573k|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  234|   573k|            VERIFY_CHECK(sign == 0 || sign == 1);
  235|   573k|            VERIFY_CHECK(abs < COMB_POINTS);
  236|       |
  237|       |            /** This uses a conditional move to avoid any secret data in array indexes.
  238|       |             *   _Any_ use of secret indexes has been demonstrated to result in timing
  239|       |             *   sidechannels, even when the cache-line access patterns are uniform.
  240|       |             *  See also:
  241|       |             *   "A word of warning", CHES 2013 Rump Session, by Daniel J. Bernstein and Peter Schwabe
  242|       |             *    (https://cryptojedi.org/peter/data/chesrump-20130822.pdf) and
  243|       |             *   "Cache Attacks and Countermeasures: the Case of AES", RSA 2006,
  244|       |             *    by Dag Arne Osvik, Adi Shamir, and Eran Tromer
  245|       |             *    (https://eprint.iacr.org/2005/271.pdf)
  246|       |             */
  247|  18.9M|            for (index = 0; index < COMB_POINTS; ++index) {
  ------------------
  |  |   87|  18.9M|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  |  Branch (247:29): [True: 18.3M, False: 573k]
  ------------------
  248|  18.3M|                secp256k1_ge_storage_cmov(&adds, &secp256k1_ecmult_gen_prec_table[block][index], index == abs);
  249|  18.3M|            }
  250|       |
  251|       |            /* Set add=adds or add=-adds, in constant time, based on sign. */
  252|   573k|            secp256k1_ge_from_storage(&add, &adds);
  253|   573k|            secp256k1_fe_negate(&neg, &add.y, 1);
  ------------------
  |  |  211|   573k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   573k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   573k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 573k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   573k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 573k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   573k|    } \
  |  |  |  |   94|   573k|    stmt; \
  |  |  |  |   95|   573k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|   573k|            secp256k1_fe_cmov(&add.y, &neg, sign);
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  255|       |
  256|       |            /* Add the looked up and conditionally negated value to r. */
  257|   573k|            if (EXPECT(first, 0)) {
  ------------------
  |  |  146|   573k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 13.3k, False: 560k]
  |  |  ------------------
  ------------------
  258|       |                /* If this is the first table lookup, we can skip addition. */
  259|  13.3k|                secp256k1_gej_set_ge(r, &add);
  260|       |                /* Give the entry a random Z coordinate to blind intermediary results. */
  261|  13.3k|                secp256k1_gej_rescale(r, &ctx->proj_blind);
  262|  13.3k|                first = 0;
  263|   560k|            } else {
  264|   560k|                secp256k1_gej_add_ge(r, r, &add);
  265|   560k|            }
  266|   573k|        }
  267|       |
  268|       |        /* Double the result, except in the last iteration. */
  269|  13.3k|        if (comb_off-- == 0) break;
  ------------------
  |  Branch (269:13): [True: 13.3k, 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|  13.3k|    secp256k1_gej_add_ge(r, r, &ctx->ge_offset);
  276|       |
  277|       |    /* Cleanup. */
  278|  13.3k|    secp256k1_fe_clear(&neg);
  279|  13.3k|    secp256k1_ge_clear(&add);
  280|  13.3k|    secp256k1_memclear_explicit(&adds, sizeof(adds));
  281|  13.3k|    secp256k1_memclear_explicit(&recoded, sizeof(recoded));
  282|  13.3k|}
secp256k1.c:secp256k1_ecmult_gen_ge:
  284|  13.3k|SECP256K1_INLINE static void secp256k1_ecmult_gen_ge(const secp256k1_ecmult_gen_context *ctx, secp256k1_ge *r, const secp256k1_scalar *a) {
  285|  13.3k|    secp256k1_gej rj;
  286|  13.3k|    secp256k1_ecmult_gen_gej(ctx, &rj, a);
  287|  13.3k|    secp256k1_ge_set_gej(r, &rj);
  288|       |    /* Jacobian coordinates resulting from our multiplication algorithm could potentially leak
  289|       |     * information about the secret input scalar, so clear the memory out to be on the safe side. */
  290|  13.3k|    secp256k1_gej_clear(&rj);
  291|  13.3k|}

secp256k1.c:secp256k1_ecmult:
  365|  5.88k|static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  366|  5.88k|    secp256k1_fe aux[ECMULT_TABLE_SIZE(WINDOW_A)];
  367|  5.88k|    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];
  368|  5.88k|    struct secp256k1_strauss_point_state ps[1];
  369|  5.88k|    struct secp256k1_strauss_state state;
  370|       |
  371|  5.88k|    state.aux = aux;
  372|  5.88k|    state.pre_a = pre_a;
  373|  5.88k|    state.ps = ps;
  374|  5.88k|    secp256k1_ecmult_strauss_wnaf(&state, r, 1, a, na, ng);
  375|  5.88k|}
secp256k1.c:secp256k1_ecmult_strauss_wnaf:
  252|  5.88k|static void secp256k1_ecmult_strauss_wnaf(const struct secp256k1_strauss_state *state, secp256k1_gej *r, size_t num, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  253|  5.88k|    secp256k1_ge tmpa;
  254|  5.88k|    secp256k1_fe Z;
  255|       |    /* Split G factors. */
  256|  5.88k|    secp256k1_scalar ng_1, ng_128;
  257|  5.88k|    int wnaf_ng_1[129];
  258|  5.88k|    int bits_ng_1 = 0;
  259|  5.88k|    int wnaf_ng_128[129];
  260|  5.88k|    int bits_ng_128 = 0;
  261|  5.88k|    int i;
  262|  5.88k|    int bits = 0;
  263|  5.88k|    size_t np;
  264|  5.88k|    size_t no = 0;
  265|       |
  266|  5.88k|    secp256k1_fe_set_int(&Z, 1);
  ------------------
  |  |   83|  5.88k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  267|  11.7k|    for (np = 0; np < num; ++np) {
  ------------------
  |  Branch (267:18): [True: 5.88k, False: 5.88k]
  ------------------
  268|  5.88k|        secp256k1_gej tmp;
  269|  5.88k|        secp256k1_scalar na_1, na_lam;
  270|  5.88k|        if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
  ------------------
  |  Branch (270:13): [True: 0, False: 5.88k]
  |  Branch (270:50): [True: 0, False: 5.88k]
  ------------------
  271|      0|            continue;
  272|      0|        }
  273|       |        /* split na into na_1 and na_lam (where na = na_1 + na_lam*lambda, and na_1 and na_lam are ~128 bit) */
  274|  5.88k|        secp256k1_scalar_split_lambda(&na_1, &na_lam, &na[np]);
  275|       |
  276|       |        /* build wnaf representation for na_1 and na_lam. */
  277|  5.88k|        state->ps[no].bits_na_1   = secp256k1_ecmult_wnaf_small(state->ps[no].wnaf_na_1,   129, &na_1,   WINDOW_A);
  ------------------
  |  |   32|  5.88k|#  define WINDOW_A 5
  ------------------
  278|  5.88k|        state->ps[no].bits_na_lam = secp256k1_ecmult_wnaf_small(state->ps[no].wnaf_na_lam, 129, &na_lam, WINDOW_A);
  ------------------
  |  |   32|  5.88k|#  define WINDOW_A 5
  ------------------
  279|  5.88k|        VERIFY_CHECK(state->ps[no].bits_na_1 <= 129);
  280|  5.88k|        VERIFY_CHECK(state->ps[no].bits_na_lam <= 129);
  281|  5.88k|        if (state->ps[no].bits_na_1 > bits) {
  ------------------
  |  Branch (281:13): [True: 5.88k, False: 0]
  ------------------
  282|  5.88k|            bits = state->ps[no].bits_na_1;
  283|  5.88k|        }
  284|  5.88k|        if (state->ps[no].bits_na_lam > bits) {
  ------------------
  |  Branch (284:13): [True: 2.29k, False: 3.59k]
  ------------------
  285|  2.29k|            bits = state->ps[no].bits_na_lam;
  286|  2.29k|        }
  287|       |
  288|       |        /* Calculate odd multiples of a.
  289|       |         * All multiples are brought to the same Z 'denominator', which is stored
  290|       |         * in Z. Due to secp256k1' isomorphism we can do all operations pretending
  291|       |         * that the Z coordinate was 1, use affine addition formulae, and correct
  292|       |         * the Z coordinate of the result once at the end.
  293|       |         * The exception is the precomputed G table points, which are actually
  294|       |         * affine. Compared to the base used for other points, they have a Z ratio
  295|       |         * of 1/Z, so we can use secp256k1_gej_add_zinv_var, which uses the same
  296|       |         * isomorphism to efficiently add with a known Z inverse.
  297|       |         */
  298|  5.88k|        tmp = a[np];
  299|  5.88k|        if (no) {
  ------------------
  |  Branch (299:13): [True: 0, False: 5.88k]
  ------------------
  300|      0|            secp256k1_gej_rescale(&tmp, &Z);
  301|      0|        }
  302|  5.88k|        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|  5.88k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                      secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), state->pre_a + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &Z, &tmp);
  ------------------
  |  |   41|  5.88k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                      secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), state->pre_a + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &Z, &tmp);
  ------------------
  |  |   41|  5.88k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  303|  5.88k|        if (no) secp256k1_fe_mul(state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &(a[np].z));
  ------------------
  |  |   93|      0|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                      if (no) secp256k1_fe_mul(state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &(a[np].z));
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                      if (no) secp256k1_fe_mul(state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &(a[np].z));
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  |  Branch (303:13): [True: 0, False: 5.88k]
  ------------------
  304|       |
  305|  5.88k|        ++no;
  306|  5.88k|    }
  307|       |
  308|       |    /* Bring them to the same Z denominator. */
  309|  5.88k|    if (no) {
  ------------------
  |  Branch (309:9): [True: 5.88k, False: 0]
  ------------------
  310|  5.88k|        secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
  ------------------
  |  |   41|  5.88k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  311|  5.88k|    }
  312|       |
  313|  11.7k|    for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (313:18): [True: 5.88k, False: 5.88k]
  ------------------
  314|  5.88k|        size_t j;
  315|  52.9k|        for (j = 0; j < ECMULT_TABLE_SIZE(WINDOW_A); j++) {
  ------------------
  |  |   41|  52.9k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  |  Branch (315:21): [True: 47.1k, False: 5.88k]
  ------------------
  316|  47.1k|            secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + j], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + j].x, &secp256k1_const_beta);
  ------------------
  |  |   93|  47.1k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                          secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + j], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + j].x, &secp256k1_const_beta);
  ------------------
  |  |   41|  47.1k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                          secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + j], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + j].x, &secp256k1_const_beta);
  ------------------
  |  |   41|  47.1k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  317|  47.1k|        }
  318|  5.88k|    }
  319|       |
  320|  5.88k|    if (ng) {
  ------------------
  |  Branch (320:9): [True: 5.88k, False: 0]
  ------------------
  321|       |        /* split ng into ng_1 and ng_128 (where gn = gn_1 + gn_128*2^128, and gn_1 and gn_128 are ~128 bit) */
  322|  5.88k|        secp256k1_scalar_split_128(&ng_1, &ng_128, ng);
  323|       |
  324|       |        /* Build wnaf representation for ng_1 and ng_128 */
  325|  5.88k|        bits_ng_1   = secp256k1_ecmult_wnaf(wnaf_ng_1,   129, &ng_1,   WINDOW_G);
  ------------------
  |  |   31|  5.88k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  326|  5.88k|        bits_ng_128 = secp256k1_ecmult_wnaf(wnaf_ng_128, 129, &ng_128, WINDOW_G);
  ------------------
  |  |   31|  5.88k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  327|  5.88k|        if (bits_ng_1 > bits) {
  ------------------
  |  Branch (327:13): [True: 108, False: 5.78k]
  ------------------
  328|    108|            bits = bits_ng_1;
  329|    108|        }
  330|  5.88k|        if (bits_ng_128 > bits) {
  ------------------
  |  Branch (330:13): [True: 82, False: 5.80k]
  ------------------
  331|     82|            bits = bits_ng_128;
  332|     82|        }
  333|  5.88k|    }
  334|       |
  335|  5.88k|    secp256k1_gej_set_infinity(r);
  336|       |
  337|   751k|    for (i = bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (337:24): [True: 745k, False: 5.88k]
  ------------------
  338|   745k|        int n;
  339|   745k|        secp256k1_gej_double_var(r, r, NULL);
  340|  1.49M|        for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (340:22): [True: 745k, False: 745k]
  ------------------
  341|   745k|            if (i < state->ps[np].bits_na_1 && (n = state->ps[np].wnaf_na_1[i])) {
  ------------------
  |  Branch (341:17): [True: 737k, False: 7.38k]
  |  Branch (341:48): [True: 127k, False: 610k]
  ------------------
  342|   127k|                secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|   127k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   32|   127k|#  define WINDOW_A 5
  ------------------
  343|   127k|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  344|   127k|            }
  345|   745k|            if (i < state->ps[np].bits_na_lam && (n = state->ps[np].wnaf_na_lam[i])) {
  ------------------
  |  Branch (345:17): [True: 736k, False: 8.88k]
  |  Branch (345:50): [True: 126k, False: 609k]
  ------------------
  346|   126k|                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|   126k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|   126k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   32|   126k|#  define WINDOW_A 5
  ------------------
  347|   126k|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  348|   126k|            }
  349|   745k|        }
  350|   745k|        if (i < bits_ng_1 && (n = wnaf_ng_1[i])) {
  ------------------
  |  Branch (350:13): [True: 52.7k, False: 692k]
  |  Branch (350:30): [True: 3.66k, False: 49.0k]
  ------------------
  351|  3.66k|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g, n, WINDOW_G);
  ------------------
  |  |   31|  3.66k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  352|  3.66k|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  353|  3.66k|        }
  354|   745k|        if (i < bits_ng_128 && (n = wnaf_ng_128[i])) {
  ------------------
  |  Branch (354:13): [True: 52.6k, False: 692k]
  |  Branch (354:32): [True: 3.65k, False: 49.0k]
  ------------------
  355|  3.65k|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g_128, n, WINDOW_G);
  ------------------
  |  |   31|  3.65k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  356|  3.65k|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  357|  3.65k|        }
  358|   745k|    }
  359|       |
  360|  5.88k|    if (!secp256k1_gej_is_infinity(r)) {
  ------------------
  |  Branch (360:9): [True: 5.88k, False: 0]
  ------------------
  361|  5.88k|        secp256k1_fe_mul(&r->z, &r->z, &Z);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  362|  5.88k|    }
  363|  5.88k|}
secp256k1.c:secp256k1_ecmult_wnaf_small:
  224|  11.7k|static int secp256k1_ecmult_wnaf_small(int8_t *wnaf, int len, const secp256k1_scalar *a, int w) {
  225|  11.7k|    int wnaf_tmp[256];
  226|  11.7k|    int ret, i;
  227|       |
  228|  11.7k|    VERIFY_CHECK(2 <= w && w <= 8);
  229|  11.7k|    ret = secp256k1_ecmult_wnaf(wnaf_tmp, len, a, w);
  230|       |
  231|  1.53M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (231:17): [True: 1.51M, False: 11.7k]
  ------------------
  232|  1.51M|        wnaf[i] = (int8_t)wnaf_tmp[i];
  233|  1.51M|    }
  234|       |
  235|  11.7k|    return ret;
  236|  11.7k|}
secp256k1.c:secp256k1_ecmult_odd_multiples_table:
   73|  5.88k|static void secp256k1_ecmult_odd_multiples_table(size_t n, secp256k1_ge *pre_a, secp256k1_fe *zr, secp256k1_fe *z, const secp256k1_gej *a) {
   74|  5.88k|    secp256k1_gej d, ai;
   75|  5.88k|    secp256k1_ge d_ge;
   76|  5.88k|    size_t i;
   77|       |
   78|  5.88k|    VERIFY_CHECK(!secp256k1_gej_is_infinity(a));
   79|       |
   80|  5.88k|    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|  5.88k|    secp256k1_ge_set_xy(&d_ge, &d.x, &d.y);
   96|  5.88k|    secp256k1_ge_set_gej_zinv(&pre_a[0], a, &d.z);
   97|  5.88k|    secp256k1_gej_set_ge(&ai, &pre_a[0]);
   98|  5.88k|    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|  5.88k|    zr[0] = d.z;
  104|       |
  105|  47.1k|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (105:17): [True: 41.2k, False: 5.88k]
  ------------------
  106|  41.2k|        secp256k1_gej_add_ge_var(&ai, &ai, &d_ge, &zr[i]);
  107|  41.2k|        secp256k1_ge_set_xy(&pre_a[i], &ai.x, &ai.y);
  108|  41.2k|    }
  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|  5.88k|    secp256k1_fe_mul(z, &ai.z, &d.z);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  115|  5.88k|}
secp256k1.c:secp256k1_ecmult_wnaf:
  162|  23.5k|static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a, int w) {
  163|  23.5k|    secp256k1_scalar s;
  164|  23.5k|    int last_set_bit = -1;
  165|  23.5k|    int bit = 0;
  166|  23.5k|    int sign = 1;
  167|  23.5k|    int carry = 0;
  168|       |
  169|  23.5k|    VERIFY_CHECK(wnaf != NULL);
  170|  23.5k|    VERIFY_CHECK(0 <= len && len <= 256);
  171|  23.5k|    VERIFY_CHECK(a != NULL);
  172|  23.5k|    VERIFY_CHECK(2 <= w && w <= 31);
  173|       |
  174|  3.06M|    for (bit = 0; bit < len; bit++) {
  ------------------
  |  Branch (174:19): [True: 3.03M, False: 23.5k]
  ------------------
  175|  3.03M|        wnaf[bit] = 0;
  176|  3.03M|    }
  177|       |
  178|  23.5k|    s = *a;
  179|  23.5k|    if (secp256k1_scalar_get_bits_limb32(&s, 255, 1)) {
  ------------------
  |  Branch (179:9): [True: 5.94k, False: 17.6k]
  ------------------
  180|  5.94k|        secp256k1_scalar_negate(&s, &s);
  181|  5.94k|        sign = -1;
  182|  5.94k|    }
  183|       |
  184|  23.5k|    bit = 0;
  185|  1.96M|    while (bit < len) {
  ------------------
  |  Branch (185:12): [True: 1.93M, False: 23.5k]
  ------------------
  186|  1.93M|        int now;
  187|  1.93M|        int word;
  188|  1.93M|        if (secp256k1_scalar_get_bits_limb32(&s, bit, 1) == (unsigned int)carry) {
  ------------------
  |  Branch (188:13): [True: 1.67M, False: 261k]
  ------------------
  189|  1.67M|            bit++;
  190|  1.67M|            continue;
  191|  1.67M|        }
  192|       |
  193|   261k|        now = w;
  194|   261k|        if (now > len - bit) {
  ------------------
  |  Branch (194:13): [True: 6.58k, False: 254k]
  ------------------
  195|  6.58k|            now = len - bit;
  196|  6.58k|        }
  197|       |
  198|   261k|        word = secp256k1_scalar_get_bits_var(&s, bit, now) + carry;
  199|       |
  200|   261k|        carry = (word >> (w-1)) & 1;
  201|   261k|        word -= carry << w;
  202|       |
  203|   261k|        wnaf[bit] = sign * word;
  204|   261k|        last_set_bit = bit;
  205|       |
  206|   261k|        bit += now;
  207|   261k|    }
  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|  23.5k|    return last_set_bit + 1;
  221|  23.5k|}
secp256k1.c:secp256k1_ecmult_table_get_ge:
  125|   127k|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
  126|   127k|    secp256k1_ecmult_table_verify(n,w);
  127|   127k|    if (n > 0) {
  ------------------
  |  Branch (127:9): [True: 63.5k, False: 63.4k]
  ------------------
  128|  63.5k|        *r = pre[(n-1)/2];
  129|  63.5k|    } else {
  130|  63.4k|        *r = pre[(-n-1)/2];
  131|  63.4k|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  63.4k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  63.4k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  63.4k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 63.4k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  63.4k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 63.4k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  63.4k|    } \
  |  |  |  |   94|  63.4k|    stmt; \
  |  |  |  |   95|  63.4k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 63.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|  63.4k|    }
  133|   127k|}
secp256k1.c:secp256k1_ecmult_table_verify:
  117|   261k|SECP256K1_INLINE static void secp256k1_ecmult_table_verify(int n, int w) {
  118|   261k|    (void)n;
  119|   261k|    (void)w;
  120|   261k|    VERIFY_CHECK(((n) & 1) == 1);
  121|   261k|    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1));
  122|   261k|    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1));
  123|   261k|}
secp256k1.c:secp256k1_ecmult_table_get_ge_lambda:
  135|   126k|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|   126k|    secp256k1_ecmult_table_verify(n,w);
  137|   126k|    if (n > 0) {
  ------------------
  |  Branch (137:9): [True: 63.5k, False: 63.2k]
  ------------------
  138|  63.5k|        secp256k1_ge_set_xy(r, &x[(n-1)/2], &pre[(n-1)/2].y);
  139|  63.5k|    } else {
  140|  63.2k|        secp256k1_ge_set_xy(r, &x[(-n-1)/2], &pre[(-n-1)/2].y);
  141|  63.2k|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  63.2k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  63.2k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  63.2k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 63.2k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  63.2k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 63.2k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  63.2k|    } \
  |  |  |  |   94|  63.2k|    stmt; \
  |  |  |  |   95|  63.2k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 63.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|  63.2k|    }
  143|   126k|}
secp256k1.c:secp256k1_ecmult_table_get_ge_storage:
  145|  7.32k|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
  146|  7.32k|    secp256k1_ecmult_table_verify(n,w);
  147|  7.32k|    if (n > 0) {
  ------------------
  |  Branch (147:9): [True: 4.06k, False: 3.26k]
  ------------------
  148|  4.06k|        secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
  149|  4.06k|    } else {
  150|  3.26k|        secp256k1_ge_from_storage(r, &pre[(-n-1)/2]);
  151|  3.26k|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  3.26k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  3.26k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  3.26k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 3.26k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  3.26k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 3.26k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  3.26k|    } \
  |  |  |  |   94|  3.26k|    stmt; \
  |  |  |  |   95|  3.26k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 3.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  3.26k|    }
  153|  7.32k|}

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

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

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

secp256k1.c:secp256k1_ge_set_xy:
  132|   173k|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|   173k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|   173k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|   173k|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  345|   173k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|   173k|    r->infinity = 0;
  137|   173k|    r->x = *x;
  138|   173k|    r->y = *y;
  139|       |
  140|   173k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   173k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|   173k|}
secp256k1.c:secp256k1_ge_verify:
   78|  1.79M|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|  1.79M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|  1.79M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|  1.79M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|  1.79M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|  1.79M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.79M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|  1.79M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.79M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|  1.79M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|  1.79M|    (void)a;
   85|  1.79M|}
secp256k1.c:secp256k1_ge_is_in_correct_subgroup:
  926|  2.94k|static int secp256k1_ge_is_in_correct_subgroup(const secp256k1_ge* ge) {
  927|       |#ifdef EXHAUSTIVE_TEST_ORDER
  928|       |    secp256k1_gej out;
  929|       |    int i;
  930|       |    SECP256K1_GE_VERIFY(ge);
  931|       |
  932|       |    /* A very simple EC multiplication ladder that avoids a dependency on ecmult. */
  933|       |    secp256k1_gej_set_infinity(&out);
  934|       |    for (i = 0; i < 32; ++i) {
  935|       |        secp256k1_gej_double_var(&out, &out, NULL);
  936|       |        if ((((uint32_t)EXHAUSTIVE_TEST_ORDER) >> (31 - i)) & 1) {
  937|       |            secp256k1_gej_add_ge_var(&out, &out, ge, NULL);
  938|       |        }
  939|       |    }
  940|       |    return secp256k1_gej_is_infinity(&out);
  941|       |#else
  942|  2.94k|    SECP256K1_GE_VERIFY(ge);
  ------------------
  |  |  212|  2.94k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  943|       |
  944|  2.94k|    (void)ge;
  945|       |    /* The real secp256k1 group has cofactor 1, so the subgroup is the entire curve. */
  946|  2.94k|    return 1;
  947|  2.94k|#endif
  948|  2.94k|}
secp256k1.c:secp256k1_ge_clear:
  343|  23.7k|static void secp256k1_ge_clear(secp256k1_ge *r) {
  344|  23.7k|    secp256k1_memclear_explicit(r, sizeof(secp256k1_ge));
  345|  23.7k|}
secp256k1.c:secp256k1_gej_eq_x_var:
  417|  5.88k|static int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a) {
  418|  5.88k|    secp256k1_fe r;
  419|  5.88k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|  5.88k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  420|  5.88k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  5.88k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  421|  5.88k|    VERIFY_CHECK(!a->infinity);
  422|       |
  423|  5.88k|    secp256k1_fe_sqr(&r, &a->z); secp256k1_fe_mul(&r, &r, x);
  ------------------
  |  |   94|  5.88k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
                  secp256k1_fe_sqr(&r, &a->z); secp256k1_fe_mul(&r, &r, x);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  424|  5.88k|    return secp256k1_fe_equal(&r, &a->x);
  425|  5.88k|}
secp256k1.c:secp256k1_gej_verify:
   87|  4.85M|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|  4.85M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|  4.85M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|  4.85M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|  4.85M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|  4.85M|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  345|  4.85M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|  4.85M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|  4.85M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|  4.85M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|  4.85M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|  4.85M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  349|  4.85M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|  4.85M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|  4.85M|    (void)a;
   96|  4.85M|}
secp256k1.c:secp256k1_gej_set_infinity:
  322|  12.0k|static void secp256k1_gej_set_infinity(secp256k1_gej *r) {
  323|  12.0k|    r->infinity = 1;
  324|  12.0k|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|  12.0k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  325|  12.0k|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|  12.0k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  326|  12.0k|    secp256k1_fe_set_int(&r->z, 0);
  ------------------
  |  |   83|  12.0k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  327|       |
  328|  12.0k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  12.0k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  329|  12.0k|}
secp256k1.c:secp256k1_gej_add_ge:
  724|   573k|static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) {
  725|       |    /* Operations: 7 mul, 5 sqr, 21 add/cmov/half/mul_int/negate/normalizes_to_zero */
  726|   573k|    secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;
  727|   573k|    secp256k1_fe m_alt, rr_alt;
  728|   573k|    int degenerate;
  729|   573k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   573k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  730|   573k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|   573k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  731|   573k|    VERIFY_CHECK(!b->infinity);
  732|       |
  733|       |    /*  In:
  734|       |     *    Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks.
  735|       |     *    In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002.
  736|       |     *  we find as solution for a unified addition/doubling formula:
  737|       |     *    lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation.
  738|       |     *    x3 = lambda^2 - (x1 + x2)
  739|       |     *    2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2).
  740|       |     *
  741|       |     *  Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives:
  742|       |     *    U1 = X1*Z2^2, U2 = X2*Z1^2
  743|       |     *    S1 = Y1*Z2^3, S2 = Y2*Z1^3
  744|       |     *    Z = Z1*Z2
  745|       |     *    T = U1+U2
  746|       |     *    M = S1+S2
  747|       |     *    Q = -T*M^2
  748|       |     *    R = T^2-U1*U2
  749|       |     *    X3 = R^2+Q
  750|       |     *    Y3 = -(R*(2*X3+Q)+M^4)/2
  751|       |     *    Z3 = M*Z
  752|       |     *  (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.)
  753|       |     *
  754|       |     *  This formula has the benefit of being the same for both addition
  755|       |     *  of distinct points and doubling. However, it breaks down in the
  756|       |     *  case that either point is infinity, or that y1 = -y2. We handle
  757|       |     *  these cases in the following ways:
  758|       |     *
  759|       |     *    - If b is infinity we simply bail by means of a VERIFY_CHECK.
  760|       |     *
  761|       |     *    - If a is infinity, we detect this, and at the end of the
  762|       |     *      computation replace the result (which will be meaningless,
  763|       |     *      but we compute to be constant-time) with b.x : b.y : 1.
  764|       |     *
  765|       |     *    - If a = -b, we have y1 = -y2, which is a degenerate case.
  766|       |     *      But here the answer is infinity, so we simply set the
  767|       |     *      infinity flag of the result, overriding the computed values
  768|       |     *      without even needing to cmov.
  769|       |     *
  770|       |     *    - If y1 = -y2 but x1 != x2, which does occur thanks to certain
  771|       |     *      properties of our curve (specifically, 1 has nontrivial cube
  772|       |     *      roots in our field, and the curve equation has no x coefficient)
  773|       |     *      then the answer is not infinity but also not given by the above
  774|       |     *      equation. In this case, we cmov in place an alternate expression
  775|       |     *      for lambda. Specifically (y1 - y2)/(x1 - x2). Where both these
  776|       |     *      expressions for lambda are defined, they are equal, and can be
  777|       |     *      obtained from each other by multiplication by (y1 + y2)/(y1 + y2)
  778|       |     *      then substitution of x^3 + 7 for y^2 (using the curve equation).
  779|       |     *      For all pairs of nonzero points (a, b) at least one is defined,
  780|       |     *      so this covers everything.
  781|       |     */
  782|       |
  783|   573k|    secp256k1_fe_sqr(&zz, &a->z);                       /* z = Z1^2 */
  ------------------
  |  |   94|   573k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  784|   573k|    u1 = a->x;                                          /* u1 = U1 = X1*Z2^2 (GEJ_X_M) */
  785|   573k|    secp256k1_fe_mul(&u2, &b->x, &zz);                  /* u2 = U2 = X2*Z1^2 (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  786|   573k|    s1 = a->y;                                          /* s1 = S1 = Y1*Z2^3 (GEJ_Y_M) */
  787|   573k|    secp256k1_fe_mul(&s2, &b->y, &zz);                  /* s2 = Y2*Z1^2 (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  788|   573k|    secp256k1_fe_mul(&s2, &s2, &a->z);                  /* s2 = S2 = Y2*Z1^3 (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  789|   573k|    t = u1; secp256k1_fe_add(&t, &u2);                  /* t = T = U1+U2 (GEJ_X_M+1) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  790|   573k|    m = s1; secp256k1_fe_add(&m, &s2);                  /* m = M = S1+S2 (GEJ_Y_M+1) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  791|   573k|    secp256k1_fe_sqr(&rr, &t);                          /* rr = T^2 (1) */
  ------------------
  |  |   94|   573k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  792|   573k|    secp256k1_fe_negate(&m_alt, &u2, 1);                /* Malt = -X2*Z1^2 (2) */
  ------------------
  |  |  211|   573k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   573k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   573k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 573k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   573k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 573k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   573k|    } \
  |  |  |  |   94|   573k|    stmt; \
  |  |  |  |   95|   573k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  793|   573k|    secp256k1_fe_mul(&tt, &u1, &m_alt);                 /* tt = -U1*U2 (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  794|   573k|    secp256k1_fe_add(&rr, &tt);                         /* rr = R = T^2-U1*U2 (2) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  795|       |    /* If lambda = R/M = R/0 we have a problem (except in the "trivial"
  796|       |     * case that Z = z1z2 = 0, and this is special-cased later on). */
  797|   573k|    degenerate = secp256k1_fe_normalizes_to_zero(&m);
  ------------------
  |  |   81|   573k|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  798|       |    /* This only occurs when y1 == -y2 and x1^3 == x2^3, but x1 != x2.
  799|       |     * This means either x1 == beta*x2 or beta*x1 == x2, where beta is
  800|       |     * a nontrivial cube root of one. In either case, an alternate
  801|       |     * non-indeterminate expression for lambda is (y1 - y2)/(x1 - x2),
  802|       |     * so we set R/M equal to this. */
  803|   573k|    rr_alt = s1;
  804|   573k|    secp256k1_fe_mul_int(&rr_alt, 2);       /* rr_alt = Y1*Z2^3 - Y2*Z1^3 (GEJ_Y_M*2) */
  ------------------
  |  |  233|   573k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   573k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   573k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 573k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   573k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 573k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   573k|    } \
  |  |  |  |   94|   573k|    stmt; \
  |  |  |  |   95|   573k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|   573k|    secp256k1_fe_add(&m_alt, &u1);          /* Malt = X1*Z2^2 - X2*Z1^2 (GEJ_X_M+2) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  806|       |
  807|   573k|    secp256k1_fe_cmov(&rr_alt, &rr, !degenerate);       /* rr_alt (GEJ_Y_M*2) */
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  808|   573k|    secp256k1_fe_cmov(&m_alt, &m, !degenerate);         /* m_alt (GEJ_X_M+2) */
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  809|       |    /* Now Ralt / Malt = lambda and is guaranteed not to be Ralt / 0.
  810|       |     * From here on out Ralt and Malt represent the numerator
  811|       |     * and denominator of lambda; R and M represent the explicit
  812|       |     * expressions x1^2 + x2^2 + x1x2 and y1 + y2. */
  813|   573k|    secp256k1_fe_sqr(&n, &m_alt);                       /* n = Malt^2 (1) */
  ------------------
  |  |   94|   573k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  814|   573k|    secp256k1_fe_negate(&q, &t,
  ------------------
  |  |  211|   573k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   573k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   573k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 573k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   573k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 573k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   573k|    } \
  |  |  |  |   94|   573k|    stmt; \
  |  |  |  |   95|   573k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|   573k|        SECP256K1_GEJ_X_MAGNITUDE_MAX + 1);             /* q = -T (GEJ_X_M+2) */
  816|   573k|    secp256k1_fe_mul(&q, &q, &n);                       /* q = Q = -T*Malt^2 (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  817|       |    /* These two lines use the observation that either M == Malt or M == 0,
  818|       |     * so M^3 * Malt is either Malt^4 (which is computed by squaring), or
  819|       |     * zero (which is "computed" by cmov). So the cost is one squaring
  820|       |     * versus two multiplications. */
  821|   573k|    secp256k1_fe_sqr(&n, &n);                           /* n = Malt^4 (1) */
  ------------------
  |  |   94|   573k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  822|   573k|    secp256k1_fe_cmov(&n, &m, degenerate);              /* n = M^3 * Malt (GEJ_Y_M+1) */
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  823|   573k|    secp256k1_fe_sqr(&t, &rr_alt);                      /* t = Ralt^2 (1) */
  ------------------
  |  |   94|   573k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  824|   573k|    secp256k1_fe_mul(&r->z, &a->z, &m_alt);             /* r->z = Z3 = Malt*Z (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  825|   573k|    secp256k1_fe_add(&t, &q);                           /* t = Ralt^2 + Q (2) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  826|   573k|    r->x = t;                                           /* r->x = X3 = Ralt^2 + Q (2) */
  827|   573k|    secp256k1_fe_mul_int(&t, 2);                        /* t = 2*X3 (4) */
  ------------------
  |  |  233|   573k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   573k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   573k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 573k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   573k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 573k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   573k|    } \
  |  |  |  |   94|   573k|    stmt; \
  |  |  |  |   95|   573k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|   573k|    secp256k1_fe_add(&t, &q);                           /* t = 2*X3 + Q (5) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  829|   573k|    secp256k1_fe_mul(&t, &t, &rr_alt);                  /* t = Ralt*(2*X3 + Q) (1) */
  ------------------
  |  |   93|   573k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  830|   573k|    secp256k1_fe_add(&t, &n);                           /* t = Ralt*(2*X3 + Q) + M^3*Malt (GEJ_Y_M+2) */
  ------------------
  |  |   92|   573k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  831|   573k|    secp256k1_fe_negate(&r->y, &t,
  ------------------
  |  |  211|   573k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   573k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   573k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 573k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   573k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 573k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   573k|    } \
  |  |  |  |   94|   573k|    stmt; \
  |  |  |  |   95|   573k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  832|   573k|        SECP256K1_GEJ_Y_MAGNITUDE_MAX + 2);             /* r->y = -(Ralt*(2*X3 + Q) + M^3*Malt) (GEJ_Y_M+3) */
  833|   573k|    secp256k1_fe_half(&r->y);                           /* r->y = Y3 = -(Ralt*(2*X3 + Q) + M^3*Malt)/2 ((GEJ_Y_M+3)/2 + 1) */
  ------------------
  |  |  101|   573k|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  834|       |
  835|       |    /* In case a->infinity == 1, replace r with (b->x, b->y, 1). */
  836|   573k|    secp256k1_fe_cmov(&r->x, &b->x, a->infinity);
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  837|   573k|    secp256k1_fe_cmov(&r->y, &b->y, a->infinity);
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  838|   573k|    secp256k1_fe_cmov(&r->z, &secp256k1_fe_one, a->infinity);
  ------------------
  |  |   95|   573k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  839|       |
  840|       |    /* Set r->infinity if r->z is 0.
  841|       |     *
  842|       |     * If a->infinity is set, then r->infinity = (r->z == 0) = (1 == 0) = false,
  843|       |     * which is correct because the function assumes that b is not infinity.
  844|       |     *
  845|       |     * Now assume !a->infinity. This implies Z = Z1 != 0.
  846|       |     *
  847|       |     * Case y1 = -y2:
  848|       |     * In this case we could have a = -b, namely if x1 = x2.
  849|       |     * We have degenerate = true, r->z = (x1 - x2) * Z.
  850|       |     * Then r->infinity = ((x1 - x2)Z == 0) = (x1 == x2) = (a == -b).
  851|       |     *
  852|       |     * Case y1 != -y2:
  853|       |     * In this case, we can't have a = -b.
  854|       |     * We have degenerate = false, r->z = (y1 + y2) * Z.
  855|       |     * Then r->infinity = ((y1 + y2)Z == 0) = (y1 == -y2) = false. */
  856|   573k|    r->infinity = secp256k1_fe_normalizes_to_zero(&r->z);
  ------------------
  |  |   81|   573k|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  857|       |
  858|   573k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   573k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  859|   573k|}
secp256k1.c:secp256k1_gej_is_infinity:
  440|  17.6k|static int secp256k1_gej_is_infinity(const secp256k1_gej *a) {
  441|  17.6k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  17.6k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  442|       |
  443|  17.6k|    return a->infinity;
  444|  17.6k|}
secp256k1.c:secp256k1_ge_set_gej:
  159|  13.3k|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|  13.3k|    secp256k1_fe z2, z3;
  161|  13.3k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  13.3k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|  13.3k|    r->infinity = a->infinity;
  164|  13.3k|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|  13.3k|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|  13.3k|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|  13.3k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|  13.3k|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|  13.3k|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|  13.3k|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|  13.3k|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|  13.3k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|  13.3k|    r->x = a->x;
  171|  13.3k|    r->y = a->y;
  172|       |
  173|  13.3k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  13.3k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|  13.3k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  13.3k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|  13.3k|}
secp256k1.c:secp256k1_ge_set_xo_var:
  347|  5.88k|static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {
  348|  5.88k|    secp256k1_fe x2, x3;
  349|  5.88k|    int ret;
  350|  5.88k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|  5.88k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  351|       |
  352|  5.88k|    r->x = *x;
  353|  5.88k|    secp256k1_fe_sqr(&x2, x);
  ------------------
  |  |   94|  5.88k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  354|  5.88k|    secp256k1_fe_mul(&x3, x, &x2);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  355|  5.88k|    r->infinity = 0;
  356|  5.88k|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|  5.88k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|  5.88k|#define SECP256K1_B 7
  ------------------
  357|  5.88k|    ret = secp256k1_fe_sqrt(&r->y, &x3);
  358|  5.88k|    secp256k1_fe_normalize_var(&r->y);
  ------------------
  |  |   80|  5.88k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  359|  5.88k|    if (secp256k1_fe_is_odd(&r->y) != odd) {
  ------------------
  |  |   85|  5.88k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (359:9): [True: 2.93k, False: 2.95k]
  ------------------
  360|  2.93k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  2.93k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  2.93k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  2.93k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 2.93k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  2.93k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 2.93k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  2.93k|    } \
  |  |  |  |   94|  2.93k|    stmt; \
  |  |  |  |   95|  2.93k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 2.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|  2.93k|    }
  362|       |
  363|  5.88k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  5.88k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  364|  5.88k|    return ret;
  365|  5.88k|}
secp256k1.c:secp256k1_gej_set_ge:
  367|  30.8k|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  368|  30.8k|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  30.8k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  369|       |
  370|  30.8k|   r->infinity = a->infinity;
  371|  30.8k|   r->x = a->x;
  372|  30.8k|   r->y = a->y;
  373|  30.8k|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  30.8k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  374|       |
  375|  30.8k|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  30.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  376|  30.8k|}
secp256k1.c:secp256k1_gej_rescale:
  861|  13.3k|static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {
  862|       |    /* Operations: 4 mul, 1 sqr */
  863|  13.3k|    secp256k1_fe zz;
  864|  13.3k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  13.3k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  865|  13.3k|    SECP256K1_FE_VERIFY(s);
  ------------------
  |  |  345|  13.3k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  866|  13.3k|    VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(s));
  867|       |
  868|  13.3k|    secp256k1_fe_sqr(&zz, s);
  ------------------
  |  |   94|  13.3k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  869|  13.3k|    secp256k1_fe_mul(&r->x, &r->x, &zz);                /* r->x *= s^2 */
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  870|  13.3k|    secp256k1_fe_mul(&r->y, &r->y, &zz);
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  871|  13.3k|    secp256k1_fe_mul(&r->y, &r->y, s);                  /* r->y *= s^3 */
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  872|  13.3k|    secp256k1_fe_mul(&r->z, &r->z, s);                  /* r->z *= s   */
  ------------------
  |  |   93|  13.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  873|       |
  874|  13.3k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  13.3k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  875|  13.3k|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|  5.88k|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|  5.88k|    secp256k1_fe zi2;
  101|  5.88k|    secp256k1_fe zi3;
  102|  5.88k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  5.88k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|  5.88k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|  5.88k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|  5.88k|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|  5.88k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  5.88k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|  5.88k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|  5.88k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|  5.88k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  5.88k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|  5.88k|    r->infinity = a->infinity;
  111|       |
  112|  5.88k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  5.88k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|  5.88k|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  289|  5.88k|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  290|  5.88k|    size_t i;
  291|  5.88k|    secp256k1_fe zs;
  292|       |#ifdef VERIFY
  293|       |    for (i = 0; i < len; i++) {
  294|       |        SECP256K1_GE_VERIFY(&a[i]);
  295|       |        SECP256K1_FE_VERIFY(&zr[i]);
  296|       |    }
  297|       |#endif
  298|       |
  299|  5.88k|    if (len > 0) {
  ------------------
  |  Branch (299:9): [True: 5.88k, False: 0]
  ------------------
  300|  5.88k|        i = len - 1;
  301|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  302|  5.88k|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|  5.88k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  303|  5.88k|        zs = zr[i];
  304|       |
  305|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  306|  47.1k|        while (i > 0) {
  ------------------
  |  Branch (306:16): [True: 41.2k, False: 5.88k]
  ------------------
  307|  41.2k|            if (i != len - 1) {
  ------------------
  |  Branch (307:17): [True: 35.3k, False: 5.88k]
  ------------------
  308|  35.3k|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|  35.3k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  309|  35.3k|            }
  310|  41.2k|            i--;
  311|  41.2k|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  312|  41.2k|        }
  313|  5.88k|    }
  314|       |
  315|       |#ifdef VERIFY
  316|       |    for (i = 0; i < len; i++) {
  317|       |        SECP256K1_GE_VERIFY(&a[i]);
  318|       |    }
  319|       |#endif
  320|  5.88k|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|  41.2k|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|  41.2k|    secp256k1_fe zi2;
  118|  41.2k|    secp256k1_fe zi3;
  119|  41.2k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  41.2k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|  41.2k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|  41.2k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|  41.2k|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|  41.2k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  41.2k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  41.2k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  41.2k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|  41.2k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  41.2k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  41.2k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  41.2k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|  41.2k|    r->infinity = a->infinity;
  128|       |
  129|  41.2k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  41.2k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|  41.2k|}
secp256k1.c:secp256k1_gej_double_var:
  495|   751k|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  496|   751k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   751k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  497|       |
  498|       |    /** For secp256k1, 2Q is infinity if and only if Q is infinity. This is because if 2Q = infinity,
  499|       |     *  Q must equal -Q, or that Q.y == -(Q.y), or Q.y is 0. For a point on y^2 = x^3 + 7 to have
  500|       |     *  y=0, x^3 must be -7 mod p. However, -7 has no cube root mod p.
  501|       |     *
  502|       |     *  Having said this, if this function receives a point on a sextic twist, e.g. by
  503|       |     *  a fault attack, it is possible for y to be 0. This happens for y^2 = x^3 + 6,
  504|       |     *  since -6 does have a cube root mod p. For this point, this function will not set
  505|       |     *  the infinity flag even though the point doubles to infinity, and the result
  506|       |     *  point will be gibberish (z = 0 but infinity = 0).
  507|       |     */
  508|   751k|    if (a->infinity) {
  ------------------
  |  Branch (508:9): [True: 6.04k, False: 745k]
  ------------------
  509|  6.04k|        secp256k1_gej_set_infinity(r);
  510|  6.04k|        if (rzr != NULL) {
  ------------------
  |  Branch (510:13): [True: 0, False: 6.04k]
  ------------------
  511|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  512|      0|        }
  513|  6.04k|        return;
  514|  6.04k|    }
  515|       |
  516|   745k|    if (rzr != NULL) {
  ------------------
  |  Branch (516:9): [True: 0, False: 745k]
  ------------------
  517|      0|        *rzr = a->y;
  518|      0|        secp256k1_fe_normalize_weak(rzr);
  ------------------
  |  |   79|      0|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  519|      0|    }
  520|       |
  521|   745k|    secp256k1_gej_double(r, a);
  522|       |
  523|   745k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   745k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  524|   745k|}
secp256k1.c:secp256k1_gej_double:
  460|   745k|static SECP256K1_INLINE void secp256k1_gej_double(secp256k1_gej *r, const secp256k1_gej *a) {
  461|       |    /* Operations: 3 mul, 4 sqr, 8 add/half/mul_int/negate */
  462|   745k|    secp256k1_fe l, s, t;
  463|   745k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   745k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  464|       |
  465|   745k|    r->infinity = a->infinity;
  466|       |
  467|       |    /* Formula used:
  468|       |     * L = (3/2) * X1^2
  469|       |     * S = Y1^2
  470|       |     * T = -X1*S
  471|       |     * X3 = L^2 + 2*T
  472|       |     * Y3 = -(L*(X3 + T) + S^2)
  473|       |     * Z3 = Y1*Z1
  474|       |     */
  475|       |
  476|   745k|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|   745k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  477|   745k|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|   745k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  478|   745k|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|   745k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  479|   745k|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|   745k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   745k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   745k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 745k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   745k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 745k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   745k|    } \
  |  |  |  |   94|   745k|    stmt; \
  |  |  |  |   95|   745k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 745k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|   745k|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|   745k|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  481|   745k|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|   745k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   745k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   745k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 745k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   745k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 745k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   745k|    } \
  |  |  |  |   94|   745k|    stmt; \
  |  |  |  |   95|   745k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 745k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|   745k|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|   745k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  483|   745k|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|   745k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  484|   745k|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|   745k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  485|   745k|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|   745k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  486|   745k|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|   745k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  487|   745k|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|   745k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  488|   745k|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|   745k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  489|   745k|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|   745k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  490|   745k|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|   745k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   745k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   745k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 745k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   745k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 745k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   745k|    } \
  |  |  |  |   94|   745k|    stmt; \
  |  |  |  |   95|   745k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 745k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|       |
  492|   745k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   745k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  493|   745k|}
secp256k1.c:secp256k1_ge_from_storage:
  890|   589k|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  891|   589k|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|   589k|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  892|   589k|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|   589k|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  893|   589k|    r->infinity = 0;
  894|       |
  895|   589k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   589k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  896|   589k|}
secp256k1.c:secp256k1_gej_add_zinv_var:
  653|  7.32k|static void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv) {
  654|       |    /* Operations: 9 mul, 3 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  655|  7.32k|    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  656|  7.32k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  7.32k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  657|  7.32k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|  7.32k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  658|  7.32k|    SECP256K1_FE_VERIFY(bzinv);
  ------------------
  |  |  345|  7.32k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  659|       |
  660|  7.32k|    if (a->infinity) {
  ------------------
  |  Branch (660:9): [True: 192, False: 7.13k]
  ------------------
  661|    192|        secp256k1_fe bzinv2, bzinv3;
  662|    192|        r->infinity = b->infinity;
  663|    192|        secp256k1_fe_sqr(&bzinv2, bzinv);
  ------------------
  |  |   94|    192|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  664|    192|        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);
  ------------------
  |  |   93|    192|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  665|    192|        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);
  ------------------
  |  |   93|    192|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  666|    192|        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);
  ------------------
  |  |   93|    192|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  667|    192|        secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|    192|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  668|    192|        SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|    192|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  669|    192|        return;
  670|    192|    }
  671|  7.13k|    if (b->infinity) {
  ------------------
  |  Branch (671:9): [True: 0, False: 7.13k]
  ------------------
  672|      0|        *r = *a;
  673|      0|        return;
  674|      0|    }
  675|       |
  676|       |    /** We need to calculate (rx,ry,rz) = (ax,ay,az) + (bx,by,1/bzinv). Due to
  677|       |     *  secp256k1's isomorphism we can multiply the Z coordinates on both sides
  678|       |     *  by bzinv, and get: (rx,ry,rz*bzinv) = (ax,ay,az*bzinv) + (bx,by,1).
  679|       |     *  This means that (rx,ry,rz) can be calculated as
  680|       |     *  (ax,ay,az*bzinv) + (bx,by,1), when not applying the bzinv factor to rz.
  681|       |     *  The variable az below holds the modified Z coordinate for a, which is used
  682|       |     *  for the computation of rx and ry, but not for rz.
  683|       |     */
  684|  7.13k|    secp256k1_fe_mul(&az, &a->z, bzinv);
  ------------------
  |  |   93|  7.13k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  685|       |
  686|  7.13k|    secp256k1_fe_sqr(&z12, &az);
  ------------------
  |  |   94|  7.13k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  687|  7.13k|    u1 = a->x;
  688|  7.13k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  7.13k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  689|  7.13k|    s1 = a->y;
  690|  7.13k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  7.13k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  7.13k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  691|  7.13k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  7.13k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  7.13k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  7.13k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 7.13k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  7.13k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 7.13k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  7.13k|    } \
  |  |  |  |   94|  7.13k|    stmt; \
  |  |  |  |   95|  7.13k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 7.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  7.13k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  692|  7.13k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  7.13k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  7.13k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  7.13k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 7.13k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  7.13k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 7.13k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  7.13k|    } \
  |  |  |  |   94|  7.13k|    stmt; \
  |  |  |  |   95|  7.13k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 7.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  7.13k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  693|  7.13k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  7.13k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (693:9): [True: 38, False: 7.09k]
  ------------------
  694|     38|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|     38|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (694:13): [True: 2, False: 36]
  ------------------
  695|      2|            secp256k1_gej_double_var(r, a, NULL);
  696|     36|        } else {
  697|     36|            secp256k1_gej_set_infinity(r);
  698|     36|        }
  699|     38|        return;
  700|     38|    }
  701|       |
  702|  7.09k|    r->infinity = 0;
  703|  7.09k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  7.09k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  704|       |
  705|  7.09k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  7.09k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  706|  7.09k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  7.09k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  7.09k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  7.09k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 7.09k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  7.09k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 7.09k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  7.09k|    } \
  |  |  |  |   94|  7.09k|    stmt; \
  |  |  |  |   95|  7.09k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 7.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  7.09k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  7.09k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  708|  7.09k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  7.09k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  709|       |
  710|  7.09k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  7.09k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  711|  7.09k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  7.09k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  712|  7.09k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  7.09k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  713|  7.09k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  7.09k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  714|       |
  715|  7.09k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  7.09k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  716|  7.09k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  7.09k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  717|  7.09k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  7.09k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  718|  7.09k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  7.09k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  719|       |
  720|  7.09k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  7.09k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  721|  7.09k|}
secp256k1.c:secp256k1_ge_storage_cmov:
  911|  18.3M|static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) {
  912|  18.3M|    VERIFY_CHECK(flag == 0 || flag == 1);
  913|  18.3M|    secp256k1_fe_storage_cmov(&r->x, &a->x, flag);
  914|  18.3M|    secp256k1_fe_storage_cmov(&r->y, &a->y, flag);
  915|  18.3M|}
secp256k1.c:secp256k1_gej_clear:
  339|  13.3k|static void secp256k1_gej_clear(secp256k1_gej *r) {
  340|  13.3k|    secp256k1_memclear_explicit(r, sizeof(secp256k1_gej));
  341|  13.3k|}
secp256k1.c:secp256k1_ge_x_on_curve_var:
  950|  6.42k|static int secp256k1_ge_x_on_curve_var(const secp256k1_fe *x) {
  951|  6.42k|    secp256k1_fe c;
  952|  6.42k|    secp256k1_fe_sqr(&c, x);
  ------------------
  |  |   94|  6.42k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  953|  6.42k|    secp256k1_fe_mul(&c, &c, x);
  ------------------
  |  |   93|  6.42k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  954|  6.42k|    secp256k1_fe_add_int(&c, SECP256K1_B);
  ------------------
  |  |  102|  6.42k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&c, SECP256K1_B);
  ------------------
  |  |   73|  6.42k|#define SECP256K1_B 7
  ------------------
  955|  6.42k|    return secp256k1_fe_is_square_var(&c);
  ------------------
  |  |  103|  6.42k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  956|  6.42k|}
secp256k1.c:secp256k1_ge_x_frac_on_curve_var:
  958|  4.32k|static int secp256k1_ge_x_frac_on_curve_var(const secp256k1_fe *xn, const secp256k1_fe *xd) {
  959|       |    /* We want to determine whether (xn/xd) is on the curve.
  960|       |     *
  961|       |     * (xn/xd)^3 + 7 is square <=> xd*xn^3 + 7*xd^4 is square (multiplying by xd^4, a square).
  962|       |     */
  963|  4.32k|     secp256k1_fe r, t;
  964|  4.32k|     VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(xd));
  965|       |
  966|  4.32k|     secp256k1_fe_mul(&r, xd, xn); /* r = xd*xn */
  ------------------
  |  |   93|  4.32k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  967|  4.32k|     secp256k1_fe_sqr(&t, xn); /* t = xn^2 */
  ------------------
  |  |   94|  4.32k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  968|  4.32k|     secp256k1_fe_mul(&r, &r, &t); /* r = xd*xn^3 */
  ------------------
  |  |   93|  4.32k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  969|  4.32k|     secp256k1_fe_sqr(&t, xd); /* t = xd^2 */
  ------------------
  |  |   94|  4.32k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  970|  4.32k|     secp256k1_fe_sqr(&t, &t); /* t = xd^4 */
  ------------------
  |  |   94|  4.32k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  971|  4.32k|     VERIFY_CHECK(SECP256K1_B <= 31);
  972|  4.32k|     secp256k1_fe_mul_int(&t, SECP256K1_B); /* t = 7*xd^4 */
  ------------------
  |  |  233|  4.32k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  4.32k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  4.32k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 4.32k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  4.32k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 4.32k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  4.32k|    } \
  |  |  |  |   94|  4.32k|    stmt; \
  |  |  |  |   95|  4.32k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 4.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|  4.32k|     secp256k1_fe_add(&r, &t); /* r = xd*xn^3 + 7*xd^4 */
  ------------------
  |  |   92|  4.32k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  974|  4.32k|     return secp256k1_fe_is_square_var(&r);
  ------------------
  |  |  103|  4.32k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  975|  4.32k|}
secp256k1.c:secp256k1_gej_add_ge_var:
  590|   295k|static void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr) {
  591|       |    /* Operations: 8 mul, 3 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  592|   295k|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  593|   295k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   295k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  594|   295k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|   295k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  595|       |
  596|   295k|    if (a->infinity) {
  ------------------
  |  Branch (596:9): [True: 5.77k, False: 289k]
  ------------------
  597|  5.77k|        VERIFY_CHECK(rzr == NULL);
  598|  5.77k|        secp256k1_gej_set_ge(r, b);
  599|  5.77k|        return;
  600|  5.77k|    }
  601|   289k|    if (b->infinity) {
  ------------------
  |  Branch (601:9): [True: 0, False: 289k]
  ------------------
  602|      0|        if (rzr != NULL) {
  ------------------
  |  Branch (602:13): [True: 0, False: 0]
  ------------------
  603|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  604|      0|        }
  605|      0|        *r = *a;
  606|      0|        return;
  607|      0|    }
  608|       |
  609|   289k|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|   289k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  610|   289k|    u1 = a->x;
  611|   289k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  612|   289k|    s1 = a->y;
  613|   289k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  614|   289k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|   289k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   289k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   289k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 289k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   289k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 289k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   289k|    } \
  |  |  |  |   94|   289k|    stmt; \
  |  |  |  |   95|   289k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 289k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  615|   289k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|   289k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   289k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   289k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 289k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   289k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 289k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   289k|    } \
  |  |  |  |   94|   289k|    stmt; \
  |  |  |  |   95|   289k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 289k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  616|   289k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|   289k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (616:9): [True: 42, False: 289k]
  ------------------
  617|     42|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|     42|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (617:13): [True: 2, False: 40]
  ------------------
  618|      2|            secp256k1_gej_double_var(r, a, rzr);
  619|     40|        } else {
  620|     40|            if (rzr != NULL) {
  ------------------
  |  Branch (620:17): [True: 0, False: 40]
  ------------------
  621|      0|                secp256k1_fe_set_int(rzr, 0);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  622|      0|            }
  623|     40|            secp256k1_gej_set_infinity(r);
  624|     40|        }
  625|     42|        return;
  626|     42|    }
  627|       |
  628|   289k|    r->infinity = 0;
  629|   289k|    if (rzr != NULL) {
  ------------------
  |  Branch (629:9): [True: 41.2k, False: 248k]
  ------------------
  630|  41.2k|        *rzr = h;
  631|  41.2k|    }
  632|   289k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  633|       |
  634|   289k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|   289k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  635|   289k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|   289k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   289k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   289k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 289k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   289k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 289k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   289k|    } \
  |  |  |  |   94|   289k|    stmt; \
  |  |  |  |   95|   289k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 289k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|   289k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  637|   289k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  638|       |
  639|   289k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|   289k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  640|   289k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  641|   289k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  642|   289k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  643|       |
  644|   289k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  645|   289k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  646|   289k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|   289k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|   289k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|   289k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  648|       |
  649|   289k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   289k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  650|   289k|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  345|  41.2k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (650:9): [True: 41.2k, False: 248k]
  ------------------
  651|   289k|}
secp256k1.c:secp256k1_ge_to_bytes:
  977|  8.83k|static void secp256k1_ge_to_bytes(unsigned char *buf, const secp256k1_ge *a) {
  978|  8.83k|    secp256k1_ge_storage s;
  979|       |
  980|       |    /* We require that the secp256k1_ge_storage type is exactly 64 bytes.
  981|       |     * This is formally not guaranteed by the C standard, but should hold on any
  982|       |     * sane compiler in the real world. */
  983|  8.83k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   74|  8.83k|#define STATIC_ASSERT(expr) do { \
  |  |   75|  8.83k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 0]
  |  |  ------------------
  |  |   76|  8.83k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 8.83k, False: 0]
  |  |  ------------------
  |  |   77|  8.83k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   78|  8.83k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (78:9): [True: 0, False: 8.83k]
  |  |  ------------------
  |  |   79|  8.83k|        ; \
  |  |   80|  8.83k|    } \
  |  |   81|  8.83k|} while(0)
  |  |  ------------------
  |  |  |  Branch (81:9): [Folded, False: 8.83k]
  |  |  ------------------
  ------------------
  984|  8.83k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(a));
  985|  8.83k|    secp256k1_ge_to_storage(&s, a);
  986|  8.83k|    memcpy(buf, &s, 64);
  987|  8.83k|}
secp256k1.c:secp256k1_ge_to_storage:
  877|  8.83k|static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {
  878|  8.83k|    secp256k1_fe x, y;
  879|  8.83k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  8.83k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  880|  8.83k|    VERIFY_CHECK(!a->infinity);
  881|       |
  882|  8.83k|    x = a->x;
  883|  8.83k|    secp256k1_fe_normalize(&x);
  ------------------
  |  |   78|  8.83k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  884|  8.83k|    y = a->y;
  885|  8.83k|    secp256k1_fe_normalize(&y);
  ------------------
  |  |   78|  8.83k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  886|  8.83k|    secp256k1_fe_to_storage(&r->x, &x);
  ------------------
  |  |   96|  8.83k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  887|  8.83k|    secp256k1_fe_to_storage(&r->y, &y);
  ------------------
  |  |   96|  8.83k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  888|  8.83k|}
secp256k1.c:secp256k1_ge_from_bytes:
  989|  8.83k|static void secp256k1_ge_from_bytes(secp256k1_ge *r, const unsigned char *buf) {
  990|  8.83k|    secp256k1_ge_storage s;
  991|       |
  992|  8.83k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   74|  8.83k|#define STATIC_ASSERT(expr) do { \
  |  |   75|  8.83k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 0]
  |  |  ------------------
  |  |   76|  8.83k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 8.83k, False: 0]
  |  |  ------------------
  |  |   77|  8.83k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   78|  8.83k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (78:9): [True: 0, False: 8.83k]
  |  |  ------------------
  |  |   79|  8.83k|        ; \
  |  |   80|  8.83k|    } \
  |  |   81|  8.83k|} while(0)
  |  |  ------------------
  |  |  |  Branch (81:9): [Folded, False: 8.83k]
  |  |  ------------------
  ------------------
  993|  8.83k|    memcpy(&s, buf, 64);
  994|  8.83k|    secp256k1_ge_from_storage(r, &s);
  995|  8.83k|}

secp256k1.c:secp256k1_sha256_transform:
  133|   191k|static void secp256k1_sha256_transform(uint32_t *state, const unsigned char *blocks64, size_t n_blocks) {
  134|   383k|    while (n_blocks--) {
  ------------------
  |  Branch (134:12): [True: 191k, False: 191k]
  ------------------
  135|   191k|        secp256k1_sha256_transform_impl(state, blocks64);
  136|   191k|        blocks64 += 64;
  137|   191k|    }
  138|   191k|}
secp256k1.c:secp256k1_sha256_transform_impl:
   51|   191k|static void secp256k1_sha256_transform_impl(uint32_t* s, const unsigned char* buf) {
   52|   191k|    uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7];
   53|   191k|    uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
   54|       |
   55|   191k|    Round(a, b, c, d, e, f, g, h, 0x428a2f98,  w0 = secp256k1_read_be32(&buf[0]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   56|   191k|    Round(h, a, b, c, d, e, f, g, 0x71374491,  w1 = secp256k1_read_be32(&buf[4]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   57|   191k|    Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf,  w2 = secp256k1_read_be32(&buf[8]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   58|   191k|    Round(f, g, h, a, b, c, d, e, 0xe9b5dba5,  w3 = secp256k1_read_be32(&buf[12]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   59|   191k|    Round(e, f, g, h, a, b, c, d, 0x3956c25b,  w4 = secp256k1_read_be32(&buf[16]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   60|   191k|    Round(d, e, f, g, h, a, b, c, 0x59f111f1,  w5 = secp256k1_read_be32(&buf[20]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   61|   191k|    Round(c, d, e, f, g, h, a, b, 0x923f82a4,  w6 = secp256k1_read_be32(&buf[24]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   62|   191k|    Round(b, c, d, e, f, g, h, a, 0xab1c5ed5,  w7 = secp256k1_read_be32(&buf[28]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   63|   191k|    Round(a, b, c, d, e, f, g, h, 0xd807aa98,  w8 = secp256k1_read_be32(&buf[32]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   64|   191k|    Round(h, a, b, c, d, e, f, g, 0x12835b01,  w9 = secp256k1_read_be32(&buf[36]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   65|   191k|    Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = secp256k1_read_be32(&buf[40]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   66|   191k|    Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = secp256k1_read_be32(&buf[44]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   67|   191k|    Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = secp256k1_read_be32(&buf[48]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   68|   191k|    Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = secp256k1_read_be32(&buf[52]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   69|   191k|    Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = secp256k1_read_be32(&buf[56]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   70|   191k|    Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = secp256k1_read_be32(&buf[60]));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   71|       |
   72|   191k|    Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   73|   191k|    Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   74|   191k|    Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   75|   191k|    Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   76|   191k|    Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   77|   191k|    Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   78|   191k|    Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   79|   191k|    Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   80|   191k|    Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   81|   191k|    Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   82|   191k|    Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   83|   191k|    Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   84|   191k|    Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   85|   191k|    Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   86|   191k|    Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   87|   191k|    Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   88|       |
   89|   191k|    Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   90|   191k|    Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   91|   191k|    Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   92|   191k|    Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   93|   191k|    Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   94|   191k|    Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   95|   191k|    Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   96|   191k|    Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   97|   191k|    Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   98|   191k|    Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
   99|   191k|    Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  100|   191k|    Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  101|   191k|    Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  102|   191k|    Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  103|   191k|    Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  104|   191k|    Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  105|       |
  106|   191k|    Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  107|   191k|    Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  108|   191k|    Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  109|   191k|    Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  110|   191k|    Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  111|   191k|    Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  112|   191k|    Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  113|   191k|    Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  114|   191k|    Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  115|   191k|    Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  116|   191k|    Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  117|   191k|    Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  118|   191k|    Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  119|   191k|    Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  120|   191k|    Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  121|   191k|    Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|   191k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   191k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   191k|#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|   191k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   191k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   191k|#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|   191k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   191k|    (d) += t1; \
  |  |   28|   191k|    (h) = t1 + t2; \
  |  |   29|   191k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 191k]
  |  |  ------------------
  ------------------
  122|       |
  123|   191k|    s[0] += a;
  124|   191k|    s[1] += b;
  125|   191k|    s[2] += c;
  126|   191k|    s[3] += d;
  127|   191k|    s[4] += e;
  128|   191k|    s[5] += f;
  129|   191k|    s[6] += g;
  130|   191k|    s[7] += h;
  131|   191k|}
secp256k1.c:secp256k1_sha256_initialize:
   31|  74.5k|static void secp256k1_sha256_initialize(secp256k1_sha256 *hash) {
   32|  74.5k|    hash->s[0] = 0x6a09e667ul;
   33|  74.5k|    hash->s[1] = 0xbb67ae85ul;
   34|  74.5k|    hash->s[2] = 0x3c6ef372ul;
   35|  74.5k|    hash->s[3] = 0xa54ff53aul;
   36|  74.5k|    hash->s[4] = 0x510e527ful;
   37|  74.5k|    hash->s[5] = 0x9b05688cul;
   38|  74.5k|    hash->s[6] = 0x1f83d9abul;
   39|  74.5k|    hash->s[7] = 0x5be0cd19ul;
   40|  74.5k|    hash->bytes = 0;
   41|  74.5k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_initialize:
  320|  7.45k|static void secp256k1_rfc6979_hmac_sha256_initialize(const secp256k1_hash_ctx *hash_ctx, secp256k1_rfc6979_hmac_sha256 *rng, const unsigned char *key, size_t keylen) {
  321|  7.45k|    secp256k1_hmac_sha256 hmac;
  322|  7.45k|    static const unsigned char zero[1] = {0x00};
  323|  7.45k|    static const unsigned char one[1] = {0x01};
  324|       |
  325|  7.45k|    memset(rng->v, 0x01, 32); /* RFC6979 3.2.b. */
  326|  7.45k|    memset(rng->k, 0x00, 32); /* RFC6979 3.2.c. */
  327|       |
  328|       |    /* RFC6979 3.2.d. */
  329|  7.45k|    secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  330|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  331|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, zero, 1);
  332|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, key, keylen);
  333|  7.45k|    secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->k);
  334|  7.45k|    secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  335|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  336|  7.45k|    secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->v);
  337|       |
  338|       |    /* RFC6979 3.2.f. */
  339|  7.45k|    secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  340|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  341|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, one, 1);
  342|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, key, keylen);
  343|  7.45k|    secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->k);
  344|  7.45k|    secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  345|  7.45k|    secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  346|  7.45k|    secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->v);
  347|  7.45k|    rng->retry = 0;
  348|  7.45k|}
secp256k1.c:secp256k1_hmac_sha256_initialize:
  276|  37.2k|static void secp256k1_hmac_sha256_initialize(const secp256k1_hash_ctx *hash_ctx, secp256k1_hmac_sha256 *hash, const unsigned char *key, size_t keylen) {
  277|  37.2k|    size_t n;
  278|  37.2k|    unsigned char rkey[64];
  279|  37.2k|    if (keylen <= sizeof(rkey)) {
  ------------------
  |  Branch (279:9): [True: 37.2k, False: 0]
  ------------------
  280|  37.2k|        memcpy(rkey, key, keylen);
  281|  37.2k|        memset(rkey + keylen, 0, sizeof(rkey) - keylen);
  282|  37.2k|    } else {
  283|      0|        secp256k1_sha256 sha256;
  284|      0|        secp256k1_sha256_initialize(&sha256);
  285|      0|        secp256k1_sha256_write(hash_ctx, &sha256, key, keylen);
  286|      0|        secp256k1_sha256_finalize(hash_ctx, &sha256, rkey);
  287|      0|        memset(rkey + 32, 0, 32);
  288|      0|    }
  289|       |
  290|  37.2k|    secp256k1_sha256_initialize(&hash->outer);
  291|  2.42M|    for (n = 0; n < sizeof(rkey); n++) {
  ------------------
  |  Branch (291:17): [True: 2.38M, False: 37.2k]
  ------------------
  292|  2.38M|        rkey[n] ^= 0x5c;
  293|  2.38M|    }
  294|  37.2k|    secp256k1_sha256_write(hash_ctx, &hash->outer, rkey, sizeof(rkey));
  295|       |
  296|  37.2k|    secp256k1_sha256_initialize(&hash->inner);
  297|  2.42M|    for (n = 0; n < sizeof(rkey); n++) {
  ------------------
  |  Branch (297:17): [True: 2.38M, False: 37.2k]
  ------------------
  298|  2.38M|        rkey[n] ^= 0x5c ^ 0x36;
  299|  2.38M|    }
  300|  37.2k|    secp256k1_sha256_write(hash_ctx, &hash->inner, rkey, sizeof(rkey));
  301|  37.2k|    secp256k1_memclear_explicit(rkey, sizeof(rkey));
  302|  37.2k|}
secp256k1.c:secp256k1_hmac_sha256_write:
  304|  67.0k|static void secp256k1_hmac_sha256_write(const secp256k1_hash_ctx *hash_ctx, secp256k1_hmac_sha256 *hash, const unsigned char *data, size_t size) {
  305|  67.0k|    secp256k1_sha256_write(hash_ctx, &hash->inner, data, size);
  306|  67.0k|}
secp256k1.c:secp256k1_hmac_sha256_finalize:
  308|  37.2k|static void secp256k1_hmac_sha256_finalize(const secp256k1_hash_ctx *hash_ctx, secp256k1_hmac_sha256 *hash, unsigned char *out32) {
  309|  37.2k|    unsigned char temp[32];
  310|  37.2k|    secp256k1_sha256_finalize(hash_ctx, &hash->inner, temp);
  311|  37.2k|    secp256k1_sha256_write(hash_ctx, &hash->outer, temp, 32);
  312|  37.2k|    secp256k1_memclear_explicit(temp, sizeof(temp));
  313|  37.2k|    secp256k1_sha256_finalize(hash_ctx, &hash->outer, out32);
  314|  37.2k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_generate:
  350|  7.45k|static void secp256k1_rfc6979_hmac_sha256_generate(const secp256k1_hash_ctx *hash_ctx, secp256k1_rfc6979_hmac_sha256 *rng, unsigned char *out, size_t outlen) {
  351|       |    /* RFC6979 3.2.h. */
  352|  7.45k|    static const unsigned char zero[1] = {0x00};
  353|  7.45k|    if (rng->retry) {
  ------------------
  |  Branch (353:9): [True: 0, False: 7.45k]
  ------------------
  354|      0|        secp256k1_hmac_sha256 hmac;
  355|      0|        secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  356|      0|        secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  357|      0|        secp256k1_hmac_sha256_write(hash_ctx, &hmac, zero, 1);
  358|      0|        secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->k);
  359|      0|        secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  360|      0|        secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  361|      0|        secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->v);
  362|      0|    }
  363|       |
  364|  14.9k|    while (outlen > 0) {
  ------------------
  |  Branch (364:12): [True: 7.45k, False: 7.45k]
  ------------------
  365|  7.45k|        secp256k1_hmac_sha256 hmac;
  366|  7.45k|        size_t now = outlen;
  367|  7.45k|        secp256k1_hmac_sha256_initialize(hash_ctx, &hmac, rng->k, 32);
  368|  7.45k|        secp256k1_hmac_sha256_write(hash_ctx, &hmac, rng->v, 32);
  369|  7.45k|        secp256k1_hmac_sha256_finalize(hash_ctx, &hmac, rng->v);
  370|  7.45k|        if (now > 32) {
  ------------------
  |  Branch (370:13): [True: 0, False: 7.45k]
  ------------------
  371|      0|            now = 32;
  372|      0|        }
  373|  7.45k|        memcpy(out, rng->v, now);
  374|  7.45k|        out += now;
  375|  7.45k|        outlen -= now;
  376|  7.45k|    }
  377|       |
  378|  7.45k|    rng->retry = 1;
  379|  7.45k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_finalize:
  381|  7.45k|static void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256 *rng) {
  382|  7.45k|    (void) rng;
  383|  7.45k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_clear:
  385|  7.45k|static void secp256k1_rfc6979_hmac_sha256_clear(secp256k1_rfc6979_hmac_sha256 *rng) {
  386|  7.45k|    secp256k1_memclear_explicit(rng, sizeof(*rng));
  387|  7.45k|}
secp256k1.c:secp256k1_sha256_write:
  210|   384k|static void secp256k1_sha256_write(const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, const unsigned char *data, size_t len) {
  211|   384k|    size_t chunk_len;
  212|   384k|    size_t bufsize = hash->bytes & 0x3F;
  213|   384k|    hash->bytes += len;
  214|   384k|    VERIFY_CHECK(hash->bytes >= len);
  215|   384k|    VERIFY_CHECK(hash_ctx != NULL);
  216|   384k|    VERIFY_CHECK(hash_ctx->fn_sha256_compression != NULL);
  217|       |
  218|       |    /* If we exceed the 64-byte block size with this input, process it and wipe the buffer */
  219|   384k|    chunk_len = 64 - bufsize;
  220|   384k|    if (bufsize && len >= chunk_len) {
  ------------------
  |  Branch (220:9): [True: 229k, False: 154k]
  |  Branch (220:20): [True: 108k, False: 121k]
  ------------------
  221|   108k|        memcpy(hash->buf + bufsize, data, chunk_len);
  222|   108k|        data += chunk_len;
  223|   108k|        len -= chunk_len;
  224|   108k|        hash_ctx->fn_sha256_compression(hash->s, hash->buf, 1);
  225|   108k|        bufsize = 0;
  226|   108k|    }
  227|       |
  228|       |    /* If we still have data to process, invoke compression directly on the input */
  229|   384k|    if (len >= 64) {
  ------------------
  |  Branch (229:9): [True: 83.5k, False: 300k]
  ------------------
  230|  83.5k|        const size_t n_blocks = len / 64;
  231|  83.5k|        const size_t advance = n_blocks * 64;
  232|  83.5k|        hash_ctx->fn_sha256_compression(hash->s, data, n_blocks);
  233|  83.5k|        data += advance;
  234|  83.5k|        len -= advance;
  235|  83.5k|    }
  236|       |
  237|       |    /* Fill the buffer with what remains */
  238|   384k|    if (len) {
  ------------------
  |  Branch (238:9): [True: 216k, False: 167k]
  ------------------
  239|   216k|        memcpy(hash->buf + bufsize, data, len);
  240|   216k|    }
  241|   384k|}
secp256k1.c:secp256k1_sha256_finalize:
  243|  90.3k|static void secp256k1_sha256_finalize(const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, unsigned char *out32) {
  244|  90.3k|    static const unsigned char pad[64] = {0x80};
  245|  90.3k|    unsigned char sizedesc[8];
  246|  90.3k|    int i;
  247|       |    /* The maximum message size of SHA256 is 2^64-1 bits. */
  248|  90.3k|    VERIFY_CHECK(hash->bytes < ((uint64_t)1 << 61));
  249|  90.3k|    secp256k1_write_be32(&sizedesc[0], hash->bytes >> 29);
  250|  90.3k|    secp256k1_write_be32(&sizedesc[4], hash->bytes << 3);
  251|  90.3k|    secp256k1_sha256_write(hash_ctx, hash, pad, 1 + ((119 - (hash->bytes % 64)) % 64));
  252|  90.3k|    secp256k1_sha256_write(hash_ctx, hash, sizedesc, 8);
  253|   812k|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (253:17): [True: 722k, False: 90.3k]
  ------------------
  254|   722k|        secp256k1_write_be32(&out32[4*i], hash->s[i]);
  255|   722k|        hash->s[i] = 0;
  256|   722k|    }
  257|  90.3k|}
secp256k1.c:secp256k1_sha256_clear:
  272|  2.94k|static void secp256k1_sha256_clear(secp256k1_sha256 *hash) {
  273|  2.94k|    secp256k1_memclear_explicit(hash, sizeof(*hash));
  274|  2.94k|}
secp256k1.c:secp256k1_sha256_initialize_midstate:
   43|  2.94k|static void secp256k1_sha256_initialize_midstate(secp256k1_sha256 *hash, uint64_t bytes, const uint32_t state[8]) {
   44|  2.94k|    VERIFY_CHECK((bytes & 0x3F) == 0);
   45|  2.94k|    VERIFY_CHECK(state != NULL);
   46|  2.94k|    memcpy(hash->s, state, sizeof(hash->s));
   47|  2.94k|    hash->bytes = bytes;
   48|  2.94k|}

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

secp256k1.c:secp256k1_modinv64_var:
  637|  11.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|  11.7k|    secp256k1_modinv64_signed62 d = {{0, 0, 0, 0, 0}};
  640|  11.7k|    secp256k1_modinv64_signed62 e = {{1, 0, 0, 0, 0}};
  641|  11.7k|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  642|  11.7k|    secp256k1_modinv64_signed62 g = *x;
  643|       |#ifdef VERIFY
  644|       |    int i = 0;
  645|       |#endif
  646|  11.7k|    int j, len = 5;
  647|  11.7k|    int64_t eta = -1; /* eta = -delta; delta is initially 1 */
  648|  11.7k|    int64_t cond, fn, gn;
  649|       |
  650|       |    /* Do iterations of 62 divsteps each until g=0. */
  651|   106k|    while (1) {
  ------------------
  |  Branch (651:12): [True: 106k, Folded]
  ------------------
  652|       |        /* Compute transition matrix and new eta after 62 divsteps. */
  653|   106k|        secp256k1_modinv64_trans2x2 t;
  654|   106k|        eta = secp256k1_modinv64_divsteps_62_var(eta, f.v[0], g.v[0], &t);
  655|       |        /* Update d,e using that transition matrix. */
  656|   106k|        secp256k1_modinv64_update_de_62(&d, &e, &t, modinfo);
  657|       |        /* Update f,g using that transition matrix. */
  658|   106k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, -1) > 0); /* f > -modulus */
  659|   106k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  660|   106k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, -1) > 0); /* g > -modulus */
  661|   106k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  662|       |
  663|   106k|        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|   106k|        if (g.v[0] == 0) {
  ------------------
  |  Branch (665:13): [True: 11.7k, False: 94.2k]
  ------------------
  666|  11.7k|            cond = 0;
  667|       |            /* Check if the other limbs are also 0. */
  668|  11.7k|            for (j = 1; j < len; ++j) {
  ------------------
  |  Branch (668:25): [True: 0, False: 11.7k]
  ------------------
  669|      0|                cond |= g.v[j];
  670|      0|            }
  671|       |            /* If so, we're done. */
  672|  11.7k|            if (cond == 0) break;
  ------------------
  |  Branch (672:17): [True: 11.7k, False: 0]
  ------------------
  673|  11.7k|        }
  674|       |
  675|       |        /* Determine if len>1 and limb (len-1) of both f and g is 0 or -1. */
  676|  94.2k|        fn = f.v[len - 1];
  677|  94.2k|        gn = g.v[len - 1];
  678|  94.2k|        cond = ((int64_t)len - 2) >> 63;
  679|  94.2k|        cond |= fn ^ (fn >> 63);
  680|  94.2k|        cond |= gn ^ (gn >> 63);
  681|       |        /* If so, reduce length, propagating the sign of f and g's top limb into the one below. */
  682|  94.2k|        if (cond == 0) {
  ------------------
  |  Branch (682:13): [True: 47.1k, False: 47.1k]
  ------------------
  683|  47.1k|            f.v[len - 2] |= (uint64_t)fn << 62;
  684|  47.1k|            g.v[len - 2] |= (uint64_t)gn << 62;
  685|  47.1k|            --len;
  686|  47.1k|        }
  687|       |
  688|  94.2k|        VERIFY_CHECK(++i < 12); /* We should never need more than 12*62 = 744 divsteps */
  689|  94.2k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, -1) > 0); /* f > -modulus */
  690|  94.2k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  691|  94.2k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, -1) > 0); /* g > -modulus */
  692|  94.2k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  693|  94.2k|    }
  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|  11.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|  11.7k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &SECP256K1_SIGNED62_ONE, -1) == 0 ||
  702|  11.7k|                 secp256k1_modinv64_mul_cmp_62(&f, len, &SECP256K1_SIGNED62_ONE, 1) == 0 ||
  703|  11.7k|                 (secp256k1_modinv64_mul_cmp_62(x, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  704|  11.7k|                  secp256k1_modinv64_mul_cmp_62(&d, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  705|  11.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|  11.7k|    secp256k1_modinv64_normalize_62(&d, f.v[len - 1], modinfo);
  709|  11.7k|    *x = d;
  710|  11.7k|}
secp256k1.c:secp256k1_modinv64_divsteps_62_var:
  239|   106k|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|   106k|    uint64_t u = 1, v = 0, q = 0, r = 1;
  242|   106k|    uint64_t f = f0, g = g0, m;
  243|   106k|    uint32_t w;
  244|   106k|    int i = 62, limit, zeros;
  245|       |
  246|  1.73M|    for (;;) {
  247|       |        /* Use a sentinel bit to count zeros only up to i. */
  248|  1.73M|        zeros = secp256k1_ctz64_var(g | (UINT64_MAX << i));
  249|       |        /* Perform zeros divsteps at once; they all just divide g by two. */
  250|  1.73M|        g >>= zeros;
  251|  1.73M|        u <<= zeros;
  252|  1.73M|        v <<= zeros;
  253|  1.73M|        eta -= zeros;
  254|  1.73M|        i -= zeros;
  255|       |        /* We're done once we've done 62 divsteps. */
  256|  1.73M|        if (i == 0) break;
  ------------------
  |  Branch (256:13): [True: 106k, False: 1.62M]
  ------------------
  257|  1.62M|        VERIFY_CHECK((f & 1) == 1);
  258|  1.62M|        VERIFY_CHECK((g & 1) == 1);
  259|  1.62M|        VERIFY_CHECK((u * f0 + v * g0) == f << (62 - i));
  260|  1.62M|        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|  1.62M|        VERIFY_CHECK(eta >= -745 && eta <= 745);
  263|       |        /* If eta is negative, negate it and replace f,g with g,-f. */
  264|  1.62M|        if (eta < 0) {
  ------------------
  |  Branch (264:13): [True: 1.57M, False: 56.3k]
  ------------------
  265|  1.57M|            uint64_t tmp;
  266|  1.57M|            eta = -eta;
  267|  1.57M|            tmp = f; f = g; g = -tmp;
  268|  1.57M|            tmp = u; u = q; q = -tmp;
  269|  1.57M|            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|  1.57M|            limit = ((int)eta + 1) > i ? i : ((int)eta + 1);
  ------------------
  |  Branch (273:21): [True: 31.3k, False: 1.54M]
  ------------------
  274|  1.57M|            VERIFY_CHECK(limit > 0 && limit <= 62);
  275|       |            /* m is a mask for the bottom min(limit, 6) bits. */
  276|  1.57M|            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|  1.57M|            w = (f * g * (f * f - 2)) & m;
  280|  1.57M|        } 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|  56.3k|            limit = ((int)eta + 1) > i ? i : ((int)eta + 1);
  ------------------
  |  Branch (283:21): [True: 372, False: 55.9k]
  ------------------
  284|  56.3k|            VERIFY_CHECK(limit > 0 && limit <= 62);
  285|       |            /* m is a mask for the bottom min(limit, 4) bits. */
  286|  56.3k|            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|  56.3k|            w = f + (((f + 1) & 4) << 1);
  290|  56.3k|            w = (-w * g) & m;
  291|  56.3k|        }
  292|  1.62M|        g += f * w;
  293|  1.62M|        q += u * w;
  294|  1.62M|        r += v * w;
  295|  1.62M|        VERIFY_CHECK((g & m) == 0);
  296|  1.62M|    }
  297|       |    /* Return data in t and return value. */
  298|   106k|    t->u = (int64_t)u;
  299|   106k|    t->v = (int64_t)v;
  300|   106k|    t->q = (int64_t)q;
  301|   106k|    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|   106k|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 62, 0));
  308|       |
  309|   106k|    return eta;
  310|   106k|}
secp256k1.c:secp256k1_modinv64_update_de_62:
  411|   313k|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|   313k|    const uint64_t M62 = UINT64_MAX >> 2;
  413|   313k|    const int64_t d0 = d->v[0], d1 = d->v[1], d2 = d->v[2], d3 = d->v[3], d4 = d->v[4];
  414|   313k|    const int64_t e0 = e->v[0], e1 = e->v[1], e2 = e->v[2], e3 = e->v[3], e4 = e->v[4];
  415|   313k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  416|   313k|    int64_t md, me, sd, se;
  417|   313k|    secp256k1_int128 cd, ce;
  418|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  419|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  420|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  421|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  422|   313k|    VERIFY_CHECK(secp256k1_modinv64_abs(u) <= (((int64_t)1 << 62) - secp256k1_modinv64_abs(v))); /* |u|+|v| <= 2^62 */
  423|   313k|    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|   313k|    sd = d4 >> 63;
  427|   313k|    se = e4 >> 63;
  428|   313k|    md = (u & sd) + (v & se);
  429|   313k|    me = (q & sd) + (r & se);
  430|       |    /* Begin computing t*[d,e]. */
  431|   313k|    secp256k1_i128_mul(&cd, u, d0);
  432|   313k|    secp256k1_i128_accum_mul(&cd, v, e0);
  433|   313k|    secp256k1_i128_mul(&ce, q, d0);
  434|   313k|    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|   313k|    md -= (modinfo->modulus_inv62 * secp256k1_i128_to_u64(&cd) + md) & M62;
  437|   313k|    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|   313k|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[0], md);
  440|   313k|    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|   313k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cd) & M62) == 0); secp256k1_i128_rshift(&cd, 62);
  443|   313k|    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|   313k|    secp256k1_i128_accum_mul(&cd, u, d1);
  446|   313k|    secp256k1_i128_accum_mul(&cd, v, e1);
  447|   313k|    secp256k1_i128_accum_mul(&ce, q, d1);
  448|   313k|    secp256k1_i128_accum_mul(&ce, r, e1);
  449|   313k|    if (modinfo->modulus.v[1]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (449:9): [True: 127k, False: 186k]
  ------------------
  450|   127k|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[1], md);
  451|   127k|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[1], me);
  452|   127k|    }
  453|   313k|    d->v[0] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  454|   313k|    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|   313k|    secp256k1_i128_accum_mul(&cd, u, d2);
  457|   313k|    secp256k1_i128_accum_mul(&cd, v, e2);
  458|   313k|    secp256k1_i128_accum_mul(&ce, q, d2);
  459|   313k|    secp256k1_i128_accum_mul(&ce, r, e2);
  460|   313k|    if (modinfo->modulus.v[2]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (460:9): [True: 127k, False: 186k]
  ------------------
  461|   127k|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[2], md);
  462|   127k|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[2], me);
  463|   127k|    }
  464|   313k|    d->v[1] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  465|   313k|    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|   313k|    secp256k1_i128_accum_mul(&cd, u, d3);
  468|   313k|    secp256k1_i128_accum_mul(&cd, v, e3);
  469|   313k|    secp256k1_i128_accum_mul(&ce, q, d3);
  470|   313k|    secp256k1_i128_accum_mul(&ce, r, e3);
  471|   313k|    if (modinfo->modulus.v[3]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (471:9): [True: 0, False: 313k]
  ------------------
  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|   313k|    d->v[2] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  476|   313k|    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|   313k|    secp256k1_i128_accum_mul(&cd, u, d4);
  479|   313k|    secp256k1_i128_accum_mul(&cd, v, e4);
  480|   313k|    secp256k1_i128_accum_mul(&ce, q, d4);
  481|   313k|    secp256k1_i128_accum_mul(&ce, r, e4);
  482|   313k|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[4], md);
  483|   313k|    secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[4], me);
  484|   313k|    d->v[3] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  485|   313k|    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|   313k|    d->v[4] = secp256k1_i128_to_i64(&cd);
  488|   313k|    e->v[4] = secp256k1_i128_to_i64(&ce);
  489|       |
  490|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  491|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  492|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  493|   313k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  494|   313k|}
secp256k1.c:secp256k1_modinv64_update_fg_62_var:
  553|   403k|static void secp256k1_modinv64_update_fg_62_var(int len, secp256k1_modinv64_signed62 *f, secp256k1_modinv64_signed62 *g, const secp256k1_modinv64_trans2x2 *t) {
  554|   403k|    const uint64_t M62 = UINT64_MAX >> 2;
  555|   403k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  556|   403k|    int64_t fi, gi;
  557|   403k|    secp256k1_int128 cf, cg;
  558|   403k|    int i;
  559|   403k|    VERIFY_CHECK(len > 0);
  560|       |    /* Start computing t*[f,g]. */
  561|   403k|    fi = f->v[0];
  562|   403k|    gi = g->v[0];
  563|   403k|    secp256k1_i128_mul(&cf, u, fi);
  564|   403k|    secp256k1_i128_accum_mul(&cf, v, gi);
  565|   403k|    secp256k1_i128_mul(&cg, q, fi);
  566|   403k|    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|   403k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cf) & M62) == 0); secp256k1_i128_rshift(&cf, 62);
  569|   403k|    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|  1.10M|    for (i = 1; i < len; ++i) {
  ------------------
  |  Branch (572:17): [True: 698k, False: 403k]
  ------------------
  573|   698k|        fi = f->v[i];
  574|   698k|        gi = g->v[i];
  575|   698k|        secp256k1_i128_accum_mul(&cf, u, fi);
  576|   698k|        secp256k1_i128_accum_mul(&cf, v, gi);
  577|   698k|        secp256k1_i128_accum_mul(&cg, q, fi);
  578|   698k|        secp256k1_i128_accum_mul(&cg, r, gi);
  579|   698k|        f->v[i - 1] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  580|   698k|        g->v[i - 1] = secp256k1_i128_to_u64(&cg) & M62; secp256k1_i128_rshift(&cg, 62);
  581|   698k|    }
  582|       |    /* What remains is limb (len) of t*[f,g]; store it as output limb (len-1). */
  583|   403k|    f->v[len - 1] = secp256k1_i128_to_i64(&cf);
  584|   403k|    g->v[len - 1] = secp256k1_i128_to_i64(&cg);
  585|   403k|}
secp256k1.c:secp256k1_modinv64_normalize_62:
   88|  32.5k|static void secp256k1_modinv64_normalize_62(secp256k1_modinv64_signed62 *r, int64_t sign, const secp256k1_modinv64_modinfo *modinfo) {
   89|  32.5k|    const int64_t M62 = (int64_t)(UINT64_MAX >> 2);
   90|  32.5k|    int64_t r0 = r->v[0], r1 = r->v[1], r2 = r->v[2], r3 = r->v[3], r4 = r->v[4];
   91|  32.5k|    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|  32.5k|    cond_add = r4 >> 63;
  110|  32.5k|    r0 += modinfo->modulus.v[0] & cond_add;
  111|  32.5k|    r1 += modinfo->modulus.v[1] & cond_add;
  112|  32.5k|    r2 += modinfo->modulus.v[2] & cond_add;
  113|  32.5k|    r3 += modinfo->modulus.v[3] & cond_add;
  114|  32.5k|    r4 += modinfo->modulus.v[4] & cond_add;
  115|  32.5k|    cond_negate = sign >> 63;
  116|  32.5k|    r0 = (r0 ^ cond_negate) - cond_negate;
  117|  32.5k|    r1 = (r1 ^ cond_negate) - cond_negate;
  118|  32.5k|    r2 = (r2 ^ cond_negate) - cond_negate;
  119|  32.5k|    r3 = (r3 ^ cond_negate) - cond_negate;
  120|  32.5k|    r4 = (r4 ^ cond_negate) - cond_negate;
  121|       |    /* Propagate the top bits, to bring limbs back to range (-2^62,2^62). */
  122|  32.5k|    r1 += r0 >> 62; r0 &= M62;
  123|  32.5k|    r2 += r1 >> 62; r1 &= M62;
  124|  32.5k|    r3 += r2 >> 62; r2 &= M62;
  125|  32.5k|    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|  32.5k|    cond_add = r4 >> 63;
  130|  32.5k|    r0 += modinfo->modulus.v[0] & cond_add;
  131|  32.5k|    r1 += modinfo->modulus.v[1] & cond_add;
  132|  32.5k|    r2 += modinfo->modulus.v[2] & cond_add;
  133|  32.5k|    r3 += modinfo->modulus.v[3] & cond_add;
  134|  32.5k|    r4 += modinfo->modulus.v[4] & cond_add;
  135|       |    /* And propagate again. */
  136|  32.5k|    r1 += r0 >> 62; r0 &= M62;
  137|  32.5k|    r2 += r1 >> 62; r1 &= M62;
  138|  32.5k|    r3 += r2 >> 62; r2 &= M62;
  139|  32.5k|    r4 += r3 >> 62; r3 &= M62;
  140|       |
  141|  32.5k|    r->v[0] = r0;
  142|  32.5k|    r->v[1] = r1;
  143|  32.5k|    r->v[2] = r2;
  144|  32.5k|    r->v[3] = r3;
  145|  32.5k|    r->v[4] = r4;
  146|       |
  147|  32.5k|    VERIFY_CHECK(r0 >> 62 == 0);
  148|  32.5k|    VERIFY_CHECK(r1 >> 62 == 0);
  149|  32.5k|    VERIFY_CHECK(r2 >> 62 == 0);
  150|  32.5k|    VERIFY_CHECK(r3 >> 62 == 0);
  151|  32.5k|    VERIFY_CHECK(r4 >> 62 == 0);
  152|  32.5k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 0) >= 0); /* r >= 0 */
  153|  32.5k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 1) < 0); /* r < modulus */
  154|  32.5k|}
secp256k1.c:secp256k1_modinv64:
  588|  20.7k|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|  20.7k|    secp256k1_modinv64_signed62 d = {{0, 0, 0, 0, 0}};
  591|  20.7k|    secp256k1_modinv64_signed62 e = {{1, 0, 0, 0, 0}};
  592|  20.7k|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  593|  20.7k|    secp256k1_modinv64_signed62 g = *x;
  594|  20.7k|    int i;
  595|  20.7k|    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|   228k|    for (i = 0; i < 10; ++i) {
  ------------------
  |  Branch (598:17): [True: 207k, False: 20.7k]
  ------------------
  599|       |        /* Compute transition matrix and new zeta after 59 divsteps. */
  600|   207k|        secp256k1_modinv64_trans2x2 t;
  601|   207k|        zeta = secp256k1_modinv64_divsteps_59(zeta, f.v[0], g.v[0], &t);
  602|       |        /* Update d,e using that transition matrix. */
  603|   207k|        secp256k1_modinv64_update_de_62(&d, &e, &t, modinfo);
  604|       |        /* Update f,g using that transition matrix. */
  605|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  606|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  607|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  608|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  609|       |
  610|   207k|        secp256k1_modinv64_update_fg_62(&f, &g, &t);
  611|       |
  612|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  613|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  614|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  615|   207k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  616|   207k|    }
  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|  20.7k|    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|  20.7k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, -1) == 0 ||
  626|  20.7k|                 secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, 1) == 0 ||
  627|  20.7k|                 (secp256k1_modinv64_mul_cmp_62(x, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  628|  20.7k|                  secp256k1_modinv64_mul_cmp_62(&d, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  629|  20.7k|                  secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) == 0));
  630|       |
  631|       |    /* Optionally negate d, normalize to [0,modulus), and return it. */
  632|  20.7k|    secp256k1_modinv64_normalize_62(&d, f.v[4], modinfo);
  633|  20.7k|    *x = d;
  634|  20.7k|}
secp256k1.c:secp256k1_modinv64_divsteps_59:
  167|   207k|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|   207k|    uint64_t u = 8, v = 0, q = 0, r = 8;
  176|   207k|    volatile uint64_t c1, c2;
  177|   207k|    uint64_t mask1, mask2, f = f0, g = g0, x, y, z;
  178|   207k|    int i;
  179|       |
  180|  12.4M|    for (i = 3; i < 62; ++i) {
  ------------------
  |  Branch (180:17): [True: 12.2M, False: 207k]
  ------------------
  181|  12.2M|        VERIFY_CHECK((f & 1) == 1); /* f must always be odd */
  182|  12.2M|        VERIFY_CHECK((u * f0 + v * g0) == f << i);
  183|  12.2M|        VERIFY_CHECK((q * f0 + r * g0) == g << i);
  184|       |        /* Compute conditional masks for (zeta < 0) and for (g & 1). */
  185|  12.2M|        c1 = zeta >> 63;
  186|  12.2M|        mask1 = c1;
  187|  12.2M|        c2 = g & 1;
  188|  12.2M|        mask2 = -c2;
  189|       |        /* Compute x,y,z, conditionally negated versions of f,u,v. */
  190|  12.2M|        x = (f ^ mask1) - mask1;
  191|  12.2M|        y = (u ^ mask1) - mask1;
  192|  12.2M|        z = (v ^ mask1) - mask1;
  193|       |        /* Conditionally add x,y,z to g,q,r. */
  194|  12.2M|        g += x & mask2;
  195|  12.2M|        q += y & mask2;
  196|  12.2M|        r += z & mask2;
  197|       |        /* In what follows, c1 is a condition mask for (zeta < 0) and (g & 1). */
  198|  12.2M|        mask1 &= mask2;
  199|       |        /* Conditionally change zeta into -zeta-2 or zeta-1. */
  200|  12.2M|        zeta = (zeta ^ mask1) - 1;
  201|       |        /* Conditionally add g,q,r to f,u,v. */
  202|  12.2M|        f += g & mask1;
  203|  12.2M|        u += q & mask1;
  204|  12.2M|        v += r & mask1;
  205|       |        /* Shifts */
  206|  12.2M|        g >>= 1;
  207|  12.2M|        u <<= 1;
  208|  12.2M|        v <<= 1;
  209|       |        /* Bounds on zeta that follow from the bounds on iteration count (max 10*59 divsteps). */
  210|  12.2M|        VERIFY_CHECK(zeta >= -591 && zeta <= 591);
  211|  12.2M|    }
  212|       |    /* Return data in t and return value. */
  213|   207k|    t->u = (int64_t)u;
  214|   207k|    t->v = (int64_t)v;
  215|   207k|    t->q = (int64_t)q;
  216|   207k|    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|   207k|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 65, 0));
  225|       |
  226|   207k|    return zeta;
  227|   207k|}
secp256k1.c:secp256k1_modinv64_update_fg_62:
  500|   207k|static void secp256k1_modinv64_update_fg_62(secp256k1_modinv64_signed62 *f, secp256k1_modinv64_signed62 *g, const secp256k1_modinv64_trans2x2 *t) {
  501|   207k|    const uint64_t M62 = UINT64_MAX >> 2;
  502|   207k|    const int64_t f0 = f->v[0], f1 = f->v[1], f2 = f->v[2], f3 = f->v[3], f4 = f->v[4];
  503|   207k|    const int64_t g0 = g->v[0], g1 = g->v[1], g2 = g->v[2], g3 = g->v[3], g4 = g->v[4];
  504|   207k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  505|   207k|    secp256k1_int128 cf, cg;
  506|       |    /* Start computing t*[f,g]. */
  507|   207k|    secp256k1_i128_mul(&cf, u, f0);
  508|   207k|    secp256k1_i128_accum_mul(&cf, v, g0);
  509|   207k|    secp256k1_i128_mul(&cg, q, f0);
  510|   207k|    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|   207k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cf) & M62) == 0); secp256k1_i128_rshift(&cf, 62);
  513|   207k|    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|   207k|    secp256k1_i128_accum_mul(&cf, u, f1);
  516|   207k|    secp256k1_i128_accum_mul(&cf, v, g1);
  517|   207k|    secp256k1_i128_accum_mul(&cg, q, f1);
  518|   207k|    secp256k1_i128_accum_mul(&cg, r, g1);
  519|   207k|    f->v[0] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  520|   207k|    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|   207k|    secp256k1_i128_accum_mul(&cf, u, f2);
  523|   207k|    secp256k1_i128_accum_mul(&cf, v, g2);
  524|   207k|    secp256k1_i128_accum_mul(&cg, q, f2);
  525|   207k|    secp256k1_i128_accum_mul(&cg, r, g2);
  526|   207k|    f->v[1] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  527|   207k|    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|   207k|    secp256k1_i128_accum_mul(&cf, u, f3);
  530|   207k|    secp256k1_i128_accum_mul(&cf, v, g3);
  531|   207k|    secp256k1_i128_accum_mul(&cg, q, f3);
  532|   207k|    secp256k1_i128_accum_mul(&cg, r, g3);
  533|   207k|    f->v[2] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  534|   207k|    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|   207k|    secp256k1_i128_accum_mul(&cf, u, f4);
  537|   207k|    secp256k1_i128_accum_mul(&cf, v, g4);
  538|   207k|    secp256k1_i128_accum_mul(&cg, q, f4);
  539|   207k|    secp256k1_i128_accum_mul(&cg, r, g4);
  540|   207k|    f->v[3] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  541|   207k|    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|   207k|    f->v[4] = secp256k1_i128_to_i64(&cf);
  544|   207k|    g->v[4] = secp256k1_i128_to_i64(&cg);
  545|   207k|}
secp256k1.c:secp256k1_jacobi64_maybe_var:
  721|  23.4k|static int secp256k1_jacobi64_maybe_var(const secp256k1_modinv64_signed62 *x, const secp256k1_modinv64_modinfo *modinfo) {
  722|       |    /* Start with f=modulus, g=x, eta=-1. */
  723|  23.4k|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  724|  23.4k|    secp256k1_modinv64_signed62 g = *x;
  725|  23.4k|    int j, len = 5;
  726|  23.4k|    int64_t eta = -1; /* eta = -delta; delta is initially 1 */
  727|  23.4k|    int64_t cond, fn, gn;
  728|  23.4k|    int jac = 0;
  729|  23.4k|    int count;
  730|       |
  731|       |    /* The input limbs must all be non-negative. */
  732|  23.4k|    VERIFY_CHECK(g.v[0] >= 0 && g.v[1] >= 0 && g.v[2] >= 0 && g.v[3] >= 0 && g.v[4] >= 0);
  733|       |
  734|       |    /* If x > 0, then if the loop below converges, it converges to f=g=gcd(x,modulus). Since we
  735|       |     * require that gcd(x,modulus)=1 and modulus>=3, x cannot be 0. Thus, we must reach f=1 (or
  736|       |     * time out). */
  737|  23.4k|    VERIFY_CHECK((g.v[0] | g.v[1] | g.v[2] | g.v[3] | g.v[4]) != 0);
  738|       |
  739|   297k|    for (count = 0; count < JACOBI64_ITERATIONS; ++count) {
  ------------------
  |  |  717|   297k|#define JACOBI64_ITERATIONS 25
  ------------------
  |  Branch (739:21): [True: 297k, False: 0]
  ------------------
  740|       |        /* Compute transition matrix and new eta after 62 posdivsteps. */
  741|   297k|        secp256k1_modinv64_trans2x2 t;
  742|   297k|        eta = secp256k1_modinv64_posdivsteps_62_var(eta, f.v[0] | ((uint64_t)f.v[1] << 62), g.v[0] | ((uint64_t)g.v[1] << 62), &t, &jac);
  743|       |        /* Update f,g using that transition matrix. */
  744|   297k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 0) > 0); /* f > 0 */
  745|   297k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  746|   297k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 0) > 0); /* g > 0 */
  747|   297k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 1) < 0);  /* g < modulus */
  748|       |
  749|   297k|        secp256k1_modinv64_update_fg_62_var(len, &f, &g, &t);
  750|       |        /* If the bottom limb of f is 1, there is a chance that f=1. */
  751|   297k|        if (f.v[0] == 1) {
  ------------------
  |  Branch (751:13): [True: 23.4k, False: 274k]
  ------------------
  752|  23.4k|            cond = 0;
  753|       |            /* Check if the other limbs are also 0. */
  754|  23.4k|            for (j = 1; j < len; ++j) {
  ------------------
  |  Branch (754:25): [True: 0, False: 23.4k]
  ------------------
  755|      0|                cond |= f.v[j];
  756|      0|            }
  757|       |            /* If so, we're done. When f=1, the Jacobi symbol (g | f)=1. */
  758|  23.4k|            if (cond == 0) return 1 - 2*(jac & 1);
  ------------------
  |  Branch (758:17): [True: 23.4k, False: 0]
  ------------------
  759|  23.4k|        }
  760|       |
  761|       |        /* Determine if len>1 and limb (len-1) of both f and g is 0. */
  762|   274k|        fn = f.v[len - 1];
  763|   274k|        gn = g.v[len - 1];
  764|   274k|        cond = ((int64_t)len - 2) >> 63;
  765|   274k|        cond |= fn;
  766|   274k|        cond |= gn;
  767|       |        /* If so, reduce length. */
  768|   274k|        if (cond == 0) --len;
  ------------------
  |  Branch (768:13): [True: 93.9k, False: 180k]
  ------------------
  769|       |
  770|   274k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 0) > 0); /* f > 0 */
  771|   274k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  772|   274k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 0) > 0); /* g > 0 */
  773|   274k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 1) < 0);  /* g < modulus */
  774|   274k|    }
  775|       |
  776|       |    /* The loop failed to converge to f=g after 1550 iterations. Return 0, indicating unknown result. */
  777|      0|    return 0;
  778|  23.4k|}
secp256k1.c:secp256k1_modinv64_posdivsteps_62_var:
  325|   297k|static int64_t secp256k1_modinv64_posdivsteps_62_var(int64_t eta, uint64_t f0, uint64_t g0, secp256k1_modinv64_trans2x2 *t, int *jacp) {
  326|       |    /* Transformation matrix; see comments in secp256k1_modinv64_divsteps_62. */
  327|   297k|    uint64_t u = 1, v = 0, q = 0, r = 1;
  328|   297k|    uint64_t f = f0, g = g0, m;
  329|   297k|    uint32_t w;
  330|   297k|    int i = 62, limit, zeros;
  331|   297k|    int jac = *jacp;
  332|       |
  333|  5.23M|    for (;;) {
  334|       |        /* Use a sentinel bit to count zeros only up to i. */
  335|  5.23M|        zeros = secp256k1_ctz64_var(g | (UINT64_MAX << i));
  336|       |        /* Perform zeros divsteps at once; they all just divide g by two. */
  337|  5.23M|        g >>= zeros;
  338|  5.23M|        u <<= zeros;
  339|  5.23M|        v <<= zeros;
  340|  5.23M|        eta -= zeros;
  341|  5.23M|        i -= zeros;
  342|       |        /* Update the bottom bit of jac: when dividing g by an odd power of 2,
  343|       |         * if (f mod 8) is 3 or 5, the Jacobi symbol changes sign. */
  344|  5.23M|        jac ^= (zeros & ((f >> 1) ^ (f >> 2)));
  345|       |        /* We're done once we've done 62 posdivsteps. */
  346|  5.23M|        if (i == 0) break;
  ------------------
  |  Branch (346:13): [True: 297k, False: 4.94M]
  ------------------
  347|  4.94M|        VERIFY_CHECK((f & 1) == 1);
  348|  4.94M|        VERIFY_CHECK((g & 1) == 1);
  349|  4.94M|        VERIFY_CHECK((u * f0 + v * g0) == f << (62 - i));
  350|  4.94M|        VERIFY_CHECK((q * f0 + r * g0) == g << (62 - i));
  351|       |        /* If eta is negative, negate it and replace f,g with g,f. */
  352|  4.94M|        if (eta < 0) {
  ------------------
  |  Branch (352:13): [True: 4.77M, False: 162k]
  ------------------
  353|  4.77M|            uint64_t tmp;
  354|  4.77M|            eta = -eta;
  355|  4.77M|            tmp = f; f = g; g = tmp;
  356|  4.77M|            tmp = u; u = q; q = tmp;
  357|  4.77M|            tmp = v; v = r; r = tmp;
  358|       |            /* Update bottom bit of jac: when swapping f and g, the Jacobi symbol changes sign
  359|       |             * if both f and g are 3 mod 4. */
  360|  4.77M|            jac ^= ((f & g) >> 1);
  361|       |            /* Use a formula to cancel out up to 6 bits of g. Also, no more than i can be cancelled
  362|       |             * out (as we'd be done before that point), and no more than eta+1 can be done as its
  363|       |             * sign will flip again once that happens. */
  364|  4.77M|            limit = ((int)eta + 1) > i ? i : ((int)eta + 1);
  ------------------
  |  Branch (364:21): [True: 92.0k, False: 4.68M]
  ------------------
  365|  4.77M|            VERIFY_CHECK(limit > 0 && limit <= 62);
  366|       |            /* m is a mask for the bottom min(limit, 6) bits. */
  367|  4.77M|            m = (UINT64_MAX >> (64 - limit)) & 63U;
  368|       |            /* Find what multiple of f must be added to g to cancel its bottom min(limit, 6)
  369|       |             * bits. */
  370|  4.77M|            w = (f * g * (f * f - 2)) & m;
  371|  4.77M|        } else {
  372|       |            /* In this branch, use a simpler formula that only lets us cancel up to 4 bits of g, as
  373|       |             * eta tends to be smaller here. */
  374|   162k|            limit = ((int)eta + 1) > i ? i : ((int)eta + 1);
  ------------------
  |  Branch (374:21): [True: 1.02k, False: 161k]
  ------------------
  375|   162k|            VERIFY_CHECK(limit > 0 && limit <= 62);
  376|       |            /* m is a mask for the bottom min(limit, 4) bits. */
  377|   162k|            m = (UINT64_MAX >> (64 - limit)) & 15U;
  378|       |            /* Find what multiple of f must be added to g to cancel its bottom min(limit, 4)
  379|       |             * bits. */
  380|   162k|            w = f + (((f + 1) & 4) << 1);
  381|   162k|            w = (-w * g) & m;
  382|   162k|        }
  383|  4.94M|        g += f * w;
  384|  4.94M|        q += u * w;
  385|  4.94M|        r += v * w;
  386|  4.94M|        VERIFY_CHECK((g & m) == 0);
  387|  4.94M|    }
  388|       |    /* Return data in t and return value. */
  389|   297k|    t->u = (int64_t)u;
  390|   297k|    t->v = (int64_t)v;
  391|   297k|    t->q = (int64_t)q;
  392|   297k|    t->r = (int64_t)r;
  393|       |
  394|       |    /* The determinant of t must be a power of two. This guarantees that multiplication with t
  395|       |     * does not change the gcd of f and g, apart from adding a power-of-2 factor to it (which
  396|       |     * will be divided out again). As each divstep's individual matrix has determinant 2 or -2,
  397|       |     * the aggregate of 62 of them will have determinant 2^62 or -2^62. */
  398|   297k|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 62, 1));
  399|       |
  400|   297k|    *jacp = jac;
  401|   297k|    return eta;
  402|   297k|}

secp256k1_ellswift_create:
  431|  2.94k|int secp256k1_ellswift_create(const secp256k1_context *ctx, unsigned char *ell64, const unsigned char *seckey32, const unsigned char *auxrnd32) {
  432|  2.94k|    secp256k1_ge p;
  433|  2.94k|    secp256k1_fe t;
  434|  2.94k|    secp256k1_sha256 hash;
  435|  2.94k|    secp256k1_scalar seckey_scalar;
  436|  2.94k|    int ret;
  437|  2.94k|    static const unsigned char zero32[32] = {0};
  438|       |
  439|       |    /* Sanity check inputs. */
  440|  2.94k|    VERIFY_CHECK(ctx != NULL);
  441|  2.94k|    ARG_CHECK(ell64 != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  442|  2.94k|    memset(ell64, 0, 64);
  443|  2.94k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  444|  2.94k|    ARG_CHECK(seckey32 != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  445|       |
  446|       |    /* Compute (affine) public key */
  447|  2.94k|    ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &seckey_scalar, &p, seckey32);
  448|  2.94k|    secp256k1_declassify(ctx, &p, sizeof(p)); /* not constant time in produced pubkey */
  449|  2.94k|    secp256k1_fe_normalize_var(&p.x);
  ------------------
  |  |   80|  2.94k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  450|  2.94k|    secp256k1_fe_normalize_var(&p.y);
  ------------------
  |  |   80|  2.94k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  451|       |
  452|       |    /* Set up hasher state. The used RNG is H(seckey32 || "\x00"*32 [|| auxrnd32] || cnt++),
  453|       |     * using BIP340 tagged hash with tag "secp256k1_ellswift_create". */
  454|  2.94k|    secp256k1_ellswift_sha256_init_create(&hash);
  455|  2.94k|    secp256k1_sha256_write(secp256k1_get_hash_context(ctx), &hash, seckey32, 32);
  456|  2.94k|    secp256k1_sha256_write(secp256k1_get_hash_context(ctx), &hash, zero32, sizeof(zero32));
  457|       |    /* Declassify only hash state. seckey32 has been hashed, but copy remains in the hash buffer */
  458|  2.94k|    secp256k1_declassify(ctx, &hash.s, sizeof(hash.s));
  459|  2.94k|    if (auxrnd32) secp256k1_sha256_write(secp256k1_get_hash_context(ctx), &hash, auxrnd32, 32);
  ------------------
  |  Branch (459:9): [True: 2.94k, False: 0]
  ------------------
  460|       |
  461|       |    /* Compute ElligatorSwift encoding and construct output. */
  462|  2.94k|    secp256k1_ellswift_elligatorswift_var(ctx, ell64, &t, &p, &hash); /* puts u in ell64[0..32] */
  463|  2.94k|    secp256k1_fe_get_b32(ell64 + 32, &t); /* puts t in ell64[32..64] */
  ------------------
  |  |   89|  2.94k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
  464|       |
  465|  2.94k|    secp256k1_memczero(ell64, 64, !ret);
  466|  2.94k|    secp256k1_scalar_clear(&seckey_scalar);
  467|  2.94k|    secp256k1_sha256_clear(&hash);
  468|       |
  469|  2.94k|    return ret;
  470|  2.94k|}
secp256k1_ellswift_decode:
  472|  2.94k|int secp256k1_ellswift_decode(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *ell64) {
  473|  2.94k|    secp256k1_fe u, t;
  474|  2.94k|    secp256k1_ge p;
  475|  2.94k|    VERIFY_CHECK(ctx != NULL);
  476|  2.94k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  477|  2.94k|    ARG_CHECK(ell64 != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  478|       |
  479|  2.94k|    secp256k1_fe_set_b32_mod(&u, ell64);
  ------------------
  |  |   87|  2.94k|#  define secp256k1_fe_set_b32_mod secp256k1_fe_impl_set_b32_mod
  ------------------
  480|  2.94k|    secp256k1_fe_set_b32_mod(&t, ell64 + 32);
  ------------------
  |  |   87|  2.94k|#  define secp256k1_fe_set_b32_mod secp256k1_fe_impl_set_b32_mod
  ------------------
  481|  2.94k|    secp256k1_fe_normalize_var(&t);
  ------------------
  |  |   80|  2.94k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  482|  2.94k|    secp256k1_ellswift_swiftec_var(&p, &u, &t);
  483|  2.94k|    secp256k1_pubkey_save(pubkey, &p);
  484|  2.94k|    return 1;
  485|  2.94k|}
secp256k1.c:secp256k1_ellswift_elligatorswift_var:
  375|  2.94k|static void secp256k1_ellswift_elligatorswift_var(const secp256k1_context *ctx, unsigned char *u32, secp256k1_fe *t, const secp256k1_ge *p, const secp256k1_sha256 *hasher) {
  376|  2.94k|    secp256k1_ellswift_xelligatorswift_var(ctx, u32, t, &p->x, hasher);
  377|  2.94k|    secp256k1_fe_normalize_var(t);
  ------------------
  |  |   80|  2.94k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  378|  2.94k|    if (secp256k1_fe_is_odd(t) != secp256k1_fe_is_odd(&p->y)) {
  ------------------
  |  |   85|  2.94k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                  if (secp256k1_fe_is_odd(t) != secp256k1_fe_is_odd(&p->y)) {
  ------------------
  |  |   85|  2.94k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (378:9): [True: 1.48k, False: 1.45k]
  ------------------
  379|  1.48k|        secp256k1_fe_negate(t, t, 1);
  ------------------
  |  |  211|  1.48k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  1.48k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  1.48k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 1.48k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  1.48k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 1.48k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  1.48k|    } \
  |  |  |  |   94|  1.48k|    stmt; \
  |  |  |  |   95|  1.48k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 1.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  380|  1.48k|        secp256k1_fe_normalize_var(t);
  ------------------
  |  |   80|  1.48k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  381|  1.48k|    }
  382|  2.94k|}
secp256k1.c:secp256k1_ellswift_xelligatorswift_var:
  333|  2.94k|static void secp256k1_ellswift_xelligatorswift_var(const secp256k1_context *ctx, unsigned char *u32, secp256k1_fe *t, const secp256k1_fe *x, const secp256k1_sha256 *hasher) {
  334|       |    /* Pool of 3-bit branch values. */
  335|  2.94k|    unsigned char branch_hash[32];
  336|       |    /* Number of 3-bit values in branch_hash left. */
  337|  2.94k|    int branches_left = 0;
  338|       |    /* Field elements u and branch values are extracted from RNG based on hasher for consecutive
  339|       |     * values of cnt. cnt==0 is first used to populate a pool of 64 4-bit branch values. The 64
  340|       |     * cnt values that follow are used to generate field elements u. cnt==65 (and multiples
  341|       |     * thereof) are used to repopulate the pool and start over, if that were ever necessary.
  342|       |     * On average, 4 iterations are needed. */
  343|  2.94k|    uint32_t cnt = 0;
  344|  12.8k|    while (1) {
  ------------------
  |  Branch (344:12): [True: 12.8k, Folded]
  ------------------
  345|  12.8k|        int branch;
  346|  12.8k|        secp256k1_fe u;
  347|       |        /* If the pool of branch values is empty, populate it. */
  348|  12.8k|        if (branches_left == 0) {
  ------------------
  |  Branch (348:13): [True: 2.95k, False: 9.87k]
  ------------------
  349|  2.95k|            secp256k1_ellswift_prng(secp256k1_get_hash_context(ctx), branch_hash, hasher, cnt++);
  350|  2.95k|            branches_left = 64;
  351|  2.95k|        }
  352|       |        /* Take a 3-bit branch value from the branch pool (top bit is discarded). */
  353|  12.8k|        --branches_left;
  354|  12.8k|        branch = (branch_hash[branches_left >> 1] >> ((branches_left & 1) << 2)) & 7;
  355|       |        /* Compute a new u value by hashing. */
  356|  12.8k|        secp256k1_ellswift_prng(secp256k1_get_hash_context(ctx), u32, hasher, cnt++);
  357|       |        /* overflow is not a problem (we prefer uniform u32 over uniform u). */
  358|  12.8k|        secp256k1_fe_set_b32_mod(&u, u32);
  ------------------
  |  |   87|  12.8k|#  define secp256k1_fe_set_b32_mod secp256k1_fe_impl_set_b32_mod
  ------------------
  359|       |        /* Since u is the output of a hash, it should practically never be 0. We could apply the
  360|       |         * u=0 to u=1 correction here too to deal with that case still, but it's such a low
  361|       |         * probability event that we do not bother. */
  362|  12.8k|        VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(&u));
  363|       |
  364|       |        /* Find a remainder t, and return it if found. */
  365|  12.8k|        if (EXPECT(secp256k1_ellswift_xswiftec_inv_var(t, x, &u, branch), 0)) break;
  ------------------
  |  |  146|  12.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 2.94k, False: 9.88k]
  |  |  ------------------
  ------------------
  366|  12.8k|    }
  367|  2.94k|}
secp256k1.c:secp256k1_ellswift_prng:
  310|  15.7k|static void secp256k1_ellswift_prng(const secp256k1_hash_ctx *hash_ctx, unsigned char* out32, const secp256k1_sha256 *hasher, uint32_t cnt) {
  311|  15.7k|    secp256k1_sha256 hash = *hasher;
  312|  15.7k|    unsigned char buf4[4];
  313|       |#ifdef VERIFY
  314|       |    size_t blocks = hash.bytes >> 6;
  315|       |#endif
  316|  15.7k|    buf4[0] = cnt;
  317|  15.7k|    buf4[1] = cnt >> 8;
  318|  15.7k|    buf4[2] = cnt >> 16;
  319|  15.7k|    buf4[3] = cnt >> 24;
  320|  15.7k|    secp256k1_sha256_write(hash_ctx, &hash, buf4, 4);
  321|  15.7k|    secp256k1_sha256_finalize(hash_ctx, &hash, out32);
  322|       |
  323|       |    /* Writing and finalizing together should trigger exactly one SHA256 compression. */
  324|  15.7k|    VERIFY_CHECK(((hash.bytes) >> 6) == (blocks + 1));
  325|  15.7k|}
secp256k1.c:secp256k1_ellswift_xswiftec_inv_var:
  168|  12.8k|static int secp256k1_ellswift_xswiftec_inv_var(secp256k1_fe *t, const secp256k1_fe *x_in, const secp256k1_fe *u_in, int c) {
  169|       |    /* The implemented algorithm is this (all arithmetic, except involving c, is mod p):
  170|       |     *
  171|       |     * - If (c & 2) = 0:
  172|       |     *   - If (-x-u) is a valid X coordinate, fail.
  173|       |     *   - Let s=-(u^3+7)/(u^2+u*x+x^2).
  174|       |     *   - If s is not square, fail.
  175|       |     *   - Let v=x.
  176|       |     * - If (c & 2) = 2:
  177|       |     *   - Let s=x-u.
  178|       |     *   - If s is not square, fail.
  179|       |     *   - Let r=sqrt(-s*(4*(u^3+7)+3*u^2*s)); fail if it doesn't exist.
  180|       |     *   - If (c & 1) = 1 and r = 0, fail.
  181|       |     *   - If s=0, fail.
  182|       |     *   - Let v=(r/s-u)/2.
  183|       |     * - Let w=sqrt(s).
  184|       |     * - If (c & 5) = 0: return -w*(c3*u + v).
  185|       |     * - If (c & 5) = 1: return  w*(c4*u + v).
  186|       |     * - If (c & 5) = 4: return  w*(c3*u + v).
  187|       |     * - If (c & 5) = 5: return -w*(c4*u + v).
  188|       |     */
  189|  12.8k|    secp256k1_fe x = *x_in, u = *u_in, g, v, s, m, r, q;
  190|  12.8k|    int ret;
  191|       |
  192|  12.8k|    secp256k1_fe_normalize_weak(&x);
  ------------------
  |  |   79|  12.8k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  193|  12.8k|    secp256k1_fe_normalize_weak(&u);
  ------------------
  |  |   79|  12.8k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  194|       |
  195|  12.8k|    VERIFY_CHECK(c >= 0 && c < 8);
  196|  12.8k|    VERIFY_CHECK(secp256k1_ge_x_on_curve_var(&x));
  197|       |
  198|  12.8k|    if (!(c & 2)) {
  ------------------
  |  Branch (198:9): [True: 6.42k, False: 6.40k]
  ------------------
  199|       |        /* c is in {0, 1, 4, 5}. In this case we look for an inverse under the x1 (if c=0 or
  200|       |         * c=4) formula, or x2 (if c=1 or c=5) formula. */
  201|       |
  202|       |        /* If -u-x is a valid X coordinate, fail. This would yield an encoding that roundtrips
  203|       |         * back under the x3 formula instead (which has priority over x1 and x2, so the decoding
  204|       |         * would not match x). */
  205|  6.42k|        m = x;                                          /* m = x */
  206|  6.42k|        secp256k1_fe_add(&m, &u);                       /* m = u+x */
  ------------------
  |  |   92|  6.42k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  207|  6.42k|        secp256k1_fe_negate(&m, &m, 2);                 /* m = -u-x */
  ------------------
  |  |  211|  6.42k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  6.42k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  6.42k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 6.42k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  6.42k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 6.42k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  6.42k|    } \
  |  |  |  |   94|  6.42k|    stmt; \
  |  |  |  |   95|  6.42k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 6.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|       |        /* Test if (-u-x) is a valid X coordinate. If so, fail. */
  209|  6.42k|        if (secp256k1_ge_x_on_curve_var(&m)) return 0;
  ------------------
  |  Branch (209:13): [True: 3.31k, False: 3.10k]
  ------------------
  210|       |
  211|       |        /* Let s = -(u^3 + 7)/(u^2 + u*x + x^2) [first part] */
  212|  3.10k|        secp256k1_fe_sqr(&s, &m);                       /* s = (u+x)^2 */
  ------------------
  |  |   94|  3.10k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  213|  3.10k|        secp256k1_fe_negate(&s, &s, 1);                 /* s = -(u+x)^2 */
  ------------------
  |  |  211|  3.10k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  3.10k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  3.10k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 3.10k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  3.10k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 3.10k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  3.10k|    } \
  |  |  |  |   94|  3.10k|    stmt; \
  |  |  |  |   95|  3.10k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 3.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  3.10k|        secp256k1_fe_mul(&m, &u, &x);                   /* m = u*x */
  ------------------
  |  |   93|  3.10k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  215|  3.10k|        secp256k1_fe_add(&s, &m);                       /* s = -(u^2 + u*x + x^2) */
  ------------------
  |  |   92|  3.10k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  216|       |
  217|       |        /* Note that at this point, s = 0 is impossible. If it were the case:
  218|       |         *             s = -(u^2 + u*x + x^2) = 0
  219|       |         * =>                 u^2 + u*x + x^2 = 0
  220|       |         * =>   (u + 2*x) * (u^2 + u*x + x^2) = 0
  221|       |         * => 2*x^3 + 3*x^2*u + 3*x*u^2 + u^3 = 0
  222|       |         * =>                 (x + u)^3 + x^3 = 0
  223|       |         * =>                             x^3 = -(x + u)^3
  224|       |         * =>                         x^3 + B = (-u - x)^3 + B
  225|       |         *
  226|       |         * However, we know x^3 + B is square (because x is on the curve) and
  227|       |         * that (-u-x)^3 + B is not square (the secp256k1_ge_x_on_curve_var(&m)
  228|       |         * test above would have failed). This is a contradiction, and thus the
  229|       |         * assumption s=0 is false. */
  230|  3.10k|        VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(&s));
  231|       |
  232|       |        /* If s is not square, fail. We have not fully computed s yet, but s is square iff
  233|       |         * -(u^3+7)*(u^2+u*x+x^2) is square (because a/b is square iff a*b is square and b is
  234|       |         * nonzero). */
  235|  3.10k|        secp256k1_fe_sqr(&g, &u);                       /* g = u^2 */
  ------------------
  |  |   94|  3.10k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  236|  3.10k|        secp256k1_fe_mul(&g, &g, &u);                   /* g = u^3 */
  ------------------
  |  |   93|  3.10k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  237|  3.10k|        secp256k1_fe_add_int(&g, SECP256K1_B);          /* g = u^3+7 */
  ------------------
  |  |  102|  3.10k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                      secp256k1_fe_add_int(&g, SECP256K1_B);          /* g = u^3+7 */
  ------------------
  |  |   73|  3.10k|#define SECP256K1_B 7
  ------------------
  238|  3.10k|        secp256k1_fe_mul(&m, &s, &g);                   /* m = -(u^3 + 7)*(u^2 + u*x + x^2) */
  ------------------
  |  |   93|  3.10k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  239|  3.10k|        if (!secp256k1_fe_is_square_var(&m)) return 0;
  ------------------
  |  |  103|  3.10k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (239:13): [True: 1.72k, False: 1.38k]
  ------------------
  240|       |
  241|       |        /* Let s = -(u^3 + 7)/(u^2 + u*x + x^2) [second part] */
  242|  1.38k|        secp256k1_fe_inv_var(&s, &s);                   /* s = -1/(u^2 + u*x + x^2) [no div by 0] */
  ------------------
  |  |   99|  1.38k|#  define secp256k1_fe_inv_var secp256k1_fe_impl_inv_var
  ------------------
  243|  1.38k|        secp256k1_fe_mul(&s, &s, &g);                   /* s = -(u^3 + 7)/(u^2 + u*x + x^2) */
  ------------------
  |  |   93|  1.38k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  244|       |
  245|       |        /* Let v = x. */
  246|  1.38k|        v = x;
  247|  6.40k|    } else {
  248|       |        /* c is in {2, 3, 6, 7}. In this case we look for an inverse under the x3 formula. */
  249|       |
  250|       |        /* Let s = x-u. */
  251|  6.40k|        secp256k1_fe_negate(&m, &u, 1);                 /* m = -u */
  ------------------
  |  |  211|  6.40k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  6.40k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  6.40k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 6.40k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  6.40k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 6.40k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  6.40k|    } \
  |  |  |  |   94|  6.40k|    stmt; \
  |  |  |  |   95|  6.40k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 6.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  6.40k|        s = m;                                          /* s = -u */
  253|  6.40k|        secp256k1_fe_add(&s, &x);                       /* s = x-u */
  ------------------
  |  |   92|  6.40k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  254|       |
  255|       |        /* If s is not square, fail. */
  256|  6.40k|        if (!secp256k1_fe_is_square_var(&s)) return 0;
  ------------------
  |  |  103|  6.40k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (256:13): [True: 3.17k, False: 3.23k]
  ------------------
  257|       |
  258|       |        /* Let r = sqrt(-s*(4*(u^3+7)+3*u^2*s)); fail if it doesn't exist. */
  259|  3.23k|        secp256k1_fe_sqr(&g, &u);                       /* g = u^2 */
  ------------------
  |  |   94|  3.23k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  260|  3.23k|        secp256k1_fe_mul(&q, &s, &g);                   /* q = s*u^2 */
  ------------------
  |  |   93|  3.23k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  261|  3.23k|        secp256k1_fe_mul_int(&q, 3);                    /* q = 3*s*u^2 */
  ------------------
  |  |  233|  3.23k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  3.23k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  3.23k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 3.23k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  3.23k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 3.23k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  3.23k|    } \
  |  |  |  |   94|  3.23k|    stmt; \
  |  |  |  |   95|  3.23k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 3.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  3.23k|        secp256k1_fe_mul(&g, &g, &u);                   /* g = u^3 */
  ------------------
  |  |   93|  3.23k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  263|  3.23k|        secp256k1_fe_mul_int(&g, 4);                    /* g = 4*u^3 */
  ------------------
  |  |  233|  3.23k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  3.23k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  3.23k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 3.23k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  3.23k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 3.23k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  3.23k|    } \
  |  |  |  |   94|  3.23k|    stmt; \
  |  |  |  |   95|  3.23k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 3.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|  3.23k|        secp256k1_fe_add_int(&g, 4 * SECP256K1_B);      /* g = 4*(u^3+7) */
  ------------------
  |  |  102|  3.23k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                      secp256k1_fe_add_int(&g, 4 * SECP256K1_B);      /* g = 4*(u^3+7) */
  ------------------
  |  |   73|  3.23k|#define SECP256K1_B 7
  ------------------
  265|  3.23k|        secp256k1_fe_add(&q, &g);                       /* q = 4*(u^3+7)+3*s*u^2 */
  ------------------
  |  |   92|  3.23k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  266|  3.23k|        secp256k1_fe_mul(&q, &q, &s);                   /* q = s*(4*(u^3+7)+3*u^2*s) */
  ------------------
  |  |   93|  3.23k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  267|  3.23k|        secp256k1_fe_negate(&q, &q, 1);                 /* q = -s*(4*(u^3+7)+3*u^2*s) */
  ------------------
  |  |  211|  3.23k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  3.23k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  3.23k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 3.23k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  3.23k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 3.23k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  3.23k|    } \
  |  |  |  |   94|  3.23k|    stmt; \
  |  |  |  |   95|  3.23k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 3.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|  3.23k|        if (!secp256k1_fe_is_square_var(&q)) return 0;
  ------------------
  |  |  103|  3.23k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (268:13): [True: 1.67k, False: 1.56k]
  ------------------
  269|  1.56k|        ret = secp256k1_fe_sqrt(&r, &q);                /* r = sqrt(-s*(4*(u^3+7)+3*u^2*s)) */
  270|       |#ifdef VERIFY
  271|       |        VERIFY_CHECK(ret);
  272|       |#else
  273|  1.56k|        (void)ret;
  274|  1.56k|#endif
  275|       |
  276|       |        /* If (c & 1) = 1 and r = 0, fail. */
  277|  1.56k|        if (EXPECT((c & 1) && secp256k1_fe_normalizes_to_zero_var(&r), 0)) return 0;
  ------------------
  |  |  146|  2.39k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 1.56k]
  |  |  |  Branch (146:39): [True: 833, False: 727]
  |  |  |  Branch (146:39): [True: 0, False: 833]
  |  |  ------------------
  ------------------
  278|       |
  279|       |        /* If s = 0, fail. */
  280|  1.56k|        if (EXPECT(secp256k1_fe_normalizes_to_zero_var(&s), 0)) return 0;
  ------------------
  |  |  146|  1.56k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
  281|       |
  282|       |        /* Let v = (r/s-u)/2. */
  283|  1.56k|        secp256k1_fe_inv_var(&v, &s);                   /* v = 1/s [no div by 0] */
  ------------------
  |  |   99|  1.56k|#  define secp256k1_fe_inv_var secp256k1_fe_impl_inv_var
  ------------------
  284|  1.56k|        secp256k1_fe_mul(&v, &v, &r);                   /* v = r/s */
  ------------------
  |  |   93|  1.56k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  285|  1.56k|        secp256k1_fe_add(&v, &m);                       /* v = r/s-u */
  ------------------
  |  |   92|  1.56k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  286|  1.56k|        secp256k1_fe_half(&v);                          /* v = (r/s-u)/2 */
  ------------------
  |  |  101|  1.56k|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  287|  1.56k|    }
  288|       |
  289|       |    /* Let w = sqrt(s). */
  290|  2.94k|    ret = secp256k1_fe_sqrt(&m, &s);                    /* m = sqrt(s) = w */
  291|  2.94k|    VERIFY_CHECK(ret);
  292|       |
  293|       |    /* Return logic. */
  294|  2.94k|    if ((c & 5) == 0 || (c & 5) == 5) {
  ------------------
  |  Branch (294:9): [True: 698, False: 2.24k]
  |  Branch (294:25): [True: 755, False: 1.49k]
  ------------------
  295|  1.45k|        secp256k1_fe_negate(&m, &m, 1);                 /* m = -w */
  ------------------
  |  |  211|  1.45k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  1.45k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  1.45k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 1.45k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  1.45k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 1.45k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  1.45k|    } \
  |  |  |  |   94|  1.45k|    stmt; \
  |  |  |  |   95|  1.45k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|  1.45k|    }
  297|       |    /* Now m = {-w if c&5=0 or c&5=5; w otherwise}. */
  298|  2.94k|    secp256k1_fe_mul(&u, &u, c&1 ? &secp256k1_ellswift_c4 : &secp256k1_ellswift_c3);
  ------------------
  |  |   93|  2.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  |  Branch (298:30): [True: 1.53k, False: 1.41k]
  ------------------
  299|       |    /* u = {c4 if c&1=1; c3 otherwise}*u */
  300|  2.94k|    secp256k1_fe_add(&u, &v);                           /* u = {c4 if c&1=1; c3 otherwise}*u + v */
  ------------------
  |  |   92|  2.94k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  301|  2.94k|    secp256k1_fe_mul(t, &m, &u);
  ------------------
  |  |   93|  2.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  302|  2.94k|    return 1;
  303|  2.94k|}
secp256k1.c:secp256k1_ellswift_sha256_init_create:
  423|  2.94k|static void secp256k1_ellswift_sha256_init_create(secp256k1_sha256* hash) {
  424|  2.94k|    static const uint32_t midstate[8] = {
  425|  2.94k|        0xd29e1bf5ul, 0xf7025f42ul, 0x9b024773ul, 0x094cb7d5ul,
  426|  2.94k|        0xe59ed789ul, 0x03bc9786ul, 0x68335b35ul, 0x4e363b53ul
  427|  2.94k|    };
  428|  2.94k|    secp256k1_sha256_initialize_midstate(hash, 64, midstate);
  429|  2.94k|}
secp256k1.c:secp256k1_ellswift_swiftec_var:
  143|  2.94k|static void secp256k1_ellswift_swiftec_var(secp256k1_ge *p, const secp256k1_fe *u, const secp256k1_fe *t) {
  144|  2.94k|    secp256k1_fe x;
  145|  2.94k|    secp256k1_ellswift_xswiftec_var(&x, u, t);
  146|  2.94k|    secp256k1_ge_set_xo_var(p, &x, secp256k1_fe_is_odd(t));
  ------------------
  |  |   85|  2.94k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  147|  2.94k|}
secp256k1.c:secp256k1_ellswift_xswiftec_var:
  135|  2.94k|static void secp256k1_ellswift_xswiftec_var(secp256k1_fe *x, const secp256k1_fe *u, const secp256k1_fe *t) {
  136|  2.94k|    secp256k1_fe xn, xd;
  137|  2.94k|    secp256k1_ellswift_xswiftec_frac_var(&xn, &xd, u, t);
  138|  2.94k|    secp256k1_fe_inv_var(&xd, &xd);
  ------------------
  |  |   99|  2.94k|#  define secp256k1_fe_inv_var secp256k1_fe_impl_inv_var
  ------------------
  139|  2.94k|    secp256k1_fe_mul(x, &xn, &xd);
  ------------------
  |  |   93|  2.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  140|  2.94k|}
secp256k1.c:secp256k1_ellswift_xswiftec_frac_var:
   24|  2.94k|static void secp256k1_ellswift_xswiftec_frac_var(secp256k1_fe *xn, secp256k1_fe *xd, const secp256k1_fe *u, const secp256k1_fe *t) {
   25|       |    /* The implemented algorithm is the following (all operations in GF(p)):
   26|       |     *
   27|       |     * - Let c0 = sqrt(-3) = 0xa2d2ba93507f1df233770c2a797962cc61f6d15da14ecd47d8d27ae1cd5f852.
   28|       |     * - If u = 0, set u = 1.
   29|       |     * - If t = 0, set t = 1.
   30|       |     * - If u^3+7+t^2 = 0, set t = 2*t.
   31|       |     * - Let X = (u^3+7-t^2)/(2*t).
   32|       |     * - Let Y = (X+t)/(c0*u).
   33|       |     * - If x3 = u+4*Y^2 is a valid x coordinate, return it.
   34|       |     * - If x2 = (-X/Y-u)/2 is a valid x coordinate, return it.
   35|       |     * - Return x1 = (X/Y-u)/2 (which is now guaranteed to be a valid x coordinate).
   36|       |     *
   37|       |     * Introducing s=t^2, g=u^3+7, and simplifying x1=-(x2+u) we get:
   38|       |     *
   39|       |     * - Let c0 = ...
   40|       |     * - If u = 0, set u = 1.
   41|       |     * - If t = 0, set t = 1.
   42|       |     * - Let s = t^2
   43|       |     * - Let g = u^3+7
   44|       |     * - If g+s = 0, set t = 2*t, s = 4*s
   45|       |     * - Let X = (g-s)/(2*t).
   46|       |     * - Let Y = (X+t)/(c0*u) = (g+s)/(2*c0*t*u).
   47|       |     * - If x3 = u+4*Y^2 is a valid x coordinate, return it.
   48|       |     * - If x2 = (-X/Y-u)/2 is a valid x coordinate, return it.
   49|       |     * - Return x1 = -(x2+u).
   50|       |     *
   51|       |     * Now substitute Y^2 = -(g+s)^2/(12*s*u^2) and X/Y = c0*u*(g-s)/(g+s). This
   52|       |     * means X and Y do not need to be evaluated explicitly anymore.
   53|       |     *
   54|       |     * - ...
   55|       |     * - If g+s = 0, set s = 4*s.
   56|       |     * - If x3 = u-(g+s)^2/(3*s*u^2) is a valid x coordinate, return it.
   57|       |     * - If x2 = (-c0*u*(g-s)/(g+s)-u)/2 is a valid x coordinate, return it.
   58|       |     * - Return x1 = -(x2+u).
   59|       |     *
   60|       |     * Simplifying x2 using 2 additional constants:
   61|       |     *
   62|       |     * - Let c1 = (c0-1)/2 = 0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40.
   63|       |     * - Let c2 = (-c0-1)/2 = 0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee.
   64|       |     * - ...
   65|       |     * - If x2 = u*(c1*s+c2*g)/(g+s) is a valid x coordinate, return it.
   66|       |     * - ...
   67|       |     *
   68|       |     * Writing x3 as a fraction:
   69|       |     *
   70|       |     * - ...
   71|       |     * - If x3 = (3*s*u^3-(g+s)^2)/(3*s*u^2) ...
   72|       |     * - ...
   73|       |
   74|       |     * Overall, we get:
   75|       |     *
   76|       |     * - Let c1 = 0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40.
   77|       |     * - Let c2 = 0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee.
   78|       |     * - If u = 0, set u = 1.
   79|       |     * - If t = 0, set s = 1, else set s = t^2.
   80|       |     * - Let g = u^3+7.
   81|       |     * - If g+s = 0, set s = 4*s.
   82|       |     * - If x3 = (3*s*u^3-(g+s)^2)/(3*s*u^2) is a valid x coordinate, return it.
   83|       |     * - If x2 = u*(c1*s+c2*g)/(g+s) is a valid x coordinate, return it.
   84|       |     * - Return x1 = -(x2+u).
   85|       |     */
   86|  2.94k|    secp256k1_fe u1, s, g, p, d, n, l;
   87|  2.94k|    u1 = *u;
   88|  2.94k|    if (EXPECT(secp256k1_fe_normalizes_to_zero_var(&u1), 0)) u1 = secp256k1_fe_one;
  ------------------
  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  ------------------
  ------------------
   89|  2.94k|    secp256k1_fe_sqr(&s, t);
  ------------------
  |  |   94|  2.94k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   90|  2.94k|    if (EXPECT(secp256k1_fe_normalizes_to_zero_var(t), 0)) s = secp256k1_fe_one;
  ------------------
  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  ------------------
  ------------------
   91|  2.94k|    secp256k1_fe_sqr(&l, &u1);                                   /* l = u^2 */
  ------------------
  |  |   94|  2.94k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   92|  2.94k|    secp256k1_fe_mul(&g, &l, &u1);                               /* g = u^3 */
  ------------------
  |  |   93|  2.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   93|  2.94k|    secp256k1_fe_add_int(&g, SECP256K1_B);                       /* g = u^3 + 7 */
  ------------------
  |  |  102|  2.94k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&g, SECP256K1_B);                       /* g = u^3 + 7 */
  ------------------
  |  |   73|  2.94k|#define SECP256K1_B 7
  ------------------
   94|  2.94k|    p = g;                                                       /* p = g */
   95|  2.94k|    secp256k1_fe_add(&p, &s);                                    /* p = g+s */
  ------------------
  |  |   92|  2.94k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
   96|  2.94k|    if (EXPECT(secp256k1_fe_normalizes_to_zero_var(&p), 0)) {
  ------------------
  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  ------------------
  ------------------
   97|      0|        secp256k1_fe_mul_int(&s, 4);
  ------------------
  |  |  233|      0|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|      0|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|      0|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|      0|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    } \
  |  |  |  |   94|      0|    stmt; \
  |  |  |  |   95|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|       |        /* Recompute p = g+s */
   99|      0|        p = g;                                                   /* p = g */
  100|      0|        secp256k1_fe_add(&p, &s);                                /* p = g+s */
  ------------------
  |  |   92|      0|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  101|      0|    }
  102|  2.94k|    secp256k1_fe_mul(&d, &s, &l);                                /* d = s*u^2 */
  ------------------
  |  |   93|  2.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  103|  2.94k|    secp256k1_fe_mul_int(&d, 3);                                 /* d = 3*s*u^2 */
  ------------------
  |  |  233|  2.94k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  2.94k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  2.94k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  2.94k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 2.94k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  2.94k|    } \
  |  |  |  |   94|  2.94k|    stmt; \
  |  |  |  |   95|  2.94k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  2.94k|    secp256k1_fe_sqr(&l, &p);                                    /* l = (g+s)^2 */
  ------------------
  |  |   94|  2.94k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  105|  2.94k|    secp256k1_fe_negate(&l, &l, 1);                              /* l = -(g+s)^2 */
  ------------------
  |  |  211|  2.94k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  2.94k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  2.94k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  2.94k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 2.94k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  2.94k|    } \
  |  |  |  |   94|  2.94k|    stmt; \
  |  |  |  |   95|  2.94k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|  2.94k|    secp256k1_fe_mul(&n, &d, &u1);                               /* n = 3*s*u^3 */
  ------------------
  |  |   93|  2.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  107|  2.94k|    secp256k1_fe_add(&n, &l);                                    /* n = 3*s*u^3-(g+s)^2 */
  ------------------
  |  |   92|  2.94k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  108|  2.94k|    if (secp256k1_ge_x_frac_on_curve_var(&n, &d)) {
  ------------------
  |  Branch (108:9): [True: 1.56k, False: 1.38k]
  ------------------
  109|       |        /* Return x3 = n/d = (3*s*u^3-(g+s)^2)/(3*s*u^2) */
  110|  1.56k|        *xn = n;
  111|  1.56k|        *xd = d;
  112|  1.56k|        return;
  113|  1.56k|    }
  114|  1.38k|    *xd = p;
  115|  1.38k|    secp256k1_fe_mul(&l, &secp256k1_ellswift_c1, &s);            /* l = c1*s */
  ------------------
  |  |   93|  1.38k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  116|  1.38k|    secp256k1_fe_mul(&n, &secp256k1_ellswift_c2, &g);            /* n = c2*g */
  ------------------
  |  |   93|  1.38k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  117|  1.38k|    secp256k1_fe_add(&n, &l);                                    /* n = c1*s+c2*g */
  ------------------
  |  |   92|  1.38k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  118|  1.38k|    secp256k1_fe_mul(&n, &n, &u1);                               /* n = u*(c1*s+c2*g) */
  ------------------
  |  |   93|  1.38k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  119|       |    /* Possible optimization: in the invocation below, p^2 = (g+s)^2 is computed,
  120|       |     * which we already have computed above. This could be deduplicated. */
  121|  1.38k|    if (secp256k1_ge_x_frac_on_curve_var(&n, &p)) {
  ------------------
  |  Branch (121:9): [True: 697, False: 687]
  ------------------
  122|       |        /* Return x2 = n/p = u*(c1*s+c2*g)/(g+s) */
  123|    697|        *xn = n;
  124|    697|        return;
  125|    697|    }
  126|    687|    secp256k1_fe_mul(&l, &p, &u1);                               /* l = u*(g+s) */
  ------------------
  |  |   93|    687|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|    687|    secp256k1_fe_add(&n, &l);                                    /* n = u*(c1*s+c2*g)+u*(g+s) */
  ------------------
  |  |   92|    687|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  128|    687|    secp256k1_fe_negate(xn, &n, 2);                              /* n = -u*(c1*s+c2*g)-u*(g+s) */
  ------------------
  |  |  211|    687|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|    687|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|    687|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 687]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|    687|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 687, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|    687|    } \
  |  |  |  |   94|    687|    stmt; \
  |  |  |  |   95|    687|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 687]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|       |
  130|    687|    VERIFY_CHECK(secp256k1_ge_x_frac_on_curve_var(xn, &p));
  131|       |    /* Return x3 = n/p = -(u*(c1*s+c2*g)/(g+s)+u) */
  132|    687|}

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

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

secp256k1_context_preallocated_destroy:
  178|      2|void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
  179|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  ------------------
  ------------------
  180|       |
  181|       |    /* Defined as noop */
  182|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (182:9): [True: 0, False: 2]
  ------------------
  183|      0|        return;
  184|      0|    }
  185|       |
  186|      2|    secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
  187|      2|}
secp256k1_context_destroy:
  189|      2|void secp256k1_context_destroy(secp256k1_context* ctx) {
  190|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  ------------------
  ------------------
  191|       |
  192|       |    /* Defined as noop */
  193|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (193:9): [True: 0, False: 2]
  ------------------
  194|      0|        return;
  195|      0|    }
  196|       |
  197|      2|    secp256k1_context_preallocated_destroy(ctx);
  198|      2|    free(ctx);
  199|      2|}
secp256k1_ec_pubkey_parse:
  268|  2.94k|int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen) {
  269|  2.94k|    secp256k1_ge Q;
  270|       |
  271|  2.94k|    VERIFY_CHECK(ctx != NULL);
  272|  2.94k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  273|  2.94k|    memset(pubkey, 0, sizeof(*pubkey));
  274|  2.94k|    ARG_CHECK(input != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  275|  2.94k|    if (!secp256k1_eckey_pubkey_parse(&Q, input, inputlen)) {
  ------------------
  |  Branch (275:9): [True: 0, False: 2.94k]
  ------------------
  276|      0|        return 0;
  277|      0|    }
  278|  2.94k|    if (!secp256k1_ge_is_in_correct_subgroup(&Q)) {
  ------------------
  |  Branch (278:9): [True: 0, False: 2.94k]
  ------------------
  279|      0|        return 0;
  280|      0|    }
  281|  2.94k|    secp256k1_pubkey_save(pubkey, &Q);
  282|  2.94k|    secp256k1_ge_clear(&Q);
  283|  2.94k|    return 1;
  284|  2.94k|}
secp256k1_ec_pubkey_serialize:
  286|  2.94k|int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey* pubkey, unsigned int flags) {
  287|  2.94k|    secp256k1_ge Q;
  288|  2.94k|    size_t len;
  289|       |
  290|  2.94k|    VERIFY_CHECK(ctx != NULL);
  291|  2.94k|    ARG_CHECK(outputlen != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  292|  2.94k|    ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33u : 65u));
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  5.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  |  Branch (146:39): [True: 2.94k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  293|  2.94k|    len = *outputlen;
  294|  2.94k|    *outputlen = 0;
  295|  2.94k|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  296|  2.94k|    memset(output, 0, len);
  297|  2.94k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  298|  2.94k|    ARG_CHECK((flags & SECP256K1_FLAGS_TYPE_MASK) == SECP256K1_FLAGS_TYPE_COMPRESSION);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  299|  2.94k|    if (secp256k1_pubkey_load(ctx, &Q, pubkey)) {
  ------------------
  |  Branch (299:9): [True: 2.94k, False: 0]
  ------------------
  300|  2.94k|        if (flags & SECP256K1_FLAGS_BIT_COMPRESSION) {
  ------------------
  |  |  202|  2.94k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  ------------------
  |  Branch (300:13): [True: 2.94k, False: 0]
  ------------------
  301|  2.94k|            secp256k1_eckey_pubkey_serialize33(&Q, output);
  302|  2.94k|            *outputlen = 33;
  303|  2.94k|        } else {
  304|      0|            secp256k1_eckey_pubkey_serialize65(&Q, output);
  305|      0|            *outputlen = 65;
  306|      0|        }
  307|  2.94k|        return 1;
  308|  2.94k|    }
  309|      0|    return 0;
  310|  2.94k|}
secp256k1_ecdsa_signature_parse_compact:
  411|  5.88k|int secp256k1_ecdsa_signature_parse_compact(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input64) {
  412|  5.88k|    secp256k1_scalar r, s;
  413|  5.88k|    int ret = 1;
  414|  5.88k|    int overflow = 0;
  415|       |
  416|  5.88k|    VERIFY_CHECK(ctx != NULL);
  417|  5.88k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  5.88k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.88k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  5.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.88k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  418|  5.88k|    ARG_CHECK(input64 != NULL);
  ------------------
  |  |   45|  5.88k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.88k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  5.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.88k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  419|       |
  420|  5.88k|    secp256k1_scalar_set_b32(&r, &input64[0], &overflow);
  421|  5.88k|    ret &= !overflow;
  422|  5.88k|    secp256k1_scalar_set_b32(&s, &input64[32], &overflow);
  423|  5.88k|    ret &= !overflow;
  424|  5.88k|    if (ret) {
  ------------------
  |  Branch (424:9): [True: 5.88k, False: 0]
  ------------------
  425|  5.88k|        secp256k1_ecdsa_signature_save(sig, &r, &s);
  426|  5.88k|    } else {
  427|      0|        memset(sig, 0, sizeof(*sig));
  428|      0|    }
  429|  5.88k|    return ret;
  430|  5.88k|}
secp256k1_ecdsa_signature_serialize_der:
  432|  2.94k|int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature* sig) {
  433|  2.94k|    secp256k1_scalar r, s;
  434|       |
  435|  2.94k|    VERIFY_CHECK(ctx != NULL);
  436|  2.94k|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  437|  2.94k|    ARG_CHECK(outputlen != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  438|  2.94k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  439|       |
  440|  2.94k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);
  441|  2.94k|    return secp256k1_ecdsa_sig_serialize(output, outputlen, &r, &s);
  442|  2.94k|}
secp256k1_ecdsa_signature_serialize_compact:
  444|  7.45k|int secp256k1_ecdsa_signature_serialize_compact(const secp256k1_context* ctx, unsigned char *output64, const secp256k1_ecdsa_signature* sig) {
  445|  7.45k|    secp256k1_scalar r, s;
  446|       |
  447|  7.45k|    VERIFY_CHECK(ctx != NULL);
  448|  7.45k|    ARG_CHECK(output64 != NULL);
  ------------------
  |  |   45|  7.45k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.45k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.45k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.45k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  449|  7.45k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  7.45k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.45k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.45k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.45k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  450|       |
  451|  7.45k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);
  452|  7.45k|    secp256k1_scalar_get_b32(&output64[0], &r);
  453|  7.45k|    secp256k1_scalar_get_b32(&output64[32], &s);
  454|  7.45k|    return 1;
  455|  7.45k|}
secp256k1_ecdsa_signature_normalize:
  457|  2.94k|int secp256k1_ecdsa_signature_normalize(const secp256k1_context* ctx, secp256k1_ecdsa_signature *sigout, const secp256k1_ecdsa_signature *sigin) {
  458|  2.94k|    secp256k1_scalar r, s;
  459|  2.94k|    int ret = 0;
  460|       |
  461|  2.94k|    VERIFY_CHECK(ctx != NULL);
  462|  2.94k|    ARG_CHECK(sigin != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  463|       |
  464|  2.94k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sigin);
  465|  2.94k|    ret = secp256k1_scalar_is_high(&s);
  466|  2.94k|    if (sigout != NULL) {
  ------------------
  |  Branch (466:9): [True: 2.94k, False: 0]
  ------------------
  467|  2.94k|        if (ret) {
  ------------------
  |  Branch (467:13): [True: 0, False: 2.94k]
  ------------------
  468|      0|            secp256k1_scalar_negate(&s, &s);
  469|      0|        }
  470|  2.94k|        secp256k1_ecdsa_signature_save(sigout, &r, &s);
  471|  2.94k|    }
  472|       |
  473|  2.94k|    return ret;
  474|  2.94k|}
secp256k1_ecdsa_verify:
  476|  5.88k|int secp256k1_ecdsa_verify(const secp256k1_context* ctx, const secp256k1_ecdsa_signature *sig, const unsigned char *msghash32, const secp256k1_pubkey *pubkey) {
  477|  5.88k|    secp256k1_ge q;
  478|  5.88k|    secp256k1_scalar r, s;
  479|  5.88k|    secp256k1_scalar m;
  480|  5.88k|    VERIFY_CHECK(ctx != NULL);
  481|  5.88k|    ARG_CHECK(msghash32 != NULL);
  ------------------
  |  |   45|  5.88k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.88k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  5.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.88k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  482|  5.88k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  5.88k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.88k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  5.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.88k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  483|  5.88k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  5.88k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.88k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  5.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.88k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  484|       |
  485|  5.88k|    secp256k1_scalar_set_b32(&m, msghash32, NULL);
  486|  5.88k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);
  487|  5.88k|    return (!secp256k1_scalar_is_high(&s) &&
  ------------------
  |  Branch (487:13): [True: 5.88k, False: 0]
  ------------------
  488|  5.88k|            secp256k1_pubkey_load(ctx, &q, pubkey) &&
  ------------------
  |  Branch (488:13): [True: 5.88k, False: 0]
  ------------------
  489|  5.88k|            secp256k1_ecdsa_sig_verify(&r, &s, &q, &m));
  ------------------
  |  Branch (489:13): [True: 5.88k, False: 0]
  ------------------
  490|  5.88k|}
secp256k1_ecdsa_sign:
  601|  7.45k|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) {
  602|  7.45k|    secp256k1_scalar r, s;
  603|  7.45k|    int ret;
  604|  7.45k|    VERIFY_CHECK(ctx != NULL);
  605|  7.45k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  7.45k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.45k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.45k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.45k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  606|  7.45k|    ARG_CHECK(msghash32 != NULL);
  ------------------
  |  |   45|  7.45k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.45k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.45k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.45k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  607|  7.45k|    ARG_CHECK(signature != NULL);
  ------------------
  |  |   45|  7.45k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.45k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.45k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.45k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  608|  7.45k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  7.45k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.45k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.45k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.45k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  609|       |
  610|  7.45k|    ret = secp256k1_ecdsa_sign_inner(ctx, &r, &s, NULL, msghash32, seckey, noncefp, noncedata);
  611|  7.45k|    secp256k1_ecdsa_signature_save(signature, &r, &s);
  612|  7.45k|    return ret;
  613|  7.45k|}
secp256k1_ec_seckey_verify:
  615|  2.99k|int secp256k1_ec_seckey_verify(const secp256k1_context* ctx, const unsigned char *seckey) {
  616|  2.99k|    secp256k1_scalar sec;
  617|  2.99k|    int ret;
  618|  2.99k|    VERIFY_CHECK(ctx != NULL);
  619|  2.99k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  2.99k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.99k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.99k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.99k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
  620|       |
  621|  2.99k|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  622|  2.99k|    secp256k1_scalar_clear(&sec);
  623|  2.99k|    return ret;
  624|  2.99k|}
secp256k1_ec_pubkey_create:
  636|  2.94k|int secp256k1_ec_pubkey_create(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) {
  637|  2.94k|    secp256k1_ge p;
  638|  2.94k|    secp256k1_scalar seckey_scalar;
  639|  2.94k|    int ret = 0;
  640|  2.94k|    VERIFY_CHECK(ctx != NULL);
  641|  2.94k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  642|  2.94k|    memset(pubkey, 0, sizeof(*pubkey));
  643|  2.94k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  644|  2.94k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  2.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  2.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.94k]
  |  |  ------------------
  ------------------
  645|       |
  646|  2.94k|    ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &seckey_scalar, &p, seckey);
  647|  2.94k|    secp256k1_pubkey_save(pubkey, &p);
  648|  2.94k|    secp256k1_memczero(pubkey, sizeof(*pubkey), !ret);
  649|       |
  650|  2.94k|    secp256k1_scalar_clear(&seckey_scalar);
  651|  2.94k|    return ret;
  652|  2.94k|}
secp256k1.c:secp256k1_context_is_proper:
   83|      4|static int secp256k1_context_is_proper(const secp256k1_context* ctx) {
   84|      4|    return secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx);
   85|      4|}
secp256k1.c:secp256k1_pubkey_save:
  264|  8.83k|static void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {
  265|  8.83k|    secp256k1_ge_to_bytes(pubkey->data, ge);
  266|  8.83k|}
secp256k1.c:secp256k1_pubkey_load:
  258|  8.83k|static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {
  259|  8.83k|    secp256k1_ge_from_bytes(ge, pubkey->data);
  260|  8.83k|    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));
  ------------------
  |  |   45|  8.83k|#define ARG_CHECK(cond) do { \
  |  |   46|  8.83k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  8.83k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 8.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  8.83k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 8.83k]
  |  |  ------------------
  ------------------
  261|  8.83k|    return 1;
  262|  8.83k|}
secp256k1.c:secp256k1_ecdsa_signature_save:
  385|  16.2k|static void secp256k1_ecdsa_signature_save(secp256k1_ecdsa_signature* sig, const secp256k1_scalar* r, const secp256k1_scalar* s) {
  386|  16.2k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (386:9): [True: 16.2k, Folded]
  ------------------
  387|  16.2k|        memcpy(&sig->data[0], r, 32);
  388|  16.2k|        memcpy(&sig->data[32], s, 32);
  389|  16.2k|    } else {
  390|      0|        secp256k1_scalar_get_b32(&sig->data[0], r);
  391|      0|        secp256k1_scalar_get_b32(&sig->data[32], s);
  392|      0|    }
  393|  16.2k|}
secp256k1.c:secp256k1_ecdsa_signature_load:
  371|  19.2k|static void secp256k1_ecdsa_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_ecdsa_signature* sig) {
  372|  19.2k|    (void)ctx;
  373|  19.2k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (373:9): [True: 19.2k, Folded]
  ------------------
  374|       |        /* When the secp256k1_scalar type is exactly 32 byte, use its
  375|       |         * representation inside secp256k1_ecdsa_signature, as conversion is very fast.
  376|       |         * Note that secp256k1_ecdsa_signature_save must use the same representation. */
  377|  19.2k|        memcpy(r, &sig->data[0], 32);
  378|  19.2k|        memcpy(s, &sig->data[32], 32);
  379|  19.2k|    } else {
  380|      0|        secp256k1_scalar_set_b32(r, &sig->data[0], NULL);
  381|       |        secp256k1_scalar_set_b32(s, &sig->data[32], NULL);
  382|      0|    }
  383|  19.2k|}
secp256k1.c:nonce_function_rfc6979_impl:
  497|  7.45k|static int nonce_function_rfc6979_impl(const secp256k1_hash_ctx *hash_ctx, unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {
  498|  7.45k|   unsigned char keydata[112];
  499|  7.45k|   unsigned int offset = 0;
  500|  7.45k|   secp256k1_rfc6979_hmac_sha256 rng;
  501|  7.45k|   unsigned int i;
  502|  7.45k|   secp256k1_scalar msg;
  503|  7.45k|   unsigned char msgmod32[32];
  504|  7.45k|   secp256k1_scalar_set_b32(&msg, msg32, NULL);
  505|  7.45k|   secp256k1_scalar_get_b32(msgmod32, &msg);
  506|       |   /* We feed a byte array to the PRNG as input, consisting of:
  507|       |    * - the private key (32 bytes) and reduced message (32 bytes), see RFC 6979 3.2d.
  508|       |    * - optionally 32 extra bytes of data, see RFC 6979 3.6 Additional Data.
  509|       |    * - optionally 16 extra bytes with the algorithm name.
  510|       |    * Because the arguments have distinct fixed lengths it is not possible for
  511|       |    *  different argument mixtures to emulate each other and result in the same
  512|       |    *  nonces.
  513|       |    */
  514|  7.45k|   buffer_append(keydata, &offset, key32, 32);
  515|  7.45k|   buffer_append(keydata, &offset, msgmod32, 32);
  516|  7.45k|   if (data != NULL) {
  ------------------
  |  Branch (516:8): [True: 4.51k, False: 2.94k]
  ------------------
  517|  4.51k|       buffer_append(keydata, &offset, data, 32);
  518|  4.51k|   }
  519|  7.45k|   if (algo16 != NULL) {
  ------------------
  |  Branch (519:8): [True: 0, False: 7.45k]
  ------------------
  520|      0|       buffer_append(keydata, &offset, algo16, 16);
  521|      0|   }
  522|  7.45k|   secp256k1_rfc6979_hmac_sha256_initialize(hash_ctx, &rng, keydata, offset);
  523|  7.45k|   for (i = 0; ; i++) {
  524|  7.45k|       secp256k1_rfc6979_hmac_sha256_generate(hash_ctx, &rng, nonce32, 32);
  525|  7.45k|       if (i == counter) break;
  ------------------
  |  Branch (525:12): [True: 7.45k, False: 0]
  ------------------
  526|  7.45k|   }
  527|  7.45k|   secp256k1_rfc6979_hmac_sha256_finalize(&rng);
  528|       |
  529|  7.45k|   secp256k1_memclear_explicit(keydata, sizeof(keydata));
  530|  7.45k|   secp256k1_rfc6979_hmac_sha256_clear(&rng);
  531|  7.45k|   return 1;
  532|  7.45k|}
secp256k1.c:buffer_append:
  492|  19.4k|static SECP256K1_INLINE void buffer_append(unsigned char *buf, unsigned int *offset, const void *data, unsigned int len) {
  493|  19.4k|    memcpy(buf + *offset, data, len);
  494|  19.4k|    *offset += len;
  495|  19.4k|}
secp256k1.c:secp256k1_ecdsa_sign_inner:
  541|  7.45k|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) {
  542|  7.45k|    secp256k1_scalar sec, non, msg;
  543|  7.45k|    int ret = 0;
  544|  7.45k|    int is_sec_valid;
  545|  7.45k|    unsigned char nonce32[32];
  546|  7.45k|    unsigned int count = 0;
  547|       |    /* Default initialization here is important so we won't pass uninit values to the cmov in the end */
  548|  7.45k|    *r = secp256k1_scalar_zero;
  549|  7.45k|    *s = secp256k1_scalar_zero;
  550|  7.45k|    if (recid) {
  ------------------
  |  Branch (550:9): [True: 0, False: 7.45k]
  ------------------
  551|      0|        *recid = 0;
  552|      0|    }
  553|       |
  554|       |    /* Fail if the secret key is invalid. */
  555|  7.45k|    is_sec_valid = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  556|  7.45k|    secp256k1_scalar_cmov(&sec, &secp256k1_scalar_one, !is_sec_valid);
  557|  7.45k|    secp256k1_scalar_set_b32(&msg, msg32, NULL);
  558|  7.45k|    while (1) {
  ------------------
  |  Branch (558:12): [True: 7.45k, Folded]
  ------------------
  559|  7.45k|        int is_nonce_valid;
  560|       |
  561|  7.45k|        if (noncefp == NULL || noncefp == secp256k1_nonce_function_rfc6979) {
  ------------------
  |  Branch (561:13): [True: 0, False: 7.45k]
  |  Branch (561:32): [True: 7.45k, False: 0]
  ------------------
  562|       |            /* Use ctx-aware function by default */
  563|  7.45k|            ret = nonce_function_rfc6979_impl(secp256k1_get_hash_context(ctx), nonce32, msg32, seckey, NULL, (void*)noncedata, count);
  564|  7.45k|        } else {
  565|      0|            ret = !!noncefp(nonce32, msg32, seckey, NULL, (void*)noncedata, count);
  566|      0|        }
  567|       |
  568|  7.45k|        if (!ret) {
  ------------------
  |  Branch (568:13): [True: 0, False: 7.45k]
  ------------------
  569|      0|            break;
  570|      0|        }
  571|  7.45k|        is_nonce_valid = secp256k1_scalar_set_b32_seckey(&non, nonce32);
  572|       |        /* The nonce is still secret here, but it being invalid is less likely than 1:2^255. */
  573|  7.45k|        secp256k1_declassify(ctx, &is_nonce_valid, sizeof(is_nonce_valid));
  574|  7.45k|        if (is_nonce_valid) {
  ------------------
  |  Branch (574:13): [True: 7.45k, False: 0]
  ------------------
  575|  7.45k|            ret = secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, r, s, &sec, &msg, &non, recid);
  576|       |            /* The final signature is no longer a secret, nor is the fact that we were successful or not. */
  577|  7.45k|            secp256k1_declassify(ctx, &ret, sizeof(ret));
  578|  7.45k|            if (ret) {
  ------------------
  |  Branch (578:17): [True: 7.45k, False: 0]
  ------------------
  579|  7.45k|                break;
  580|  7.45k|            }
  581|  7.45k|        }
  582|      0|        count++;
  583|      0|    }
  584|       |    /* We don't want to declassify is_sec_valid and therefore the range of
  585|       |     * seckey. As a result is_sec_valid is included in ret only after ret was
  586|       |     * used as a branching variable. */
  587|  7.45k|    ret &= is_sec_valid;
  588|  7.45k|    secp256k1_memclear_explicit(nonce32, sizeof(nonce32));
  589|  7.45k|    secp256k1_scalar_clear(&msg);
  590|  7.45k|    secp256k1_scalar_clear(&non);
  591|  7.45k|    secp256k1_scalar_clear(&sec);
  592|  7.45k|    secp256k1_scalar_cmov(r, &secp256k1_scalar_zero, !ret);
  593|  7.45k|    secp256k1_scalar_cmov(s, &secp256k1_scalar_zero, !ret);
  594|  7.45k|    if (recid) {
  ------------------
  |  Branch (594:9): [True: 0, False: 7.45k]
  ------------------
  595|      0|        const int zero = 0;
  596|      0|        secp256k1_int_cmov(recid, &zero, !ret);
  597|      0|    }
  598|  7.45k|    return ret;
  599|  7.45k|}
secp256k1.c:secp256k1_ec_pubkey_create_helper:
  626|  5.88k|static int secp256k1_ec_pubkey_create_helper(const secp256k1_ecmult_gen_context *ecmult_gen_ctx, secp256k1_scalar *seckey_scalar, secp256k1_ge *p, const unsigned char *seckey) {
  627|  5.88k|    int ret;
  628|       |
  629|  5.88k|    ret = secp256k1_scalar_set_b32_seckey(seckey_scalar, seckey);
  630|  5.88k|    secp256k1_scalar_cmov(seckey_scalar, &secp256k1_scalar_one, !ret);
  631|       |
  632|  5.88k|    secp256k1_ecmult_gen_ge(ecmult_gen_ctx, p, seckey_scalar);
  633|  5.88k|    return ret;
  634|  5.88k|}
secp256k1.c:secp256k1_get_hash_context:
  237|  32.0k|static SECP256K1_INLINE const secp256k1_hash_ctx* secp256k1_get_hash_context(const secp256k1_context *ctx) {
  238|  32.0k|    return &ctx->hash_ctx;
  239|  32.0k|}
secp256k1.c:secp256k1_declassify:
  254|  20.7k|static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, const void *p, size_t len) {
  255|  20.7k|    if (EXPECT(ctx->declassify, 0)) SECP256K1_CHECKMEM_DEFINE(p, len);
  ------------------
  |  |  146|  20.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 20.7k]
  |  |  ------------------
  ------------------
                  if (EXPECT(ctx->declassify, 0)) SECP256K1_CHECKMEM_DEFINE(p, len);
  ------------------
  |  |  106|      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, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  20.7k|}

secp256k1.c:secp256k1_read_be32:
  428|  3.06M|SECP256K1_INLINE static uint32_t secp256k1_read_be32(const unsigned char* p) {
  429|  3.06M|    return (uint32_t)p[0] << 24 |
  430|  3.06M|           (uint32_t)p[1] << 16 |
  431|  3.06M|           (uint32_t)p[2] << 8  |
  432|  3.06M|           (uint32_t)p[3];
  433|  3.06M|}
secp256k1.c:secp256k1_read_be64:
  444|   255k|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  445|   255k|    return (uint64_t)p[0] << 56 |
  446|   255k|           (uint64_t)p[1] << 48 |
  447|   255k|           (uint64_t)p[2] << 40 |
  448|   255k|           (uint64_t)p[3] << 32 |
  449|   255k|           (uint64_t)p[4] << 24 |
  450|   255k|           (uint64_t)p[5] << 16 |
  451|   255k|           (uint64_t)p[6] << 8  |
  452|   255k|           (uint64_t)p[7];
  453|   255k|}
secp256k1.c:secp256k1_ctz64_var:
  410|  6.97M|static SECP256K1_INLINE int secp256k1_ctz64_var(uint64_t x) {
  411|  6.97M|    VERIFY_CHECK(x != 0);
  412|  6.97M|#if (__has_builtin(__builtin_ctzl) || defined(__GNUC__))
  413|       |    /* If the unsigned long type is sufficient to represent the largest uint64_t, consider __builtin_ctzl. */
  414|  6.97M|    if (((unsigned long)UINT64_MAX) == UINT64_MAX) {
  ------------------
  |  Branch (414:9): [True: 6.97M, Folded]
  ------------------
  415|  6.97M|        return __builtin_ctzl(x);
  416|  6.97M|    }
  417|      0|#endif
  418|      0|#if (__has_builtin(__builtin_ctzll) || defined(__GNUC__))
  419|       |    /* Otherwise consider __builtin_ctzll (the unsigned long long type is always at least 64 bits). */
  420|      0|    return __builtin_ctzll(x);
  421|       |#else
  422|       |    /* If no suitable CTZ builtin is available, use a (variable time) software emulation. */
  423|       |    return secp256k1_ctz64_var_debruijn(x);
  424|       |#endif
  425|  6.97M|}
secp256k1.c:secp256k1_memczero:
  220|  5.88k|static SECP256K1_INLINE void secp256k1_memczero(void *s, size_t len, int flag) {
  221|  5.88k|    unsigned char *p = (unsigned char *)s;
  222|       |    /* Access flag with a volatile-qualified lvalue.
  223|       |       This prevents clang from figuring out (after inlining) that flag can
  224|       |       take only be 0 or 1, which leads to variable time code. */
  225|  5.88k|    volatile int vflag = flag;
  226|  5.88k|    unsigned char mask = -(unsigned char) vflag;
  227|  5.88k|    VERIFY_CHECK(flag == 0 || flag == 1);
  228|   382k|    while (len) {
  ------------------
  |  Branch (228:12): [True: 376k, False: 5.88k]
  ------------------
  229|   376k|        *p &= ~mask;
  230|   376k|        p++;
  231|   376k|        len--;
  232|   376k|    }
  233|  5.88k|}
secp256k1.c:secp256k1_rotr32:
  468|  3.44M|SECP256K1_INLINE static uint32_t secp256k1_rotr32(const uint32_t x, const unsigned int by) {
  469|       |#if defined(_MSC_VER)
  470|       |    return _rotr(x, by);  /* needs <stdlib.h> */
  471|       |#else
  472|       |    /* Reduce rotation amount to avoid UB when shifting. */
  473|  3.44M|    const unsigned int mask = CHAR_BIT * sizeof(x) - 1;
  474|       |    /* Turned into a rot instruction by GCC and clang. */
  475|  3.44M|    return (x >> (by & mask)) | (x << ((-by) & mask));
  476|  3.44M|#endif
  477|  3.44M|}
secp256k1.c:secp256k1_write_be64:
  456|   189k|SECP256K1_INLINE static void secp256k1_write_be64(unsigned char* p, uint64_t x) {
  457|   189k|    p[7] = x;
  458|   189k|    p[6] = x >>  8;
  459|   189k|    p[5] = x >> 16;
  460|   189k|    p[4] = x >> 24;
  461|   189k|    p[3] = x >> 32;
  462|   189k|    p[2] = x >> 40;
  463|   189k|    p[1] = x >> 48;
  464|   189k|    p[0] = x >> 56;
  465|   189k|}
secp256k1.c:secp256k1_memclear_explicit:
  268|   229k|static SECP256K1_INLINE void secp256k1_memclear_explicit(void *ptr, size_t len) {
  269|       |    /* The current implementation zeroes, but callers must not rely on this */
  270|   229k|    secp256k1_memzero_explicit(ptr, len);
  271|       |#ifdef VERIFY
  272|       |    SECP256K1_CHECKMEM_UNDEFINE(ptr, len);
  273|       |#endif
  274|   229k|}
secp256k1.c:secp256k1_memzero_explicit:
  236|   229k|static SECP256K1_INLINE void secp256k1_memzero_explicit(void *ptr, size_t len) {
  237|       |#if defined(_MSC_VER)
  238|       |    /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */
  239|       |    SecureZeroMemory(ptr, len);
  240|       |#elif defined(__GNUC__)
  241|       |    /* We use a memory barrier that scares the compiler away from optimizing out the memset.
  242|       |     *
  243|       |     * Quoting Adam Langley <agl@google.com> in commit ad1907fe73334d6c696c8539646c21b11178f20f
  244|       |     * in BoringSSL (ISC License):
  245|       |     *    As best as we can tell, this is sufficient to break any optimisations that
  246|       |     *    might try to eliminate "superfluous" memsets.
  247|       |     * This method is used in memzero_explicit() the Linux kernel, too. Its advantage is that it
  248|       |     * is pretty efficient, because the compiler can still implement the memset() efficiently,
  249|       |     * just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
  250|       |     * Yang et al. (USENIX Security 2017) for more background.
  251|       |     */
  252|   229k|    memset(ptr, 0, len);
  253|   229k|    __asm__ __volatile__("" : : "r"(ptr) : "memory");
  254|       |#else
  255|       |    void *(*volatile const volatile_memset)(void *, int, size_t) = memset;
  256|       |    volatile_memset(ptr, 0, len);
  257|       |#endif
  258|   229k|}
secp256k1.c:secp256k1_write_be32:
  436|   903k|SECP256K1_INLINE static void secp256k1_write_be32(unsigned char* p, uint32_t x) {
  437|   903k|    p[3] = x;
  438|   903k|    p[2] = x >>  8;
  439|   903k|    p[1] = x >> 16;
  440|   903k|    p[0] = x >> 24;
  441|   903k|}

_Z9UCharCastPh:
   96|  2.99k|inline unsigned char* UCharCast(unsigned char* c) { return c; }
_Z9UCharCastPSt4byte:
   98|  2.94k|inline unsigned char* UCharCast(std::byte* c) { return reinterpret_cast<unsigned char*>(c); }
_Z9UCharCastPKSt4byte:
  102|  16.2k|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }

random.cpp:_ZN16secure_allocatorIN12_GLOBAL__N_18RNGStateEE10deallocateEPS1_m:
   37|      2|    {
   38|      2|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 2, False: 0]
  ------------------
   39|      2|            memory_cleanse(p, sizeof(T) * n);
   40|      2|        }
   41|      2|        LockedPoolManager::Instance().free(p);
   42|      2|    }
_Z18make_secure_uniqueINSt3__15arrayIhLm32EEEJEENS0_10unique_ptrIT_19SecureUniqueDeleterIS4_EEEDpOT0_:
   67|  2.94k|{
   68|  2.94k|    T* p = secure_allocator<T>().allocate(1);
   69|       |
   70|       |    // initialize in place, and return as secure_unique_ptr
   71|  2.94k|    try {
   72|  2.94k|        return secure_unique_ptr<T>(new (p) T(std::forward<Args>(as)...));
   73|  2.94k|    } catch (...) {
   74|      0|        secure_allocator<T>().deallocate(p, 1);
   75|      0|        throw;
   76|      0|    }
   77|  2.94k|}
_ZN16secure_allocatorINSt3__15arrayIhLm32EEEE8allocateEm:
   28|  2.94k|    {
   29|  2.94k|        T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
   30|  2.94k|        if (!allocation) {
  ------------------
  |  Branch (30:13): [True: 0, False: 2.94k]
  ------------------
   31|      0|            throw std::bad_alloc();
   32|      0|        }
   33|  2.94k|        return allocation;
   34|  2.94k|    }
_ZN19SecureUniqueDeleterINSt3__15arrayIhLm32EEEEclEPS2_:
   57|  2.94k|    void operator()(T* t) noexcept {
   58|  2.94k|        secure_allocator<T>().deallocate(t, 1);
   59|  2.94k|    }
_ZN16secure_allocatorINSt3__15arrayIhLm32EEEE10deallocateEPS2_m:
   37|  2.94k|    {
   38|  2.94k|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 2.94k, False: 0]
  ------------------
   39|  2.94k|            memory_cleanse(p, sizeof(T) * n);
   40|  2.94k|        }
   41|  2.94k|        LockedPoolManager::Instance().free(p);
   42|  2.94k|    }

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

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

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

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

_ZN18FuzzedDataProviderC2EPKhm:
   37|  2.99k|      : data_ptr_(data), remaining_bytes_(size) {}
_ZN18FuzzedDataProvider12ConsumeBytesISt4byteEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEm:
  109|  2.94k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
  110|  2.94k|  num_bytes = std::min(num_bytes, remaining_bytes_);
  111|  2.94k|  return ConsumeBytes<T>(num_bytes, num_bytes);
  112|  2.94k|}
_ZN18FuzzedDataProvider12ConsumeBytesISt4byteEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEmm:
  352|  2.94k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
  353|  2.94k|  static_assert(sizeof(T) == sizeof(uint8_t), "Incompatible data type.");
  354|       |
  355|       |  // The point of using the size-based constructor below is to increase the
  356|       |  // odds of having a vector object with capacity being equal to the length.
  357|       |  // That part is always implementation specific, but at least both libc++ and
  358|       |  // libstdc++ allocate the requested number of bytes in that constructor,
  359|       |  // which seems to be a natural choice for other implementations as well.
  360|       |  // To increase the odds even more, we also call |shrink_to_fit| below.
  361|  2.94k|  std::vector<T> result(size);
  362|  2.94k|  if (size == 0) {
  ------------------
  |  Branch (362:7): [True: 2.65k, False: 291]
  ------------------
  363|  2.65k|    if (num_bytes != 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 2.65k]
  ------------------
  364|      0|      abort();
  365|  2.65k|    return result;
  366|  2.65k|  }
  367|       |
  368|    291|  CopyAndAdvance(result.data(), num_bytes);
  369|       |
  370|       |  // Even though |shrink_to_fit| is also implementation specific, we expect it
  371|       |  // to provide an additional assurance in case vector's constructor allocated
  372|       |  // a buffer which is larger than the actual amount of data we put inside it.
  373|    291|  result.shrink_to_fit();
  374|    291|  return result;
  375|  2.94k|}
_ZN18FuzzedDataProvider14CopyAndAdvanceEPvm:
  338|  3.51k|                                               size_t num_bytes) {
  339|  3.51k|  std::memcpy(destination, data_ptr_, num_bytes);
  340|  3.51k|  Advance(num_bytes);
  341|  3.51k|}
_ZN18FuzzedDataProvider7AdvanceEm:
  343|  3.51k|inline void FuzzedDataProvider::Advance(size_t num_bytes) {
  344|  3.51k|  if (num_bytes > remaining_bytes_)
  ------------------
  |  Branch (344:7): [True: 0, False: 3.51k]
  ------------------
  345|      0|    abort();
  346|       |
  347|  3.51k|  data_ptr_ += num_bytes;
  348|  3.51k|  remaining_bytes_ -= num_bytes;
  349|  3.51k|}
_ZN18FuzzedDataProvider12ConsumeBytesIhEENSt3__16vectorIT_NS1_9allocatorIS3_EEEEm:
  109|  5.94k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
  110|  5.94k|  num_bytes = std::min(num_bytes, remaining_bytes_);
  111|  5.94k|  return ConsumeBytes<T>(num_bytes, num_bytes);
  112|  5.94k|}
_ZN18FuzzedDataProvider12ConsumeBytesIhEENSt3__16vectorIT_NS1_9allocatorIS3_EEEEmm:
  352|  5.94k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
  353|  5.94k|  static_assert(sizeof(T) == sizeof(uint8_t), "Incompatible data type.");
  354|       |
  355|       |  // The point of using the size-based constructor below is to increase the
  356|       |  // odds of having a vector object with capacity being equal to the length.
  357|       |  // That part is always implementation specific, but at least both libc++ and
  358|       |  // libstdc++ allocate the requested number of bytes in that constructor,
  359|       |  // which seems to be a natural choice for other implementations as well.
  360|       |  // To increase the odds even more, we also call |shrink_to_fit| below.
  361|  5.94k|  std::vector<T> result(size);
  362|  5.94k|  if (size == 0) {
  ------------------
  |  Branch (362:7): [True: 2.71k, False: 3.22k]
  ------------------
  363|  2.71k|    if (num_bytes != 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 2.71k]
  ------------------
  364|      0|      abort();
  365|  2.71k|    return result;
  366|  2.71k|  }
  367|       |
  368|  3.22k|  CopyAndAdvance(result.data(), num_bytes);
  369|       |
  370|       |  // Even though |shrink_to_fit| is also implementation specific, we expect it
  371|       |  // to provide an additional assurance in case vector's constructor allocated
  372|       |  // a buffer which is larger than the actual amount of data we put inside it.
  373|  3.22k|  result.shrink_to_fit();
  374|  3.22k|  return result;
  375|  5.94k|}

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

_Z30ellswift_roundtrip_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
  301|  2.99k|{
  302|  2.99k|    FuzzedDataProvider fdp{buffer.data(), buffer.size()};
  303|       |
  304|  2.99k|    CKey key = ConsumePrivateKey(fdp, /*compressed=*/true);
  305|  2.99k|    if (!key.IsValid()) return;
  ------------------
  |  Branch (305:9): [True: 52, False: 2.94k]
  ------------------
  306|       |
  307|  2.94k|    auto ent32 = fdp.ConsumeBytes<std::byte>(32);
  308|  2.94k|    ent32.resize(32);
  309|       |
  310|  2.94k|    auto encoded_ellswift = key.EllSwiftCreate(ent32);
  311|  2.94k|    auto decoded_pubkey = encoded_ellswift.Decode();
  312|       |
  313|  2.94k|    uint256 hash{ConsumeUInt256(fdp)};
  314|  2.94k|    std::vector<unsigned char> sig;
  315|  2.94k|    key.Sign(hash, sig);
  316|       |    assert(decoded_pubkey.Verify(hash, sig));
  ------------------
  |  Branch (316:5): [True: 2.94k, False: 0]
  ------------------
  317|  2.94k|}

_Z17ConsumePrivateKeyR18FuzzedDataProviderNSt3__18optionalIbEE:
  231|  2.99k|{
  232|  2.99k|    auto key_data = fuzzed_data_provider.ConsumeBytes<uint8_t>(32);
  233|  2.99k|    key_data.resize(32);
  234|  2.99k|    CKey key;
  235|  2.99k|    bool compressed_value = compressed ? *compressed : fuzzed_data_provider.ConsumeBool();
  ------------------
  |  Branch (235:29): [True: 2.99k, False: 0]
  ------------------
  236|  2.99k|    key.Set(key_data.begin(), key_data.end(), compressed_value);
  237|  2.99k|    return key;
  238|  2.99k|}

_Z14ConsumeUInt256R18FuzzedDataProvider:
  196|  2.94k|{
  197|  2.94k|    const std::vector<uint8_t> v256 = fuzzed_data_provider.ConsumeBytes<uint8_t>(256 / 8);
  198|  2.94k|    if (v256.size() != 256 / 8) {
  ------------------
  |  Branch (198:9): [True: 2.72k, False: 216]
  ------------------
  199|  2.72k|        return {};
  200|  2.72k|    }
  201|    216|    return uint256{v256};
  202|  2.94k|}

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

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

_ZNK9base_blobILj256EE5beginEv:
  104|  13.3k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN7uint256C2ENSt3__14spanIKhLm18446744073709551615EEE:
  203|    216|    constexpr explicit uint256(std::span<const unsigned char> vch) : base_blob<256>(vch) {}
_ZN9base_blobILj256EEC2ENSt3__14spanIKhLm18446744073709551615EEE:
   43|    216|    {
   44|    216|        assert(vch.size() == WIDTH);
  ------------------
  |  Branch (44:9): [True: 216, False: 0]
  ------------------
   45|    216|        std::copy(vch.begin(), vch.end(), m_data.begin());
   46|    216|    }
_ZN9base_blobILj256EE4dataEv:
   99|      2|    constexpr unsigned char* data() { return m_data.data(); }
_ZN7uint256C2Ev:
  200|  2.72k|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   37|  2.72k|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EE4sizeEv:
  107|      2|    static constexpr unsigned int size() { return WIDTH; }

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

_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_RKNS0_15source_locationENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   90|  2.99k|{
   91|  2.99k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 2.99k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  2.99k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 2.99k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  2.99k|    }
   96|  2.99k|    return std::forward<T>(val);
   97|  2.99k|}
_Z22inline_assertion_checkILb1EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|  2.99k|{
   91|  2.99k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 2.99k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  2.99k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 2.99k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  2.99k|    }
   96|  2.99k|    return std::forward<T>(val);
   97|  2.99k|}
_Z22inline_assertion_checkILb0EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|     10|{
   91|     10|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [Folded, False: 0]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|     10|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 10]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|     10|    }
   96|     10|    return std::forward<T>(val);
   97|     10|}

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

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

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

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

