_ZNK8AddrInfo14GetTriedBucketERK7uint256RK15NetGroupManager:
   30|  33.5k|{
   31|  33.5k|    uint64_t hash1 = (HashWriter{} << nKey << GetKey()).GetCheapHash();
   32|  33.5k|    uint64_t hash2 = (HashWriter{} << nKey << netgroupman.GetGroup(*this) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash();
   33|  33.5k|    return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
   34|  33.5k|}
_ZNK8AddrInfo12GetNewBucketERK7uint256RK8CNetAddrRK15NetGroupManager:
   37|  27.5k|{
   38|  27.5k|    std::vector<unsigned char> vchSourceGroupKey = netgroupman.GetGroup(src);
   39|  27.5k|    uint64_t hash1 = (HashWriter{} << nKey << netgroupman.GetGroup(*this) << vchSourceGroupKey).GetCheapHash();
   40|  27.5k|    uint64_t hash2 = (HashWriter{} << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetCheapHash();
   41|  27.5k|    return hash2 % ADDRMAN_NEW_BUCKET_COUNT;
   42|  27.5k|}
_ZNK8AddrInfo17GetBucketPositionERK7uint256bi:
   45|  90.0k|{
   46|  90.0k|    uint64_t hash1 = (HashWriter{} << nKey << (fNew ? uint8_t{'N'} : uint8_t{'K'}) << bucket << GetKey()).GetCheapHash();
  ------------------
  |  Branch (46:48): [True: 56.5k, False: 33.5k]
  ------------------
   47|  90.0k|    return hash1 % ADDRMAN_BUCKET_SIZE;
   48|  90.0k|}
_ZNK8AddrInfo10IsTerribleENSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1EEEEEEE:
   51|   109k|{
   52|   109k|    if (now - m_last_try <= 1min) { // never remove things tried in the last minute
  ------------------
  |  Branch (52:9): [True: 0, False: 109k]
  ------------------
   53|      0|        return false;
   54|      0|    }
   55|       |
   56|   109k|    if (nTime > now + 10min) { // came in a flying DeLorean
  ------------------
  |  Branch (56:9): [True: 12.6k, False: 96.5k]
  ------------------
   57|  12.6k|        return true;
   58|  12.6k|    }
   59|       |
   60|  96.5k|    if (now - nTime > ADDRMAN_HORIZON) { // not seen in recent history
  ------------------
  |  Branch (60:9): [True: 90.8k, False: 5.70k]
  ------------------
   61|  90.8k|        return true;
   62|  90.8k|    }
   63|       |
   64|  5.70k|    if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
  ------------------
  |  Branch (64:9): [True: 1.83k, False: 3.87k]
  |  Branch (64:71): [True: 275, False: 1.55k]
  ------------------
   65|    275|        return true;
   66|    275|    }
   67|       |
   68|  5.43k|    if (now - m_last_success > ADDRMAN_MIN_FAIL && nAttempts >= ADDRMAN_MAX_FAILURES) { // N successive failures in the last week
  ------------------
  |  Branch (68:9): [True: 2.13k, False: 3.30k]
  |  Branch (68:9): [True: 255, False: 5.17k]
  |  Branch (68:52): [True: 255, False: 1.87k]
  ------------------
   69|    255|        return true;
   70|    255|    }
   71|       |
   72|  5.17k|    return false;
   73|  5.43k|}
_ZN11AddrManImplC2ERK15NetGroupManagerbi:
   91|  12.9k|    : insecure_rand{deterministic}
   92|  12.9k|    , nKey{deterministic ? uint256{1} : insecure_rand.rand256()}
  ------------------
  |  Branch (92:12): [True: 12.9k, False: 0]
  ------------------
   93|  12.9k|    , m_consistency_check_ratio{consistency_check_ratio}
   94|  12.9k|    , m_netgroupman{netgroupman}
   95|  12.9k|{
   96|  13.2M|    for (auto& bucket : vvNew) {
  ------------------
  |  Branch (96:23): [True: 13.2M, False: 12.9k]
  ------------------
   97|   850M|        for (auto& entry : bucket) {
  ------------------
  |  Branch (97:26): [True: 850M, False: 13.2M]
  ------------------
   98|   850M|            entry = -1;
   99|   850M|        }
  100|  13.2M|    }
  101|  3.32M|    for (auto& bucket : vvTried) {
  ------------------
  |  Branch (101:23): [True: 3.32M, False: 12.9k]
  ------------------
  102|   212M|        for (auto& entry : bucket) {
  ------------------
  |  Branch (102:26): [True: 212M, False: 3.32M]
  ------------------
  103|   212M|            entry = -1;
  104|   212M|        }
  105|  3.32M|    }
  106|  12.9k|}
_ZN11AddrManImplD2Ev:
  109|  12.9k|{
  110|  12.9k|    nKey.SetNull();
  111|  12.9k|}
_ZN11AddrManImpl4FindERK8CServicePl:
  383|  6.18k|{
  384|  6.18k|    AssertLockHeld(cs);
  ------------------
  |  |  144|  6.18k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  385|       |
  386|  6.18k|    const auto it = mapAddr.find(addr);
  387|  6.18k|    if (it == mapAddr.end())
  ------------------
  |  Branch (387:9): [True: 6.18k, False: 0]
  ------------------
  388|  6.18k|        return nullptr;
  389|      0|    if (pnId)
  ------------------
  |  Branch (389:9): [True: 0, False: 0]
  ------------------
  390|      0|        *pnId = (*it).second;
  391|      0|    const auto it2 = mapInfo.find((*it).second);
  392|      0|    if (it2 != mapInfo.end())
  ------------------
  |  Branch (392:9): [True: 0, False: 0]
  ------------------
  393|      0|        return &(*it2).second;
  394|      0|    return nullptr;
  395|      0|}
_ZNK11AddrManImpl10SwapRandomEjj:
  414|   225k|{
  415|   225k|    AssertLockHeld(cs);
  ------------------
  |  |  144|   225k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  416|       |
  417|   225k|    if (nRndPos1 == nRndPos2)
  ------------------
  |  Branch (417:9): [True: 121k, False: 104k]
  ------------------
  418|   121k|        return;
  419|       |
  420|   225k|    assert(nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size());
  ------------------
  |  Branch (420:5): [True: 104k, False: 0]
  |  Branch (420:5): [True: 104k, False: 0]
  |  Branch (420:5): [True: 104k, False: 0]
  ------------------
  421|       |
  422|   104k|    nid_type nId1 = vRandom[nRndPos1];
  423|   104k|    nid_type nId2 = vRandom[nRndPos2];
  424|       |
  425|   104k|    const auto it_1{mapInfo.find(nId1)};
  426|   104k|    const auto it_2{mapInfo.find(nId2)};
  427|   104k|    assert(it_1 != mapInfo.end());
  ------------------
  |  Branch (427:5): [True: 104k, False: 0]
  ------------------
  428|   104k|    assert(it_2 != mapInfo.end());
  ------------------
  |  Branch (428:5): [True: 104k, False: 0]
  ------------------
  429|       |
  430|   104k|    it_1->second.nRandomPos = nRndPos2;
  431|   104k|    it_2->second.nRandomPos = nRndPos1;
  432|       |
  433|   104k|    vRandom[nRndPos1] = nId2;
  434|   104k|    vRandom[nRndPos2] = nId1;
  435|   104k|}
_ZN11AddrManImpl6DeleteEl:
  438|   113k|{
  439|   113k|    AssertLockHeld(cs);
  ------------------
  |  |  144|   113k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  440|       |
  441|   113k|    assert(mapInfo.contains(nId));
  ------------------
  |  Branch (441:5): [True: 113k, False: 0]
  ------------------
  442|   113k|    AddrInfo& info = mapInfo[nId];
  443|   113k|    assert(!info.fInTried);
  ------------------
  |  Branch (443:5): [True: 113k, False: 0]
  ------------------
  444|   113k|    assert(info.nRefCount == 0);
  ------------------
  |  Branch (444:5): [True: 113k, False: 0]
  ------------------
  445|       |
  446|   113k|    SwapRandom(info.nRandomPos, vRandom.size() - 1);
  447|   113k|    m_network_counts[info.GetNetwork()].n_new--;
  448|   113k|    vRandom.pop_back();
  449|   113k|    mapAddr.erase(info);
  450|   113k|    mapInfo.erase(nId);
  451|   113k|    nNew--;
  452|   113k|}
_ZN11AddrManImpl8Attempt_ERK8CServicebNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
  675|  6.18k|{
  676|  6.18k|    AssertLockHeld(cs);
  ------------------
  |  |  144|  6.18k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  677|       |
  678|  6.18k|    AddrInfo* pinfo = Find(addr);
  679|       |
  680|       |    // if not found, bail out
  681|  6.18k|    if (!pinfo)
  ------------------
  |  Branch (681:9): [True: 6.18k, False: 0]
  ------------------
  682|  6.18k|        return;
  683|       |
  684|      0|    AddrInfo& info = *pinfo;
  685|       |
  686|       |    // update info
  687|      0|    info.m_last_try = time;
  688|      0|    if (fCountFailure && info.m_last_count_attempt < m_last_good) {
  ------------------
  |  Branch (688:9): [True: 0, False: 0]
  |  Branch (688:26): [True: 0, False: 0]
  ------------------
  689|      0|        info.m_last_count_attempt = time;
  690|      0|        info.nAttempts++;
  691|      0|    }
  692|      0|}
_ZNK11AddrManImpl8GetAddr_EmmNSt3__18optionalI7NetworkEEb:
  794|  47.8k|{
  795|  47.8k|    AssertLockHeld(cs);
  ------------------
  |  |  144|  47.8k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  796|  47.8k|    Assume(max_pct <= 100);
  ------------------
  |  |  128|  47.8k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  797|       |
  798|  47.8k|    size_t nNodes = vRandom.size();
  799|  47.8k|    if (max_pct != 0) {
  ------------------
  |  Branch (799:9): [True: 27.6k, False: 20.1k]
  ------------------
  800|  27.6k|        max_pct = std::min(max_pct, size_t{100});
  801|  27.6k|        nNodes = max_pct * nNodes / 100;
  802|  27.6k|    }
  803|  47.8k|    if (max_addresses != 0) {
  ------------------
  |  Branch (803:9): [True: 27.9k, False: 19.8k]
  ------------------
  804|  27.9k|        nNodes = std::min(nNodes, max_addresses);
  805|  27.9k|    }
  806|       |
  807|       |    // gather a list of random nodes, skipping those of low quality
  808|  47.8k|    const auto now{Now<NodeSeconds>()};
  809|  47.8k|    std::vector<CAddress> addresses;
  810|  47.8k|    addresses.reserve(nNodes);
  811|   160k|    for (unsigned int n = 0; n < vRandom.size(); n++) {
  ------------------
  |  Branch (811:30): [True: 114k, False: 46.1k]
  ------------------
  812|   114k|        if (addresses.size() >= nNodes)
  ------------------
  |  Branch (812:13): [True: 1.61k, False: 112k]
  ------------------
  813|  1.61k|            break;
  814|       |
  815|   112k|        int nRndPos = insecure_rand.randrange(vRandom.size() - n) + n;
  816|   112k|        SwapRandom(n, nRndPos);
  817|   112k|        const auto it{mapInfo.find(vRandom[n])};
  818|   112k|        assert(it != mapInfo.end());
  ------------------
  |  Branch (818:9): [True: 112k, False: 0]
  ------------------
  819|       |
  820|   112k|        const AddrInfo& ai{it->second};
  821|       |
  822|       |        // Filter by network (optional)
  823|   112k|        if (network != std::nullopt && ai.GetNetClass() != network) continue;
  ------------------
  |  Branch (823:13): [True: 5.88k, False: 107k]
  |  Branch (823:13): [True: 3.67k, False: 109k]
  |  Branch (823:40): [True: 3.67k, False: 2.21k]
  ------------------
  824|       |
  825|       |        // Filter for quality
  826|   109k|        if (ai.IsTerrible(now) && filtered) continue;
  ------------------
  |  Branch (826:13): [True: 104k, False: 5.17k]
  |  Branch (826:35): [True: 100k, False: 3.04k]
  ------------------
  827|       |
  828|  8.22k|        addresses.push_back(ai);
  829|  8.22k|    }
  830|  47.8k|    LogDebug(BCLog::ADDRMAN, "GetAddr returned %d random addresses\n", addresses.size());
  ------------------
  |  |  143|  47.8k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  47.8k|    do {                                                                                      \
  |  |  |  |  137|  47.8k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 47.8k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  47.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 47.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  831|  47.8k|    return addresses;
  832|  47.8k|}
_ZNK11AddrManImpl5CheckEv:
 1031|   107k|{
 1032|   107k|    AssertLockHeld(cs);
  ------------------
  |  |  144|   107k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1033|       |
 1034|       |    // Run consistency checks 1 in m_consistency_check_ratio times if enabled
 1035|   107k|    if (m_consistency_check_ratio == 0) return;
  ------------------
  |  Branch (1035:9): [True: 107k, False: 0]
  ------------------
 1036|      0|    if (insecure_rand.randrange(m_consistency_check_ratio) >= 1) return;
  ------------------
  |  Branch (1036:9): [True: 0, False: 0]
  ------------------
 1037|       |
 1038|      0|    const int err{CheckAddrman()};
 1039|      0|    if (err) {
  ------------------
  |  Branch (1039:9): [True: 0, False: 0]
  ------------------
 1040|      0|        LogError("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i", err);
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1041|       |        assert(false);
  ------------------
  |  Branch (1041:9): [Folded, False: 0]
  ------------------
 1042|      0|    }
 1043|      0|}
_ZNK11AddrManImpl12CheckAddrmanEv:
 1046|  1.37k|{
 1047|  1.37k|    AssertLockHeld(cs);
  ------------------
  |  |  144|  1.37k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1048|       |
 1049|  1.37k|    LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE(
  ------------------
  |  |  106|  1.37k|    BCLog::Timer<std::chrono::milliseconds> BITCOIN_UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category, /* msg_on_completion=*/false)
  |  |  ------------------
  |  |  |  |   11|  1.37k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.37k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.37k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1050|  1.37k|        strprintf("new %i, tried %i, total %u", nNew, nTried, vRandom.size()), BCLog::ADDRMAN);
 1051|       |
 1052|  1.37k|    std::unordered_set<nid_type> setTried;
 1053|  1.37k|    std::unordered_map<nid_type, int> mapNew;
 1054|  1.37k|    std::unordered_map<Network, NewTriedCount> local_counts;
 1055|       |
 1056|  1.37k|    if (vRandom.size() != (size_t)(nTried + nNew))
  ------------------
  |  Branch (1056:9): [True: 0, False: 1.37k]
  ------------------
 1057|      0|        return -7;
 1058|       |
 1059|  3.38k|    for (const auto& entry : mapInfo) {
  ------------------
  |  Branch (1059:28): [True: 3.38k, False: 1.15k]
  ------------------
 1060|  3.38k|        nid_type n = entry.first;
 1061|  3.38k|        const AddrInfo& info = entry.second;
 1062|  3.38k|        if (info.fInTried) {
  ------------------
  |  Branch (1062:13): [True: 2.02k, False: 1.35k]
  ------------------
 1063|  2.02k|            if (!TicksSinceEpoch<std::chrono::seconds>(info.m_last_success)) {
  ------------------
  |  Branch (1063:17): [True: 50, False: 1.97k]
  ------------------
 1064|     50|                return -1;
 1065|     50|            }
 1066|  1.97k|            if (info.nRefCount)
  ------------------
  |  Branch (1066:17): [True: 0, False: 1.97k]
  ------------------
 1067|      0|                return -2;
 1068|  1.97k|            setTried.insert(n);
 1069|  1.97k|            local_counts[info.GetNetwork()].n_tried++;
 1070|  1.97k|        } else {
 1071|  1.35k|            if (info.nRefCount < 0 || info.nRefCount > ADDRMAN_NEW_BUCKETS_PER_ADDRESS)
  ------------------
  |  Branch (1071:17): [True: 0, False: 1.35k]
  |  Branch (1071:39): [True: 0, False: 1.35k]
  ------------------
 1072|      0|                return -3;
 1073|  1.35k|            if (!info.nRefCount)
  ------------------
  |  Branch (1073:17): [True: 0, False: 1.35k]
  ------------------
 1074|      0|                return -4;
 1075|  1.35k|            mapNew[n] = info.nRefCount;
 1076|  1.35k|            local_counts[info.GetNetwork()].n_new++;
 1077|  1.35k|        }
 1078|  3.33k|        const auto it{mapAddr.find(info)};
 1079|  3.33k|        if (it == mapAddr.end() || it->second != n) {
  ------------------
  |  Branch (1079:13): [True: 5, False: 3.33k]
  |  Branch (1079:13): [True: 7, False: 3.33k]
  |  Branch (1079:36): [True: 2, False: 3.33k]
  ------------------
 1080|      7|            return -5;
 1081|      7|        }
 1082|  3.33k|        if (info.nRandomPos < 0 || (size_t)info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n)
  ------------------
  |  Branch (1082:13): [True: 0, False: 3.33k]
  |  Branch (1082:36): [True: 0, False: 3.33k]
  |  Branch (1082:81): [True: 0, False: 3.33k]
  ------------------
 1083|      0|            return -14;
 1084|  3.33k|        if (info.m_last_try < NodeSeconds{0s}) {
  ------------------
  |  Branch (1084:13): [True: 0, False: 3.33k]
  ------------------
 1085|      0|            return -6;
 1086|      0|        }
 1087|  3.33k|        if (info.m_last_success < NodeSeconds{0s}) {
  ------------------
  |  Branch (1087:13): [True: 159, False: 3.17k]
  ------------------
 1088|    159|            return -8;
 1089|    159|        }
 1090|  3.33k|    }
 1091|       |
 1092|  1.15k|    if (setTried.size() != (size_t)nTried)
  ------------------
  |  Branch (1092:9): [True: 0, False: 1.15k]
  ------------------
 1093|      0|        return -9;
 1094|  1.15k|    if (mapNew.size() != (size_t)nNew)
  ------------------
  |  Branch (1094:9): [True: 0, False: 1.15k]
  ------------------
 1095|      0|        return -10;
 1096|       |
 1097|   297k|    for (int n = 0; n < ADDRMAN_TRIED_BUCKET_COUNT; n++) {
  ------------------
  |  Branch (1097:21): [True: 296k, False: 1.15k]
  ------------------
 1098|  19.2M|        for (int i = 0; i < ADDRMAN_BUCKET_SIZE; i++) {
  ------------------
  |  Branch (1098:25): [True: 18.9M, False: 296k]
  ------------------
 1099|  18.9M|            if (vvTried[n][i] != -1) {
  ------------------
  |  Branch (1099:17): [True: 1.70k, False: 18.9M]
  ------------------
 1100|  1.70k|                if (!setTried.contains(vvTried[n][i]))
  ------------------
  |  Branch (1100:21): [True: 0, False: 1.70k]
  ------------------
 1101|      0|                    return -11;
 1102|  1.70k|                const auto it{mapInfo.find(vvTried[n][i])};
 1103|  1.70k|                if (it == mapInfo.end() || it->second.GetTriedBucket(nKey, m_netgroupman) != n) {
  ------------------
  |  Branch (1103:21): [True: 0, False: 1.70k]
  |  Branch (1103:21): [True: 0, False: 1.70k]
  |  Branch (1103:44): [True: 0, False: 1.70k]
  ------------------
 1104|      0|                    return -17;
 1105|      0|                }
 1106|  1.70k|                if (it->second.GetBucketPosition(nKey, false, n) != i) {
  ------------------
  |  Branch (1106:21): [True: 0, False: 1.70k]
  ------------------
 1107|      0|                    return -18;
 1108|      0|                }
 1109|  1.70k|                setTried.erase(vvTried[n][i]);
 1110|  1.70k|            }
 1111|  18.9M|        }
 1112|   296k|    }
 1113|       |
 1114|  1.18M|    for (int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; n++) {
  ------------------
  |  Branch (1114:21): [True: 1.18M, False: 1.15k]
  ------------------
 1115|  77.0M|        for (int i = 0; i < ADDRMAN_BUCKET_SIZE; i++) {
  ------------------
  |  Branch (1115:25): [True: 75.8M, False: 1.18M]
  ------------------
 1116|  75.8M|            if (vvNew[n][i] != -1) {
  ------------------
  |  Branch (1116:17): [True: 1.31k, False: 75.8M]
  ------------------
 1117|  1.31k|                if (!mapNew.contains(vvNew[n][i]))
  ------------------
  |  Branch (1117:21): [True: 0, False: 1.31k]
  ------------------
 1118|      0|                    return -12;
 1119|  1.31k|                const auto it{mapInfo.find(vvNew[n][i])};
 1120|  1.31k|                if (it == mapInfo.end() || it->second.GetBucketPosition(nKey, true, n) != i) {
  ------------------
  |  Branch (1120:21): [True: 0, False: 1.31k]
  |  Branch (1120:21): [True: 0, False: 1.31k]
  |  Branch (1120:44): [True: 0, False: 1.31k]
  ------------------
 1121|      0|                    return -19;
 1122|      0|                }
 1123|  1.31k|                if (--mapNew[vvNew[n][i]] == 0)
  ------------------
  |  Branch (1123:21): [True: 1.23k, False: 73]
  ------------------
 1124|  1.23k|                    mapNew.erase(vvNew[n][i]);
 1125|  1.31k|            }
 1126|  75.8M|        }
 1127|  1.18M|    }
 1128|       |
 1129|  1.15k|    if (setTried.size())
  ------------------
  |  Branch (1129:9): [True: 0, False: 1.15k]
  ------------------
 1130|      0|        return -13;
 1131|  1.15k|    if (mapNew.size())
  ------------------
  |  Branch (1131:9): [True: 0, False: 1.15k]
  ------------------
 1132|      0|        return -15;
 1133|  1.15k|    if (nKey.IsNull())
  ------------------
  |  Branch (1133:9): [True: 4, False: 1.15k]
  ------------------
 1134|      4|        return -16;
 1135|       |
 1136|       |    // It's possible that m_network_counts may have all-zero entries that local_counts
 1137|       |    // doesn't have if addrs from a network were being added and then removed again in the past.
 1138|  1.15k|    if (m_network_counts.size() < local_counts.size()) {
  ------------------
  |  Branch (1138:9): [True: 0, False: 1.15k]
  ------------------
 1139|      0|        return -20;
 1140|      0|    }
 1141|  1.62k|    for (const auto& [net, count] : m_network_counts) {
  ------------------
  |  Branch (1141:35): [True: 1.62k, False: 1.15k]
  ------------------
 1142|  1.62k|        if (local_counts[net].n_new != count.n_new || local_counts[net].n_tried != count.n_tried) {
  ------------------
  |  Branch (1142:13): [True: 0, False: 1.62k]
  |  Branch (1142:55): [True: 0, False: 1.62k]
  ------------------
 1143|      0|            return -21;
 1144|      0|        }
 1145|  1.62k|    }
 1146|       |
 1147|  1.15k|    return 0;
 1148|  1.15k|}
_ZN11AddrManImpl7AttemptERK8CServicebNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
 1178|  6.18k|{
 1179|  6.18k|    LOCK(cs);
  ------------------
  |  |  268|  6.18k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  6.18k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  6.18k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  6.18k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1180|  6.18k|    Check();
 1181|  6.18k|    Attempt_(addr, fCountFailure, time);
 1182|  6.18k|    Check();
 1183|  6.18k|}
_ZNK11AddrManImpl7GetAddrEmmNSt3__18optionalI7NetworkEEb:
 1212|  47.8k|{
 1213|  47.8k|    LOCK(cs);
  ------------------
  |  |  268|  47.8k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  47.8k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  47.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  47.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1214|  47.8k|    Check();
 1215|  47.8k|    auto addresses = GetAddr_(max_addresses, max_pct, network, filtered);
 1216|  47.8k|    Check();
 1217|  47.8k|    return addresses;
 1218|  47.8k|}
_ZN7AddrManC2ERK15NetGroupManagerbi:
 1255|  12.9k|    : m_impl(std::make_unique<AddrManImpl>(netgroupman, deterministic, consistency_check_ratio)) {}
_ZN7AddrManD2Ev:
 1257|  12.9k|AddrMan::~AddrMan() = default;
_ZN7AddrMan11UnserializeI10DataStreamEEvRT_:
 1267|  4.23k|{
 1268|  4.23k|    m_impl->Unserialize<Stream>(s_);
 1269|  4.23k|}
_ZN7AddrMan7AttemptERK8CServicebNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
 1295|  6.18k|{
 1296|  6.18k|    m_impl->Attempt(addr, fCountFailure, time);
 1297|  6.18k|}
_ZNK7AddrMan7GetAddrEmmNSt3__18optionalI7NetworkEEb:
 1315|  47.8k|{
 1316|  47.8k|    return m_impl->GetAddr(max_addresses, max_pct, network, filtered);
 1317|  47.8k|}
_ZN11AddrManImpl11UnserializeI10DataStreamEEvRT_:
  213|  4.23k|{
  214|  4.23k|    LOCK(cs);
  ------------------
  |  |  268|  4.23k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.23k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.23k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.23k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|       |
  216|  4.23k|    assert(vRandom.empty());
  ------------------
  |  Branch (216:5): [True: 4.23k, False: 0]
  ------------------
  217|       |
  218|  4.23k|    Format format;
  219|  4.23k|    s_ >> Using<CustomUintFormatter<1>>(format);
  220|       |
  221|  4.23k|    const auto ser_params = (format >= Format::V3_BIP155 ? CAddress::V2_DISK : CAddress::V1_DISK);
  ------------------
  |  Branch (221:30): [True: 2.53k, False: 1.69k]
  ------------------
  222|  4.23k|    ParamsStream s{s_, ser_params};
  223|       |
  224|  4.23k|    uint8_t compat;
  225|  4.23k|    s >> compat;
  226|  4.23k|    if (compat < INCOMPATIBILITY_BASE) {
  ------------------
  |  Branch (226:9): [True: 385, False: 3.85k]
  ------------------
  227|    385|        throw std::ios_base::failure(strprintf(
  ------------------
  |  | 1172|    385|#define strprintf tfm::format
  ------------------
  228|    385|            "Corrupted addrman database: The compat value (%u) "
  229|    385|            "is lower than the expected minimum value %u.",
  230|    385|            compat, INCOMPATIBILITY_BASE));
  231|    385|    }
  232|  3.85k|    const uint8_t lowest_compatible = compat - INCOMPATIBILITY_BASE;
  233|  3.85k|    if (lowest_compatible > FILE_FORMAT) {
  ------------------
  |  Branch (233:9): [True: 728, False: 3.12k]
  ------------------
  234|    728|        throw InvalidAddrManVersionError(strprintf(
  ------------------
  |  | 1172|    728|#define strprintf tfm::format
  ------------------
  235|    728|            "Unsupported format of addrman database: %u. It is compatible with formats >=%u, "
  236|    728|            "but the maximum supported by this version of %s is %u.",
  237|    728|            uint8_t{format}, lowest_compatible, CLIENT_NAME, uint8_t{FILE_FORMAT}));
  ------------------
  |  |  101|    728|#define CLIENT_NAME "Bitcoin Core"
  ------------------
  238|    728|    }
  239|       |
  240|  3.12k|    s >> nKey;
  241|  3.12k|    s >> nNew;
  242|  3.12k|    s >> nTried;
  243|  3.12k|    int nUBuckets = 0;
  244|  3.12k|    s >> nUBuckets;
  245|  3.12k|    if (format >= Format::V1_DETERMINISTIC) {
  ------------------
  |  Branch (245:9): [True: 1.54k, False: 1.57k]
  ------------------
  246|  1.54k|        nUBuckets ^= (1 << 30);
  247|  1.54k|    }
  248|       |
  249|  3.12k|    if (nNew > ADDRMAN_NEW_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE || nNew < 0) {
  ------------------
  |  Branch (249:9): [True: 320, False: 2.80k]
  |  Branch (249:66): [True: 40, False: 2.76k]
  ------------------
  250|     62|        throw std::ios_base::failure(
  251|     62|                strprintf("Corrupt AddrMan serialization: nNew=%d, should be in [0, %d]",
  ------------------
  |  | 1172|     62|#define strprintf tfm::format
  ------------------
  252|     62|                    nNew,
  253|     62|                    ADDRMAN_NEW_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE));
  254|     62|    }
  255|       |
  256|  3.06k|    if (nTried > ADDRMAN_TRIED_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE || nTried < 0) {
  ------------------
  |  Branch (256:9): [True: 309, False: 2.75k]
  |  Branch (256:70): [True: 33, False: 2.71k]
  ------------------
  257|     44|        throw std::ios_base::failure(
  258|     44|                strprintf("Corrupt AddrMan serialization: nTried=%d, should be in [0, %d]",
  ------------------
  |  | 1172|     44|#define strprintf tfm::format
  ------------------
  259|     44|                    nTried,
  260|     44|                    ADDRMAN_TRIED_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE));
  261|     44|    }
  262|       |
  263|       |    // Deserialize entries from the new table.
  264|   205k|    for (int n = 0; n < nNew; n++) {
  ------------------
  |  Branch (264:21): [True: 202k, False: 3.01k]
  ------------------
  265|   202k|        AddrInfo& info = mapInfo[n];
  266|   202k|        s >> info;
  267|   202k|        mapAddr[info] = n;
  268|   202k|        info.nRandomPos = vRandom.size();
  269|   202k|        vRandom.push_back(n);
  270|   202k|        m_network_counts[info.GetNetwork()].n_new++;
  271|   202k|    }
  272|  3.01k|    nIdCount = nNew;
  273|       |
  274|       |    // Deserialize entries from the tried table.
  275|  3.01k|    int nLost = 0;
  276|  35.2k|    for (int n = 0; n < nTried; n++) {
  ------------------
  |  Branch (276:21): [True: 32.2k, False: 3.01k]
  ------------------
  277|  32.2k|        AddrInfo info;
  278|  32.2k|        s >> info;
  279|  32.2k|        int nKBucket = info.GetTriedBucket(nKey, m_netgroupman);
  280|  32.2k|        int nKBucketPos = info.GetBucketPosition(nKey, false, nKBucket);
  281|  32.2k|        if (info.IsValid()
  ------------------
  |  Branch (281:13): [True: 13.7k, False: 18.4k]
  ------------------
  282|  13.7k|                && vvTried[nKBucket][nKBucketPos] == -1) {
  ------------------
  |  Branch (282:20): [True: 4.19k, False: 9.58k]
  ------------------
  283|  4.19k|            info.nRandomPos = vRandom.size();
  284|  4.19k|            info.fInTried = true;
  285|  4.19k|            vRandom.push_back(nIdCount);
  286|  4.19k|            mapInfo[nIdCount] = info;
  287|  4.19k|            mapAddr[info] = nIdCount;
  288|  4.19k|            vvTried[nKBucket][nKBucketPos] = nIdCount;
  289|  4.19k|            nIdCount++;
  290|  4.19k|            m_network_counts[info.GetNetwork()].n_tried++;
  291|  28.0k|        } else {
  292|  28.0k|            nLost++;
  293|  28.0k|        }
  294|  32.2k|    }
  295|  3.01k|    nTried -= nLost;
  296|       |
  297|       |    // Store positions in the new table buckets to apply later (if possible).
  298|       |    // An entry may appear in up to ADDRMAN_NEW_BUCKETS_PER_ADDRESS buckets,
  299|       |    // so we store all bucket-entry_index pairs to iterate through later.
  300|  3.01k|    std::vector<std::pair<int, int>> bucket_entries;
  301|       |
  302|  38.5k|    for (int bucket = 0; bucket < nUBuckets; ++bucket) {
  ------------------
  |  Branch (302:26): [True: 35.5k, False: 3.01k]
  ------------------
  303|  35.5k|        int num_entries{0};
  304|  35.5k|        s >> num_entries;
  305|   438k|        for (int n = 0; n < num_entries; ++n) {
  ------------------
  |  Branch (305:25): [True: 402k, False: 35.5k]
  ------------------
  306|   402k|            int entry_index{0};
  307|   402k|            s >> entry_index;
  308|   402k|            if (entry_index >= 0 && entry_index < nNew) {
  ------------------
  |  Branch (308:17): [True: 397k, False: 5.28k]
  |  Branch (308:37): [True: 301k, False: 95.6k]
  ------------------
  309|   301k|                bucket_entries.emplace_back(bucket, entry_index);
  310|   301k|            }
  311|   402k|        }
  312|  35.5k|    }
  313|       |
  314|       |    // If the bucket count and asmap version haven't changed, then attempt
  315|       |    // to restore the entries to the buckets/positions they were in before
  316|       |    // serialization.
  317|  3.01k|    uint256 supplied_asmap_version{m_netgroupman.GetAsmapVersion()};
  318|  3.01k|    uint256 serialized_asmap_version;
  319|  3.01k|    if (format >= Format::V2_ASMAP) {
  ------------------
  |  Branch (319:9): [True: 336, False: 2.68k]
  ------------------
  320|    336|        s >> serialized_asmap_version;
  321|    336|    }
  322|  3.01k|    const bool restore_bucketing{nUBuckets == ADDRMAN_NEW_BUCKET_COUNT &&
  ------------------
  |  Branch (322:34): [True: 26, False: 2.99k]
  ------------------
  323|     26|        serialized_asmap_version == supplied_asmap_version};
  ------------------
  |  Branch (323:9): [True: 24, False: 2]
  ------------------
  324|       |
  325|  3.01k|    if (!restore_bucketing) {
  ------------------
  |  Branch (325:9): [True: 1.34k, False: 1.66k]
  ------------------
  326|  1.34k|        LogDebug(BCLog::ADDRMAN, "Bucketing method was updated, re-bucketing addrman entries from disk\n");
  ------------------
  |  |  143|  1.34k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  1.34k|    do {                                                                                      \
  |  |  |  |  137|  1.34k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 1.34k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  1.34k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 1.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  327|  1.34k|    }
  328|       |
  329|  28.5k|    for (auto bucket_entry : bucket_entries) {
  ------------------
  |  Branch (329:28): [True: 28.5k, False: 3.01k]
  ------------------
  330|  28.5k|        int bucket{bucket_entry.first};
  331|  28.5k|        const int entry_index{bucket_entry.second};
  332|  28.5k|        AddrInfo& info = mapInfo[entry_index];
  333|       |
  334|       |        // Don't store the entry in the new bucket if it's not a valid address for our addrman
  335|  28.5k|        if (!info.IsValid()) continue;
  ------------------
  |  Branch (335:13): [True: 448, False: 28.1k]
  ------------------
  336|       |
  337|       |        // The entry shouldn't appear in more than
  338|       |        // ADDRMAN_NEW_BUCKETS_PER_ADDRESS. If it has already, just skip
  339|       |        // this bucket_entry.
  340|  28.1k|        if (info.nRefCount >= ADDRMAN_NEW_BUCKETS_PER_ADDRESS) continue;
  ------------------
  |  Branch (340:13): [True: 461, False: 27.6k]
  ------------------
  341|       |
  342|  27.6k|        int bucket_position = info.GetBucketPosition(nKey, true, bucket);
  343|  27.6k|        if (restore_bucketing && vvNew[bucket][bucket_position] == -1) {
  ------------------
  |  Branch (343:13): [True: 497, False: 27.1k]
  |  Branch (343:34): [True: 138, False: 359]
  ------------------
  344|       |            // Bucketing has not changed, using existing bucket positions for the new table
  345|    138|            vvNew[bucket][bucket_position] = entry_index;
  346|    138|            ++info.nRefCount;
  347|  27.5k|        } else {
  348|       |            // In case the new table data cannot be used (bucket count wrong or new asmap),
  349|       |            // try to give them a reference based on their primary source address.
  350|  27.5k|            bucket = info.GetNewBucket(nKey, m_netgroupman);
  351|  27.5k|            bucket_position = info.GetBucketPosition(nKey, true, bucket);
  352|  27.5k|            if (vvNew[bucket][bucket_position] == -1) {
  ------------------
  |  Branch (352:17): [True: 1.37k, False: 26.1k]
  ------------------
  353|  1.37k|                vvNew[bucket][bucket_position] = entry_index;
  354|  1.37k|                ++info.nRefCount;
  355|  1.37k|            }
  356|  27.5k|        }
  357|  27.6k|    }
  358|       |
  359|       |    // Prune new entries with refcount 0 (as a result of collisions or invalid address).
  360|  3.01k|    int nLostUnk = 0;
  361|   119k|    for (auto it = mapInfo.cbegin(); it != mapInfo.cend(); ) {
  ------------------
  |  Branch (361:38): [True: 116k, False: 3.01k]
  ------------------
  362|   116k|        if (it->second.fInTried == false && it->second.nRefCount == 0) {
  ------------------
  |  Branch (362:13): [True: 114k, False: 2.44k]
  |  Branch (362:45): [True: 113k, False: 1.38k]
  ------------------
  363|   113k|            const auto itCopy = it++;
  364|   113k|            Delete(itCopy->first);
  365|   113k|            ++nLostUnk;
  366|   113k|        } else {
  367|  3.82k|            ++it;
  368|  3.82k|        }
  369|   116k|    }
  370|  3.01k|    if (nLost + nLostUnk > 0) {
  ------------------
  |  Branch (370:9): [True: 639, False: 2.37k]
  ------------------
  371|    639|        LogDebug(BCLog::ADDRMAN, "addrman lost %i new and %i tried addresses due to collisions or invalid addresses\n", nLostUnk, nLost);
  ------------------
  |  |  143|    639|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    639|    do {                                                                                      \
  |  |  |  |  137|    639|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 639]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    639|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 639]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|    639|    }
  373|       |
  374|  3.01k|    const int check_code{CheckAddrman()};
  375|  3.01k|    if (check_code != 0) {
  ------------------
  |  Branch (375:9): [True: 220, False: 2.79k]
  ------------------
  376|    220|        throw std::ios_base::failure(strprintf(
  ------------------
  |  | 1172|    220|#define strprintf tfm::format
  ------------------
  377|    220|            "Corrupt data. Consistency check failed with code %s",
  378|    220|            check_code));
  379|    220|    }
  380|  3.01k|}

_ZN26InvalidAddrManVersionErrorC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   49|    728|    InvalidAddrManVersionError(std::string msg) : std::ios_base::failure(msg) { }

_ZNK8AddrInfo12GetNewBucketERK7uint256RK15NetGroupManager:
   93|  27.5k|    {
   94|  27.5k|        return GetNewBucket(nKey, source, netgroupman);
   95|  27.5k|    }
_ZN8AddrInfoC2Ev:
   81|   239k|    AddrInfo() : CAddress(), source()
   82|   239k|    {
   83|   239k|    }
_ZN8AddrInfo16SerializationOpsI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_:
   73|   235k|    {
   74|   235k|        READWRITE(AsBase<CAddress>(obj), obj.source, Using<ChronoFormatter<int64_t>>(obj.m_last_success), obj.nAttempts);
  ------------------
  |  |  148|   235k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   75|   235k|    }

_ZN6BanManD2Ev:
   25|      2|{
   26|      2|    DumpBanlist();
   27|      2|}
_ZN6BanMan11DumpBanlistEv:
   49|      2|{
   50|      2|    static Mutex dump_mutex;
   51|      2|    LOCK(dump_mutex);
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   52|       |
   53|      2|    banmap_t banmap;
   54|      2|    {
   55|      2|        LOCK(m_banned_mutex);
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|      2|        SweepBanned();
   57|      2|        if (!m_is_dirty) return;
  ------------------
  |  Branch (57:13): [True: 2, False: 0]
  ------------------
   58|      0|        banmap = m_banned;
   59|      0|        m_is_dirty = false;
   60|      0|    }
   61|       |
   62|      0|    const auto start{SteadyClock::now()};
   63|      0|    if (!m_ban_db.Write(banmap)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 0]
  ------------------
   64|      0|        LOCK(m_banned_mutex);
  ------------------
  |  |  268|      0|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|      0|        m_is_dirty = true;
   66|      0|    }
   67|       |
   68|      0|    LogDebug(BCLog::NET, "Flushed %d banned node addresses/subnets to disk %dms", banmap.size(),
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   69|      0|             Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
   70|      0|}
_ZN6BanMan11SweepBannedEv:
  183|      2|{
  184|      2|    AssertLockHeld(m_banned_mutex);
  ------------------
  |  |  144|      2|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  185|       |
  186|      2|    int64_t now = GetTime();
  187|      2|    bool notify_ui = false;
  188|      2|    banmap_t::iterator it = m_banned.begin();
  189|      2|    while (it != m_banned.end()) {
  ------------------
  |  Branch (189:12): [True: 0, False: 2]
  ------------------
  190|      0|        CSubNet sub_net = (*it).first;
  191|      0|        CBanEntry ban_entry = (*it).second;
  192|      0|        if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  |  Branch (192:35): [True: 0, False: 0]
  ------------------
  193|      0|            m_banned.erase(it++);
  194|      0|            m_is_dirty = true;
  195|      0|            notify_ui = true;
  196|      0|            LogDebug(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|      0|        } else {
  198|      0|            ++it;
  199|      0|        }
  200|      0|    }
  201|       |
  202|       |    // update UI
  203|      2|    if (notify_ui && m_client_interface) {
  ------------------
  |  Branch (203:9): [True: 0, False: 2]
  |  Branch (203:22): [True: 0, False: 0]
  ------------------
  204|      0|        m_client_interface->BannedListChanged();
  205|      0|    }
  206|      2|}

_ZN12BIP324CipherC2ERK4CKeyNSt3__14spanIKSt4byteLm18446744073709551615EEE:
   26|   256k|    : m_key(key)
   27|   256k|{
   28|   256k|    m_our_pubkey = m_key.EllSwiftCreate(ent32);
   29|   256k|}
_ZN12BIP324Cipher10InitializeERK14EllSwiftPubKeybb:
   35|  18.8k|{
   36|       |    // Determine salt (fixed string + network magic bytes)
   37|  18.8k|    const auto& message_header = Params().MessageStart();
   38|  18.8k|    std::string salt = std::string{"bitcoin_v2_shared_secret"} + std::string(std::begin(message_header), std::end(message_header));
   39|       |
   40|       |    // Perform ECDH to derive shared secret.
   41|  18.8k|    ECDHSecret ecdh_secret = m_key.ComputeBIP324ECDHSecret(their_pubkey, m_our_pubkey, initiator);
   42|       |
   43|       |    // Derive encryption keys from shared secret, and initialize stream ciphers and AEADs.
   44|  18.8k|    bool side = (initiator != self_decrypt);
   45|  18.8k|    CHKDF_HMAC_SHA256_L32 hkdf(UCharCast(ecdh_secret.data()), ecdh_secret.size(), salt);
   46|  18.8k|    std::array<std::byte, 32> hkdf_32_okm;
   47|  18.8k|    hkdf.Expand32("initiator_L", UCharCast(hkdf_32_okm.data()));
   48|  18.8k|    (side ? m_send_l_cipher : m_recv_l_cipher).emplace(hkdf_32_okm, REKEY_INTERVAL);
  ------------------
  |  Branch (48:6): [True: 46, False: 18.8k]
  ------------------
   49|  18.8k|    hkdf.Expand32("initiator_P", UCharCast(hkdf_32_okm.data()));
   50|  18.8k|    (side ? m_send_p_cipher : m_recv_p_cipher).emplace(hkdf_32_okm, REKEY_INTERVAL);
  ------------------
  |  Branch (50:6): [True: 46, False: 18.8k]
  ------------------
   51|  18.8k|    hkdf.Expand32("responder_L", UCharCast(hkdf_32_okm.data()));
   52|  18.8k|    (side ? m_recv_l_cipher : m_send_l_cipher).emplace(hkdf_32_okm, REKEY_INTERVAL);
  ------------------
  |  Branch (52:6): [True: 46, False: 18.8k]
  ------------------
   53|  18.8k|    hkdf.Expand32("responder_P", UCharCast(hkdf_32_okm.data()));
   54|  18.8k|    (side ? m_recv_p_cipher : m_send_p_cipher).emplace(hkdf_32_okm, REKEY_INTERVAL);
  ------------------
  |  Branch (54:6): [True: 46, False: 18.8k]
  ------------------
   55|       |
   56|       |    // Derive garbage terminators from shared secret.
   57|  18.8k|    hkdf.Expand32("garbage_terminators", UCharCast(hkdf_32_okm.data()));
   58|  18.8k|    std::copy(std::begin(hkdf_32_okm), std::begin(hkdf_32_okm) + GARBAGE_TERMINATOR_LEN,
   59|  18.8k|        (initiator ? m_send_garbage_terminator : m_recv_garbage_terminator).begin());
  ------------------
  |  Branch (59:10): [True: 46, False: 18.8k]
  ------------------
   60|  18.8k|    std::copy(std::end(hkdf_32_okm) - GARBAGE_TERMINATOR_LEN, std::end(hkdf_32_okm),
   61|  18.8k|        (initiator ? m_recv_garbage_terminator : m_send_garbage_terminator).begin());
  ------------------
  |  Branch (61:10): [True: 46, False: 18.8k]
  ------------------
   62|       |
   63|       |    // Derive session id from shared secret.
   64|  18.8k|    hkdf.Expand32("session_id", UCharCast(m_session_id.data()));
   65|       |
   66|       |    // Wipe all variables that contain information which could be used to re-derive encryption keys.
   67|  18.8k|    memory_cleanse(ecdh_secret.data(), ecdh_secret.size());
   68|  18.8k|    memory_cleanse(hkdf_32_okm.data(), sizeof(hkdf_32_okm));
   69|  18.8k|    memory_cleanse(&hkdf, sizeof(hkdf));
   70|  18.8k|    m_key = CKey();
   71|  18.8k|}
_ZN12BIP324Cipher7EncryptENSt3__14spanIKSt4byteLm18446744073709551615EEES4_bNS1_IS2_Lm18446744073709551615EEE:
   74|  18.8k|{
   75|  18.8k|    assert(output.size() == contents.size() + EXPANSION);
  ------------------
  |  Branch (75:5): [True: 18.8k, False: 0]
  ------------------
   76|       |
   77|       |    // Encrypt length.
   78|  18.8k|    std::byte len[LENGTH_LEN];
   79|  18.8k|    len[0] = std::byte{(uint8_t)(contents.size() & 0xFF)};
   80|  18.8k|    len[1] = std::byte{(uint8_t)((contents.size() >> 8) & 0xFF)};
   81|  18.8k|    len[2] = std::byte{(uint8_t)((contents.size() >> 16) & 0xFF)};
   82|  18.8k|    m_send_l_cipher->Crypt(len, output.first(LENGTH_LEN));
   83|       |
   84|       |    // Encrypt plaintext.
   85|  18.8k|    std::byte header[HEADER_LEN] = {ignore ? IGNORE_BIT : std::byte{0}};
  ------------------
  |  Branch (85:37): [True: 0, False: 18.8k]
  ------------------
   86|  18.8k|    m_send_p_cipher->Encrypt(header, contents, aad, output.subspan(LENGTH_LEN));
   87|  18.8k|}

_ZNK12BIP324Cipher12GetOurPubKeyEv:
   56|  39.6k|    const EllSwiftPubKey& GetOurPubKey() const noexcept { return m_our_pubkey; }
_ZNK12BIP324Cipher24GetSendGarbageTerminatorEv:
   92|  37.7k|    std::span<const std::byte> GetSendGarbageTerminator() const noexcept { return m_send_garbage_terminator; }
_ZNK12BIP324Cipher27GetReceiveGarbageTerminatorEv:
   95|  76.5M|    std::span<const std::byte> GetReceiveGarbageTerminator() const noexcept { return m_recv_garbage_terminator; }

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

_ZN11CCheckQueueI12CScriptCheckNSt3__14pairI13ScriptError_tNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEED2Ev:
  193|      2|    {
  194|      2|        WITH_LOCK(m_mutex, m_request_stop = true);
  ------------------
  |  |  299|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  195|      2|        m_worker_cv.notify_all();
  196|      2|        for (std::thread& t : m_worker_threads) {
  ------------------
  |  Branch (196:29): [True: 0, False: 2]
  ------------------
  197|      0|            t.join();
  198|      0|        }
  199|      2|    }

_ZN10CCoinsViewD2Ev:
  359|      8|    virtual ~CCoinsView() = default;
_ZN16CCoinsCacheEntryD2Ev:
  179|      4|    {
  180|      4|        SetClean();
  181|      4|    }
_ZN16CCoinsCacheEntry8SetCleanEv:
  187|      4|    {
  188|      4|        if (!m_flags) return;
  ------------------
  |  Branch (188:13): [True: 0, False: 4]
  ------------------
  189|      4|        m_next->second.m_prev = m_prev;
  190|      4|        m_prev->second.m_next = m_next;
  191|      4|        m_flags = 0;
  192|      4|        m_prev = m_next = nullptr;
  193|      4|    }
_ZN16CoinsViewOverlayD2Ev:
  758|      2|    ~CoinsViewOverlay() noexcept override { StopFetching(); }
_ZN16CoinsViewOverlay12StopFetchingEv:
  705|      2|    {
  706|      2|        if (m_futures.empty()) {
  ------------------
  |  Branch (706:13): [True: 2, False: 0]
  ------------------
  707|      2|            Assert(m_inputs.empty());
  ------------------
  |  |  116|      2|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
  708|      2|            Assert(m_input_head.load(std::memory_order_relaxed) == 0);
  ------------------
  |  |  116|      2|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
  709|      2|            Assert(m_input_tail == 0);
  ------------------
  |  |  116|      2|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
  710|      2|            return;
  711|      2|        }
  712|       |        // Skip fetching the rest of the inputs by moving the head to the end.
  713|      0|        m_input_head.store(m_inputs.size(), std::memory_order_relaxed);
  714|       |        // Wait for all threads to stop.
  715|      0|        for (auto& future : m_futures) future.wait();
  ------------------
  |  Branch (715:27): [True: 0, False: 0]
  ------------------
  716|      0|        m_futures.clear();
  717|      0|        m_inputs.clear();
  718|      0|        m_input_head.store(0, std::memory_order_relaxed);
  719|      0|        m_input_tail = 0;
  720|      0|    }

_ZN11ArgsManagerD2Ev:
  130|      4|ArgsManager::~ArgsManager() = default;
_ZNK11ArgsManager7GetArgsERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  423|  26.7k|{
  424|  26.7k|    std::vector<std::string> result;
  425|  26.7k|    for (const common::SettingsValue& value : GetSettingsList(strArg)) {
  ------------------
  |  Branch (425:45): [True: 0, False: 26.7k]
  ------------------
  426|      0|        result.push_back(value.isFalse() ? "0" : value.isTrue() ? "1" : value.get_str());
  ------------------
  |  Branch (426:26): [True: 0, False: 0]
  |  Branch (426:50): [True: 0, False: 0]
  ------------------
  427|      0|    }
  428|  26.7k|    return result;
  429|  26.7k|}
_ZNK11ArgsManager6GetArgITkNSt3__18integralElEET_RKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES2_:
  544|  26.3k|{
  545|  26.3k|    return GetArg<Int>(strArg).value_or(nDefault);
  546|  26.3k|}
_ZNK11ArgsManager6GetArgITkNSt3__18integralElEENS1_8optionalIT_EERKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  550|  26.3k|{
  551|  26.3k|    const common::SettingsValue value = GetSetting(strArg);
  552|  26.3k|    return SettingTo<Int>(value);
  553|  26.3k|}
_Z9SettingToITkNSt3__18integralElENS0_8optionalIT_EERK8UniValue:
  557|  26.3k|{
  558|  26.3k|    if (value.isNull()) return std::nullopt;
  ------------------
  |  Branch (558:9): [True: 26.3k, False: 0]
  ------------------
  559|      0|    if (value.isFalse()) return 0;
  ------------------
  |  Branch (559:9): [True: 0, False: 0]
  ------------------
  560|      0|    if (value.isTrue()) return 1;
  ------------------
  |  Branch (560:9): [True: 0, False: 0]
  ------------------
  561|      0|    if (value.isNum()) return value.getInt<Int>();
  ------------------
  |  Branch (561:9): [True: 0, False: 0]
  ------------------
  562|      0|    return LocaleIndependentAtoi<Int>(value.get_str());
  563|      0|}
_ZN11ArgsManager11ForceSetArgERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  628|      2|{
  629|      2|    LOCK(cs_args);
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|      2|    m_settings.forced_settings[SettingName(strArg)] = strValue;
  631|      2|}
_ZN11ArgsManager9ClearArgsEv:
  694|      2|{
  695|      2|    LOCK(cs_args);
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|      2|    m_settings = {};
  697|      2|    m_available_args.clear();
  698|      2|    m_command_args.clear();
  699|      2|    m_network_only_args.clear();
  700|      2|    m_config_sections.clear();
  701|      2|}
_ZNK11ArgsManager17UseDefaultSectionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  957|  53.0k|{
  958|  53.0k|    AssertLockHeld(cs_args);
  ------------------
  |  |  144|  53.0k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  959|  53.0k|    return m_network == ChainTypeToString(ChainType::MAIN) || !m_network_only_args.contains(arg);
  ------------------
  |  Branch (959:12): [True: 0, False: 53.0k]
  |  Branch (959:63): [True: 26.3k, False: 26.7k]
  ------------------
  960|  53.0k|}
_ZNK11ArgsManager11GetSetting_ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  963|  26.3k|{
  964|  26.3k|    AssertLockHeld(cs_args);
  ------------------
  |  |  144|  26.3k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  965|  26.3k|    return common::GetSetting(
  966|  26.3k|        m_settings, m_network, SettingName(arg), !UseDefaultSection(arg),
  967|  26.3k|        /*ignore_nonpersistent=*/false, /*get_chain_type=*/false);
  968|  26.3k|}
_ZNK11ArgsManager10GetSettingERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  971|  26.3k|{
  972|  26.3k|    LOCK(cs_args);
  ------------------
  |  |  268|  26.3k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  26.3k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  26.3k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  26.3k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|  26.3k|    return GetSetting_(arg);
  974|  26.3k|}
_ZNK11ArgsManager15GetSettingsListERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  977|  26.7k|{
  978|  26.7k|    LOCK(cs_args);
  ------------------
  |  |  268|  26.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  26.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  26.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  26.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  979|  26.7k|    return common::GetSettingsList(m_settings, m_network, SettingName(arg), !UseDefaultSection(arg));
  980|  26.7k|}
args.cpp:_ZL11SettingNameRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
   63|  53.0k|{
   64|  53.0k|    return arg.size() > 0 && arg[0] == '-' ? arg.substr(1) : arg;
  ------------------
  |  Branch (64:12): [True: 53.0k, False: 0]
  |  Branch (64:30): [True: 53.0k, False: 0]
  ------------------
   65|  53.0k|}

_ZNK11ArgsManager9GetIntArgERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEl:
  323|  26.3k|    int64_t GetIntArg(const std::string& strArg, int64_t nDefault) const EXCLUSIVE_LOCKS_REQUIRED(!cs_args) { return GetArg<int64_t>(strArg, nDefault); }

_ZN6common10GetSettingERKNS_8SettingsERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_bbb:
  159|  26.3k|{
  160|  26.3k|    SettingsValue result;
  161|  26.3k|    bool done = false; // Done merging any more settings sources.
  162|  26.3k|    MergeSettings(settings, section, name, [&](SettingsSpan span, Source source) {
  163|       |        // Weird behavior preserved for backwards compatibility: Apply negated
  164|       |        // setting even if non-negated setting would be ignored. A negated
  165|       |        // value in the default section is applied to network specific options,
  166|       |        // even though normal non-negated values there would be ignored.
  167|  26.3k|        const bool never_ignore_negated_setting = span.last_negated();
  168|       |
  169|       |        // Weird behavior preserved for backwards compatibility: Take first
  170|       |        // assigned value instead of last. In general, later settings take
  171|       |        // precedence over early settings, but for backwards compatibility in
  172|       |        // the config file the precedence is reversed for all settings except
  173|       |        // chain type settings.
  174|  26.3k|        const bool reverse_precedence =
  175|  26.3k|            (source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
  176|  26.3k|            !get_chain_type;
  177|       |
  178|       |        // Weird behavior preserved for backwards compatibility: Negated
  179|       |        // -regtest and -testnet arguments which you would expect to override
  180|       |        // values set in the configuration file are currently accepted but
  181|       |        // silently ignored. It would be better to apply these just like other
  182|       |        // negated values, or at least warn they are ignored.
  183|  26.3k|        const bool skip_negated_command_line = get_chain_type;
  184|       |
  185|  26.3k|        if (done) return;
  186|       |
  187|       |        // Ignore settings in default config section if requested.
  188|  26.3k|        if (ignore_default_section_config && source == Source::CONFIG_FILE_DEFAULT_SECTION &&
  189|  26.3k|            !never_ignore_negated_setting) {
  190|  26.3k|            return;
  191|  26.3k|        }
  192|       |
  193|       |        // Ignore nonpersistent settings if requested.
  194|  26.3k|        if (ignore_nonpersistent && (source == Source::COMMAND_LINE || source == Source::FORCED)) return;
  195|       |
  196|       |        // Skip negated command line settings.
  197|  26.3k|        if (skip_negated_command_line && span.last_negated()) return;
  198|       |
  199|  26.3k|        if (!span.empty()) {
  200|  26.3k|            result = reverse_precedence ? span.begin()[0] : span.end()[-1];
  201|  26.3k|            done = true;
  202|  26.3k|        } else if (span.last_negated()) {
  203|  26.3k|            result = false;
  204|  26.3k|            done = true;
  205|  26.3k|        }
  206|  26.3k|    });
  207|  26.3k|    return result;
  208|  26.3k|}
_ZN6common15GetSettingsListERKNS_8SettingsERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_b:
  214|  26.7k|{
  215|  26.7k|    std::vector<SettingsValue> result;
  216|  26.7k|    bool done = false; // Done merging any more settings sources.
  217|  26.7k|    bool prev_negated_empty = false;
  218|  26.7k|    MergeSettings(settings, section, name, [&](SettingsSpan span, Source source) {
  219|       |        // Weird behavior preserved for backwards compatibility: Apply config
  220|       |        // file settings even if negated on command line. Negating a setting on
  221|       |        // command line will ignore earlier settings on the command line and
  222|       |        // ignore settings in the config file, unless the negated command line
  223|       |        // value is followed by non-negated value, in which case config file
  224|       |        // settings will be brought back from the dead (but earlier command
  225|       |        // line settings will still be ignored).
  226|  26.7k|        const bool add_zombie_config_values =
  227|  26.7k|            (source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
  228|  26.7k|            !prev_negated_empty;
  229|       |
  230|       |        // Ignore settings in default config section if requested.
  231|  26.7k|        if (ignore_default_section_config && source == Source::CONFIG_FILE_DEFAULT_SECTION) return;
  232|       |
  233|       |        // Add new settings to the result if isn't already complete, or if the
  234|       |        // values are zombies.
  235|  26.7k|        if (!done || add_zombie_config_values) {
  236|  26.7k|            for (const auto& value : span) {
  237|  26.7k|                if (value.isArray()) {
  238|  26.7k|                    result.insert(result.end(), value.getValues().begin(), value.getValues().end());
  239|  26.7k|                } else {
  240|  26.7k|                    result.push_back(value);
  241|  26.7k|                }
  242|  26.7k|            }
  243|  26.7k|        }
  244|       |
  245|       |        // If a setting was negated, or if a setting was forced, set
  246|       |        // done to true to ignore any later lower priority settings.
  247|  26.7k|        done |= span.negated() > 0 || source == Source::FORCED;
  248|       |
  249|       |        // Update the negated and empty state used for the zombie values check.
  250|  26.7k|        prev_negated_empty |= span.last_negated() && result.empty();
  251|  26.7k|    });
  252|  26.7k|    return result;
  253|  26.7k|}
settings.cpp:_ZN6common12_GLOBAL__N_113MergeSettingsIZNS_10GetSettingERKNS_8SettingsERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEESD_bbbE3$_0EEvS4_SD_SD_OT_:
   41|  26.3k|{
   42|       |    // Merge in the forced settings
   43|  26.3k|    if (auto* value = FindKey(settings.forced_settings, name)) {
  ------------------
  |  Branch (43:15): [True: 0, False: 26.3k]
  ------------------
   44|      0|        fn(SettingsSpan(*value), Source::FORCED);
   45|      0|    }
   46|       |    // Merge in the command-line options
   47|  26.3k|    if (auto* values = FindKey(settings.command_line_options, name)) {
  ------------------
  |  Branch (47:15): [True: 0, False: 26.3k]
  ------------------
   48|      0|        fn(SettingsSpan(*values), Source::COMMAND_LINE);
   49|      0|    }
   50|       |    // Merge in the read-write settings
   51|  26.3k|    if (const SettingsValue* value = FindKey(settings.rw_settings, name)) {
  ------------------
  |  Branch (51:30): [True: 0, False: 26.3k]
  ------------------
   52|      0|        fn(SettingsSpan(*value), Source::RW_SETTINGS);
   53|      0|    }
   54|       |    // Merge in the network-specific section of the config file
   55|  26.3k|    if (!section.empty()) {
  ------------------
  |  Branch (55:9): [True: 26.3k, False: 0]
  ------------------
   56|  26.3k|        if (auto* map = FindKey(settings.ro_config, section)) {
  ------------------
  |  Branch (56:19): [True: 0, False: 26.3k]
  ------------------
   57|      0|            if (auto* values = FindKey(*map, name)) {
  ------------------
  |  Branch (57:23): [True: 0, False: 0]
  ------------------
   58|      0|                fn(SettingsSpan(*values), Source::CONFIG_FILE_NETWORK_SECTION);
   59|      0|            }
   60|      0|        }
   61|  26.3k|    }
   62|       |    // Merge in the default section of the config file
   63|  26.3k|    if (auto* map = FindKey(settings.ro_config, "")) {
  ------------------
  |  Branch (63:15): [True: 0, False: 26.3k]
  ------------------
   64|      0|        if (auto* values = FindKey(*map, name)) {
  ------------------
  |  Branch (64:19): [True: 0, False: 0]
  ------------------
   65|      0|            fn(SettingsSpan(*values), Source::CONFIG_FILE_DEFAULT_SECTION);
   66|      0|        }
   67|      0|    }
   68|  26.3k|}
settings.cpp:_ZN6common12_GLOBAL__N_113MergeSettingsIZNS_15GetSettingsListERKNS_8SettingsERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEESD_bE3$_0EEvS4_SD_SD_OT_:
   41|  26.7k|{
   42|       |    // Merge in the forced settings
   43|  26.7k|    if (auto* value = FindKey(settings.forced_settings, name)) {
  ------------------
  |  Branch (43:15): [True: 0, False: 26.7k]
  ------------------
   44|      0|        fn(SettingsSpan(*value), Source::FORCED);
   45|      0|    }
   46|       |    // Merge in the command-line options
   47|  26.7k|    if (auto* values = FindKey(settings.command_line_options, name)) {
  ------------------
  |  Branch (47:15): [True: 0, False: 26.7k]
  ------------------
   48|      0|        fn(SettingsSpan(*values), Source::COMMAND_LINE);
   49|      0|    }
   50|       |    // Merge in the read-write settings
   51|  26.7k|    if (const SettingsValue* value = FindKey(settings.rw_settings, name)) {
  ------------------
  |  Branch (51:30): [True: 0, False: 26.7k]
  ------------------
   52|      0|        fn(SettingsSpan(*value), Source::RW_SETTINGS);
   53|      0|    }
   54|       |    // Merge in the network-specific section of the config file
   55|  26.7k|    if (!section.empty()) {
  ------------------
  |  Branch (55:9): [True: 26.7k, False: 0]
  ------------------
   56|  26.7k|        if (auto* map = FindKey(settings.ro_config, section)) {
  ------------------
  |  Branch (56:19): [True: 0, False: 26.7k]
  ------------------
   57|      0|            if (auto* values = FindKey(*map, name)) {
  ------------------
  |  Branch (57:23): [True: 0, False: 0]
  ------------------
   58|      0|                fn(SettingsSpan(*values), Source::CONFIG_FILE_NETWORK_SECTION);
   59|      0|            }
   60|      0|        }
   61|  26.7k|    }
   62|       |    // Merge in the default section of the config file
   63|  26.7k|    if (auto* map = FindKey(settings.ro_config, "")) {
  ------------------
  |  Branch (63:15): [True: 0, False: 26.7k]
  ------------------
   64|      0|        if (auto* values = FindKey(*map, name)) {
  ------------------
  |  Branch (64:19): [True: 0, False: 0]
  ------------------
   65|      0|            fn(SettingsSpan(*values), Source::CONFIG_FILE_DEFAULT_SECTION);
   66|      0|        }
   67|      0|    }
   68|  26.7k|}

_ZN6common7FindKeyIRKNSt3__13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_6vectorI8UniValueNS6_ISA_EEEENS1_4lessIS8_EENS6_INS1_4pairIKS8_SC_EEEEEERSG_EEDTadcldtfp_2atfp0_EEOT_OT0_:
  110|  53.0k|{
  111|  53.0k|    auto it = map.find(key);
  112|  53.0k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (112:12): [True: 53.0k, False: 0]
  ------------------
  113|  53.0k|}
_ZN6common7FindKeyIRKNSt3__13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS2_IS8_NS1_6vectorI8UniValueNS6_ISA_EEEENS1_4lessIS8_EENS6_INS1_4pairIKS8_SC_EEEEEESE_NS6_INSF_ISG_SJ_EEEEEERSG_EEDTadcldtfp_2atfp0_EEOT_OT0_:
  110|  53.0k|{
  111|  53.0k|    auto it = map.find(key);
  112|  53.0k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (112:12): [True: 53.0k, False: 0]
  ------------------
  113|  53.0k|}
_ZN6common7FindKeyIRKNSt3__13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS2_IS8_NS1_6vectorI8UniValueNS6_ISA_EEEENS1_4lessIS8_EENS6_INS1_4pairIKS8_SC_EEEEEESE_NS6_INSF_ISG_SJ_EEEEEERA1_KcEEDTadcldtfp_2atfp0_EEOT_OT0_:
  110|  53.0k|{
  111|  53.0k|    auto it = map.find(key);
  112|  53.0k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (112:12): [True: 53.0k, False: 0]
  ------------------
  113|  53.0k|}
_ZN6common7FindKeyIRKNSt3__13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE8UniValueNS1_4lessIS8_EENS6_INS1_4pairIKS8_S9_EEEEEERSD_EEDTadcldtfp_2atfp0_EEOT_OT0_:
  110|   106k|{
  111|   106k|    auto it = map.find(key);
  112|   106k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (112:12): [True: 106k, False: 0]
  ------------------
  113|   106k|}

_Z17internal_bswap_16t:
   45|  2.66M|{
   46|  2.66M|#ifdef bitcoin_builtin_bswap16
   47|  2.66M|    return bitcoin_builtin_bswap16(x);
  ------------------
  |  |   21|  2.66M|#      define bitcoin_builtin_bswap16(x) __builtin_bswap16(x)
  ------------------
   48|       |#else
   49|       |    return (x >> 8) | (x << 8);
   50|       |#endif
   51|  2.66M|}
_Z17internal_bswap_32j:
   54|  14.9M|{
   55|  14.9M|#ifdef bitcoin_builtin_bswap32
   56|  14.9M|    return bitcoin_builtin_bswap32(x);
  ------------------
  |  |   24|  14.9M|#      define bitcoin_builtin_bswap32(x) __builtin_bswap32(x)
  ------------------
   57|       |#else
   58|       |    return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >>  8) |
   59|       |            ((x & 0x0000ff00U) <<  8) | ((x & 0x000000ffU) << 24));
   60|       |#endif
   61|  14.9M|}
_Z17internal_bswap_64m:
   64|  25.4M|{
   65|  25.4M|#ifdef bitcoin_builtin_bswap64
   66|  25.4M|    return bitcoin_builtin_bswap64(x);
  ------------------
  |  |   27|  25.4M|#      define bitcoin_builtin_bswap64(x) __builtin_bswap64(x)
  ------------------
   67|       |#else
   68|       |     return (((x & 0xff00000000000000ull) >> 56)
   69|       |          | ((x & 0x00ff000000000000ull) >> 40)
   70|       |          | ((x & 0x0000ff0000000000ull) >> 24)
   71|       |          | ((x & 0x000000ff00000000ull) >> 8)
   72|       |          | ((x & 0x00000000ff000000ull) << 8)
   73|       |          | ((x & 0x0000000000ff0000ull) << 24)
   74|       |          | ((x & 0x000000000000ff00ull) << 40)
   75|       |          | ((x & 0x00000000000000ffull) << 56));
   76|       |#endif
   77|  25.4M|}

_Z16be16toh_internalt:
   24|  2.66M|{
   25|  2.66M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_16(big_endian_16bits);
   26|       |        else return big_endian_16bits;
   27|  2.66M|}
_Z16le16toh_internalt:
   29|    414|{
   30|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_16(little_endian_16bits);
   31|    414|        else return little_endian_16bits;
   32|    414|}
_Z16be32toh_internalj:
   44|  5.41M|{
   45|  5.41M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(big_endian_32bits);
   46|       |        else return big_endian_32bits;
   47|  5.41M|}
_Z16htobe32_internalj:
   34|  9.54M|{
   35|  9.54M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(host_32bits);
   36|       |        else return host_32bits;
   37|  9.54M|}
_Z16htole64_internalm:
   59|   143k|{
   60|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(host_64bits);
   61|   143k|        else return host_64bits;
   62|   143k|}
_Z16be64toh_internalm:
   64|  17.1M|{
   65|  17.1M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(big_endian_64bits);
   66|       |        else return big_endian_64bits;
   67|  17.1M|}
_Z16htobe64_internalm:
   54|  8.38M|{
   55|  8.38M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(host_64bits);
   56|       |        else return host_64bits;
   57|  8.38M|}
_Z16le64toh_internalm:
   69|  1.04M|{
   70|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(little_endian_64bits);
   71|  1.04M|        else return little_endian_64bits;
   72|  1.04M|}
_Z16htole32_internalj:
   39|   139M|{
   40|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(host_32bits);
   41|   139M|        else return host_32bits;
   42|   139M|}
_Z16le32toh_internalj:
   49|  18.8M|{
   50|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(little_endian_32bits);
   51|  18.8M|        else return little_endian_32bits;
   52|  18.8M|}

_ZN15ChaCha20Aligned6SetKeyENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   25|   679k|{
   26|   679k|    assert(key.size() == KEYLEN);
  ------------------
  |  Branch (26:5): [True: 679k, False: 0]
  ------------------
   27|   679k|    input[0] = ReadLE32(key.data() + 0);
   28|   679k|    input[1] = ReadLE32(key.data() + 4);
   29|   679k|    input[2] = ReadLE32(key.data() + 8);
   30|   679k|    input[3] = ReadLE32(key.data() + 12);
   31|   679k|    input[4] = ReadLE32(key.data() + 16);
   32|   679k|    input[5] = ReadLE32(key.data() + 20);
   33|   679k|    input[6] = ReadLE32(key.data() + 24);
   34|   679k|    input[7] = ReadLE32(key.data() + 28);
   35|   679k|    input[8] = 0;
   36|   679k|    input[9] = 0;
   37|   679k|    input[10] = 0;
   38|   679k|    input[11] = 0;
   39|   679k|}
_ZN15ChaCha20AlignedD2Ev:
   42|   396k|{
   43|   396k|    memory_cleanse(input, sizeof(input));
   44|   396k|}
_ZN15ChaCha20AlignedC2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   47|   396k|{
   48|   396k|    SetKey(key);
   49|   396k|}
_ZN15ChaCha20Aligned4SeekENSt3__14pairIjmEEj:
   52|  37.7k|{
   53|  37.7k|    input[8] = block_counter;
   54|  37.7k|    input[9] = nonce.first;
   55|  37.7k|    input[10] = nonce.second;
   56|  37.7k|    input[11] = nonce.second >> 32;
   57|  37.7k|}
_ZN8ChaCha209KeystreamENSt3__14spanISt4byteLm18446744073709551615EEE:
  282|  1.10M|{
  283|  1.10M|    if (out.empty()) return;
  ------------------
  |  Branch (283:9): [True: 35, False: 1.10M]
  ------------------
  284|  1.10M|    if (m_bufleft) {
  ------------------
  |  Branch (284:9): [True: 532k, False: 574k]
  ------------------
  285|   532k|        unsigned reuse = std::min<size_t>(m_bufleft, out.size());
  286|   532k|        std::copy(m_buffer.end() - m_bufleft, m_buffer.end() - m_bufleft + reuse, out.begin());
  287|   532k|        m_bufleft -= reuse;
  288|   532k|        out = out.subspan(reuse);
  289|   532k|    }
  290|  1.10M|    if (out.size() >= m_aligned.BLOCKLEN) {
  ------------------
  |  Branch (290:9): [True: 269k, False: 838k]
  ------------------
  291|   269k|        size_t blocks = out.size() / m_aligned.BLOCKLEN;
  292|   269k|        m_aligned.Keystream(out.first(blocks * m_aligned.BLOCKLEN));
  293|   269k|        out = out.subspan(blocks * m_aligned.BLOCKLEN);
  294|   269k|    }
  295|  1.10M|    if (!out.empty()) {
  ------------------
  |  Branch (295:9): [True: 806k, False: 300k]
  ------------------
  296|   806k|        m_aligned.Keystream(m_buffer);
  297|   806k|        std::copy(m_buffer.begin(), m_buffer.begin() + out.size(), out.begin());
  298|   806k|        m_bufleft = m_aligned.BLOCKLEN - out.size();
  299|   806k|    }
  300|  1.10M|}
_ZN8ChaCha205CryptENSt3__14spanIKSt4byteLm18446744073709551615EEENS1_IS2_Lm18446744073709551615EEE:
  303|  56.6k|{
  304|  56.6k|    assert(input.size() == output.size());
  ------------------
  |  Branch (304:5): [True: 56.6k, False: 0]
  ------------------
  305|       |
  306|  56.6k|    if (!input.size()) return;
  ------------------
  |  Branch (306:9): [True: 18.8k, False: 37.7k]
  ------------------
  307|  37.7k|    if (m_bufleft) {
  ------------------
  |  Branch (307:9): [True: 0, False: 37.7k]
  ------------------
  308|      0|        unsigned reuse = std::min<size_t>(m_bufleft, input.size());
  309|      0|        for (unsigned i = 0; i < reuse; i++) {
  ------------------
  |  Branch (309:30): [True: 0, False: 0]
  ------------------
  310|      0|            output[i] = input[i] ^ m_buffer[m_aligned.BLOCKLEN - m_bufleft + i];
  311|      0|        }
  312|      0|        m_bufleft -= reuse;
  313|      0|        output = output.subspan(reuse);
  314|      0|        input = input.subspan(reuse);
  315|      0|    }
  316|  37.7k|    if (input.size() >= m_aligned.BLOCKLEN) {
  ------------------
  |  Branch (316:9): [True: 0, False: 37.7k]
  ------------------
  317|      0|        size_t blocks = input.size() / m_aligned.BLOCKLEN;
  318|      0|        m_aligned.Crypt(input.first(blocks * m_aligned.BLOCKLEN), output.first(blocks * m_aligned.BLOCKLEN));
  319|      0|        output = output.subspan(blocks * m_aligned.BLOCKLEN);
  320|      0|        input = input.subspan(blocks * m_aligned.BLOCKLEN);
  321|      0|    }
  322|  37.7k|    if (!input.empty()) {
  ------------------
  |  Branch (322:9): [True: 37.7k, False: 0]
  ------------------
  323|  37.7k|        m_aligned.Keystream(m_buffer);
  324|   113k|        for (unsigned i = 0; i < input.size(); i++) {
  ------------------
  |  Branch (324:30): [True: 75.5k, False: 37.7k]
  ------------------
  325|  75.5k|            output[i] = input[i] ^ m_buffer[i];
  326|  75.5k|        }
  327|  37.7k|        m_bufleft = m_aligned.BLOCKLEN - input.size();
  328|  37.7k|    }
  329|  37.7k|}
_ZN8ChaCha20D2Ev:
  332|   396k|{
  333|   396k|    memory_cleanse(m_buffer.data(), m_buffer.size());
  334|   396k|}
_ZN8ChaCha206SetKeyENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  337|   283k|{
  338|   283k|    m_aligned.SetKey(key);
  339|   283k|    m_bufleft = 0;
  340|   283k|    memory_cleanse(m_buffer.data(), m_buffer.size());
  341|   283k|}
_ZN10FSChaCha20C2ENSt3__14spanIKSt4byteLm18446744073709551615EEEj:
  344|  37.7k|    m_chacha20(key), m_rekey_interval(rekey_interval)
  345|  37.7k|{
  346|       |    assert(key.size() == KEYLEN);
  ------------------
  |  Branch (346:5): [True: 37.7k, False: 0]
  ------------------
  347|  37.7k|}
_ZN10FSChaCha205CryptENSt3__14spanIKSt4byteLm18446744073709551615EEENS1_IS2_Lm18446744073709551615EEE:
  350|  18.8k|{
  351|  18.8k|    assert(input.size() == output.size());
  ------------------
  |  Branch (351:5): [True: 18.8k, False: 0]
  ------------------
  352|       |
  353|       |    // Invoke internal stream cipher for actual encryption/decryption.
  354|  18.8k|    m_chacha20.Crypt(input, output);
  355|       |
  356|       |    // Rekey after m_rekey_interval encryptions/decryptions.
  357|  18.8k|    if (++m_chunk_counter == m_rekey_interval) {
  ------------------
  |  Branch (357:9): [True: 0, False: 18.8k]
  ------------------
  358|       |        // Get new key from the stream cipher.
  359|      0|        std::byte new_key[KEYLEN];
  360|      0|        m_chacha20.Keystream(new_key);
  361|       |        // Update its key.
  362|      0|        m_chacha20.SetKey(new_key);
  363|       |        // Wipe the key (a copy remains inside m_chacha20, where it'll be wiped on the next rekey
  364|       |        // or on destruction).
  365|      0|        memory_cleanse(new_key, sizeof(new_key));
  366|       |        // Set the nonce for the new section of output.
  367|      0|        m_chacha20.Seek({0, ++m_rekey_counter}, 0);
  368|       |        // Reset the chunk counter.
  369|      0|        m_chunk_counter = 0;
  370|      0|    }
  371|  18.8k|}
_ZN15ChaCha20Aligned9KeystreamENSt3__14spanISt4byteLm18446744073709551615EEE:
   60|  1.11M|{
   61|  1.11M|    std::byte* c = output.data();
   62|  1.11M|    size_t blocks = output.size() / BLOCKLEN;
   63|  1.11M|    assert(blocks * BLOCKLEN == output.size());
  ------------------
  |  Branch (63:5): [True: 1.11M, False: 0]
  ------------------
   64|       |
   65|  1.11M|    uint32_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
   66|  1.11M|    uint32_t j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
   67|       |
   68|  1.11M|    if (!blocks) return;
  ------------------
  |  Branch (68:9): [True: 0, False: 1.11M]
  ------------------
   69|       |
   70|  1.11M|    j4 = input[0];
   71|  1.11M|    j5 = input[1];
   72|  1.11M|    j6 = input[2];
   73|  1.11M|    j7 = input[3];
   74|  1.11M|    j8 = input[4];
   75|  1.11M|    j9 = input[5];
   76|  1.11M|    j10 = input[6];
   77|  1.11M|    j11 = input[7];
   78|  1.11M|    j12 = input[8];
   79|  1.11M|    j13 = input[9];
   80|  1.11M|    j14 = input[10];
   81|  1.11M|    j15 = input[11];
   82|       |
   83|  8.72M|    for (;;) {
   84|  8.72M|        x0 = 0x61707865;
   85|  8.72M|        x1 = 0x3320646e;
   86|  8.72M|        x2 = 0x79622d32;
   87|  8.72M|        x3 = 0x6b206574;
   88|  8.72M|        x4 = j4;
   89|  8.72M|        x5 = j5;
   90|  8.72M|        x6 = j6;
   91|  8.72M|        x7 = j7;
   92|  8.72M|        x8 = j8;
   93|  8.72M|        x9 = j9;
   94|  8.72M|        x10 = j10;
   95|  8.72M|        x11 = j11;
   96|  8.72M|        x12 = j12;
   97|  8.72M|        x13 = j13;
   98|  8.72M|        x14 = j14;
   99|  8.72M|        x15 = j15;
  100|       |
  101|       |        // The 20 inner ChaCha20 rounds are unrolled here for performance.
  102|  8.72M|        REPEAT10(
  ------------------
  |  |   22|  8.72M|#define REPEAT10(a) do { {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; } while(0)
  |  |  ------------------
  |  |  |  Branch (22:84): [Folded, False: 8.72M]
  |  |  ------------------
  ------------------
  103|  8.72M|            QUARTERROUND( x0, x4, x8,x12);
  104|  8.72M|            QUARTERROUND( x1, x5, x9,x13);
  105|  8.72M|            QUARTERROUND( x2, x6,x10,x14);
  106|  8.72M|            QUARTERROUND( x3, x7,x11,x15);
  107|  8.72M|            QUARTERROUND( x0, x5,x10,x15);
  108|  8.72M|            QUARTERROUND( x1, x6,x11,x12);
  109|  8.72M|            QUARTERROUND( x2, x7, x8,x13);
  110|  8.72M|            QUARTERROUND( x3, x4, x9,x14);
  111|  8.72M|        );
  112|       |
  113|  8.72M|        x0 += 0x61707865;
  114|  8.72M|        x1 += 0x3320646e;
  115|  8.72M|        x2 += 0x79622d32;
  116|  8.72M|        x3 += 0x6b206574;
  117|  8.72M|        x4 += j4;
  118|  8.72M|        x5 += j5;
  119|  8.72M|        x6 += j6;
  120|  8.72M|        x7 += j7;
  121|  8.72M|        x8 += j8;
  122|  8.72M|        x9 += j9;
  123|  8.72M|        x10 += j10;
  124|  8.72M|        x11 += j11;
  125|  8.72M|        x12 += j12;
  126|  8.72M|        x13 += j13;
  127|  8.72M|        x14 += j14;
  128|  8.72M|        x15 += j15;
  129|       |
  130|  8.72M|        ++j12;
  131|  8.72M|        if (!j12) ++j13;
  ------------------
  |  Branch (131:13): [True: 0, False: 8.72M]
  ------------------
  132|       |
  133|  8.72M|        WriteLE32(c + 0, x0);
  134|  8.72M|        WriteLE32(c + 4, x1);
  135|  8.72M|        WriteLE32(c + 8, x2);
  136|  8.72M|        WriteLE32(c + 12, x3);
  137|  8.72M|        WriteLE32(c + 16, x4);
  138|  8.72M|        WriteLE32(c + 20, x5);
  139|  8.72M|        WriteLE32(c + 24, x6);
  140|  8.72M|        WriteLE32(c + 28, x7);
  141|  8.72M|        WriteLE32(c + 32, x8);
  142|  8.72M|        WriteLE32(c + 36, x9);
  143|  8.72M|        WriteLE32(c + 40, x10);
  144|  8.72M|        WriteLE32(c + 44, x11);
  145|  8.72M|        WriteLE32(c + 48, x12);
  146|  8.72M|        WriteLE32(c + 52, x13);
  147|  8.72M|        WriteLE32(c + 56, x14);
  148|  8.72M|        WriteLE32(c + 60, x15);
  149|       |
  150|  8.72M|        if (blocks == 1) {
  ------------------
  |  Branch (150:13): [True: 1.11M, False: 7.61M]
  ------------------
  151|  1.11M|            input[8] = j12;
  152|  1.11M|            input[9] = j13;
  153|  1.11M|            return;
  154|  1.11M|        }
  155|  7.61M|        blocks -= 1;
  156|  7.61M|        c += BLOCKLEN;
  157|  7.61M|    }
  158|  1.11M|}

_ZN8ChaCha20C2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   90|   396k|    ChaCha20(std::span<const std::byte> key) noexcept : m_aligned(key) {}
_ZN8ChaCha204SeekENSt3__14pairIjmEEj:
  103|  37.7k|    {
  104|  37.7k|        m_aligned.Seek(nonce, block_counter);
  105|  37.7k|        m_bufleft = 0;
  106|  37.7k|    }

_ZN20AEADChaCha20Poly1305C2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   16|  37.7k|AEADChaCha20Poly1305::AEADChaCha20Poly1305(std::span<const std::byte> key) noexcept : m_chacha20(key)
   17|  37.7k|{
   18|       |    assert(key.size() == KEYLEN);
  ------------------
  |  Branch (18:5): [True: 37.7k, False: 0]
  ------------------
   19|  37.7k|}
_ZN20AEADChaCha20Poly13057EncryptENSt3__14spanIKSt4byteLm18446744073709551615EEES4_S4_NS0_4pairIjmEENS1_IS2_Lm18446744073709551615EEE:
   70|  18.8k|{
   71|  18.8k|    assert(cipher.size() == plain1.size() + plain2.size() + EXPANSION);
  ------------------
  |  Branch (71:5): [True: 18.8k, False: 0]
  ------------------
   72|       |
   73|       |    // Encrypt using ChaCha20 (starting at block 1).
   74|  18.8k|    m_chacha20.Seek(nonce, 1);
   75|  18.8k|    m_chacha20.Crypt(plain1, cipher.first(plain1.size()));
   76|  18.8k|    m_chacha20.Crypt(plain2, cipher.subspan(plain1.size()).first(plain2.size()));
   77|       |
   78|       |    // Seek to block 0, and compute tag using key drawn from there.
   79|  18.8k|    m_chacha20.Seek(nonce, 0);
   80|  18.8k|    ComputeTag(m_chacha20, aad, cipher.first(cipher.size() - EXPANSION), cipher.last(EXPANSION));
   81|  18.8k|}
_ZN18FSChaCha20Poly130510NextPacketEv:
  107|  18.8k|{
  108|  18.8k|    if (++m_packet_counter == m_rekey_interval) {
  ------------------
  |  Branch (108:9): [True: 0, False: 18.8k]
  ------------------
  109|       |        // Generate a full block of keystream, to avoid needing the ChaCha20 buffer, even though
  110|       |        // we only need KEYLEN (32) bytes.
  111|      0|        std::byte one_block[ChaCha20Aligned::BLOCKLEN];
  112|      0|        m_aead.Keystream({0xFFFFFFFF, m_rekey_counter}, one_block);
  113|       |        // Switch keys.
  114|      0|        m_aead.SetKey(std::span{one_block}.first(KEYLEN));
  115|       |        // Wipe the generated keystream (a copy remains inside m_aead, which will be cleaned up
  116|       |        // once it cycles again, or is destroyed).
  117|      0|        memory_cleanse(one_block, sizeof(one_block));
  118|       |        // Update counters.
  119|      0|        m_packet_counter = 0;
  120|      0|        ++m_rekey_counter;
  121|      0|    }
  122|  18.8k|}
_ZN18FSChaCha20Poly13057EncryptENSt3__14spanIKSt4byteLm18446744073709551615EEES4_S4_NS1_IS2_Lm18446744073709551615EEE:
  125|  18.8k|{
  126|  18.8k|    m_aead.Encrypt(plain1, plain2, aad, {m_packet_counter, m_rekey_counter}, cipher);
  127|  18.8k|    NextPacket();
  128|  18.8k|}
chacha20poly1305.cpp:_ZN12_GLOBAL__N_110ComputeTagER8ChaCha20NSt3__14spanIKSt4byteLm18446744073709551615EEES6_NS3_IS4_Lm18446744073709551615EEE:
   40|  18.8k|{
   41|  18.8k|    static const std::byte PADDING[16] = {{}};
   42|       |
   43|       |    // Get block of keystream (use a full 64 byte buffer to avoid the need for chacha20's own buffering).
   44|  18.8k|    std::byte first_block[ChaCha20Aligned::BLOCKLEN];
   45|  18.8k|    chacha20.Keystream(first_block);
   46|       |
   47|       |    // Use the first 32 bytes of the first keystream block as poly1305 key.
   48|  18.8k|    Poly1305 poly1305{std::span{first_block}.first(Poly1305::KEYLEN)};
   49|       |
   50|       |    // Compute tag:
   51|       |    // - Process the padded AAD with Poly1305.
   52|  18.8k|    const unsigned aad_padding_length = (16 - (aad.size() % 16)) % 16;
   53|  18.8k|    poly1305.Update(aad).Update(std::span{PADDING}.first(aad_padding_length));
   54|       |    // - Process the padded ciphertext with Poly1305.
   55|  18.8k|    const unsigned cipher_padding_length = (16 - (cipher.size() % 16)) % 16;
   56|  18.8k|    poly1305.Update(cipher).Update(std::span{PADDING}.first(cipher_padding_length));
   57|       |    // - Process the AAD and plaintext length with Poly1305.
   58|  18.8k|    std::byte length_desc[Poly1305::TAGLEN];
   59|  18.8k|    WriteLE64(length_desc, aad.size());
   60|  18.8k|    WriteLE64(length_desc + 8, cipher.size());
   61|  18.8k|    poly1305.Update(length_desc);
   62|       |
   63|       |    // Output tag.
   64|  18.8k|    poly1305.Finalize(tag);
   65|  18.8k|}

_ZN18FSChaCha20Poly1305C2ENSt3__14spanIKSt4byteLm18446744073709551615EEEj:
  115|  37.7k|        m_aead(key), m_rekey_interval(rekey_interval) {}

_Z8ReadBE16ITk8ByteTypehEtPKT_:
   65|  2.66M|{
   66|  2.66M|    uint16_t x;
   67|  2.66M|    memcpy(&x, ptr, 2);
   68|  2.66M|    return be16toh_internal(x);
   69|  2.66M|}
_Z8ReadLE64ITk8ByteTypeSt4byteEmPKT_:
   36|   290k|{
   37|   290k|    uint64_t x;
   38|   290k|    memcpy(&x, ptr, 8);
   39|   290k|    return le64toh_internal(x);
   40|   290k|}
_Z8ReadLE64ITk8ByteTypehEmPKT_:
   36|   289k|{
   37|   289k|    uint64_t x;
   38|   289k|    memcpy(&x, ptr, 8);
   39|   289k|    return le64toh_internal(x);
   40|   289k|}
_Z9WriteLE32ITk8ByteTypeSt4byteEvPT_j:
   51|   139M|{
   52|   139M|    uint32_t v = htole32_internal(x);
   53|   139M|    memcpy(ptr, &v, 4);
   54|   139M|}
_Z8ReadLE32ITk8ByteTypeSt4byteEjPKT_:
   28|  5.43M|{
   29|  5.43M|    uint32_t x;
   30|  5.43M|    memcpy(&x, ptr, 4);
   31|  5.43M|    return le32toh_internal(x);
   32|  5.43M|}
_Z9WriteLE64ITk8ByteTypeSt4byteEvPT_m:
   58|  37.7k|{
   59|  37.7k|    uint64_t v = htole64_internal(x);
   60|  37.7k|    memcpy(ptr, &v, 8);
   61|  37.7k|}
_Z8ReadLE32ITk8ByteTypehEjPKT_:
   28|  12.2M|{
   29|  12.2M|    uint32_t x;
   30|  12.2M|    memcpy(&x, ptr, 4);
   31|  12.2M|    return le32toh_internal(x);
   32|  12.2M|}
_Z9WriteLE32ITk8ByteTypehEvPT_j:
   51|  75.5k|{
   52|  75.5k|    uint32_t v = htole32_internal(x);
   53|  75.5k|    memcpy(ptr, &v, 4);
   54|  75.5k|}
_Z8ReadBE32ITk8ByteTypehEjPKT_:
   73|  5.41M|{
   74|  5.41M|    uint32_t x;
   75|  5.41M|    memcpy(&x, ptr, 4);
   76|  5.41M|    return be32toh_internal(x);
   77|  5.41M|}
_Z9WriteBE32ITk8ByteTypehEvPT_j:
   96|  9.54M|{
   97|  9.54M|    uint32_t v = htobe32_internal(x);
   98|  9.54M|    memcpy(ptr, &v, 4);
   99|  9.54M|}
_Z9WriteLE64ITk8ByteTypehEvPT_m:
   58|  44.2k|{
   59|  44.2k|    uint64_t v = htole64_internal(x);
   60|  44.2k|    memcpy(ptr, &v, 8);
   61|  44.2k|}
_Z8ReadBE64ITk8ByteTypehEmPKT_:
   81|  16.8M|{
   82|  16.8M|    uint64_t x;
   83|  16.8M|    memcpy(&x, ptr, 8);
   84|  16.8M|    return be64toh_internal(x);
   85|  16.8M|}
_Z9WriteBE64ITk8ByteTypehEvPT_m:
  103|  8.38M|{
  104|  8.38M|    uint64_t v = htobe64_internal(x);
  105|  8.38M|    memcpy(ptr, &v, 8);
  106|  8.38M|}

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

_ZN21CHKDF_HMAC_SHA256_L32C2EPKhmRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   12|  18.8k|{
   13|  18.8k|    CHMAC_SHA256((const unsigned char*)salt.data(), salt.size()).Write(ikm, ikmlen).Finalize(m_prk);
   14|  18.8k|}
_ZN21CHKDF_HMAC_SHA256_L328Expand32ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPh:
   17|   113k|{
   18|       |    // expand a 32byte key (single round)
   19|   113k|    assert(info.size() <= 128);
  ------------------
  |  Branch (19:5): [True: 113k, False: 0]
  ------------------
   20|   113k|    static const unsigned char one[1] = {1};
   21|   113k|    CHMAC_SHA256(m_prk, 32).Write((const unsigned char*)info.data(), info.size()).Write(one, 1).Finalize(hash);
   22|   113k|}

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

_ZN12CHMAC_SHA2565WriteEPKhm:
   24|   245k|    {
   25|   245k|        inner.Write(data, len);
   26|   245k|        return *this;
   27|   245k|    }

_ZN14poly1305_donna13poly1305_initEPNS_16poly1305_contextEPKh:
   13|  18.8k|void poly1305_init(poly1305_context *st, const unsigned char key[32]) noexcept {
   14|       |    /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
   15|  18.8k|    st->r[0] = (ReadLE32(&key[ 0])     ) & 0x3ffffff;
   16|  18.8k|    st->r[1] = (ReadLE32(&key[ 3]) >> 2) & 0x3ffff03;
   17|  18.8k|    st->r[2] = (ReadLE32(&key[ 6]) >> 4) & 0x3ffc0ff;
   18|  18.8k|    st->r[3] = (ReadLE32(&key[ 9]) >> 6) & 0x3f03fff;
   19|  18.8k|    st->r[4] = (ReadLE32(&key[12]) >> 8) & 0x00fffff;
   20|       |
   21|       |    /* h = 0 */
   22|  18.8k|    st->h[0] = 0;
   23|  18.8k|    st->h[1] = 0;
   24|  18.8k|    st->h[2] = 0;
   25|  18.8k|    st->h[3] = 0;
   26|  18.8k|    st->h[4] = 0;
   27|       |
   28|       |    /* save pad for later */
   29|  18.8k|    st->pad[0] = ReadLE32(&key[16]);
   30|  18.8k|    st->pad[1] = ReadLE32(&key[20]);
   31|  18.8k|    st->pad[2] = ReadLE32(&key[24]);
   32|  18.8k|    st->pad[3] = ReadLE32(&key[28]);
   33|       |
   34|  18.8k|    st->leftover = 0;
   35|  18.8k|    st->final = 0;
   36|  18.8k|}
_ZN14poly1305_donna15poly1305_finishEPNS_16poly1305_contextEPh:
   98|  18.8k|void poly1305_finish(poly1305_context *st, unsigned char mac[16]) noexcept {
   99|  18.8k|    uint32_t h0,h1,h2,h3,h4,c;
  100|  18.8k|    uint32_t g0,g1,g2,g3,g4;
  101|  18.8k|    uint64_t f;
  102|  18.8k|    uint32_t mask;
  103|       |
  104|       |    /* process the remaining block */
  105|  18.8k|    if (st->leftover) {
  ------------------
  |  Branch (105:9): [True: 0, False: 18.8k]
  ------------------
  106|      0|        size_t i = st->leftover;
  107|      0|        st->buffer[i++] = 1;
  108|      0|        for (; i < POLY1305_BLOCK_SIZE; i++) {
  ------------------
  |  |   15|      0|#define POLY1305_BLOCK_SIZE 16
  ------------------
  |  Branch (108:16): [True: 0, False: 0]
  ------------------
  109|      0|            st->buffer[i] = 0;
  110|      0|        }
  111|      0|        st->final = 1;
  112|      0|        poly1305_blocks(st, st->buffer, POLY1305_BLOCK_SIZE);
  ------------------
  |  |   15|      0|#define POLY1305_BLOCK_SIZE 16
  ------------------
  113|      0|    }
  114|       |
  115|       |    /* fully carry h */
  116|  18.8k|    h0 = st->h[0];
  117|  18.8k|    h1 = st->h[1];
  118|  18.8k|    h2 = st->h[2];
  119|  18.8k|    h3 = st->h[3];
  120|  18.8k|    h4 = st->h[4];
  121|       |
  122|  18.8k|                 c = h1 >> 26; h1 = h1 & 0x3ffffff;
  123|  18.8k|    h2 +=     c; c = h2 >> 26; h2 = h2 & 0x3ffffff;
  124|  18.8k|    h3 +=     c; c = h3 >> 26; h3 = h3 & 0x3ffffff;
  125|  18.8k|    h4 +=     c; c = h4 >> 26; h4 = h4 & 0x3ffffff;
  126|  18.8k|    h0 += c * 5; c = h0 >> 26; h0 = h0 & 0x3ffffff;
  127|  18.8k|    h1 +=     c;
  128|       |
  129|       |    /* compute h + -p */
  130|  18.8k|    g0 = h0 + 5; c = g0 >> 26; g0 &= 0x3ffffff;
  131|  18.8k|    g1 = h1 + c; c = g1 >> 26; g1 &= 0x3ffffff;
  132|  18.8k|    g2 = h2 + c; c = g2 >> 26; g2 &= 0x3ffffff;
  133|  18.8k|    g3 = h3 + c; c = g3 >> 26; g3 &= 0x3ffffff;
  134|  18.8k|    g4 = h4 + c - (1UL << 26);
  135|       |
  136|       |    /* select h if h < p, or h + -p if h >= p */
  137|  18.8k|    mask = (g4 >> ((sizeof(uint32_t) * 8) - 1)) - 1;
  138|  18.8k|    g0 &= mask;
  139|  18.8k|    g1 &= mask;
  140|  18.8k|    g2 &= mask;
  141|  18.8k|    g3 &= mask;
  142|  18.8k|    g4 &= mask;
  143|  18.8k|    mask = ~mask;
  144|  18.8k|    h0 = (h0 & mask) | g0;
  145|  18.8k|    h1 = (h1 & mask) | g1;
  146|  18.8k|    h2 = (h2 & mask) | g2;
  147|  18.8k|    h3 = (h3 & mask) | g3;
  148|  18.8k|    h4 = (h4 & mask) | g4;
  149|       |
  150|       |    /* h = h % (2^128) */
  151|  18.8k|    h0 = ((h0      ) | (h1 << 26)) & 0xffffffff;
  152|  18.8k|    h1 = ((h1 >>  6) | (h2 << 20)) & 0xffffffff;
  153|  18.8k|    h2 = ((h2 >> 12) | (h3 << 14)) & 0xffffffff;
  154|  18.8k|    h3 = ((h3 >> 18) | (h4 <<  8)) & 0xffffffff;
  155|       |
  156|       |    /* mac = (h + pad) % (2^128) */
  157|  18.8k|    f = (uint64_t)h0 + st->pad[0]            ; h0 = (uint32_t)f;
  158|  18.8k|    f = (uint64_t)h1 + st->pad[1] + (f >> 32); h1 = (uint32_t)f;
  159|  18.8k|    f = (uint64_t)h2 + st->pad[2] + (f >> 32); h2 = (uint32_t)f;
  160|  18.8k|    f = (uint64_t)h3 + st->pad[3] + (f >> 32); h3 = (uint32_t)f;
  161|       |
  162|  18.8k|    WriteLE32(mac +  0, h0);
  163|  18.8k|    WriteLE32(mac +  4, h1);
  164|  18.8k|    WriteLE32(mac +  8, h2);
  165|  18.8k|    WriteLE32(mac + 12, h3);
  166|       |
  167|       |    /* zero out the state */
  168|  18.8k|    st->h[0] = 0;
  169|  18.8k|    st->h[1] = 0;
  170|  18.8k|    st->h[2] = 0;
  171|  18.8k|    st->h[3] = 0;
  172|  18.8k|    st->h[4] = 0;
  173|  18.8k|    st->r[0] = 0;
  174|  18.8k|    st->r[1] = 0;
  175|  18.8k|    st->r[2] = 0;
  176|  18.8k|    st->r[3] = 0;
  177|  18.8k|    st->r[4] = 0;
  178|  18.8k|    st->pad[0] = 0;
  179|  18.8k|    st->pad[1] = 0;
  180|  18.8k|    st->pad[2] = 0;
  181|  18.8k|    st->pad[3] = 0;
  182|  18.8k|}
_ZN14poly1305_donna15poly1305_updateEPNS_16poly1305_contextEPKhm:
  184|  94.4k|void poly1305_update(poly1305_context *st, const unsigned char *m, size_t bytes) noexcept {
  185|  94.4k|    size_t i;
  186|       |
  187|       |    /* handle leftover */
  188|  94.4k|    if (st->leftover) {
  ------------------
  |  Branch (188:9): [True: 36.5k, False: 57.8k]
  ------------------
  189|  36.5k|        size_t want = (POLY1305_BLOCK_SIZE - st->leftover);
  ------------------
  |  |   15|  36.5k|#define POLY1305_BLOCK_SIZE 16
  ------------------
  190|  36.5k|        if (want > bytes) {
  ------------------
  |  Branch (190:13): [True: 0, False: 36.5k]
  ------------------
  191|      0|            want = bytes;
  192|      0|        }
  193|   468k|        for (i = 0; i < want; i++) {
  ------------------
  |  Branch (193:21): [True: 431k, False: 36.5k]
  ------------------
  194|   431k|            st->buffer[st->leftover + i] = m[i];
  195|   431k|        }
  196|  36.5k|        bytes -= want;
  197|  36.5k|        m += want;
  198|  36.5k|        st->leftover += want;
  199|  36.5k|        if (st->leftover < POLY1305_BLOCK_SIZE) return;
  ------------------
  |  |   15|  36.5k|#define POLY1305_BLOCK_SIZE 16
  ------------------
  |  Branch (199:13): [True: 0, False: 36.5k]
  ------------------
  200|  36.5k|        poly1305_blocks(st, st->buffer, POLY1305_BLOCK_SIZE);
  ------------------
  |  |   15|  36.5k|#define POLY1305_BLOCK_SIZE 16
  ------------------
  201|  36.5k|        st->leftover = 0;
  202|  36.5k|    }
  203|       |
  204|       |    /* process full blocks */
  205|  94.4k|    if (bytes >= POLY1305_BLOCK_SIZE) {
  ------------------
  |  |   15|  94.4k|#define POLY1305_BLOCK_SIZE 16
  ------------------
  |  Branch (205:9): [True: 37.7k, False: 56.6k]
  ------------------
  206|  37.7k|        size_t want = (bytes & ~(POLY1305_BLOCK_SIZE - 1));
  ------------------
  |  |   15|  37.7k|#define POLY1305_BLOCK_SIZE 16
  ------------------
  207|  37.7k|        poly1305_blocks(st, m, want);
  208|  37.7k|        m += want;
  209|  37.7k|        bytes -= want;
  210|  37.7k|    }
  211|       |
  212|       |    /* store leftover */
  213|  94.4k|    if (bytes) {
  ------------------
  |  Branch (213:9): [True: 36.5k, False: 57.8k]
  ------------------
  214|   190k|        for (i = 0; i < bytes; i++) {
  ------------------
  |  Branch (214:21): [True: 153k, False: 36.5k]
  ------------------
  215|   153k|            st->buffer[st->leftover + i] = m[i];
  216|   153k|        }
  217|  36.5k|        st->leftover += bytes;
  218|  36.5k|    }
  219|  94.4k|}
poly1305.cpp:_ZN14poly1305_donnaL15poly1305_blocksEPNS_16poly1305_contextEPKhm:
   38|  74.3k|static void poly1305_blocks(poly1305_context *st, const unsigned char *m, size_t bytes) noexcept {
   39|  74.3k|    const uint32_t hibit = (st->final) ? 0 : (1UL << 24); /* 1 << 128 */
  ------------------
  |  Branch (39:28): [True: 0, False: 74.3k]
  ------------------
   40|  74.3k|    uint32_t r0,r1,r2,r3,r4;
   41|  74.3k|    uint32_t s1,s2,s3,s4;
   42|  74.3k|    uint32_t h0,h1,h2,h3,h4;
   43|  74.3k|    uint64_t d0,d1,d2,d3,d4;
   44|  74.3k|    uint32_t c;
   45|       |
   46|  74.3k|    r0 = st->r[0];
   47|  74.3k|    r1 = st->r[1];
   48|  74.3k|    r2 = st->r[2];
   49|  74.3k|    r3 = st->r[3];
   50|  74.3k|    r4 = st->r[4];
   51|       |
   52|  74.3k|    s1 = r1 * 5;
   53|  74.3k|    s2 = r2 * 5;
   54|  74.3k|    s3 = r3 * 5;
   55|  74.3k|    s4 = r4 * 5;
   56|       |
   57|  74.3k|    h0 = st->h[0];
   58|  74.3k|    h1 = st->h[1];
   59|  74.3k|    h2 = st->h[2];
   60|  74.3k|    h3 = st->h[3];
   61|  74.3k|    h4 = st->h[4];
   62|       |
   63|  2.48M|    while (bytes >= POLY1305_BLOCK_SIZE) {
  ------------------
  |  |   15|  2.48M|#define POLY1305_BLOCK_SIZE 16
  ------------------
  |  Branch (63:12): [True: 2.41M, False: 74.3k]
  ------------------
   64|       |        /* h += m[i] */
   65|  2.41M|        h0 += (ReadLE32(m+ 0)     ) & 0x3ffffff;
   66|  2.41M|        h1 += (ReadLE32(m+ 3) >> 2) & 0x3ffffff;
   67|  2.41M|        h2 += (ReadLE32(m+ 6) >> 4) & 0x3ffffff;
   68|  2.41M|        h3 += (ReadLE32(m+ 9) >> 6) & 0x3ffffff;
   69|  2.41M|        h4 += (ReadLE32(m+12) >> 8) | hibit;
   70|       |
   71|       |        /* h *= r */
   72|  2.41M|        d0 = ((uint64_t)h0 * r0) + ((uint64_t)h1 * s4) + ((uint64_t)h2 * s3) + ((uint64_t)h3 * s2) + ((uint64_t)h4 * s1);
   73|  2.41M|        d1 = ((uint64_t)h0 * r1) + ((uint64_t)h1 * r0) + ((uint64_t)h2 * s4) + ((uint64_t)h3 * s3) + ((uint64_t)h4 * s2);
   74|  2.41M|        d2 = ((uint64_t)h0 * r2) + ((uint64_t)h1 * r1) + ((uint64_t)h2 * r0) + ((uint64_t)h3 * s4) + ((uint64_t)h4 * s3);
   75|  2.41M|        d3 = ((uint64_t)h0 * r3) + ((uint64_t)h1 * r2) + ((uint64_t)h2 * r1) + ((uint64_t)h3 * r0) + ((uint64_t)h4 * s4);
   76|  2.41M|        d4 = ((uint64_t)h0 * r4) + ((uint64_t)h1 * r3) + ((uint64_t)h2 * r2) + ((uint64_t)h3 * r1) + ((uint64_t)h4 * r0);
   77|       |
   78|       |        /* (partial) h %= p */
   79|  2.41M|                      c = (uint32_t)(d0 >> 26); h0 = (uint32_t)d0 & 0x3ffffff;
   80|  2.41M|        d1 += c;      c = (uint32_t)(d1 >> 26); h1 = (uint32_t)d1 & 0x3ffffff;
   81|  2.41M|        d2 += c;      c = (uint32_t)(d2 >> 26); h2 = (uint32_t)d2 & 0x3ffffff;
   82|  2.41M|        d3 += c;      c = (uint32_t)(d3 >> 26); h3 = (uint32_t)d3 & 0x3ffffff;
   83|  2.41M|        d4 += c;      c = (uint32_t)(d4 >> 26); h4 = (uint32_t)d4 & 0x3ffffff;
   84|  2.41M|        h0 += c * 5;  c =           (h0 >> 26); h0 =           h0 & 0x3ffffff;
   85|  2.41M|        h1 += c;
   86|       |
   87|  2.41M|        m += POLY1305_BLOCK_SIZE;
  ------------------
  |  |   15|  2.41M|#define POLY1305_BLOCK_SIZE 16
  ------------------
   88|  2.41M|        bytes -= POLY1305_BLOCK_SIZE;
  ------------------
  |  |   15|  2.41M|#define POLY1305_BLOCK_SIZE 16
  ------------------
   89|  2.41M|    }
   90|       |
   91|  74.3k|    st->h[0] = h0;
   92|  74.3k|    st->h[1] = h1;
   93|  74.3k|    st->h[2] = h2;
   94|  74.3k|    st->h[3] = h3;
   95|  74.3k|    st->h[4] = h4;
   96|  74.3k|}

_ZN8Poly1305C2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   51|  18.8k|    {
   52|  18.8k|        assert(key.size() == KEYLEN);
  ------------------
  |  Branch (52:9): [True: 18.8k, False: 0]
  ------------------
   53|  18.8k|        poly1305_donna::poly1305_init(&m_ctx, UCharCast(key.data()));
   54|  18.8k|    }
_ZN8Poly13056UpdateENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   58|  94.4k|    {
   59|  94.4k|        poly1305_donna::poly1305_update(&m_ctx, UCharCast(msg.data()), msg.size());
   60|  94.4k|        return *this;
   61|  94.4k|    }
_ZN8Poly13058FinalizeENSt3__14spanISt4byteLm18446744073709551615EEE:
   65|  18.8k|    {
   66|  18.8k|        assert(out.size() == TAGLEN);
  ------------------
  |  Branch (66:9): [True: 18.8k, False: 0]
  ------------------
   67|  18.8k|        poly1305_donna::poly1305_finish(&m_ctx, UCharCast(out.data()));
   68|  18.8k|    }

_ZN7CSHA256C2Ev:
  695|  1.02M|{
  696|  1.02M|    sha256::Initialize(s);
  697|  1.02M|}
_ZN7CSHA2565WriteEPKhm:
  700|  5.33M|{
  701|  5.33M|    const unsigned char* end = data + len;
  702|  5.33M|    size_t bufsize = bytes % 64;
  703|  5.33M|    if (bufsize && bufsize + len >= 64) {
  ------------------
  |  Branch (703:9): [True: 3.84M, False: 1.49M]
  |  Branch (703:20): [True: 1.29M, False: 2.55M]
  ------------------
  704|       |        // Fill the buffer, and process it.
  705|  1.29M|        memcpy(buf + bufsize, data, 64 - bufsize);
  706|  1.29M|        bytes += 64 - bufsize;
  707|  1.29M|        data += 64 - bufsize;
  708|  1.29M|        Transform(s, buf, 1);
  709|  1.29M|        bufsize = 0;
  710|  1.29M|    }
  711|  5.33M|    if (end - data >= 64) {
  ------------------
  |  Branch (711:9): [True: 267k, False: 5.07M]
  ------------------
  712|   267k|        size_t blocks = (end - data) / 64;
  713|   267k|        Transform(s, data, blocks);
  714|   267k|        data += 64 * blocks;
  715|   267k|        bytes += 64 * blocks;
  716|   267k|    }
  717|  5.33M|    if (end > data) {
  ------------------
  |  Branch (717:9): [True: 3.84M, False: 1.49M]
  ------------------
  718|       |        // Fill the buffer with what remains.
  719|  3.84M|        memcpy(buf + bufsize, data, end - data);
  720|  3.84M|        bytes += end - data;
  721|  3.84M|    }
  722|  5.33M|    return *this;
  723|  5.33M|}
_ZN7CSHA2568FinalizeEPh:
  726|  1.19M|{
  727|  1.19M|    static const unsigned char pad[64] = {0x80};
  728|  1.19M|    unsigned char sizedesc[8];
  729|  1.19M|    WriteBE64(sizedesc, bytes << 3);
  730|  1.19M|    Write(pad, 1 + ((119 - (bytes % 64)) % 64));
  731|  1.19M|    Write(sizedesc, 8);
  732|  1.19M|    WriteBE32(hash, s[0]);
  733|  1.19M|    WriteBE32(hash + 4, s[1]);
  734|  1.19M|    WriteBE32(hash + 8, s[2]);
  735|  1.19M|    WriteBE32(hash + 12, s[3]);
  736|  1.19M|    WriteBE32(hash + 16, s[4]);
  737|  1.19M|    WriteBE32(hash + 20, s[5]);
  738|  1.19M|    WriteBE32(hash + 24, s[6]);
  739|  1.19M|    WriteBE32(hash + 28, s[7]);
  740|  1.19M|}
_ZN7CSHA2565ResetEv:
  743|   949k|{
  744|   949k|    bytes = 0;
  745|   949k|    sha256::Initialize(s);
  746|   949k|    return *this;
  747|   949k|}
sha256.cpp:_ZN12_GLOBAL__N_16sha25610InitializeEPj:
   87|  1.97M|{
   88|  1.97M|    s[0] = 0x6a09e667ul;
   89|  1.97M|    s[1] = 0xbb67ae85ul;
   90|  1.97M|    s[2] = 0x3c6ef372ul;
   91|  1.97M|    s[3] = 0xa54ff53aul;
   92|  1.97M|    s[4] = 0x510e527ful;
   93|  1.97M|    s[5] = 0x9b05688cul;
   94|  1.97M|    s[6] = 0x1f83d9abul;
   95|  1.97M|    s[7] = 0x5be0cd19ul;
   96|  1.97M|}

_ZN16sha256_x86_shani9TransformEPjPKhm:
   82|  1.56M|{
   83|  1.56M|    __m128i m0, m1, m2, m3, s0, s1, so0, so1;
   84|       |
   85|       |    /* Load state */
   86|  1.56M|    s0 = _mm_loadu_si128((const __m128i*)s);
   87|  1.56M|    s1 = _mm_loadu_si128((const __m128i*)(s + 4));
   88|  1.56M|    Shuffle(s0, s1);
   89|       |
   90|  3.38M|    while (blocks--) {
  ------------------
  |  Branch (90:12): [True: 1.82M, False: 1.56M]
  ------------------
   91|       |        /* Remember old state */
   92|  1.82M|        so0 = s0;
   93|  1.82M|        so1 = s1;
   94|       |
   95|       |        /* Load data and transform */
   96|  1.82M|        m0 = Load(chunk);
   97|  1.82M|        QuadRound(s0, s1, m0, 0xe9b5dba5b5c0fbcfull, 0x71374491428a2f98ull);
   98|  1.82M|        m1 = Load(chunk + 16);
   99|  1.82M|        QuadRound(s0, s1, m1, 0xab1c5ed5923f82a4ull, 0x59f111f13956c25bull);
  100|  1.82M|        ShiftMessageA(m0, m1);
  101|  1.82M|        m2 = Load(chunk + 32);
  102|  1.82M|        QuadRound(s0, s1, m2, 0x550c7dc3243185beull, 0x12835b01d807aa98ull);
  103|  1.82M|        ShiftMessageA(m1, m2);
  104|  1.82M|        m3 = Load(chunk + 48);
  105|  1.82M|        QuadRound(s0, s1, m3, 0xc19bf1749bdc06a7ull, 0x80deb1fe72be5d74ull);
  106|  1.82M|        ShiftMessageB(m2, m3, m0);
  107|  1.82M|        QuadRound(s0, s1, m0, 0x240ca1cc0fc19dc6ull, 0xefbe4786E49b69c1ull);
  108|  1.82M|        ShiftMessageB(m3, m0, m1);
  109|  1.82M|        QuadRound(s0, s1, m1, 0x76f988da5cb0a9dcull, 0x4a7484aa2de92c6full);
  110|  1.82M|        ShiftMessageB(m0, m1, m2);
  111|  1.82M|        QuadRound(s0, s1, m2, 0xbf597fc7b00327c8ull, 0xa831c66d983e5152ull);
  112|  1.82M|        ShiftMessageB(m1, m2, m3);
  113|  1.82M|        QuadRound(s0, s1, m3, 0x1429296706ca6351ull, 0xd5a79147c6e00bf3ull);
  114|  1.82M|        ShiftMessageB(m2, m3, m0);
  115|  1.82M|        QuadRound(s0, s1, m0, 0x53380d134d2c6dfcull, 0x2e1b213827b70a85ull);
  116|  1.82M|        ShiftMessageB(m3, m0, m1);
  117|  1.82M|        QuadRound(s0, s1, m1, 0x92722c8581c2c92eull, 0x766a0abb650a7354ull);
  118|  1.82M|        ShiftMessageB(m0, m1, m2);
  119|  1.82M|        QuadRound(s0, s1, m2, 0xc76c51A3c24b8b70ull, 0xa81a664ba2bfe8a1ull);
  120|  1.82M|        ShiftMessageB(m1, m2, m3);
  121|  1.82M|        QuadRound(s0, s1, m3, 0x106aa070f40e3585ull, 0xd6990624d192e819ull);
  122|  1.82M|        ShiftMessageB(m2, m3, m0);
  123|  1.82M|        QuadRound(s0, s1, m0, 0x34b0bcb52748774cull, 0x1e376c0819a4c116ull);
  124|  1.82M|        ShiftMessageB(m3, m0, m1);
  125|  1.82M|        QuadRound(s0, s1, m1, 0x682e6ff35b9cca4full, 0x4ed8aa4a391c0cb3ull);
  126|  1.82M|        ShiftMessageC(m0, m1, m2);
  127|  1.82M|        QuadRound(s0, s1, m2, 0x8cc7020884c87814ull, 0x78a5636f748f82eeull);
  128|  1.82M|        ShiftMessageC(m1, m2, m3);
  129|  1.82M|        QuadRound(s0, s1, m3, 0xc67178f2bef9A3f7ull, 0xa4506ceb90befffaull);
  130|       |
  131|       |        /* Combine with old state */
  132|  1.82M|        s0 = _mm_add_epi32(s0, so0);
  133|  1.82M|        s1 = _mm_add_epi32(s1, so1);
  134|       |
  135|       |        /* Advance */
  136|  1.82M|        chunk += 64;
  137|  1.82M|    }
  138|       |
  139|  1.56M|    Unshuffle(s0, s1);
  140|  1.56M|    _mm_storeu_si128((__m128i*)s, s0);
  141|  1.56M|    _mm_storeu_si128((__m128i*)(s + 4), s1);
  142|  1.56M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_17ShuffleERDv2_xS1_:
   54|  1.56M|{
   55|  1.56M|    const __m128i t1 = _mm_shuffle_epi32(s0, 0xB1);
   56|  1.56M|    const __m128i t2 = _mm_shuffle_epi32(s1, 0x1B);
   57|  1.56M|    s0 = _mm_alignr_epi8(t1, t2, 0x08);
   58|       |    s1 = _mm_blend_epi16(t2, t1, 0xF0);
   59|  1.56M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_14LoadEPKh:
   70|  7.28M|{
   71|  7.28M|    return _mm_shuffle_epi8(_mm_loadu_si128((const __m128i*)in), _mm_load_si128((const __m128i*)MASK));
   72|  7.28M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_19QuadRoundERDv2_xS1_S0_mm:
   31|  29.1M|{
   32|  29.1M|    const __m128i msg = _mm_add_epi32(m, _mm_set_epi64x(k1, k0));
   33|  29.1M|    state1 = _mm_sha256rnds2_epu32(state1, state0, msg);
   34|       |    state0 = _mm_sha256rnds2_epu32(state0, state1, _mm_shuffle_epi32(msg, 0x0e));
   35|  29.1M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_113ShiftMessageAERDv2_xS0_:
   38|  21.8M|{
   39|  21.8M|    m0 = _mm_sha256msg1_epu32(m0, m1);
   40|  21.8M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_113ShiftMessageBERDv2_xS0_S1_:
   48|  18.2M|{
   49|  18.2M|    ShiftMessageC(m0, m1, m2);
   50|  18.2M|    ShiftMessageA(m0, m1);
   51|  18.2M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_113ShiftMessageCERDv2_xS0_S1_:
   43|  21.8M|{
   44|       |    m2 = _mm_sha256msg2_epu32(_mm_add_epi32(m2, _mm_alignr_epi8(m1, m0, 4)), m1);
   45|  21.8M|}
sha256_x86_shani.cpp:_ZN12_GLOBAL__N_19UnshuffleERDv2_xS1_:
   62|  1.56M|{
   63|  1.56M|    const __m128i t1 = _mm_shuffle_epi32(s0, 0x1B);
   64|  1.56M|    const __m128i t2 = _mm_shuffle_epi32(s1, 0xB1);
   65|  1.56M|    s0 = _mm_blend_epi16(t1, t2, 0xF0);
   66|       |    s1 = _mm_alignr_epi8(t2, t1, 0x08);
   67|  1.56M|}

_Z7KeccakFRA25_m:
   18|  11.0k|{
   19|  11.0k|    static constexpr uint64_t RNDC[24] = {
   20|  11.0k|        0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000,
   21|  11.0k|        0x000000000000808b, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009,
   22|  11.0k|        0x000000000000008a, 0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
   23|  11.0k|        0x000000008000808b, 0x800000000000008b, 0x8000000000008089, 0x8000000000008003,
   24|  11.0k|        0x8000000000008002, 0x8000000000000080, 0x000000000000800a, 0x800000008000000a,
   25|  11.0k|        0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008
   26|  11.0k|    };
   27|  11.0k|    static constexpr int ROUNDS = 24;
   28|       |
   29|   276k|    for (int round = 0; round < ROUNDS; ++round) {
  ------------------
  |  Branch (29:25): [True: 265k, False: 11.0k]
  ------------------
   30|   265k|        uint64_t bc0, bc1, bc2, bc3, bc4, t;
   31|       |
   32|       |        // Theta
   33|   265k|        bc0 = st[0] ^ st[5] ^ st[10] ^ st[15] ^ st[20];
   34|   265k|        bc1 = st[1] ^ st[6] ^ st[11] ^ st[16] ^ st[21];
   35|   265k|        bc2 = st[2] ^ st[7] ^ st[12] ^ st[17] ^ st[22];
   36|   265k|        bc3 = st[3] ^ st[8] ^ st[13] ^ st[18] ^ st[23];
   37|   265k|        bc4 = st[4] ^ st[9] ^ st[14] ^ st[19] ^ st[24];
   38|   265k|        t = bc4 ^ std::rotl(bc1, 1); st[0] ^= t; st[5] ^= t; st[10] ^= t; st[15] ^= t; st[20] ^= t;
   39|   265k|        t = bc0 ^ std::rotl(bc2, 1); st[1] ^= t; st[6] ^= t; st[11] ^= t; st[16] ^= t; st[21] ^= t;
   40|   265k|        t = bc1 ^ std::rotl(bc3, 1); st[2] ^= t; st[7] ^= t; st[12] ^= t; st[17] ^= t; st[22] ^= t;
   41|   265k|        t = bc2 ^ std::rotl(bc4, 1); st[3] ^= t; st[8] ^= t; st[13] ^= t; st[18] ^= t; st[23] ^= t;
   42|   265k|        t = bc3 ^ std::rotl(bc0, 1); st[4] ^= t; st[9] ^= t; st[14] ^= t; st[19] ^= t; st[24] ^= t;
   43|       |
   44|       |        // Rho Pi
   45|   265k|        t = st[1];
   46|   265k|        bc0 = st[10]; st[10] = std::rotl(t, 1); t = bc0;
   47|   265k|        bc0 = st[7]; st[7] = std::rotl(t, 3); t = bc0;
   48|   265k|        bc0 = st[11]; st[11] = std::rotl(t, 6); t = bc0;
   49|   265k|        bc0 = st[17]; st[17] = std::rotl(t, 10); t = bc0;
   50|   265k|        bc0 = st[18]; st[18] = std::rotl(t, 15); t = bc0;
   51|   265k|        bc0 = st[3]; st[3] = std::rotl(t, 21); t = bc0;
   52|   265k|        bc0 = st[5]; st[5] = std::rotl(t, 28); t = bc0;
   53|   265k|        bc0 = st[16]; st[16] = std::rotl(t, 36); t = bc0;
   54|   265k|        bc0 = st[8]; st[8] = std::rotl(t, 45); t = bc0;
   55|   265k|        bc0 = st[21]; st[21] = std::rotl(t, 55); t = bc0;
   56|   265k|        bc0 = st[24]; st[24] = std::rotl(t, 2); t = bc0;
   57|   265k|        bc0 = st[4]; st[4] = std::rotl(t, 14); t = bc0;
   58|   265k|        bc0 = st[15]; st[15] = std::rotl(t, 27); t = bc0;
   59|   265k|        bc0 = st[23]; st[23] = std::rotl(t, 41); t = bc0;
   60|   265k|        bc0 = st[19]; st[19] = std::rotl(t, 56); t = bc0;
   61|   265k|        bc0 = st[13]; st[13] = std::rotl(t, 8); t = bc0;
   62|   265k|        bc0 = st[12]; st[12] = std::rotl(t, 25); t = bc0;
   63|   265k|        bc0 = st[2]; st[2] = std::rotl(t, 43); t = bc0;
   64|   265k|        bc0 = st[20]; st[20] = std::rotl(t, 62); t = bc0;
   65|   265k|        bc0 = st[14]; st[14] = std::rotl(t, 18); t = bc0;
   66|   265k|        bc0 = st[22]; st[22] = std::rotl(t, 39); t = bc0;
   67|   265k|        bc0 = st[9]; st[9] = std::rotl(t, 61); t = bc0;
   68|   265k|        bc0 = st[6]; st[6] = std::rotl(t, 20); t = bc0;
   69|   265k|        st[1] = std::rotl(t, 44);
   70|       |
   71|       |        // Chi Iota
   72|   265k|        bc0 = st[0]; bc1 = st[1]; bc2 = st[2]; bc3 = st[3]; bc4 = st[4];
   73|   265k|        st[0] = bc0 ^ (~bc1 & bc2) ^ RNDC[round];
   74|   265k|        st[1] = bc1 ^ (~bc2 & bc3);
   75|   265k|        st[2] = bc2 ^ (~bc3 & bc4);
   76|   265k|        st[3] = bc3 ^ (~bc4 & bc0);
   77|   265k|        st[4] = bc4 ^ (~bc0 & bc1);
   78|   265k|        bc0 = st[5]; bc1 = st[6]; bc2 = st[7]; bc3 = st[8]; bc4 = st[9];
   79|   265k|        st[5] = bc0 ^ (~bc1 & bc2);
   80|   265k|        st[6] = bc1 ^ (~bc2 & bc3);
   81|   265k|        st[7] = bc2 ^ (~bc3 & bc4);
   82|   265k|        st[8] = bc3 ^ (~bc4 & bc0);
   83|   265k|        st[9] = bc4 ^ (~bc0 & bc1);
   84|   265k|        bc0 = st[10]; bc1 = st[11]; bc2 = st[12]; bc3 = st[13]; bc4 = st[14];
   85|   265k|        st[10] = bc0 ^ (~bc1 & bc2);
   86|   265k|        st[11] = bc1 ^ (~bc2 & bc3);
   87|   265k|        st[12] = bc2 ^ (~bc3 & bc4);
   88|   265k|        st[13] = bc3 ^ (~bc4 & bc0);
   89|   265k|        st[14] = bc4 ^ (~bc0 & bc1);
   90|   265k|        bc0 = st[15]; bc1 = st[16]; bc2 = st[17]; bc3 = st[18]; bc4 = st[19];
   91|   265k|        st[15] = bc0 ^ (~bc1 & bc2);
   92|   265k|        st[16] = bc1 ^ (~bc2 & bc3);
   93|   265k|        st[17] = bc2 ^ (~bc3 & bc4);
   94|   265k|        st[18] = bc3 ^ (~bc4 & bc0);
   95|   265k|        st[19] = bc4 ^ (~bc0 & bc1);
   96|   265k|        bc0 = st[20]; bc1 = st[21]; bc2 = st[22]; bc3 = st[23]; bc4 = st[24];
   97|   265k|        st[20] = bc0 ^ (~bc1 & bc2);
   98|   265k|        st[21] = bc1 ^ (~bc2 & bc3);
   99|   265k|        st[22] = bc2 ^ (~bc3 & bc4);
  100|   265k|        st[23] = bc3 ^ (~bc4 & bc0);
  101|   265k|        st[24] = bc4 ^ (~bc0 & bc1);
  102|   265k|    }
  103|  11.0k|}
_ZN8SHA3_2565WriteENSt3__14spanIKhLm18446744073709551615EEE:
  106|  33.2k|{
  107|  33.2k|    if (m_bufsize && data.size() >= sizeof(m_buffer) - m_bufsize) {
  ------------------
  |  Branch (107:9): [True: 22.1k, False: 11.0k]
  |  Branch (107:22): [True: 22.1k, False: 0]
  ------------------
  108|       |        // Fill the buffer and process it.
  109|  22.1k|        std::copy(data.begin(), data.begin() + (sizeof(m_buffer) - m_bufsize), m_buffer + m_bufsize);
  110|  22.1k|        data = data.subspan(sizeof(m_buffer) - m_bufsize);
  111|  22.1k|        m_state[m_pos++] ^= ReadLE64(m_buffer);
  112|  22.1k|        m_bufsize = 0;
  113|  22.1k|        if (m_pos == RATE_BUFFERS) {
  ------------------
  |  Branch (113:13): [True: 0, False: 22.1k]
  ------------------
  114|      0|            KeccakF(m_state);
  115|      0|            m_pos = 0;
  116|      0|        }
  117|  22.1k|    }
  118|  77.5k|    while (data.size() >= sizeof(m_buffer)) {
  ------------------
  |  Branch (118:12): [True: 44.2k, False: 33.2k]
  ------------------
  119|       |        // Process chunks directly from the buffer.
  120|  44.2k|        m_state[m_pos++] ^= ReadLE64(data.data());
  121|  44.2k|        data = data.subspan(8);
  122|  44.2k|        if (m_pos == RATE_BUFFERS) {
  ------------------
  |  Branch (122:13): [True: 0, False: 44.2k]
  ------------------
  123|      0|            KeccakF(m_state);
  124|      0|            m_pos = 0;
  125|      0|        }
  126|  44.2k|    }
  127|  33.2k|    if (data.size()) {
  ------------------
  |  Branch (127:9): [True: 22.1k, False: 11.0k]
  ------------------
  128|       |        // Keep the remainder in the buffer.
  129|  22.1k|        std::copy(data.begin(), data.end(), m_buffer + m_bufsize);
  130|  22.1k|        m_bufsize += data.size();
  131|  22.1k|    }
  132|  33.2k|    return *this;
  133|  33.2k|}
_ZN8SHA3_2568FinalizeENSt3__14spanIhLm18446744073709551615EEE:
  136|  11.0k|{
  137|  11.0k|    assert(output.size() == OUTPUT_SIZE);
  ------------------
  |  Branch (137:5): [True: 11.0k, False: 0]
  ------------------
  138|  11.0k|    std::fill(m_buffer + m_bufsize, m_buffer + sizeof(m_buffer), 0);
  139|  11.0k|    m_buffer[m_bufsize] ^= 0x06;
  140|  11.0k|    m_state[m_pos] ^= ReadLE64(m_buffer);
  141|  11.0k|    m_state[RATE_BUFFERS - 1] ^= 0x8000000000000000;
  142|  11.0k|    KeccakF(m_state);
  143|  55.3k|    for (unsigned i = 0; i < 4; ++i) {
  ------------------
  |  Branch (143:26): [True: 44.2k, False: 11.0k]
  ------------------
  144|  44.2k|        WriteLE64(output.data() + 8 * i, m_state[i]);
  145|  44.2k|    }
  146|  11.0k|    return *this;
  147|  11.0k|}

_ZN8SHA3_256C2Ev:
   34|  11.0k|    SHA3_256() = default;

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

_ZN10CSipHasherC2Emm:
   12|  1.30M|CSipHasher::CSipHasher(uint64_t k0, uint64_t k1) : m_state{k0, k1} {}
_ZN10CSipHasher5WriteEm:
   15|  2.60M|{
   16|  2.60M|    assert(m_count % 8 == 0);
  ------------------
  |  Branch (16:5): [True: 2.60M, False: 0]
  ------------------
   17|  2.60M|    m_state.Compress2(data);
   18|  2.60M|    m_count += 8;
   19|  2.60M|    return *this;
   20|  2.60M|}
_ZN10CSipHasher5WriteENSt3__14spanIKhLm18446744073709551615EEE:
   23|   969k|{
   24|   969k|    SipHashState state{m_state.Copy()};
   25|   969k|    uint64_t t{m_tmp};
   26|   969k|    uint8_t c{m_count};
   27|       |
   28|  13.1M|    while (data.size() > 0) {
  ------------------
  |  Branch (28:12): [True: 12.2M, False: 969k]
  ------------------
   29|  12.2M|        t |= uint64_t{data.front()} << (8 * (c % 8));
   30|  12.2M|        c++;
   31|  12.2M|        if ((c & 7) == 0) {
  ------------------
  |  Branch (31:13): [True: 1.33M, False: 10.8M]
  ------------------
   32|  1.33M|            state.Compress2(t);
   33|  1.33M|            t = 0;
   34|  1.33M|        }
   35|  12.2M|        data = data.subspan(1);
   36|  12.2M|    }
   37|       |
   38|   969k|    m_state = state;
   39|   969k|    m_count = c;
   40|   969k|    m_tmp = t;
   41|       |
   42|   969k|    return *this;
   43|   969k|}
_ZNK10CSipHasher8FinalizeEv:
   46|  1.30M|{
   47|  1.30M|    return m_state.Copy()
   48|  1.30M|                  .Compress2(m_tmp | (uint64_t{m_count} << 56))
   49|  1.30M|                  .Finalize4();
   50|  1.30M|}

_ZN12SipHashStateC2Emmmm:
   28|  3.57M|    ALWAYS_INLINE SipHashState(uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3) noexcept : m_v0{v0}, m_v1{v1}, m_v2{v2}, m_v3{v3} {}
_ZN12SipHashState8SipRoundEv:
   35|  15.6M|    {
   36|  15.6M|        m_v0 += m_v1; m_v1 = std::rotl(m_v1, 13); m_v1 ^= m_v0;
   37|  15.6M|        m_v0 = std::rotl(m_v0, 32);
   38|  15.6M|        m_v2 += m_v3; m_v3 = std::rotl(m_v3, 16); m_v3 ^= m_v2;
   39|  15.6M|        m_v0 += m_v3; m_v3 = std::rotl(m_v3, 21); m_v3 ^= m_v0;
   40|  15.6M|        m_v2 += m_v1; m_v1 = std::rotl(m_v1, 17); m_v1 ^= m_v2;
   41|  15.6M|        m_v2 = std::rotl(m_v2, 32);
   42|  15.6M|    }
_ZN12SipHashStateC2Emm:
   46|  1.30M|    explicit ALWAYS_INLINE SipHashState(uint64_t k0, uint64_t k1) noexcept : SipHashState{C0 ^ k0, C1 ^ k1, C2 ^ k0, C3 ^ k1} {}
_ZNK12SipHashState4CopyEv:
   48|  2.26M|    ALWAYS_INLINE SipHashState Copy() const noexcept { return {m_v0, m_v1, m_v2, m_v3}; }
_ZN12SipHashState9Compress2Em:
   68|  5.23M|    {
   69|  5.23M|        m_v3 ^= data;
   70|  5.23M|        SipRound();
   71|  5.23M|        SipRound();
   72|  5.23M|        m_v0 ^= data;
   73|  5.23M|        return *this;
   74|  5.23M|    }
_ZN12SipHashState9Finalize4Ev:
   77|  1.30M|    {
   78|  1.30M|        m_v2 ^= FINALIZER;
   79|  1.30M|        SipRound();
   80|  1.30M|        SipRound();
   81|  1.30M|        SipRound();
   82|  1.30M|        SipRound();
   83|  1.30M|        return m_v0 ^ m_v1 ^ m_v2 ^ m_v3;
   84|  1.30M|    }

_ZN10CDBWrapperD2Ev:
  299|      4|{
  300|      4|    delete DBContext().pdb;
  301|      4|    DBContext().pdb = nullptr;
  302|      4|    delete DBContext().options.filter_policy;
  303|      4|    DBContext().options.filter_policy = nullptr;
  304|      4|    delete DBContext().options.info_log;
  305|      4|    DBContext().options.info_log = nullptr;
  306|      4|    delete DBContext().options.block_cache;
  307|      4|    DBContext().options.block_cache = nullptr;
  308|      4|    delete DBContext().penv;
  309|      4|    DBContext().options.env = nullptr;
  310|      4|}

_ZNK10CDBWrapper9DBContextEv:
  210|     40|    auto& DBContext() const LIFETIMEBOUND { return *Assert(m_db_context); }
  ------------------
  |  |  116|     40|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------

_ZN10HashWriterlsINSt3__14spanIKSt4byteLm18446744073709551615EEEEERS_RKT_:
  150|    280|    {
  151|    280|        ::Serialize(*this, obj);
  152|    280|        return *this;
  153|    280|    }
_ZN10HashWriter12GetCheapHashEv:
  143|   212k|    inline uint64_t GetCheapHash() {
  144|   212k|        uint256 result = GetHash();
  145|   212k|        return ReadLE64(result.begin());
  146|   212k|    }
_ZN8CHash2565ResetEv:
   50|   393k|    CHash256& Reset() {
   51|   393k|        sha.Reset();
   52|   393k|        return *this;
   53|   393k|    }
_Z4HashINSt3__16vectorIhNS0_9allocatorIhEEEEE7uint256RKT_:
   84|  86.7k|{
   85|  86.7k|    uint256 result;
   86|  86.7k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   87|  86.7k|    return result;
   88|  86.7k|}
_ZN10HashWriterlsImEERS_RKT_:
  150|  61.0k|    {
  151|  61.0k|        ::Serialize(*this, obj);
  152|  61.0k|        return *this;
  153|  61.0k|    }
_ZN9ChainCodeD2Ev:
   28|      2|    ~ChainCode() { memory_cleanse(data(), size()); }
_ZN8CHash2565WriteENSt3__14spanIKhLm18446744073709551615EEE:
   45|  87.1k|    CHash256& Write(std::span<const unsigned char> input) {
   46|  87.1k|        sha.Write(input.data(), input.size());
   47|  87.1k|        return *this;
   48|  87.1k|    }
_ZN8CHash2568FinalizeENSt3__14spanIhLm18446744073709551615EEE:
   38|  87.1k|    void Finalize(std::span<unsigned char> output) {
   39|  87.1k|        assert(output.size() == OUTPUT_SIZE);
  ------------------
  |  Branch (39:9): [True: 87.1k, False: 0]
  ------------------
   40|  87.1k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   41|  87.1k|        sha.Finalize(buf);
   42|  87.1k|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   43|  87.1k|    }
_ZN10HashWriterlsINSt3__16vectorIhNS1_9allocatorIhEEEEEERS_RKT_:
  150|   239k|    {
  151|   239k|        ::Serialize(*this, obj);
  152|   239k|        return *this;
  153|   239k|    }
_ZN10HashWriterlsINSt3__14spanIKhLm32EEEEERS_RKT_:
  150|   212k|    {
  151|   212k|        ::Serialize(*this, obj);
  152|   212k|        return *this;
  153|   212k|    }
_ZN10HashWriterlsIiEERS_RKT_:
  150|  90.0k|    {
  151|  90.0k|        ::Serialize(*this, obj);
  152|  90.0k|        return *this;
  153|  90.0k|    }
_ZN10HashWriter7GetHashEv:
  123|   212k|    uint256 GetHash() {
  124|   212k|        uint256 result;
  125|   212k|        ctx.Finalize(result.begin());
  126|   212k|        ctx.Reset().Write(result.begin(), CSHA256::OUTPUT_SIZE).Finalize(result.begin());
  127|   212k|        return result;
  128|   212k|    }
_ZN10HashWriterlsI7uint256EERS_RKT_:
  150|   212k|    {
  151|   212k|        ::Serialize(*this, obj);
  152|   212k|        return *this;
  153|   212k|    }
_ZN10HashWriterlsIhEERS_RKT_:
  150|  90.0k|    {
  151|  90.0k|        ::Serialize(*this, obj);
  152|  90.0k|        return *this;
  153|  90.0k|    }
_ZN10HashWriter5writeENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  115|   932k|    {
  116|   932k|        ctx.Write(UCharCast(src.data()), src.size());
  117|   932k|    }

_ZN3i2p3sam7SessionC2ERK5ProxyNSt3__110shared_ptrI16CThreadInterruptEE:
  131|    479|    : m_control_host{control_host},
  132|    479|      m_interrupt{interrupt},
  133|    479|      m_transient{true}
  134|    479|{
  135|    479|}
_ZN3i2p3sam7SessionD2Ev:
  138|    479|{
  139|    479|    LOCK(m_mutex);
  ------------------
  |  |  268|    479|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    479|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    479|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    479|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|    479|    Disconnect();
  141|    479|}
_ZN3i2p3sam7Session7ConnectERK8CServiceRNS_10ConnectionERb:
  223|  2.74k|{
  224|       |    // Refuse connecting to arbitrary ports. We don't specify any destination port to the SAM proxy
  225|       |    // when connecting (SAM 3.1 does not use ports) and it forces/defaults it to I2P_SAM31_PORT.
  226|  2.74k|    if (to.GetPort() != I2P_SAM31_PORT) {
  ------------------
  |  Branch (226:9): [True: 587, False: 2.15k]
  ------------------
  227|    587|        LogDebug(BCLog::I2P, "Error connecting to %s, connection refused due to arbitrary port %s\n", to.ToStringAddrPort(), to.GetPort());
  ------------------
  |  |  143|    587|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    587|    do {                                                                                      \
  |  |  |  |  137|    587|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 587]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    587|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 587]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|    587|        proxy_error = false;
  229|    587|        return false;
  230|    587|    }
  231|       |
  232|  2.15k|    proxy_error = true;
  233|       |
  234|  2.15k|    std::string session_id;
  235|  2.15k|    std::unique_ptr<Sock> sock;
  236|  2.15k|    conn.peer = to;
  237|       |
  238|  2.15k|    try {
  239|  2.15k|        {
  240|  2.15k|            LOCK(m_mutex);
  ------------------
  |  |  268|  2.15k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.15k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.15k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.15k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  2.15k|            CreateIfNotCreatedAlready();
  242|  2.15k|            session_id = m_session_id;
  243|  2.15k|            conn.me = m_my_addr;
  244|  2.15k|            sock = Hello();
  245|  2.15k|        }
  246|       |
  247|  2.15k|        const Reply& lookup_reply =
  248|  2.15k|            SendRequestAndGetReply(*sock, strprintf("NAMING LOOKUP NAME=%s", to.ToStringAddr()));
  ------------------
  |  | 1172|  2.15k|#define strprintf tfm::format
  ------------------
  249|       |
  250|  2.15k|        const std::string& dest = lookup_reply.Get("VALUE");
  251|       |
  252|  2.15k|        const Reply& connect_reply = SendRequestAndGetReply(
  253|  2.15k|            *sock, strprintf("STREAM CONNECT ID=%s DESTINATION=%s SILENT=false", session_id, dest),
  ------------------
  |  | 1172|  2.15k|#define strprintf tfm::format
  ------------------
  254|  2.15k|            false);
  255|       |
  256|  2.15k|        const std::string& result = connect_reply.Get("RESULT");
  257|       |
  258|  2.15k|        if (result == "OK") {
  ------------------
  |  Branch (258:13): [True: 0, False: 2.15k]
  ------------------
  259|      0|            conn.sock = std::move(sock);
  260|      0|            return true;
  261|      0|        }
  262|       |
  263|  2.15k|        if (result == "INVALID_ID") {
  ------------------
  |  Branch (263:13): [True: 0, False: 2.15k]
  ------------------
  264|      0|            LOCK(m_mutex);
  ------------------
  |  |  268|      0|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|      0|            Disconnect();
  266|      0|            throw std::runtime_error("Invalid session id");
  267|      0|        }
  268|       |
  269|  2.15k|        if (result == "CANT_REACH_PEER" || result == "TIMEOUT") {
  ------------------
  |  Branch (269:13): [True: 2.15k, False: 0]
  |  Branch (269:44): [True: 0, False: 0]
  ------------------
  270|      0|            proxy_error = false;
  271|      0|        }
  272|       |
  273|  2.15k|        throw std::runtime_error(strprintf("\"%s\"", connect_reply.full));
  ------------------
  |  | 1172|  2.15k|#define strprintf tfm::format
  ------------------
  274|  2.15k|    } catch (const std::runtime_error& e) {
  275|  2.15k|        LogDebug(BCLog::I2P, "Error connecting to %s: %s\n", to.ToStringAddrPort(), e.what());
  ------------------
  |  |  143|  2.15k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  2.15k|    do {                                                                                      \
  |  |  |  |  137|  2.15k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 2.15k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  2.15k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|  2.15k|        CheckControlSock();
  277|  2.15k|        return false;
  278|  2.15k|    }
  279|  2.15k|}
_ZNK3i2p3sam7Session5Reply3GetERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  284|    406|{
  285|    406|    const auto& pos = keys.find(key);
  286|    406|    if (pos == keys.end() || !pos->second.has_value()) {
  ------------------
  |  Branch (286:9): [True: 358, False: 48]
  |  Branch (286:9): [True: 364, False: 42]
  |  Branch (286:30): [True: 6, False: 42]
  ------------------
  287|    364|        throw std::runtime_error(
  288|    364|            strprintf("Missing %s= in the reply to \"%s\"", key, request));
  ------------------
  |  | 1172|    364|#define strprintf tfm::format
  ------------------
  289|    364|    }
  290|     42|    return pos->second.value();
  291|    406|}
_ZNK3i2p3sam7Session22SendRequestAndGetReplyERK4SockRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEb:
  296|  1.20k|{
  297|  1.20k|    sock.SendComplete(request + "\n", MAX_WAIT_FOR_IO, *m_interrupt);
  298|       |
  299|  1.20k|    Reply reply;
  300|       |
  301|       |    // Don't log the full "SESSION CREATE ..." because it contains our private key.
  302|  1.20k|    reply.request = request.starts_with("SESSION CREATE") ? "SESSION CREATE ..." : request;
  ------------------
  |  Branch (302:21): [True: 18, False: 1.18k]
  ------------------
  303|       |
  304|       |    // It could take a few minutes for the I2P router to reply as it is querying the I2P network
  305|       |    // (when doing name lookup, for example). Notice: `RecvUntilTerminator()` is checking
  306|       |    // `m_interrupt` more often, so we would not be stuck here for long if `m_interrupt` is
  307|       |    // signaled.
  308|  1.20k|    static constexpr auto recv_timeout = 3min;
  309|       |
  310|  1.20k|    reply.full = sock.RecvUntilTerminator('\n', recv_timeout, *m_interrupt, MAX_MSG_SIZE);
  311|       |
  312|  26.3k|    for (const auto& kv : Split(reply.full, ' ')) {
  ------------------
  |  Branch (312:25): [True: 26.3k, False: 1.20k]
  ------------------
  313|  26.3k|        const auto pos{std::ranges::find(kv, '=')};
  314|  26.3k|        if (pos != kv.end()) {
  ------------------
  |  Branch (314:13): [True: 4.82k, False: 21.5k]
  ------------------
  315|  4.82k|            reply.keys.emplace(std::string{kv.begin(), pos}, std::string{pos + 1, kv.end()});
  316|  21.5k|        } else {
  317|  21.5k|            reply.keys.emplace(std::string{kv.begin(), kv.end()}, std::nullopt);
  318|  21.5k|        }
  319|  26.3k|    }
  320|       |
  321|  1.20k|    if (check_result_ok && reply.Get("RESULT") != "OK") {
  ------------------
  |  Branch (321:9): [True: 399, False: 802]
  |  Branch (321:9): [True: 17, False: 1.18k]
  |  Branch (321:28): [True: 17, False: 382]
  ------------------
  322|     17|        throw std::runtime_error(
  323|     17|            strprintf("Reply to \"%s\": had a RESULT not equal to OK.", reply.request));
  ------------------
  |  | 1172|     17|#define strprintf tfm::format
  ------------------
  324|     17|    }
  325|       |
  326|  1.18k|    return reply;
  327|  1.20k|}
_ZNK3i2p3sam7Session5HelloEv:
  330|  2.15k|{
  331|  2.15k|    auto sock = m_control_host.Connect();
  332|       |
  333|  2.15k|    if (!sock) {
  ------------------
  |  Branch (333:9): [True: 976, False: 1.18k]
  ------------------
  334|    976|        throw std::runtime_error(strprintf("Cannot connect to %s", m_control_host.ToString()));
  ------------------
  |  | 1172|    976|#define strprintf tfm::format
  ------------------
  335|    976|    }
  336|       |
  337|  1.18k|    SendRequestAndGetReply(*sock, "HELLO VERSION MIN=3.1 MAX=3.1");
  338|       |
  339|  1.18k|    return sock;
  340|  2.15k|}
_ZN3i2p3sam7Session16CheckControlSockEv:
  343|  2.15k|{
  344|  2.15k|    LOCK(m_mutex);
  ------------------
  |  |  268|  2.15k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.15k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.15k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.15k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  345|       |
  346|  2.15k|    std::string errmsg;
  347|  2.15k|    if (m_control_sock && !m_control_sock->IsConnected(errmsg)) {
  ------------------
  |  Branch (347:9): [True: 0, False: 2.15k]
  |  Branch (347:27): [True: 0, False: 0]
  ------------------
  348|      0|        LogDebug(BCLog::I2P, "Control socket error: %s\n", errmsg);
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|      0|        Disconnect();
  350|      0|    }
  351|  2.15k|}
_ZN3i2p3sam7Session25CreateIfNotCreatedAlreadyEv:
  409|  2.15k|{
  410|  2.15k|    std::string errmsg;
  411|  2.15k|    if (m_control_sock && m_control_sock->IsConnected(errmsg)) {
  ------------------
  |  Branch (411:9): [True: 0, False: 2.15k]
  |  Branch (411:27): [True: 0, False: 0]
  ------------------
  412|      0|        return;
  413|      0|    }
  414|       |
  415|  2.15k|    const auto session_type = m_transient ? "transient" : "persistent";
  ------------------
  |  Branch (415:31): [True: 2.15k, False: 0]
  ------------------
  416|  2.15k|    const auto session_id = GetRandHash().GetHex().substr(0, 10); // full is overkill, too verbose in the logs
  417|       |
  418|  2.15k|    LogDebug(BCLog::I2P, "Creating %s I2P SAM session %s with %s\n", session_type, session_id, m_control_host.ToString());
  ------------------
  |  |  143|  2.15k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  2.15k|    do {                                                                                      \
  |  |  |  |  137|  2.15k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 2.15k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  2.15k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  419|       |
  420|  2.15k|    auto sock = Hello();
  421|       |
  422|  2.15k|    if (m_transient) {
  ------------------
  |  Branch (422:9): [True: 18, False: 2.14k]
  ------------------
  423|       |        // The destination (private key) is generated upon session creation and returned
  424|       |        // in the reply in DESTINATION=.
  425|     18|        const Reply& reply = SendRequestAndGetReply(
  426|     18|            *sock,
  427|     18|            strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7 "
  ------------------
  |  | 1172|     18|#define strprintf tfm::format
  ------------------
  428|     18|                      "i2cp.leaseSetEncType=4,0 inbound.quantity=1 outbound.quantity=1",
  429|     18|                      session_id));
  430|       |
  431|     18|        m_private_key = DecodeI2PBase64(reply.Get("DESTINATION"));
  432|  2.14k|    } else {
  433|       |        // Read our persistent destination (private key) from disk or generate
  434|       |        // one and save it to disk. Then use it when creating the session.
  435|  2.14k|        const auto& [read_ok, data] = ReadBinaryFile(m_private_key_file);
  436|  2.14k|        if (read_ok) {
  ------------------
  |  Branch (436:13): [True: 0, False: 2.14k]
  ------------------
  437|      0|            m_private_key.assign(data.begin(), data.end());
  438|  2.14k|        } else {
  439|  2.14k|            GenerateAndSavePrivateKey(*sock);
  440|  2.14k|        }
  441|       |
  442|  2.14k|        const std::string& private_key_b64 = SwapBase64(EncodeBase64(m_private_key));
  443|       |
  444|  2.14k|        SendRequestAndGetReply(*sock,
  445|  2.14k|                               strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
  ------------------
  |  | 1172|  2.14k|#define strprintf tfm::format
  ------------------
  446|  2.14k|                                         "i2cp.leaseSetEncType=4,0 inbound.quantity=3 outbound.quantity=3",
  447|  2.14k|                                         session_id,
  448|  2.14k|                                         private_key_b64));
  449|  2.14k|    }
  450|       |
  451|  2.15k|    m_my_addr = CService(DestBinToAddr(MyDestination()), I2P_SAM31_PORT);
  452|  2.15k|    m_session_id = session_id;
  453|  2.15k|    m_control_sock = std::move(sock);
  454|       |
  455|  2.15k|    LogInfo("%s I2P SAM session %s created, my address=%s",
  ------------------
  |  |  125|  2.15k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  2.15k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  456|  2.15k|        Capitalize(session_type),
  457|  2.15k|        m_session_id,
  458|  2.15k|        m_my_addr.ToStringAddrPort());
  459|  2.15k|}
_ZN3i2p3sam7Session10DisconnectEv:
  483|    479|{
  484|    479|    if (m_control_sock) {
  ------------------
  |  Branch (484:9): [True: 0, False: 479]
  ------------------
  485|      0|        if (m_session_id.empty()) {
  ------------------
  |  Branch (485:13): [True: 0, False: 0]
  ------------------
  486|      0|            LogInfo("Destroying incomplete I2P SAM session");
  ------------------
  |  |  125|      0|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  487|      0|        } else {
  488|      0|            LogInfo("Destroying I2P SAM session %s", m_session_id);
  ------------------
  |  |  125|      0|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  489|      0|        }
  490|      0|        m_control_sock.reset();
  491|      0|    }
  492|    479|    m_session_id.clear();
  493|    479|}

_ZN10interfaces5ChainD2Ev:
  119|      2|    virtual ~Chain() = default;

_ZNK12CChainParams14GetDefaultPortEv:
   91|   180k|    uint16_t GetDefaultPort() const { return nDefaultPort; }
_ZNK12CChainParams12MessageStartEv:
   90|   446k|    const MessageStartChars& MessageStart() const { return pchMessageStart; }

_ZN6kernel13NotificationsD2Ev:
   38|      2|    virtual ~Notifications() = default;

_ZN4CKey5CheckEPKh:
  159|   256k|bool CKey::Check(const unsigned char *vch) {
  160|   256k|    return secp256k1_ec_seckey_verify(secp256k1_context_static, vch);
  161|   256k|}
_ZN4CKey10MakeNewKeyEb:
  163|   256k|void CKey::MakeNewKey(bool fCompressedIn) {
  164|   256k|    MakeKeyData();
  165|   256k|    do {
  166|   256k|        GetStrongRandBytes(*keydata);
  167|   256k|    } while (!Check(keydata->data()));
  ------------------
  |  Branch (167:14): [True: 0, False: 256k]
  ------------------
  168|   256k|    fCompressed = fCompressedIn;
  169|   256k|}
_ZNK4CKey14EllSwiftCreateENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  314|   256k|{
  315|   256k|    assert(keydata);
  ------------------
  |  Branch (315:5): [True: 256k, False: 0]
  ------------------
  316|   256k|    assert(ent32.size() == 32);
  ------------------
  |  Branch (316:5): [True: 256k, False: 0]
  ------------------
  317|   256k|    std::array<std::byte, EllSwiftPubKey::size()> encoded_pubkey;
  318|       |
  319|   256k|    auto success = secp256k1_ellswift_create(secp256k1_context_sign,
  320|   256k|                                             UCharCast(encoded_pubkey.data()),
  321|   256k|                                             keydata->data(),
  322|   256k|                                             UCharCast(ent32.data()));
  323|       |
  324|       |    // Should always succeed for valid keys (asserted above).
  325|   256k|    assert(success);
  ------------------
  |  Branch (325:5): [True: 256k, False: 0]
  ------------------
  326|   256k|    return {encoded_pubkey};
  327|   256k|}
_ZNK4CKey23ComputeBIP324ECDHSecretERK14EllSwiftPubKeyS2_b:
  330|  18.8k|{
  331|  18.8k|    assert(keydata);
  ------------------
  |  Branch (331:5): [True: 18.8k, False: 0]
  ------------------
  332|       |
  333|  18.8k|    ECDHSecret output;
  334|       |    // BIP324 uses the initiator as party A, and the responder as party B. Remap the inputs
  335|       |    // accordingly:
  336|  18.8k|    bool success = secp256k1_ellswift_xdh(secp256k1_context_static,
  337|  18.8k|                                          UCharCast(output.data()),
  338|  18.8k|                                          UCharCast(initiating ? our_ellswift.data() : their_ellswift.data()),
  ------------------
  |  Branch (338:53): [True: 46, False: 18.8k]
  ------------------
  339|  18.8k|                                          UCharCast(initiating ? their_ellswift.data() : our_ellswift.data()),
  ------------------
  |  Branch (339:53): [True: 46, False: 18.8k]
  ------------------
  340|  18.8k|                                          keydata->data(),
  341|  18.8k|                                          initiating ? 0 : 1,
  ------------------
  |  Branch (341:43): [True: 46, False: 18.8k]
  ------------------
  342|  18.8k|                                          secp256k1_ellswift_xdh_hash_function_bip324,
  343|  18.8k|                                          nullptr);
  344|       |    // Should always succeed for valid keys (assert above).
  345|  18.8k|    assert(success);
  ------------------
  |  Branch (345:5): [True: 18.8k, False: 0]
  ------------------
  346|  18.8k|    return output;
  347|  18.8k|}
_Z17GenerateRandomKeyb:
  355|   256k|{
  356|   256k|    CKey key;
  357|   256k|    key.MakeNewKey(/*fCompressed=*/compressed);
  358|   256k|    return key;
  359|   256k|}
_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|}

_ZN4CKeyC2Ev:
   79|   275k|    CKey() noexcept = default;
_ZN4CKeyaSEOS_:
   81|  18.8k|    CKey& operator=(CKey&&) noexcept = default;
_ZN4CKeyC2ERKS_:
   97|   256k|    CKey(const CKey& other) { *this = other; }
_ZN4CKeyaSERKS_:
   84|   256k|    {
   85|   256k|        if (this != &other) {
  ------------------
  |  Branch (85:13): [True: 256k, False: 0]
  ------------------
   86|   256k|            if (other.keydata) {
  ------------------
  |  Branch (86:17): [True: 256k, False: 0]
  ------------------
   87|   256k|                MakeKeyData();
   88|   256k|                *keydata = *other.keydata;
   89|   256k|            } else {
   90|      0|                ClearKeyData();
   91|      0|            }
   92|   256k|            fCompressed = other.fCompressed;
   93|   256k|        }
   94|   256k|        return *this;
   95|   256k|    }
_ZN4CKey11MakeKeyDataEv:
   69|   512k|    {
   70|   512k|        if (!keydata) keydata = make_secure_unique<KeyType>();
  ------------------
  |  Branch (70:13): [True: 512k, False: 0]
  ------------------
   71|   512k|    }

_ZN7leveldb6DBImplD2Ev:
  153|      4|DBImpl::~DBImpl() {
  154|       |  // Wait for background work to finish.
  155|      4|  mutex_.Lock();
  156|      4|  shutting_down_.store(true, std::memory_order_release);
  157|      4|  while (background_compaction_scheduled_) {
  ------------------
  |  Branch (157:10): [True: 0, False: 4]
  ------------------
  158|      0|    background_work_finished_signal_.Wait();
  159|      0|  }
  160|      4|  mutex_.Unlock();
  161|       |
  162|      4|  if (db_lock_ != nullptr) {
  ------------------
  |  Branch (162:7): [True: 4, False: 0]
  ------------------
  163|      4|    env_->UnlockFile(db_lock_);
  164|      4|  }
  165|       |
  166|      4|  delete versions_;
  167|      4|  if (mem_ != nullptr) mem_->Unref();
  ------------------
  |  Branch (167:7): [True: 4, False: 0]
  ------------------
  168|      4|  if (imm_ != nullptr) imm_->Unref();
  ------------------
  |  Branch (168:7): [True: 0, False: 4]
  ------------------
  169|      4|  delete tmp_batch_;
  170|      4|  delete log_;
  171|      4|  delete logfile_;
  172|      4|  delete table_cache_;
  173|       |
  174|      4|  if (owns_info_log_) {
  ------------------
  |  Branch (174:7): [True: 0, False: 4]
  ------------------
  175|      0|    delete options_.info_log;
  176|      0|  }
  177|      4|  if (owns_cache_) {
  ------------------
  |  Branch (177:7): [True: 0, False: 4]
  ------------------
  178|      0|    delete options_.block_cache;
  179|      0|  }
  180|      4|}
_ZN7leveldb2DBD2Ev:
 1478|      4|DB::~DB() = default;
_ZN7leveldb8SnapshotD2Ev:
 1523|      4|Snapshot::~Snapshot() = default;

_ZN7leveldb3log6WriterD2Ev:
   32|      8|Writer::~Writer() = default;

_ZN7leveldb8MemTableD2Ev:
   24|      4|MemTable::~MemTable() { assert(refs_ == 0); }
  ------------------
  |  Branch (24:25): [True: 4, False: 0]
  ------------------

_ZN7leveldb8MemTable5UnrefEv:
   33|      4|  void Unref() {
   34|      4|    --refs_;
   35|      4|    assert(refs_ >= 0);
  ------------------
  |  Branch (35:5): [True: 4, False: 0]
  ------------------
   36|      4|    if (refs_ <= 0) {
  ------------------
  |  Branch (36:9): [True: 4, False: 0]
  ------------------
   37|      4|      delete this;
   38|      4|    }
   39|      4|  }

_ZN7leveldb10TableCacheD2Ev:
   39|      4|TableCache::~TableCache() { delete cache_; }

_ZN7leveldb7VersionD2Ev:
   68|      8|Version::~Version() {
   69|      8|  assert(refs_ == 0);
  ------------------
  |  Branch (69:3): [True: 8, False: 0]
  ------------------
   70|       |
   71|       |  // Remove from linked list
   72|      8|  prev_->next_ = next_;
   73|      8|  next_->prev_ = prev_;
   74|       |
   75|       |  // Drop references to files
   76|     64|  for (int level = 0; level < config::kNumLevels; level++) {
  ------------------
  |  Branch (76:23): [True: 56, False: 8]
  ------------------
   77|     56|    for (size_t i = 0; i < files_[level].size(); i++) {
  ------------------
  |  Branch (77:24): [True: 0, False: 56]
  ------------------
   78|      0|      FileMetaData* f = files_[level][i];
   79|      0|      assert(f->refs > 0);
  ------------------
  |  Branch (79:7): [True: 0, False: 0]
  ------------------
   80|      0|      f->refs--;
   81|      0|      if (f->refs <= 0) {
  ------------------
  |  Branch (81:11): [True: 0, False: 0]
  ------------------
   82|      0|        delete f;
   83|      0|      }
   84|      0|    }
   85|     56|  }
   86|      8|}
_ZN7leveldb7Version5UnrefEv:
  451|      4|void Version::Unref() {
  452|      4|  assert(this != &vset_->dummy_versions_);
  ------------------
  |  Branch (452:3): [True: 4, False: 0]
  ------------------
  453|      4|  assert(refs_ >= 1);
  ------------------
  |  Branch (453:3): [True: 4, False: 0]
  ------------------
  454|      4|  --refs_;
  455|      4|  if (refs_ == 0) {
  ------------------
  |  Branch (455:7): [True: 4, False: 0]
  ------------------
  456|      4|    delete this;
  457|      4|  }
  458|      4|}
_ZN7leveldb10VersionSetD2Ev:
  751|      4|VersionSet::~VersionSet() {
  752|      4|  current_->Unref();
  753|      4|  assert(dummy_versions_.next_ == &dummy_versions_);  // List must be empty
  ------------------
  |  Branch (753:3): [True: 4, False: 0]
  ------------------
  754|      4|  delete descriptor_log_;
  755|      4|  delete descriptor_file_;
  756|      4|}

_ZN7leveldb10WriteBatchD2Ev:
   31|      4|WriteBatch::~WriteBatch() = default;

memenv.cc:_ZN7leveldb12_GLOBAL__N_111InMemoryEnvD2Ev:
  229|      4|  ~InMemoryEnv() override {
  230|     12|    for (const auto& kvp : file_map_) {
  ------------------
  |  Branch (230:26): [True: 12, False: 4]
  ------------------
  231|     12|      kvp.second->Unref();
  232|     12|    }
  233|      4|  }
memenv.cc:_ZN7leveldb12_GLOBAL__N_19FileState5UnrefEv:
   41|     20|  void Unref() {
   42|     20|    bool do_delete = false;
   43|       |
   44|     20|    {
   45|     20|      MutexLock lock(&refs_mutex_);
   46|     20|      --refs_;
   47|     20|      assert(refs_ >= 0);
  ------------------
  |  Branch (47:7): [True: 20, False: 0]
  ------------------
   48|     20|      if (refs_ <= 0) {
  ------------------
  |  Branch (48:11): [True: 12, False: 8]
  ------------------
   49|     12|        do_delete = true;
   50|     12|      }
   51|     20|    }
   52|       |
   53|     20|    if (do_delete) {
  ------------------
  |  Branch (53:9): [True: 12, False: 8]
  ------------------
   54|     12|      delete this;
   55|     12|    }
   56|     20|  }
memenv.cc:_ZN7leveldb12_GLOBAL__N_19FileStateD2Ev:
  143|     12|  ~FileState() { Truncate(); }
memenv.cc:_ZN7leveldb12_GLOBAL__N_19FileState8TruncateEv:
   63|     12|  void Truncate() {
   64|     12|    MutexLock lock(&blocks_mutex_);
   65|     12|    for (char*& block : blocks_) {
  ------------------
  |  Branch (65:23): [True: 10, False: 12]
  ------------------
   66|     10|      delete[] block;
   67|     10|    }
   68|     12|    blocks_.clear();
   69|     12|    size_ = 0;
   70|     12|  }
memenv.cc:_ZN7leveldb12_GLOBAL__N_116WritableFileImplD2Ev:
  207|      8|  ~WritableFileImpl() override { file_->Unref(); }
memenv.cc:_ZN7leveldb12_GLOBAL__N_111InMemoryEnv10UnlockFileEPNS_8FileLockE:
  367|      4|  Status UnlockFile(FileLock* lock) override {
  368|      4|    delete lock;
  369|      4|    return Status::OK();
  370|      4|  }

_ZN7leveldb6StatusD2Ev:
   28|      8|  ~Status() { delete[] state_; }
_ZN7leveldb6StatusC2Ev:
   27|      4|  Status() noexcept : state_(nullptr) {}
_ZN7leveldb6Status2OKEv:
   37|      4|  static Status OK() { return Status(); }

_ZN7leveldb4port7CondVarD2Ev:
   68|      4|  ~CondVar() = default;
_ZN7leveldb4port5Mutex6UnlockEv:
   56|     36|  void Unlock() UNLOCK_FUNCTION() { mu_.unlock(); }
_ZN7leveldb4port5Mutex4LockEv:
   55|     36|  void Lock() EXCLUSIVE_LOCK_FUNCTION() { mu_.lock(); }

_ZN7leveldb5ArenaD2Ev:
   14|      4|Arena::~Arena() {
   15|      8|  for (size_t i = 0; i < blocks_.size(); i++) {
  ------------------
  |  Branch (15:22): [True: 4, False: 4]
  ------------------
   16|      4|    delete[] blocks_[i];
   17|      4|  }
   18|      4|}

_ZN7leveldb5CacheD2Ev:
   17|      8|Cache::~Cache() {}
cache.cc:_ZN7leveldb12_GLOBAL__N_18LRUCacheD2Ev:
  205|    128|LRUCache::~LRUCache() {
  206|    128|  assert(in_use_.next == &in_use_);  // Error if caller has an unreleased handle
  ------------------
  |  Branch (206:3): [True: 128, False: 0]
  ------------------
  207|    128|  for (LRUHandle* e = lru_.next; e != &lru_;) {
  ------------------
  |  Branch (207:34): [True: 0, False: 128]
  ------------------
  208|      0|    LRUHandle* next = e->next;
  209|      0|    assert(e->in_cache);
  ------------------
  |  Branch (209:5): [True: 0, False: 0]
  ------------------
  210|      0|    e->in_cache = false;
  211|      0|    assert(e->refs == 1);  // Invariant of lru_ list.
  ------------------
  |  Branch (211:5): [True: 0, False: 0]
  ------------------
  212|      0|    Unref(e);
  213|      0|    e = next;
  214|      0|  }
  215|    128|}
cache.cc:_ZN7leveldb12_GLOBAL__N_111HandleTableD2Ev:
   72|    128|  ~HandleTable() { delete[] list_; }
cache.cc:_ZN7leveldb12_GLOBAL__N_115ShardedLRUCacheD2Ev:
  357|      8|  ~ShardedLRUCache() override {}

_ZN7leveldb10ComparatorD2Ev:
   18|     16|Comparator::~Comparator() = default;

_ZN7leveldb3EnvD2Ev:
    9|      4|Env::~Env() = default;
_ZN7leveldb12WritableFileD2Ev:
   19|      8|WritableFile::~WritableFile() = default;
_ZN7leveldb6LoggerD2Ev:
   21|      4|Logger::~Logger() = default;
_ZN7leveldb8FileLockD2Ev:
   23|      4|FileLock::~FileLock() = default;

_ZN7leveldb12FilterPolicyD2Ev:
    9|      8|FilterPolicy::~FilterPolicy() {}

_ZN7leveldb9MutexLockC2EPNS_4port5MutexE:
   25|     32|  explicit MutexLock(port::Mutex* mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mu_(mu) {
   26|     32|    this->mu_->Lock();
   27|     32|  }
_ZN7leveldb9MutexLockD2Ev:
   28|     32|  ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); }

_Z11LogInstancev:
   27|  2.27M|{
   28|       |/**
   29|       | * NOTE: the logger instances is leaked on exit. This is ugly, but will be
   30|       | * cleaned up by the OS/libc. Defining a logger as a global object doesn't work
   31|       | * since the order of destruction of static/global objects is undefined.
   32|       | * Consider if the logger gets destroyed, and then some later destructor calls
   33|       | * LogInfo, maybe indirectly, and you get a core dump at shutdown trying to
   34|       | * access the logger. When the shutdown sequence is fully audited and tested,
   35|       | * explicit destruction of these objects can be implemented by changing this
   36|       | * from a raw pointer to a std::unique_ptr.
   37|       | * Since the ~Logger() destructor is never called, the Logger class and all
   38|       | * its subclasses must have implicitly-defined destructors.
   39|       | *
   40|       | * This method of initialization was originally introduced in
   41|       | * ee3374234c60aba2cc4c5cd5cac1c0aefc2d817c.
   42|       | */
   43|  2.27M|    static BCLog::Logger* g_logger{new BCLog::Logger()};
   44|  2.27M|    return *g_logger;
   45|  2.27M|}
_ZN5BCLog6Logger20DisconnectTestLoggerEv:
  104|      2|{
  105|      2|    STDLOCK(m_cs);
  ------------------
  |  |   41|      2|#define STDLOCK(cs) StdMutex::Guard BITCOIN_UNIQUE_NAME(criticalblock){StdMutex::CheckNotHeld(cs)}
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|      2|    m_buffering = true;
  107|      2|    if (m_fileout != nullptr) fclose(m_fileout);
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  ------------------
  108|      2|    m_fileout = nullptr;
  109|      2|    m_print_callbacks.clear();
  110|      2|    m_max_buffer_memusage = DEFAULT_MAX_LOG_BUFFER;
  111|      2|    m_cur_buffer_memusage = 0;
  112|      2|    m_buffer_lines_discarded = 0;
  113|      2|    m_msgs_before_open.clear();
  114|      2|}
_ZNK5BCLog6Logger15WillLogCategoryENS_8LogFlagsE:
  157|  1.77M|{
  158|  1.77M|    return (m_categories.load(std::memory_order_relaxed) & category) != 0;
  159|  1.77M|}
_ZNK5BCLog6Logger20WillLogCategoryLevelENS_8LogFlagsEN4util3log5LevelE:
  162|  1.77M|{
  163|       |    // Log messages at Info, Warning and Error level unconditionally, so that
  164|       |    // important troubleshooting information doesn't get lost.
  165|  1.77M|    if (level >= BCLog::Level::Info) return true;
  ------------------
  |  Branch (165:9): [True: 0, False: 1.77M]
  ------------------
  166|       |
  167|  1.77M|    if (!WillLogCategory(category)) return false;
  ------------------
  |  Branch (167:9): [True: 1.77M, False: 0]
  ------------------
  168|       |
  169|      0|    STDLOCK(m_cs);
  ------------------
  |  |   41|      0|#define STDLOCK(cs) StdMutex::Guard BITCOIN_UNIQUE_NAME(criticalblock){StdMutex::CheckNotHeld(cs)}
  |  |  ------------------
  |  |  |  |   11|      0|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|      0|    const auto it{m_category_log_levels.find(category)};
  171|      0|    return level >= (it == m_category_log_levels.end() ? LogLevel() : it->second);
  ------------------
  |  Branch (171:22): [True: 0, False: 0]
  ------------------
  172|  1.77M|}
_ZN4util3log14ShouldDebugLogEm:
  620|  1.77M|{
  621|  1.77M|    return LogInstance().WillLogCategoryLevel(static_cast<BCLog::LogFlags>(category), util::log::Level::Debug);
  622|  1.77M|}
_ZN4util3log3LogENS0_5EntryE:
  630|   497k|{
  631|   497k|    BCLog::Logger& logger{LogInstance()};
  632|   497k|    if (logger.Enabled()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 497k]
  ------------------
  633|      0|        logger.LogPrint(std::move(entry));
  634|      0|    }
  635|   497k|}

_ZNK5BCLog6Logger7EnabledEv:
  185|   497k|        {
  186|   497k|            STDLOCK(m_cs);
  ------------------
  |  |   41|   497k|#define STDLOCK(cs) StdMutex::Guard BITCOIN_UNIQUE_NAME(criticalblock){StdMutex::CheckNotHeld(cs)}
  |  |  ------------------
  |  |  |  |   11|   497k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   497k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   497k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|   497k|            return m_buffering || m_print_to_console || m_print_to_file || !m_print_callbacks.empty();
  ------------------
  |  Branch (187:20): [True: 0, False: 497k]
  |  Branch (187:35): [True: 0, False: 497k]
  |  Branch (187:57): [True: 0, False: 497k]
  |  Branch (187:76): [True: 0, False: 497k]
  ------------------
  188|   497k|        }

_ZN5BCLog5TimerINSt3__16chrono8durationIxNS1_5ratioILl1ELl1000EEEEEEC2ENS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEESD_NS_8LogFlagsEb:
   33|  1.37k|        : m_prefix(std::move(prefix)),
   34|  1.37k|          m_title(std::move(end_msg)),
   35|  1.37k|          m_log_category(log_category),
   36|  1.37k|          m_message_on_completion(msg_on_completion)
   37|  1.37k|    {
   38|  1.37k|        this->Log(strprintf("%s started", m_title));
  ------------------
  |  | 1172|  1.37k|#define strprintf tfm::format
  ------------------
   39|  1.37k|        m_start_t = std::chrono::steady_clock::now();
   40|  1.37k|    }
_ZN5BCLog5TimerINSt3__16chrono8durationIxNS1_5ratioILl1ELl1000EEEEEE3LogERKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   52|  2.74k|    {
   53|  2.74k|        const std::string full_msg = this->LogMsg(msg);
   54|       |
   55|  2.74k|        if (m_log_category == BCLog::LogFlags::ALL) {
  ------------------
  |  Branch (55:13): [True: 0, False: 2.74k]
  ------------------
   56|      0|            LogInfo("%s\n", full_msg);
  ------------------
  |  |  125|      0|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
   57|  2.74k|        } else {
   58|  2.74k|            LogDebug(m_log_category, "%s\n", full_msg);
  ------------------
  |  |  143|  2.74k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  2.74k|    do {                                                                                      \
  |  |  |  |  137|  2.74k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 2.74k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  2.74k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 2.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   59|  2.74k|        }
   60|  2.74k|    }
_ZN5BCLog5TimerINSt3__16chrono8durationIxNS1_5ratioILl1ELl1000EEEEEE6LogMsgERKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   63|  2.74k|    {
   64|  2.74k|        const auto end_time{std::chrono::steady_clock::now()};
   65|  2.74k|        if (!m_start_t) {
  ------------------
  |  Branch (65:13): [True: 1.37k, False: 1.37k]
  ------------------
   66|  1.37k|            return strprintf("%s: %s", m_prefix, msg);
  ------------------
  |  | 1172|  1.37k|#define strprintf tfm::format
  ------------------
   67|  1.37k|        }
   68|  1.37k|        const auto duration{end_time - *m_start_t};
   69|       |
   70|       |        if constexpr (std::is_same_v<TimeType, std::chrono::microseconds>) {
   71|       |            return strprintf("%s: %s (%iμs)", m_prefix, msg, Ticks<std::chrono::microseconds>(duration));
   72|  1.37k|        } else if constexpr (std::is_same_v<TimeType, std::chrono::milliseconds>) {
   73|  1.37k|            return strprintf("%s: %s (%.2fms)", m_prefix, msg, Ticks<MillisecondsDouble>(duration));
  ------------------
  |  | 1172|  1.37k|#define strprintf tfm::format
  ------------------
   74|       |        } else if constexpr (std::is_same_v<TimeType, std::chrono::seconds>) {
   75|       |            return strprintf("%s: %s (%.2fs)", m_prefix, msg, Ticks<SecondsDouble>(duration));
   76|       |        } else {
   77|       |            static_assert(ALWAYS_FALSE<TimeType>, "Error: unexpected time type");
   78|       |        }
   79|  1.37k|    }
_ZN5BCLog5TimerINSt3__16chrono8durationIxNS1_5ratioILl1ELl1000EEEEEED2Ev:
   43|  1.37k|    {
   44|  1.37k|        if (m_message_on_completion) {
  ------------------
  |  Branch (44:13): [True: 0, False: 1.37k]
  ------------------
   45|      0|            this->Log(strprintf("%s completed", m_title));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
   46|  1.37k|        } else {
   47|  1.37k|            this->Log("completed");
   48|  1.37k|        }
   49|  1.37k|    }

streams.cpp:_ZN8memusageL12DynamicUsageISt4byte25zero_after_free_allocatorIS1_EEEmRKNSt3__16vectorIT_T0_EE:
   90|     72|{
   91|     72|    return MallocUsage(v.capacity() * sizeof(T));
   92|     72|}
streams.cpp:_ZN8memusageL11MallocUsageEm:
   53|     72|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|     72|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 72, False: 0]
  ------------------
   56|     72|        return 0;
   57|     72|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [True: 0, Folded]
  ------------------
   58|      0|        return ((alloc + 31) >> 4) << 4;
   59|      0|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded, False: 0]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|       |        assert(0);
  ------------------
  |  Branch (62:9): [Folded, False: 0]
  ------------------
   63|      0|    }
   64|     72|}
net.cpp:_ZN8memusageL12DynamicUsageERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   95|   415k|{
   96|   415k|    const char* s_ptr = reinterpret_cast<const char*>(&s);
   97|       |    // Don't count the dynamic memory used for string, if it resides in the
   98|       |    // "small string" optimization area (which stores data inside the object itself, up to some
   99|       |    // size; 15 bytes in modern libstdc++).
  100|   415k|    if (!std::less{}(s.data(), s_ptr) && !std::greater{}(s.data() + s.size(), s_ptr + sizeof(s))) {
  ------------------
  |  Branch (100:9): [True: 415k, False: 0]
  |  Branch (100:9): [True: 415k, False: 0]
  |  Branch (100:42): [True: 415k, False: 0]
  ------------------
  101|   415k|        return 0;
  102|   415k|    }
  103|      0|    return MallocUsage(s.capacity());
  104|   415k|}
net.cpp:_ZN8memusageL11MallocUsageEm:
   53|   419k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|   419k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 260k, False: 159k]
  ------------------
   56|   260k|        return 0;
   57|   260k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [True: 159k, Folded]
  ------------------
   58|   159k|        return ((alloc + 31) >> 4) << 4;
   59|   159k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded, False: 0]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|       |        assert(0);
  ------------------
  |  Branch (62:9): [Folded, False: 0]
  ------------------
   63|      0|    }
   64|   419k|}
net.cpp:_ZN8memusageL12DynamicUsageIhNSt3__19allocatorIhEEEEmRKNS1_6vectorIT_T0_EE:
   90|   419k|{
   91|   419k|    return MallocUsage(v.capacity() * sizeof(T));
   92|   419k|}

_ZNK17CSerializedNetMsg14GetMemoryUsageEv:
  124|   415k|{
  125|   415k|    return sizeof(*this) + memusage::DynamicUsage(m_type) + memusage::DynamicUsage(data);
  126|   415k|}
_ZNK11CNetMessage14GetMemoryUsageEv:
  129|     72|{
  130|     72|    return sizeof(*this) + memusage::DynamicUsage(m_type) + m_recv.GetMemoryUsage();
  131|     72|}
_Z13GetListenPortv:
  140|  13.3k|{
  141|       |    // If -bind= is provided with ":port" part, use that (first one if multiple are provided).
  142|  13.3k|    for (const std::string& bind_arg : gArgs.GetArgs("-bind")) {
  ------------------
  |  Branch (142:38): [True: 0, False: 13.3k]
  ------------------
  143|      0|        constexpr uint16_t dummy_port = 0;
  144|       |
  145|      0|        const std::optional<CService> bind_addr{Lookup(bind_arg, dummy_port, /*fAllowLookup=*/false)};
  146|      0|        if (bind_addr.has_value() && bind_addr->GetPort() != dummy_port) return bind_addr->GetPort();
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  |  Branch (146:38): [True: 0, False: 0]
  ------------------
  147|      0|    }
  148|       |
  149|       |    // Otherwise, if -whitebind= without NetPermissionFlags::NoBan is provided, use that
  150|       |    // (-whitebind= is required to have ":port").
  151|  13.3k|    for (const std::string& whitebind_arg : gArgs.GetArgs("-whitebind")) {
  ------------------
  |  Branch (151:43): [True: 0, False: 13.3k]
  ------------------
  152|      0|        NetWhitebindPermissions whitebind;
  153|      0|        bilingual_str error;
  154|      0|        if (NetWhitebindPermissions::TryParse(whitebind_arg, whitebind, error)) {
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            if (!NetPermissions::HasFlag(whitebind.m_flags, NetPermissionFlags::NoBan)) {
  ------------------
  |  Branch (155:17): [True: 0, False: 0]
  ------------------
  156|      0|                return whitebind.m_service.GetPort();
  157|      0|            }
  158|      0|        }
  159|      0|    }
  160|       |
  161|       |    // Otherwise, if -port= is provided, use that. Otherwise use the default port.
  162|  13.3k|    return static_cast<uint16_t>(gArgs.GetIntArg("-port", Params().GetDefaultPort()));
  163|  13.3k|}
_Z8AddLocalRK8CServiceib:
  279|  4.70k|{
  280|  4.70k|    CService addr{MaybeFlipIPv6toCJDNS(addr_)};
  281|       |
  282|  4.70k|    if (!addr.IsRoutable())
  ------------------
  |  Branch (282:9): [True: 0, False: 4.70k]
  ------------------
  283|      0|        return false;
  284|       |
  285|  4.70k|    if (!fDiscover && nScore < LOCAL_MANUAL)
  ------------------
  |  Branch (285:9): [True: 0, False: 4.70k]
  |  Branch (285:23): [True: 0, False: 0]
  ------------------
  286|      0|        return false;
  287|       |
  288|  4.70k|    if (!g_reachable_nets.Contains(addr) && !add_even_if_unreachable)
  ------------------
  |  Branch (288:9): [True: 0, False: 4.70k]
  |  Branch (288:45): [True: 0, False: 0]
  ------------------
  289|      0|        return false;
  290|       |
  291|  4.70k|    if (fLogIPs) {
  ------------------
  |  Branch (291:9): [True: 0, False: 4.70k]
  ------------------
  292|      0|        LogInfo("AddLocal(%s,%i)\n", addr.ToStringAddrPort(), nScore);
  ------------------
  |  |  125|      0|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  293|      0|    }
  294|       |
  295|  4.70k|    {
  296|  4.70k|        LOCK(g_maplocalhost_mutex);
  ------------------
  |  |  268|  4.70k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.70k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.70k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.70k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  297|  4.70k|        const auto [it, is_newly_added] = mapLocalHost.emplace(addr, LocalServiceInfo());
  298|  4.70k|        LocalServiceInfo &info = it->second;
  299|  4.70k|        if (is_newly_added || nScore >= info.nScore) {
  ------------------
  |  Branch (299:13): [True: 2.12k, False: 2.57k]
  |  Branch (299:31): [True: 491, False: 2.08k]
  ------------------
  300|  2.61k|            info.nScore = SaturatingAdd(nScore, is_newly_added ? 0 : 1);
  ------------------
  |  Branch (300:49): [True: 2.12k, False: 491]
  ------------------
  301|  2.61k|            info.nPort = addr.GetPort();
  302|  2.61k|        }
  303|  4.70k|    }
  304|       |
  305|  4.70k|    return true;
  306|  4.70k|}
_Z7IsLocalRK8CService:
  336|  10.5k|{
  337|  10.5k|    LOCK(g_maplocalhost_mutex);
  ------------------
  |  |  268|  10.5k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  10.5k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  10.5k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  10.5k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  338|  10.5k|    return mapLocalHost.contains(addr);
  339|  10.5k|}
_ZNK8CConnman22AlreadyConnectedToHostENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  342|  6.77k|{
  343|  6.77k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  6.77k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  6.77k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  6.77k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  6.77k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|  6.77k|    return std::ranges::any_of(m_nodes, [&host](CNode* node) { return node->m_addr_name == host; });
  345|  6.77k|}
_ZNK8CConnman29AlreadyConnectedToAddressPortERK8CService:
  348|  5.98k|{
  349|  5.98k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  5.98k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.98k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.98k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.98k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|  5.98k|    return std::ranges::any_of(m_nodes, [&addr_port](CNode* node) { return node->addr == addr_port; });
  351|  5.98k|}
_ZNK8CConnman25AlreadyConnectedToAddressERK8CNetAddr:
  354|  5.28k|{
  355|  5.28k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  5.28k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.28k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.28k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.28k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|  5.28k|    return std::ranges::any_of(m_nodes, [&addr](CNode* node) { return node->addr == addr; });
  357|  5.28k|}
_ZN8CConnman18CheckIncomingNonceEm:
  360|  4.59k|{
  361|  4.59k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  4.59k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.59k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.59k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.59k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  362|   100k|    for (const CNode* pnode : m_nodes) {
  ------------------
  |  Branch (362:29): [True: 100k, False: 4.59k]
  ------------------
  363|       |        // Omit private broadcast connections from this check to prevent this privacy attack:
  364|       |        // - We connect to a peer in an attempt to privately broadcast a transaction. From our
  365|       |        //   VERSION message the peer deducts that this is a short-lived connection for
  366|       |        //   broadcasting a transaction, takes our nonce and delays their VERACK.
  367|       |        // - The peer starts connecting to (clearnet) nodes and sends them a VERSION message
  368|       |        //   which contains our nonce. If the peer manages to connect to us we would disconnect.
  369|       |        // - Upon a disconnect, the peer knows our clearnet address. They go back to the short
  370|       |        //   lived privacy broadcast connection and continue with VERACK.
  371|   100k|        if (!pnode->fSuccessfullyConnected && !pnode->IsInboundConn() && !pnode->IsPrivateBroadcastConn() &&
  ------------------
  |  Branch (371:13): [True: 39.9k, False: 60.8k]
  |  Branch (371:47): [True: 556, False: 39.3k]
  |  Branch (371:74): [True: 556, False: 0]
  ------------------
  372|    556|            pnode->GetLocalNonce() == nonce)
  ------------------
  |  Branch (372:13): [True: 0, False: 556]
  ------------------
  373|      0|            return false;
  374|   100k|    }
  375|  4.59k|    return true;
  376|  4.59k|}
_ZN8CConnman11ConnectNodeE8CAddressPKcb14ConnectionTypebRKNSt3__18optionalI5ProxyEE:
  384|  11.4k|{
  385|  11.4k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  11.4k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  386|  11.4k|    AssertLockNotHeld(m_unused_i2p_sessions_mutex);
  ------------------
  |  |  149|  11.4k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  387|  11.4k|    assert(conn_type != ConnectionType::INBOUND);
  ------------------
  |  Branch (387:5): [True: 11.4k, False: 0]
  ------------------
  388|       |
  389|  11.4k|    if (pszDest == nullptr) {
  ------------------
  |  Branch (389:9): [True: 4.83k, False: 6.59k]
  ------------------
  390|  4.83k|        if (IsLocal(addrConnect))
  ------------------
  |  Branch (390:13): [True: 0, False: 4.83k]
  ------------------
  391|      0|            return nullptr;
  392|       |
  393|       |        // Look for an existing connection
  394|  4.83k|        if (AlreadyConnectedToAddressPort(addrConnect)) {
  ------------------
  |  Branch (394:13): [True: 0, False: 4.83k]
  ------------------
  395|      0|            LogInfo("Failed to open new connection to %s, already connected", addrConnect.ToStringAddrPort());
  ------------------
  |  |  125|      0|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  396|      0|            return nullptr;
  397|      0|        }
  398|  4.83k|    }
  399|       |
  400|  11.4k|    LogDebug(BCLog::NET, "trying %s connection (%s) to %s, lastseen=%.1fhrs\n",
  ------------------
  |  |  143|  11.4k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  11.4k|    do {                                                                                      \
  |  |  |  |  137|  11.4k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 11.4k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (119:129): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (119:129): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (119:129): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  11.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|  11.4k|        use_v2transport ? "v2" : "v1",
  402|  11.4k|        ConnectionTypeAsString(conn_type),
  403|  11.4k|        pszDest ? pszDest : addrConnect.ToStringAddrPort(),
  404|  11.4k|        Ticks<HoursDouble>(pszDest ? 0h : Now<NodeSeconds>() - addrConnect.nTime));
  405|       |
  406|       |    // Resolve
  407|  11.4k|    const uint16_t default_port{pszDest != nullptr ? GetDefaultPort(pszDest) :
  ------------------
  |  Branch (407:33): [True: 6.59k, False: 4.83k]
  ------------------
  408|  11.4k|                                                     m_params.GetDefaultPort()};
  409|       |
  410|       |    // Collection of addresses to try to connect to: either all dns resolved addresses if a domain name (pszDest) is provided, or addrConnect otherwise.
  411|  11.4k|    std::vector<CAddress> connect_to{};
  412|  11.4k|    if (pszDest) {
  ------------------
  |  Branch (412:9): [True: 6.59k, False: 4.83k]
  ------------------
  413|  6.59k|        std::vector<CService> resolved{Lookup(pszDest, default_port, fNameLookup && !HaveNameProxy(), 256)};
  ------------------
  |  Branch (413:70): [True: 6.59k, False: 0]
  |  Branch (413:85): [True: 6.59k, False: 0]
  ------------------
  414|  6.59k|        if (!resolved.empty()) {
  ------------------
  |  Branch (414:13): [True: 1.53k, False: 5.05k]
  ------------------
  415|  1.53k|            std::shuffle(resolved.begin(), resolved.end(), FastRandomContext());
  416|       |            // If the connection is made by name, it can be the case that the name resolves to more than one address.
  417|       |            // We don't want to connect any more of them if we are already connected to one
  418|  1.53k|            for (const auto& r : resolved) {
  ------------------
  |  Branch (418:32): [True: 1.53k, False: 1.14k]
  ------------------
  419|  1.53k|                addrConnect = CAddress{MaybeFlipIPv6toCJDNS(r), NODE_NONE};
  420|  1.53k|                if (!addrConnect.IsValid()) {
  ------------------
  |  Branch (420:21): [True: 387, False: 1.15k]
  ------------------
  421|    387|                    LogDebug(BCLog::NET, "Resolver returned invalid address %s for %s\n", addrConnect.ToStringAddrPort(), pszDest);
  ------------------
  |  |  143|    387|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    387|    do {                                                                                      \
  |  |  |  |  137|    387|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 387]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    387|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 387]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  422|    387|                    return nullptr;
  423|    387|                }
  424|       |                // It is possible that we already have a connection to the IP/port pszDest resolved to.
  425|       |                // In that case, drop the connection that was just created.
  426|  1.15k|                if (AlreadyConnectedToAddressPort(addrConnect)) {
  ------------------
  |  Branch (426:21): [True: 5, False: 1.14k]
  ------------------
  427|      5|                    LogInfo("Not opening a connection to %s, already connected to %s\n", pszDest, addrConnect.ToStringAddrPort());
  ------------------
  |  |  125|      5|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      5|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  428|      5|                    return nullptr;
  429|      5|                }
  430|       |                // Add the address to the resolved addresses vector so we can try to connect to it later on
  431|  1.14k|                connect_to.push_back(addrConnect);
  432|  1.14k|            }
  433|  5.05k|        } else {
  434|       |            // For resolution via proxy
  435|  5.05k|            connect_to.push_back(addrConnect);
  436|  5.05k|        }
  437|  6.59k|    } else {
  438|       |        // Connect via addrConnect directly
  439|  4.83k|        connect_to.push_back(addrConnect);
  440|  4.83k|    }
  441|       |
  442|       |    // Connect
  443|  11.0k|    std::unique_ptr<Sock> sock;
  444|  11.0k|    CService addr_bind;
  445|  11.0k|    assert(!addr_bind.IsValid());
  ------------------
  |  Branch (445:5): [True: 11.0k, False: 0]
  ------------------
  446|  11.0k|    std::unique_ptr<i2p::sam::Session> i2p_transient_session;
  447|       |
  448|  11.0k|    for (auto& target_addr : connect_to) {
  ------------------
  |  Branch (448:28): [True: 11.0k, False: 10.0k]
  ------------------
  449|  11.0k|        if (target_addr.IsValid()) {
  ------------------
  |  Branch (449:13): [True: 9.45k, False: 1.57k]
  ------------------
  450|  9.45k|            const std::optional<Proxy> use_proxy{
  451|  9.45k|                proxy_override.has_value() ? proxy_override : GetProxy(target_addr.GetNetwork()),
  ------------------
  |  Branch (451:17): [True: 5.90k, False: 3.55k]
  ------------------
  452|  9.45k|            };
  453|  9.45k|            bool proxyConnectionFailed = false;
  454|       |
  455|  9.45k|            if (target_addr.IsI2P() && use_proxy) {
  ------------------
  |  Branch (455:17): [True: 4.16k, False: 5.28k]
  |  Branch (455:40): [True: 2.74k, False: 1.42k]
  ------------------
  456|  2.74k|                i2p::Connection conn;
  457|  2.74k|                bool connected{false};
  458|       |
  459|       |                // If an I2P SAM session already exists, normally we would re-use it. But in the case of
  460|       |                // private broadcast we force a new transient session. A Connect() using m_i2p_sam_session
  461|       |                // would use our permanent I2P address as a source address.
  462|  2.74k|                if (m_i2p_sam_session && conn_type != ConnectionType::PRIVATE_BROADCAST) {
  ------------------
  |  Branch (462:21): [True: 0, False: 2.74k]
  |  Branch (462:42): [True: 0, False: 0]
  ------------------
  463|      0|                    connected = m_i2p_sam_session->Connect(target_addr, conn, proxyConnectionFailed);
  464|  2.74k|                } else {
  465|  2.74k|                    {
  466|  2.74k|                        LOCK(m_unused_i2p_sessions_mutex);
  ------------------
  |  |  268|  2.74k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.74k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.74k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.74k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  467|  2.74k|                        if (m_unused_i2p_sessions.empty()) {
  ------------------
  |  Branch (467:29): [True: 479, False: 2.26k]
  ------------------
  468|    479|                            i2p_transient_session =
  469|    479|                                std::make_unique<i2p::sam::Session>(*use_proxy, m_interrupt_net);
  470|  2.26k|                        } else {
  471|  2.26k|                            i2p_transient_session.swap(m_unused_i2p_sessions.front());
  472|  2.26k|                            m_unused_i2p_sessions.pop();
  473|  2.26k|                        }
  474|  2.74k|                    }
  475|  2.74k|                    connected = i2p_transient_session->Connect(target_addr, conn, proxyConnectionFailed);
  476|  2.74k|                    if (!connected) {
  ------------------
  |  Branch (476:25): [True: 2.74k, False: 0]
  ------------------
  477|  2.74k|                        LOCK(m_unused_i2p_sessions_mutex);
  ------------------
  |  |  268|  2.74k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.74k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.74k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.74k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  2.74k|                        if (m_unused_i2p_sessions.size() < MAX_UNUSED_I2P_SESSIONS_SIZE) {
  ------------------
  |  Branch (478:29): [True: 2.74k, False: 0]
  ------------------
  479|  2.74k|                            m_unused_i2p_sessions.emplace(i2p_transient_session.release());
  480|  2.74k|                        }
  481|  2.74k|                    }
  482|  2.74k|                }
  483|       |
  484|  2.74k|                if (connected) {
  ------------------
  |  Branch (484:21): [True: 0, False: 2.74k]
  ------------------
  485|      0|                    sock = std::move(conn.sock);
  486|      0|                    addr_bind = conn.me;
  487|      0|                }
  488|  6.71k|            } else if (use_proxy) {
  ------------------
  |  Branch (488:24): [True: 3.15k, False: 3.55k]
  ------------------
  489|  3.15k|                LogDebug(BCLog::PROXY, "Using proxy: %s to connect to %s\n", use_proxy->ToString(), target_addr.ToStringAddrPort());
  ------------------
  |  |  143|  3.15k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  3.15k|    do {                                                                                      \
  |  |  |  |  137|  3.15k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 3.15k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  3.15k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 3.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  3.15k|                sock = ConnectThroughProxy(*use_proxy, target_addr.ToStringAddr(), target_addr.GetPort(), proxyConnectionFailed);
  491|  3.55k|            } else {
  492|       |                // No proxy needed (none set for target network). Private broadcast connections
  493|       |                // must always use a proxy, otherwise they would leak the originator's IP address.
  494|  3.55k|                if (Assume(conn_type != ConnectionType::PRIVATE_BROADCAST)) {
  ------------------
  |  |  128|  3.55k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  |  |  ------------------
  |  |  |  Branch (128:21): [True: 3.55k, False: 0]
  |  |  ------------------
  ------------------
  495|  3.55k|                    sock = ConnectDirectly(target_addr, conn_type == ConnectionType::MANUAL);
  496|  3.55k|                }
  497|  3.55k|            }
  498|  9.45k|            if (!proxyConnectionFailed) {
  ------------------
  |  Branch (498:17): [True: 6.18k, False: 3.27k]
  ------------------
  499|       |                // If a connection to the node was attempted, and failure (if any) is not caused by a problem connecting to
  500|       |                // the proxy, mark this as an attempt.
  501|  6.18k|                addrman.get().Attempt(target_addr, fCountFailure);
  502|  6.18k|            }
  503|  9.45k|        } else if (pszDest) {
  ------------------
  |  Branch (503:20): [True: 469, False: 1.11k]
  ------------------
  504|    469|            if (const auto name_proxy = GetNameProxy()) {
  ------------------
  |  Branch (504:28): [True: 0, False: 469]
  ------------------
  505|      0|                std::string host;
  506|      0|                uint16_t port{default_port};
  507|      0|                SplitHostPort(pszDest, port, host);
  508|      0|                bool proxyConnectionFailed;
  509|      0|                sock = ConnectThroughProxy(*name_proxy, host, port, proxyConnectionFailed);
  510|      0|            }
  511|    469|        }
  512|       |        // Check any other resolved address (if any) if we fail to connect
  513|  11.0k|        if (!sock) {
  ------------------
  |  Branch (513:13): [True: 10.0k, False: 938]
  ------------------
  514|  10.0k|            continue;
  515|  10.0k|        }
  516|       |
  517|    938|        NetPermissionFlags permission_flags = NetPermissionFlags::None;
  518|    938|        std::vector<NetWhitelistPermissions> whitelist_permissions = conn_type == ConnectionType::MANUAL ? vWhitelistedRangeOutgoing : std::vector<NetWhitelistPermissions>{};
  ------------------
  |  Branch (518:70): [True: 256, False: 682]
  ------------------
  519|    938|        AddWhitelistPermissionFlags(permission_flags, target_addr, whitelist_permissions);
  520|       |
  521|       |        // Add node
  522|    938|        NodeId id = GetNewNodeId();
  523|    938|        uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
  524|    938|        if (!addr_bind.IsValid()) {
  ------------------
  |  Branch (524:13): [True: 938, False: 0]
  ------------------
  525|    938|            addr_bind = GetBindAddress(*sock);
  526|    938|        }
  527|    938|        uint64_t network_id = GetDeterministicRandomizer(RANDOMIZER_ID_NETWORKKEY)
  528|    938|                            .Write(target_addr.GetNetClass())
  529|    938|                            .Write(addr_bind.GetAddrBytes())
  530|       |                            // For outbound connections, the port of the bound address is randomly
  531|       |                            // assigned by the OS and would therefore not be useful for seeding.
  532|    938|                            .Write(0)
  533|    938|                            .Finalize();
  534|    938|        CNode* pnode = new CNode(id,
  535|    938|                                std::move(sock),
  536|    938|                                target_addr,
  537|    938|                                CalculateKeyedNetGroup(target_addr),
  538|    938|                                nonce,
  539|    938|                                addr_bind,
  540|    938|                                pszDest ? pszDest : "",
  ------------------
  |  Branch (540:33): [True: 868, False: 70]
  ------------------
  541|    938|                                conn_type,
  542|    938|                                /*inbound_onion=*/false,
  543|    938|                                network_id,
  544|    938|                                CNodeOptions{
  545|    938|                                    .permission_flags = permission_flags,
  546|    938|                                    .proxy_override = proxy_override,
  547|    938|                                    .i2p_sam_session = std::move(i2p_transient_session),
  548|    938|                                    .recv_flood_size = nReceiveFloodSize,
  549|    938|                                    .use_v2transport = use_v2transport,
  550|    938|                                });
  551|    938|        pnode->AddRef();
  552|       |
  553|       |        // We're making a new connection, harvest entropy from the time (and our peer count)
  554|    938|        RandAddEvent((uint32_t)id);
  555|       |
  556|    938|        return pnode;
  557|  11.0k|    }
  558|       |
  559|  10.0k|    return nullptr;
  560|  11.0k|}
_ZN5CNode21CloseSocketDisconnectEv:
  563|  35.5k|{
  564|  35.5k|    fDisconnect = true;
  565|  35.5k|    LOCK(m_sock_mutex);
  ------------------
  |  |  268|  35.5k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  35.5k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  35.5k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  35.5k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|  35.5k|    if (m_sock) {
  ------------------
  |  Branch (566:9): [True: 35.5k, False: 0]
  ------------------
  567|  35.5k|        LogDebug(BCLog::NET, "Resetting socket for %s", LogPeer());
  ------------------
  |  |  143|  35.5k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  35.5k|    do {                                                                                      \
  |  |  |  |  137|  35.5k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 35.5k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  35.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 35.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|  35.5k|        m_sock.reset();
  569|       |
  570|  35.5k|        TRACEPOINT(net, closed_connection,
  571|  35.5k|            GetId(),
  572|  35.5k|            m_addr_name.c_str(),
  573|  35.5k|            ConnectionTypeAsString().c_str(),
  574|  35.5k|            ConnectedThroughNetwork(),
  575|  35.5k|            TicksSinceEpoch<std::chrono::seconds>(m_connected));
  576|  35.5k|    }
  577|  35.5k|    m_i2p_sam_session.reset();
  578|  35.5k|}
_ZNK8CConnman27AddWhitelistPermissionFlagsER18NetPermissionFlagsNSt3__18optionalI8CNetAddrEERKNS2_6vectorI23NetWhitelistPermissionsNS2_9allocatorIS7_EEEE:
  580|   354k|void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const {
  581|   354k|    for (const auto& subnet : ranges) {
  ------------------
  |  Branch (581:29): [True: 286k, False: 354k]
  ------------------
  582|   286k|        if (addr.has_value() && subnet.m_subnet.Match(addr.value())) {
  ------------------
  |  Branch (582:13): [True: 286k, False: 0]
  |  Branch (582:33): [True: 22.6k, False: 263k]
  ------------------
  583|  22.6k|            NetPermissions::AddFlag(flags, subnet.m_flags);
  584|  22.6k|        }
  585|   286k|    }
  586|   354k|    if (NetPermissions::HasFlag(flags, NetPermissionFlags::Implicit)) {
  ------------------
  |  Branch (586:9): [True: 8.23k, False: 346k]
  ------------------
  587|  8.23k|        NetPermissions::ClearFlag(flags, NetPermissionFlags::Implicit);
  588|  8.23k|        if (whitelist_forcerelay) NetPermissions::AddFlag(flags, NetPermissionFlags::ForceRelay);
  ------------------
  |  Branch (588:13): [True: 0, False: 8.23k]
  ------------------
  589|  8.23k|        if (whitelist_relay) NetPermissions::AddFlag(flags, NetPermissionFlags::Relay);
  ------------------
  |  Branch (589:13): [True: 8.23k, False: 0]
  ------------------
  590|  8.23k|        NetPermissions::AddFlag(flags, NetPermissionFlags::Mempool);
  591|  8.23k|        NetPermissions::AddFlag(flags, NetPermissionFlags::NoBan);
  592|  8.23k|    }
  593|   354k|}
_ZNK5CNode12GetAddrLocalEv:
  596|   379k|{
  597|   379k|    AssertLockNotHeld(m_addr_local_mutex);
  ------------------
  |  |  149|   379k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  598|   379k|    LOCK(m_addr_local_mutex);
  ------------------
  |  |  268|   379k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   379k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   379k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   379k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|   379k|    return m_addr_local;
  600|   379k|}
_ZNK5CNode23ConnectedThroughNetworkEv:
  611|  41.9M|{
  612|  41.9M|    return m_inbound_onion ? NET_ONION : addr.GetNetClass();
  ------------------
  |  Branch (612:12): [True: 341k, False: 41.6M]
  ------------------
  613|  41.9M|}
_ZN5CNode9CopyStatsER10CNodeStats:
  623|   379k|{
  624|   379k|    stats.nodeid = this->GetId();
  625|   379k|    X(addr);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  626|   379k|    X(addrBind);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  627|   379k|    stats.m_network = ConnectedThroughNetwork();
  628|   379k|    X(m_last_send);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  629|   379k|    X(m_last_recv);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  630|   379k|    X(m_last_tx_time);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  631|   379k|    X(m_last_block_time);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  632|   379k|    X(m_connected);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  633|   379k|    X(m_addr_name);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  634|   379k|    X(nVersion);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  635|   379k|    {
  636|   379k|        LOCK(m_subver_mutex);
  ------------------
  |  |  268|   379k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   379k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   379k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   379k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  637|   379k|        X(cleanSubVer);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  638|   379k|    }
  639|   379k|    stats.fInbound = IsInboundConn();
  640|   379k|    X(m_bip152_highbandwidth_to);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  641|   379k|    X(m_bip152_highbandwidth_from);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  642|   379k|    {
  643|   379k|        LOCK(cs_vSend);
  ------------------
  |  |  268|   379k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   379k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   379k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   379k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|   379k|        X(mapSendBytesPerMsgType);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  645|   379k|        X(nSendBytes);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  646|   379k|    }
  647|   379k|    {
  648|   379k|        LOCK(cs_vRecv);
  ------------------
  |  |  268|   379k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   379k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   379k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   379k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|   379k|        X(mapRecvBytesPerMsgType);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  650|   379k|        X(nRecvBytes);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  651|   379k|        Transport::Info info = m_transport->GetInfo();
  652|   379k|        stats.m_transport_type = info.transport_type;
  653|   379k|        if (info.session_id) stats.m_session_id = HexStr(*info.session_id);
  ------------------
  |  Branch (653:13): [True: 0, False: 379k]
  ------------------
  654|   379k|    }
  655|   379k|    X(m_permission_flags);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  656|       |
  657|   379k|    X(m_last_ping_time);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  658|   379k|    X(m_min_ping_time);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  659|       |
  660|       |    // Leave string empty if addrLocal invalid (not filled in yet)
  661|   379k|    CService addrLocalUnlocked = GetAddrLocal();
  662|   379k|    stats.addrLocal = addrLocalUnlocked.IsValid() ? addrLocalUnlocked.ToStringAddrPort() : "";
  ------------------
  |  Branch (662:23): [True: 0, False: 379k]
  ------------------
  663|       |
  664|   379k|    X(m_conn_type);
  ------------------
  |  |  621|   379k|#define X(name) stats.name = name
  ------------------
  665|   379k|}
_ZN5CNode15ReceiveMsgBytesENSt3__14spanIKhLm18446744073709551615EEERb:
  669|  23.7k|{
  670|  23.7k|    complete = false;
  671|  23.7k|    const auto time{NodeClock::now()};
  672|  23.7k|    LOCK(cs_vRecv);
  ------------------
  |  |  268|  23.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  23.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  23.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  23.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  673|  23.7k|    m_last_recv = time;
  674|  23.7k|    nRecvBytes += msg_bytes.size();
  675|  25.2k|    while (msg_bytes.size() > 0) {
  ------------------
  |  Branch (675:12): [True: 24.4k, False: 853]
  ------------------
  676|       |        // absorb network data
  677|  24.4k|        if (!m_transport->ReceivedBytes(msg_bytes)) {
  ------------------
  |  Branch (677:13): [True: 22.8k, False: 1.56k]
  ------------------
  678|       |            // Serious transport problem, disconnect from the peer.
  679|  22.8k|            return false;
  680|  22.8k|        }
  681|       |
  682|  1.56k|        if (m_transport->ReceivedMessageComplete()) {
  ------------------
  |  Branch (682:13): [True: 335, False: 1.22k]
  ------------------
  683|       |            // decompose a transport agnostic CNetMessage from the deserializer
  684|    335|            bool reject_message{false};
  685|    335|            CNetMessage msg = m_transport->GetReceivedMessage(time, reject_message);
  686|    335|            if (reject_message) {
  ------------------
  |  Branch (686:17): [True: 263, False: 72]
  ------------------
  687|       |                // Message deserialization failed. Drop the message but don't disconnect the peer.
  688|       |                // store the size of the corrupt message
  689|    263|                mapRecvBytesPerMsgType.at(NET_MESSAGE_TYPE_OTHER) += msg.m_raw_message_size;
  690|    263|                continue;
  691|    263|            }
  692|       |
  693|       |            // Store received bytes per message type.
  694|       |            // To prevent a memory DOS, only allow known message types.
  695|     72|            auto i = mapRecvBytesPerMsgType.find(msg.m_type);
  696|     72|            if (i == mapRecvBytesPerMsgType.end()) {
  ------------------
  |  Branch (696:17): [True: 44, False: 28]
  ------------------
  697|     44|                i = mapRecvBytesPerMsgType.find(NET_MESSAGE_TYPE_OTHER);
  698|     44|            }
  699|     72|            assert(i != mapRecvBytesPerMsgType.end());
  ------------------
  |  Branch (699:13): [True: 72, False: 0]
  ------------------
  700|     72|            i->second += msg.m_raw_message_size;
  701|       |
  702|       |            // push the message to the process queue,
  703|     72|            vRecvMsg.push_back(std::move(msg));
  704|       |
  705|     72|            complete = true;
  706|     72|        }
  707|  1.56k|    }
  708|       |
  709|    853|    return true;
  710|  23.7k|}
_ZN11V1TransportC2El:
  728|   388k|    : m_magic_bytes{Params().MessageStart()}, m_node_id{node_id}
  729|   388k|{
  730|   388k|    LOCK(m_recv_mutex);
  ------------------
  |  |  268|   388k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   388k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   388k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   388k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  731|   388k|    Reset();
  732|   388k|}
_ZNK11V1Transport7GetInfoEv:
  735|   122k|{
  736|   122k|    return {.transport_type = TransportProtocolType::V1, .session_id = {}};
  737|   122k|}
_ZN11V1Transport10readHeaderENSt3__14spanIKhLm18446744073709551615EEE:
  740|  4.83k|{
  741|  4.83k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  4.83k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  742|       |    // copy data to temporary parsing buffer
  743|  4.83k|    unsigned int nRemaining = CMessageHeader::HEADER_SIZE - nHdrPos;
  744|  4.83k|    unsigned int nCopy = std::min<unsigned int>(nRemaining, msg_bytes.size());
  745|       |
  746|  4.83k|    memcpy(&hdrbuf[nHdrPos], msg_bytes.data(), nCopy);
  747|  4.83k|    nHdrPos += nCopy;
  748|       |
  749|       |    // if header incomplete, exit
  750|  4.83k|    if (nHdrPos < CMessageHeader::HEADER_SIZE)
  ------------------
  |  Branch (750:9): [True: 231, False: 4.60k]
  ------------------
  751|    231|        return nCopy;
  752|       |
  753|       |    // deserialize to CMessageHeader
  754|  4.60k|    try {
  755|  4.60k|        hdrbuf >> hdr;
  756|  4.60k|    }
  757|  4.60k|    catch (const std::exception&) {
  758|      0|        LogDebug(BCLog::NET, "Header error: Unable to deserialize, peer=%d\n", m_node_id);
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|      0|        return -1;
  760|      0|    }
  761|       |
  762|       |    // Check start string, network magic
  763|  4.60k|    if (hdr.pchMessageStart != m_magic_bytes) {
  ------------------
  |  Branch (763:9): [True: 4.00k, False: 597]
  ------------------
  764|  4.00k|        LogDebug(BCLog::NET, "Header error: Wrong MessageStart %s received, peer=%d\n", HexStr(hdr.pchMessageStart), m_node_id);
  ------------------
  |  |  143|  4.00k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  4.00k|    do {                                                                                      \
  |  |  |  |  137|  4.00k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 4.00k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  4.00k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 4.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|  4.00k|        return -1;
  766|  4.00k|    }
  767|       |
  768|       |    // reject messages larger than MAX_SIZE or MAX_PROTOCOL_MESSAGE_LENGTH
  769|       |    // NOTE: failing to perform this check previously allowed a malicious peer to make us allocate 32MiB of memory per
  770|       |    // connection. See https://bitcoincore.org/en/2024/07/03/disclose_receive_buffer_oom.
  771|    597|    if (hdr.nMessageSize > MAX_SIZE || hdr.nMessageSize > MAX_PROTOCOL_MESSAGE_LENGTH) {
  ------------------
  |  Branch (771:9): [True: 166, False: 431]
  |  Branch (771:40): [True: 23, False: 408]
  ------------------
  772|    189|        LogDebug(BCLog::NET, "Header error: Size too large (%s, %u bytes), peer=%d\n", SanitizeString(hdr.GetMessageType()), hdr.nMessageSize, m_node_id);
  ------------------
  |  |  143|    189|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    189|    do {                                                                                      \
  |  |  |  |  137|    189|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 189]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    189|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 189]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  773|    189|        return -1;
  774|    189|    }
  775|       |
  776|       |    // switch state to reading message data
  777|    408|    in_data = true;
  778|       |
  779|    408|    return nCopy;
  780|    597|}
_ZN11V1Transport8readDataENSt3__14spanIKhLm18446744073709551615EEE:
  783|    324|{
  784|    324|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|    324|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  785|    324|    unsigned int nRemaining = hdr.nMessageSize - nDataPos;
  786|    324|    unsigned int nCopy = std::min<unsigned int>(nRemaining, msg_bytes.size());
  787|       |
  788|    324|    if (vRecv.size() < nDataPos + nCopy) {
  ------------------
  |  Branch (788:9): [True: 291, False: 33]
  ------------------
  789|       |        // Allocate up to 256 KiB ahead, but never more than the total message size.
  790|    291|        vRecv.resize(std::min(hdr.nMessageSize, nDataPos + nCopy + 256 * 1024));
  791|    291|    }
  792|       |
  793|    324|    hasher.Write(msg_bytes.first(nCopy));
  794|    324|    memcpy(&vRecv[nDataPos], msg_bytes.data(), nCopy);
  795|    324|    nDataPos += nCopy;
  796|       |
  797|    324|    return nCopy;
  798|    324|}
_ZNK11V1Transport14GetMessageHashEv:
  801|    335|{
  802|    335|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|    335|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  803|    335|    assert(CompleteInternal());
  ------------------
  |  Branch (803:5): [True: 335, False: 0]
  ------------------
  804|    335|    if (data_hash.IsNull())
  ------------------
  |  Branch (804:9): [True: 335, False: 0]
  ------------------
  805|    335|        hasher.Finalize(data_hash);
  806|    335|    return data_hash;
  807|    335|}
_ZN11V1Transport18GetReceivedMessageENSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1000000EEEEEEERb:
  810|    335|{
  811|    335|    AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|    335|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  812|       |    // Initialize out parameter
  813|    335|    reject_message = false;
  814|       |    // decompose a single CNetMessage from the TransportDeserializer
  815|    335|    LOCK(m_recv_mutex);
  ------------------
  |  |  268|    335|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    335|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    335|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    335|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|    335|    CNetMessage msg(std::move(vRecv));
  817|       |
  818|       |    // store message type string, time, and sizes
  819|    335|    msg.m_type = hdr.GetMessageType();
  820|    335|    msg.m_time = time;
  821|    335|    msg.m_message_size = hdr.nMessageSize;
  822|    335|    msg.m_raw_message_size = hdr.nMessageSize + CMessageHeader::HEADER_SIZE;
  823|       |
  824|    335|    uint256 hash = GetMessageHash();
  825|       |
  826|       |    // We just received a message off the wire, harvest entropy from the time (and the message checksum)
  827|    335|    RandAddEvent(ReadLE32(hash.begin()));
  828|       |
  829|       |    // Check checksum and header message type string
  830|    335|    if (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != 0) {
  ------------------
  |  Branch (830:9): [True: 227, False: 108]
  ------------------
  831|    227|        LogDebug(BCLog::NET, "Header error: Wrong checksum (%s, %u bytes), expected %s was %s, peer=%d\n",
  ------------------
  |  |  143|    227|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    227|    do {                                                                                      \
  |  |  |  |  137|    227|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    227|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  832|    227|                 SanitizeString(msg.m_type), msg.m_message_size,
  833|    227|                 HexStr(std::span{hash}.first(CMessageHeader::CHECKSUM_SIZE)),
  834|    227|                 HexStr(hdr.pchChecksum),
  835|    227|                 m_node_id);
  836|    227|        reject_message = true;
  837|    227|    } else if (!hdr.IsMessageTypeValid()) {
  ------------------
  |  Branch (837:16): [True: 36, False: 72]
  ------------------
  838|     36|        LogDebug(BCLog::NET, "Header error: Invalid message type (%s, %u bytes), peer=%d\n",
  ------------------
  |  |  143|     36|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|     36|    do {                                                                                      \
  |  |  |  |  137|     36|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 36]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|     36|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  839|     36|                 SanitizeString(hdr.GetMessageType()), msg.m_message_size, m_node_id);
  840|     36|        reject_message = true;
  841|     36|    }
  842|       |
  843|       |    // Always reset the network deserializer (prepare for the next message)
  844|    335|    Reset();
  845|    335|    return msg;
  846|    335|}
_ZN11V1Transport16SetMessageToSendER17CSerializedNetMsg:
  849|  86.7k|{
  850|  86.7k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|  86.7k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  851|       |    // Determine whether a new message can be set.
  852|  86.7k|    LOCK(m_send_mutex);
  ------------------
  |  |  268|  86.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  86.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  86.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  86.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  853|  86.7k|    if (m_sending_header || m_bytes_sent < m_message_to_send.data.size()) return false;
  ------------------
  |  Branch (853:9): [True: 0, False: 86.7k]
  |  Branch (853:29): [True: 0, False: 86.7k]
  ------------------
  854|       |
  855|       |    // create dbl-sha256 checksum
  856|  86.7k|    uint256 hash = Hash(msg.data);
  857|       |
  858|       |    // create header
  859|  86.7k|    CMessageHeader hdr(m_magic_bytes, msg.m_type.c_str(), msg.data.size());
  860|  86.7k|    memcpy(hdr.pchChecksum, hash.begin(), CMessageHeader::CHECKSUM_SIZE);
  861|       |
  862|       |    // serialize header
  863|  86.7k|    m_header_to_send.clear();
  864|  86.7k|    VectorWriter{m_header_to_send, 0, hdr};
  865|       |
  866|       |    // update state
  867|  86.7k|    m_message_to_send = std::move(msg);
  868|  86.7k|    m_sending_header = true;
  869|  86.7k|    m_bytes_sent = 0;
  870|  86.7k|    return true;
  871|  86.7k|}
_ZNK11V1Transport14GetBytesToSendEb:
  874|   966k|{
  875|   966k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|   966k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  876|   966k|    LOCK(m_send_mutex);
  ------------------
  |  |  268|   966k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   966k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   966k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   966k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|   966k|    if (m_sending_header) {
  ------------------
  |  Branch (877:9): [True: 113k, False: 852k]
  ------------------
  878|   113k|        return {std::span{m_header_to_send}.subspan(m_bytes_sent),
  879|       |                // We have more to send after the header if the message has payload, or if there
  880|       |                // is a next message after that.
  881|   113k|                have_next_message || !m_message_to_send.data.empty(),
  ------------------
  |  Branch (881:17): [True: 27.0k, False: 86.7k]
  |  Branch (881:38): [True: 59.5k, False: 27.2k]
  ------------------
  882|   113k|                m_message_to_send.m_type
  883|   113k|               };
  884|   852k|    } else {
  885|   852k|        return {std::span{m_message_to_send.data}.subspan(m_bytes_sent),
  886|       |                // We only have more to send after this message's payload if there is another
  887|       |                // message.
  888|   852k|                have_next_message,
  889|   852k|                m_message_to_send.m_type
  890|   852k|               };
  891|   852k|    }
  892|   966k|}
_ZN11V1Transport13MarkBytesSentEm:
  895|   145k|{
  896|   145k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|   145k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  897|   145k|    LOCK(m_send_mutex);
  ------------------
  |  |  268|   145k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   145k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   145k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   145k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  898|   145k|    m_bytes_sent += bytes_sent;
  899|   145k|    if (m_sending_header && m_bytes_sent == m_header_to_send.size()) {
  ------------------
  |  Branch (899:9): [True: 86.6k, False: 59.2k]
  |  Branch (899:29): [True: 86.5k, False: 121]
  ------------------
  900|       |        // We're done sending a message's header. Switch to sending its data bytes.
  901|  86.5k|        m_sending_header = false;
  902|  86.5k|        m_bytes_sent = 0;
  903|  86.5k|    } else if (!m_sending_header && m_bytes_sent == m_message_to_send.data.size()) {
  ------------------
  |  Branch (903:16): [True: 59.2k, False: 121]
  |  Branch (903:37): [True: 59.1k, False: 164]
  ------------------
  904|       |        // We're done sending a message's data. Wipe the data vector to reduce memory consumption.
  905|  59.1k|        ClearShrink(m_message_to_send.data);
  906|  59.1k|        m_bytes_sent = 0;
  907|  59.1k|    }
  908|   145k|}
_ZNK11V1Transport18GetSendMemoryUsageEv:
  911|   207k|{
  912|   207k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|   207k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  913|   207k|    LOCK(m_send_mutex);
  ------------------
  |  |  268|   207k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   207k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   207k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   207k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|       |    // Don't count sending-side fields besides m_message_to_send, as they're all small and bounded.
  915|   207k|    return m_message_to_send.GetMemoryUsage();
  916|   207k|}
_ZN11V2Transport21StartSendingHandshakeEv:
  995|  19.8k|{
  996|  19.8k|    AssertLockHeld(m_send_mutex);
  ------------------
  |  |  144|  19.8k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  997|  19.8k|    Assume(m_send_state == SendState::AWAITING_KEY);
  ------------------
  |  |  128|  19.8k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  998|  19.8k|    Assume(m_send_buffer.empty());
  ------------------
  |  |  128|  19.8k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  999|       |    // Initialize the send buffer with ellswift pubkey + provided garbage.
 1000|  19.8k|    m_send_buffer.resize(EllSwiftPubKey::size() + m_send_garbage.size());
 1001|  19.8k|    std::copy(std::begin(m_cipher.GetOurPubKey()), std::end(m_cipher.GetOurPubKey()), MakeWritableByteSpan(m_send_buffer).begin());
 1002|  19.8k|    std::copy(m_send_garbage.begin(), m_send_garbage.end(), m_send_buffer.begin() + EllSwiftPubKey::size());
 1003|       |    // We cannot wipe m_send_garbage as it will still be used as AAD later in the handshake.
 1004|  19.8k|}
_ZN11V2TransportC2ElbRK4CKeyNSt3__14spanIKSt4byteLm18446744073709551615EEENS3_6vectorIhNS3_9allocatorIhEEEE:
 1007|   256k|    : m_cipher{key, ent32},
 1008|   256k|      m_initiating{initiating},
 1009|   256k|      m_nodeid{nodeid},
 1010|   256k|      m_v1_fallback{nodeid},
 1011|   256k|      m_recv_state{initiating ? RecvState::KEY : RecvState::KEY_MAYBE_V1},
  ------------------
  |  Branch (1011:20): [True: 637, False: 255k]
  ------------------
 1012|   256k|      m_send_garbage{std::move(garbage)},
 1013|   256k|      m_send_state{initiating ? SendState::AWAITING_KEY : SendState::MAYBE_V1}
  ------------------
  |  Branch (1013:20): [True: 637, False: 255k]
  ------------------
 1014|   256k|{
 1015|   256k|    Assume(m_send_garbage.size() <= MAX_GARBAGE_LEN);
  ------------------
  |  |  128|   256k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1016|       |    // Start sending immediately if we're the initiator of the connection.
 1017|   256k|    if (initiating) {
  ------------------
  |  Branch (1017:9): [True: 637, False: 255k]
  ------------------
 1018|    637|        LOCK(m_send_mutex);
  ------------------
  |  |  268|    637|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    637|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    637|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    637|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1019|    637|        StartSendingHandshake();
 1020|    637|    }
 1021|   256k|}
_ZN11V2TransportC2Elb:
 1024|   256k|    : V2Transport{nodeid, initiating, GenerateRandomKey(),
 1025|   256k|                  MakeByteSpan(GetRandHash()), GenerateRandomGarbage()} {}
_ZN11V2Transport15SetReceiveStateENS_9RecvStateE:
 1028|  38.1k|{
 1029|  38.1k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  38.1k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1030|       |    // Enforce allowed state transitions.
 1031|  38.1k|    switch (m_recv_state) {
  ------------------
  |  Branch (1031:13): [True: 38.1k, False: 0]
  ------------------
 1032|  19.2k|    case RecvState::KEY_MAYBE_V1:
  ------------------
  |  Branch (1032:5): [True: 19.2k, False: 18.8k]
  ------------------
 1033|  19.2k|        Assume(recv_state == RecvState::KEY || recv_state == RecvState::V1);
  ------------------
  |  |  128|  19.3k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  |  |  ------------------
  |  |  |  Branch (128:51): [True: 19.2k, False: 84]
  |  |  |  Branch (128:51): [True: 84, False: 0]
  |  |  ------------------
  ------------------
 1034|  19.2k|        break;
 1035|  18.8k|    case RecvState::KEY:
  ------------------
  |  Branch (1035:5): [True: 18.8k, False: 19.2k]
  ------------------
 1036|  18.8k|        Assume(recv_state == RecvState::GARB_GARBTERM);
  ------------------
  |  |  128|  18.8k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1037|  18.8k|        break;
 1038|      0|    case RecvState::GARB_GARBTERM:
  ------------------
  |  Branch (1038:5): [True: 0, False: 38.1k]
  ------------------
 1039|      0|        Assume(recv_state == RecvState::VERSION);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1040|      0|        break;
 1041|      0|    case RecvState::VERSION:
  ------------------
  |  Branch (1041:5): [True: 0, False: 38.1k]
  ------------------
 1042|      0|        Assume(recv_state == RecvState::APP);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1043|      0|        break;
 1044|      0|    case RecvState::APP:
  ------------------
  |  Branch (1044:5): [True: 0, False: 38.1k]
  ------------------
 1045|      0|        Assume(recv_state == RecvState::APP_READY);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1046|      0|        break;
 1047|      0|    case RecvState::APP_READY:
  ------------------
  |  Branch (1047:5): [True: 0, False: 38.1k]
  ------------------
 1048|      0|        Assume(recv_state == RecvState::APP);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1049|      0|        break;
 1050|      0|    case RecvState::V1:
  ------------------
  |  Branch (1050:5): [True: 0, False: 38.1k]
  ------------------
 1051|      0|        Assume(false); // V1 state cannot be left
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1052|      0|        break;
 1053|  38.1k|    }
 1054|       |    // Change state.
 1055|  38.1k|    m_recv_state = recv_state;
 1056|  38.1k|}
_ZN11V2Transport12SetSendStateENS_9SendStateE:
 1059|  38.1k|{
 1060|  38.1k|    AssertLockHeld(m_send_mutex);
  ------------------
  |  |  144|  38.1k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1061|       |    // Enforce allowed state transitions.
 1062|  38.1k|    switch (m_send_state) {
  ------------------
  |  Branch (1062:13): [True: 38.1k, False: 0]
  ------------------
 1063|  19.2k|    case SendState::MAYBE_V1:
  ------------------
  |  Branch (1063:5): [True: 19.2k, False: 18.8k]
  ------------------
 1064|  19.2k|        Assume(send_state == SendState::V1 || send_state == SendState::AWAITING_KEY);
  ------------------
  |  |  128|  38.4k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  |  |  ------------------
  |  |  |  Branch (128:51): [True: 84, False: 19.2k]
  |  |  |  Branch (128:51): [True: 19.2k, False: 0]
  |  |  ------------------
  ------------------
 1065|  19.2k|        break;
 1066|  18.8k|    case SendState::AWAITING_KEY:
  ------------------
  |  Branch (1066:5): [True: 18.8k, False: 19.2k]
  ------------------
 1067|  18.8k|        Assume(send_state == SendState::READY);
  ------------------
  |  |  128|  18.8k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1068|  18.8k|        break;
 1069|      0|    case SendState::READY:
  ------------------
  |  Branch (1069:5): [True: 0, False: 38.1k]
  ------------------
 1070|      0|    case SendState::V1:
  ------------------
  |  Branch (1070:5): [True: 0, False: 38.1k]
  ------------------
 1071|      0|        Assume(false); // Final states
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1072|      0|        break;
 1073|  38.1k|    }
 1074|       |    // Change state.
 1075|  38.1k|    m_send_state = send_state;
 1076|  38.1k|}
_ZNK11V2Transport23ReceivedMessageCompleteEv:
 1079|    791|{
 1080|    791|    AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|    791|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1081|    791|    LOCK(m_recv_mutex);
  ------------------
  |  |  268|    791|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    791|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    791|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    791|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1082|    791|    if (m_recv_state == RecvState::V1) return m_v1_fallback.ReceivedMessageComplete();
  ------------------
  |  Branch (1082:9): [True: 191, False: 600]
  ------------------
 1083|       |
 1084|    600|    return m_recv_state == RecvState::APP_READY;
 1085|    791|}
_ZN11V2Transport27ProcessReceivedMaybeV1BytesEv:
 1088|  19.2k|{
 1089|  19.2k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  19.2k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1090|  19.2k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|  19.2k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1091|  19.2k|    Assume(m_recv_state == RecvState::KEY_MAYBE_V1);
  ------------------
  |  |  128|  19.2k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1092|       |    // We still have to determine if this is a v1 or v2 connection. The bytes being received could
 1093|       |    // be the beginning of either a v1 packet (network magic + "version\x00\x00\x00\x00\x00"), or
 1094|       |    // of a v2 public key. BIP324 specifies that a mismatch with this 16-byte string should trigger
 1095|       |    // sending of the key.
 1096|  19.2k|    std::array<uint8_t, V1_PREFIX_LEN> v1_prefix = {0, 0, 0, 0, 'v', 'e', 'r', 's', 'i', 'o', 'n', 0, 0, 0, 0, 0};
 1097|  19.2k|    std::copy(std::begin(Params().MessageStart()), std::end(Params().MessageStart()), v1_prefix.begin());
 1098|  19.2k|    Assume(m_recv_buffer.size() <= v1_prefix.size());
  ------------------
  |  |  128|  19.2k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1099|  19.2k|    if (!std::equal(m_recv_buffer.begin(), m_recv_buffer.end(), v1_prefix.begin())) {
  ------------------
  |  Branch (1099:9): [True: 19.2k, False: 85]
  ------------------
 1100|       |        // Mismatch with v1 prefix, so we can assume a v2 connection.
 1101|  19.2k|        SetReceiveState(RecvState::KEY); // Convert to KEY state, leaving received bytes around.
 1102|       |        // Transition the sender to AWAITING_KEY state and start sending.
 1103|  19.2k|        LOCK(m_send_mutex);
  ------------------
  |  |  268|  19.2k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  19.2k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  19.2k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  19.2k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1104|  19.2k|        SetSendState(SendState::AWAITING_KEY);
 1105|  19.2k|        StartSendingHandshake();
 1106|  19.2k|    } else if (m_recv_buffer.size() == v1_prefix.size()) {
  ------------------
  |  Branch (1106:16): [True: 84, False: 1]
  ------------------
 1107|       |        // Full match with the v1 prefix, so fall back to v1 behavior.
 1108|     84|        LOCK(m_send_mutex);
  ------------------
  |  |  268|     84|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     84|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     84|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     84|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1109|     84|        std::span<const uint8_t> feedback{m_recv_buffer};
 1110|       |        // Feed already received bytes to v1 transport. It should always accept these, because it's
 1111|       |        // less than the size of a v1 header, and these are the first bytes fed to m_v1_fallback.
 1112|     84|        bool ret = m_v1_fallback.ReceivedBytes(feedback);
 1113|     84|        Assume(feedback.empty());
  ------------------
  |  |  128|     84|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1114|     84|        Assume(ret);
  ------------------
  |  |  128|     84|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1115|     84|        SetReceiveState(RecvState::V1);
 1116|     84|        SetSendState(SendState::V1);
 1117|       |        // Reset v2 transport buffers to save memory.
 1118|     84|        ClearShrink(m_recv_buffer);
 1119|     84|        ClearShrink(m_send_buffer);
 1120|     84|    } else {
 1121|       |        // We have not received enough to distinguish v1 from v2 yet. Wait until more bytes come.
 1122|      1|    }
 1123|  19.2k|}
_ZN11V2Transport23ProcessReceivedKeyBytesEv:
 1126|  19.1k|{
 1127|  19.1k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  19.1k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1128|  19.1k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|  19.1k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1129|  19.1k|    Assume(m_recv_state == RecvState::KEY);
  ------------------
  |  |  128|  19.1k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1130|  19.1k|    Assume(m_recv_buffer.size() <= EllSwiftPubKey::size());
  ------------------
  |  |  128|  19.1k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1131|       |
 1132|       |    // As a special exception, if bytes 4-16 of the key on a responder connection match the
 1133|       |    // corresponding bytes of a V1 version message, but bytes 0-4 don't match the network magic
 1134|       |    // (if they did, we'd have switched to V1 state already), assume this is a peer from
 1135|       |    // another network, and disconnect them. They will almost certainly disconnect us too when
 1136|       |    // they receive our uniformly random key and garbage, but detecting this case specially
 1137|       |    // means we can log it.
 1138|  19.1k|    static constexpr std::array<uint8_t, 12> MATCH = {'v', 'e', 'r', 's', 'i', 'o', 'n', 0, 0, 0, 0, 0};
 1139|  19.1k|    static constexpr size_t OFFSET = std::tuple_size_v<MessageStartChars>;
 1140|  19.1k|    if (!m_initiating && m_recv_buffer.size() >= OFFSET + MATCH.size()) {
  ------------------
  |  Branch (1140:9): [True: 19.0k, False: 52]
  |  Branch (1140:26): [True: 19.0k, False: 3]
  ------------------
 1141|  19.0k|        if (std::equal(MATCH.begin(), MATCH.end(), m_recv_buffer.begin() + OFFSET)) {
  ------------------
  |  Branch (1141:13): [True: 3, False: 19.0k]
  ------------------
 1142|      3|            LogDebug(BCLog::NET, "V2 transport error: V1 peer with wrong MessageStart %s\n",
  ------------------
  |  |  143|      3|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      3|    do {                                                                                      \
  |  |  |  |  137|      3|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1143|      3|                     HexStr(std::span(m_recv_buffer).first(OFFSET)));
 1144|      3|            return false;
 1145|      3|        }
 1146|  19.0k|    }
 1147|       |
 1148|  19.1k|    if (m_recv_buffer.size() == EllSwiftPubKey::size()) {
  ------------------
  |  Branch (1148:9): [True: 18.8k, False: 222]
  ------------------
 1149|       |        // Other side's key has been fully received, and can now be Diffie-Hellman combined with
 1150|       |        // our key to initialize the encryption ciphers.
 1151|       |
 1152|       |        // Initialize the ciphers.
 1153|  18.8k|        EllSwiftPubKey ellswift(MakeByteSpan(m_recv_buffer));
 1154|  18.8k|        LOCK(m_send_mutex);
  ------------------
  |  |  268|  18.8k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  18.8k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  18.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  18.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1155|  18.8k|        m_cipher.Initialize(ellswift, m_initiating);
 1156|       |
 1157|       |        // Switch receiver state to GARB_GARBTERM.
 1158|  18.8k|        SetReceiveState(RecvState::GARB_GARBTERM);
 1159|  18.8k|        m_recv_buffer.clear();
 1160|       |
 1161|       |        // Switch sender state to READY.
 1162|  18.8k|        SetSendState(SendState::READY);
 1163|       |
 1164|       |        // Append the garbage terminator to the send buffer.
 1165|  18.8k|        m_send_buffer.resize(m_send_buffer.size() + BIP324Cipher::GARBAGE_TERMINATOR_LEN);
 1166|  18.8k|        std::copy(m_cipher.GetSendGarbageTerminator().begin(),
 1167|  18.8k|                  m_cipher.GetSendGarbageTerminator().end(),
 1168|  18.8k|                  MakeWritableByteSpan(m_send_buffer).last(BIP324Cipher::GARBAGE_TERMINATOR_LEN).begin());
 1169|       |
 1170|       |        // Construct version packet in the send buffer, with the sent garbage data as AAD.
 1171|  18.8k|        m_send_buffer.resize(m_send_buffer.size() + BIP324Cipher::EXPANSION + VERSION_CONTENTS.size());
 1172|  18.8k|        m_cipher.Encrypt(
 1173|  18.8k|            /*contents=*/VERSION_CONTENTS,
 1174|  18.8k|            /*aad=*/MakeByteSpan(m_send_garbage),
 1175|  18.8k|            /*ignore=*/false,
 1176|  18.8k|            /*output=*/MakeWritableByteSpan(m_send_buffer).last(BIP324Cipher::EXPANSION + VERSION_CONTENTS.size()));
 1177|       |        // We no longer need the garbage.
 1178|  18.8k|        ClearShrink(m_send_garbage);
 1179|  18.8k|    } else {
 1180|       |        // We still have to receive more key bytes.
 1181|    222|    }
 1182|  19.1k|    return true;
 1183|  19.1k|}
_ZN11V2Transport27ProcessReceivedGarbageBytesEv:
 1186|  76.7M|{
 1187|  76.7M|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  76.7M|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1188|  76.7M|    Assume(m_recv_state == RecvState::GARB_GARBTERM);
  ------------------
  |  |  128|  76.7M|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1189|  76.7M|    Assume(m_recv_buffer.size() <= MAX_GARBAGE_LEN + BIP324Cipher::GARBAGE_TERMINATOR_LEN);
  ------------------
  |  |  128|  76.7M|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1190|  76.7M|    if (m_recv_buffer.size() >= BIP324Cipher::GARBAGE_TERMINATOR_LEN) {
  ------------------
  |  Branch (1190:9): [True: 76.5M, False: 282k]
  ------------------
 1191|  76.5M|        if (std::ranges::equal(MakeByteSpan(m_recv_buffer).last(BIP324Cipher::GARBAGE_TERMINATOR_LEN), m_cipher.GetReceiveGarbageTerminator())) {
  ------------------
  |  Branch (1191:13): [True: 0, False: 76.5M]
  ------------------
 1192|       |            // Garbage terminator received. Store garbage to authenticate it as AAD later.
 1193|      0|            m_recv_aad = std::move(m_recv_buffer);
 1194|      0|            m_recv_aad.resize(m_recv_aad.size() - BIP324Cipher::GARBAGE_TERMINATOR_LEN);
 1195|      0|            m_recv_buffer.clear();
 1196|      0|            SetReceiveState(RecvState::VERSION);
 1197|  76.5M|        } else if (m_recv_buffer.size() == MAX_GARBAGE_LEN + BIP324Cipher::GARBAGE_TERMINATOR_LEN) {
  ------------------
  |  Branch (1197:20): [True: 18.6k, False: 76.4M]
  ------------------
 1198|       |            // We've reached the maximum length for garbage + garbage terminator, and the
 1199|       |            // terminator still does not match. Abort.
 1200|  18.6k|            LogDebug(BCLog::NET, "V2 transport error: missing garbage terminator, peer=%d\n", m_nodeid);
  ------------------
  |  |  143|  18.6k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  18.6k|    do {                                                                                      \
  |  |  |  |  137|  18.6k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 18.6k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  18.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 18.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1201|  18.6k|            return false;
 1202|  76.4M|        } else {
 1203|       |            // We still need to receive more garbage and/or garbage terminator bytes.
 1204|  76.4M|        }
 1205|  76.5M|    } else {
 1206|       |        // We have less than GARBAGE_TERMINATOR_LEN (16) bytes, so we certainly need to receive
 1207|       |        // more first.
 1208|   282k|    }
 1209|  76.7M|    return true;
 1210|  76.7M|}
_ZN11V2Transport20GetMaxBytesToProcessEv:
 1282|  76.8M|{
 1283|  76.8M|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  76.8M|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1284|  76.8M|    switch (m_recv_state) {
  ------------------
  |  Branch (1284:13): [True: 76.8M, False: 0]
  ------------------
 1285|  19.2k|    case RecvState::KEY_MAYBE_V1:
  ------------------
  |  Branch (1285:5): [True: 19.2k, False: 76.8M]
  ------------------
 1286|       |        // During the KEY_MAYBE_V1 state we do not allow more than the length of v1 prefix into the
 1287|       |        // receive buffer.
 1288|  19.2k|        Assume(m_recv_buffer.size() <= V1_PREFIX_LEN);
  ------------------
  |  |  128|  19.2k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1289|       |        // As long as we're not sure if this is a v1 or v2 connection, don't receive more than what
 1290|       |        // is strictly necessary to distinguish the two (16 bytes). If we permitted more than
 1291|       |        // the v1 header size (24 bytes), we may not be able to feed the already-received bytes
 1292|       |        // back into the m_v1_fallback V1 transport.
 1293|  19.2k|        return V1_PREFIX_LEN - m_recv_buffer.size();
 1294|  19.1k|    case RecvState::KEY:
  ------------------
  |  Branch (1294:5): [True: 19.1k, False: 76.8M]
  ------------------
 1295|       |        // During the KEY state, we only allow the 64-byte key into the receive buffer.
 1296|  19.1k|        Assume(m_recv_buffer.size() <= EllSwiftPubKey::size());
  ------------------
  |  |  128|  19.1k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1297|       |        // As long as we have not received the other side's public key, don't receive more than
 1298|       |        // that (64 bytes), as garbage follows, and locating the garbage terminator requires the
 1299|       |        // key exchange first.
 1300|  19.1k|        return EllSwiftPubKey::size() - m_recv_buffer.size();
 1301|  76.7M|    case RecvState::GARB_GARBTERM:
  ------------------
  |  Branch (1301:5): [True: 76.7M, False: 38.3k]
  ------------------
 1302|       |        // Process garbage bytes one by one (because terminator may appear anywhere).
 1303|  76.7M|        return 1;
 1304|      0|    case RecvState::VERSION:
  ------------------
  |  Branch (1304:5): [True: 0, False: 76.8M]
  ------------------
 1305|      0|    case RecvState::APP:
  ------------------
  |  Branch (1305:5): [True: 0, False: 76.8M]
  ------------------
 1306|       |        // These three states all involve decoding a packet. Process the length descriptor first,
 1307|       |        // so that we know where the current packet ends (and we don't process bytes from the next
 1308|       |        // packet or decoy yet). Then, process the ciphertext bytes of the current packet.
 1309|      0|        if (m_recv_buffer.size() < BIP324Cipher::LENGTH_LEN) {
  ------------------
  |  Branch (1309:13): [True: 0, False: 0]
  ------------------
 1310|      0|            return BIP324Cipher::LENGTH_LEN - m_recv_buffer.size();
 1311|      0|        } else {
 1312|       |            // Note that BIP324Cipher::EXPANSION is the total difference between contents size
 1313|       |            // and encoded packet size, which includes the 3 bytes due to the packet length.
 1314|       |            // When transitioning from receiving the packet length to receiving its ciphertext,
 1315|       |            // the encrypted packet length is left in the receive buffer.
 1316|      0|            return BIP324Cipher::EXPANSION + m_recv_len - m_recv_buffer.size();
 1317|      0|        }
 1318|      0|    case RecvState::APP_READY:
  ------------------
  |  Branch (1318:5): [True: 0, False: 76.8M]
  ------------------
 1319|       |        // No bytes can be processed until GetMessage() is called.
 1320|      0|        return 0;
 1321|      0|    case RecvState::V1:
  ------------------
  |  Branch (1321:5): [True: 0, False: 76.8M]
  ------------------
 1322|       |        // Not allowed (must be dealt with by the caller).
 1323|      0|        Assume(false);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1324|      0|        return 0;
 1325|  76.8M|    }
 1326|      0|    Assume(false); // unreachable
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1327|      0|    return 0;
 1328|  76.8M|}
_ZN11V2Transport13ReceivedBytesERNSt3__14spanIKhLm18446744073709551615EEE:
 1331|  19.5k|{
 1332|  19.5k|    AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|  19.5k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1333|       |    /** How many bytes to allocate in the receive buffer at most above what is received so far. */
 1334|  19.5k|    static constexpr size_t MAX_RESERVE_AHEAD = 256 * 1024;
 1335|       |
 1336|  19.5k|    LOCK(m_recv_mutex);
  ------------------
  |  |  268|  19.5k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  19.5k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  19.5k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  19.5k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1337|  19.5k|    if (m_recv_state == RecvState::V1) return m_v1_fallback.ReceivedBytes(msg_bytes);
  ------------------
  |  Branch (1337:9): [True: 152, False: 19.3k]
  ------------------
 1338|       |
 1339|       |    // Process the provided bytes in msg_bytes in a loop. In each iteration a nonzero number of
 1340|       |    // bytes (decided by GetMaxBytesToProcess) are taken from the beginning om msg_bytes, and
 1341|       |    // appended to m_recv_buffer. Then, depending on the receiver state, one of the
 1342|       |    // ProcessReceived*Bytes functions is called to process the bytes in that buffer.
 1343|  76.8M|    while (!msg_bytes.empty()) {
  ------------------
  |  Branch (1343:12): [True: 76.8M, False: 600]
  ------------------
 1344|       |        // Decide how many bytes to copy from msg_bytes to m_recv_buffer.
 1345|  76.8M|        size_t max_read = GetMaxBytesToProcess();
 1346|       |
 1347|       |        // Reserve space in the buffer if there is not enough.
 1348|  76.8M|        if (m_recv_buffer.size() + std::min(msg_bytes.size(), max_read) > m_recv_buffer.capacity()) {
  ------------------
  |  Branch (1348:13): [True: 19.3k, False: 76.8M]
  ------------------
 1349|  19.3k|            switch (m_recv_state) {
  ------------------
  |  Branch (1349:21): [True: 19.3k, False: 0]
  ------------------
 1350|  19.2k|            case RecvState::KEY_MAYBE_V1:
  ------------------
  |  Branch (1350:13): [True: 19.2k, False: 50]
  ------------------
 1351|  19.3k|            case RecvState::KEY:
  ------------------
  |  Branch (1351:13): [True: 50, False: 19.2k]
  ------------------
 1352|  19.3k|            case RecvState::GARB_GARBTERM:
  ------------------
  |  Branch (1352:13): [True: 0, False: 19.3k]
  ------------------
 1353|       |                // During the initial states (key/garbage), allocate once to fit the maximum (4111
 1354|       |                // bytes).
 1355|  19.3k|                m_recv_buffer.reserve(MAX_GARBAGE_LEN + BIP324Cipher::GARBAGE_TERMINATOR_LEN);
 1356|  19.3k|                break;
 1357|      0|            case RecvState::VERSION:
  ------------------
  |  Branch (1357:13): [True: 0, False: 19.3k]
  ------------------
 1358|      0|            case RecvState::APP: {
  ------------------
  |  Branch (1358:13): [True: 0, False: 19.3k]
  ------------------
 1359|       |                // During states where a packet is being received, as much as is expected but never
 1360|       |                // more than MAX_RESERVE_AHEAD bytes in addition to what is received so far.
 1361|       |                // This means attackers that want to cause us to waste allocated memory are limited
 1362|       |                // to MAX_RESERVE_AHEAD above the largest allowed message contents size, and to
 1363|       |                // MAX_RESERVE_AHEAD more than they've actually sent us.
 1364|      0|                size_t alloc_add = std::min(max_read, msg_bytes.size() + MAX_RESERVE_AHEAD);
 1365|      0|                m_recv_buffer.reserve(m_recv_buffer.size() + alloc_add);
 1366|      0|                break;
 1367|      0|            }
 1368|      0|            case RecvState::APP_READY:
  ------------------
  |  Branch (1368:13): [True: 0, False: 19.3k]
  ------------------
 1369|       |                // The buffer is empty in this state.
 1370|      0|                Assume(m_recv_buffer.empty());
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1371|      0|                break;
 1372|      0|            case RecvState::V1:
  ------------------
  |  Branch (1372:13): [True: 0, False: 19.3k]
  ------------------
 1373|       |                // Should have bailed out above.
 1374|      0|                Assume(false);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1375|      0|                break;
 1376|  19.3k|            }
 1377|  19.3k|        }
 1378|       |
 1379|       |        // Can't read more than provided input.
 1380|  76.8M|        max_read = std::min(msg_bytes.size(), max_read);
 1381|       |        // Copy data to buffer.
 1382|  76.8M|        m_recv_buffer.insert(m_recv_buffer.end(), UCharCast(msg_bytes.data()), UCharCast(msg_bytes.data() + max_read));
 1383|  76.8M|        msg_bytes = msg_bytes.subspan(max_read);
 1384|       |
 1385|       |        // Process data in the buffer.
 1386|  76.8M|        switch (m_recv_state) {
  ------------------
  |  Branch (1386:17): [True: 76.8M, False: 0]
  ------------------
 1387|  19.2k|        case RecvState::KEY_MAYBE_V1:
  ------------------
  |  Branch (1387:9): [True: 19.2k, False: 76.8M]
  ------------------
 1388|  19.2k|            ProcessReceivedMaybeV1Bytes();
 1389|  19.2k|            if (m_recv_state == RecvState::V1) return true;
  ------------------
  |  Branch (1389:17): [True: 84, False: 19.2k]
  ------------------
 1390|  19.2k|            break;
 1391|       |
 1392|  19.2k|        case RecvState::KEY:
  ------------------
  |  Branch (1392:9): [True: 19.1k, False: 76.8M]
  ------------------
 1393|  19.1k|            if (!ProcessReceivedKeyBytes()) return false;
  ------------------
  |  Branch (1393:17): [True: 3, False: 19.1k]
  ------------------
 1394|  19.1k|            break;
 1395|       |
 1396|  76.7M|        case RecvState::GARB_GARBTERM:
  ------------------
  |  Branch (1396:9): [True: 76.7M, False: 38.3k]
  ------------------
 1397|  76.7M|            if (!ProcessReceivedGarbageBytes()) return false;
  ------------------
  |  Branch (1397:17): [True: 18.6k, False: 76.7M]
  ------------------
 1398|  76.7M|            break;
 1399|       |
 1400|  76.7M|        case RecvState::VERSION:
  ------------------
  |  Branch (1400:9): [True: 0, False: 76.8M]
  ------------------
 1401|      0|        case RecvState::APP:
  ------------------
  |  Branch (1401:9): [True: 0, False: 76.8M]
  ------------------
 1402|      0|            if (!ProcessReceivedPacketBytes()) return false;
  ------------------
  |  Branch (1402:17): [True: 0, False: 0]
  ------------------
 1403|      0|            break;
 1404|       |
 1405|      0|        case RecvState::APP_READY:
  ------------------
  |  Branch (1405:9): [True: 0, False: 76.8M]
  ------------------
 1406|      0|            return true;
 1407|       |
 1408|      0|        case RecvState::V1:
  ------------------
  |  Branch (1408:9): [True: 0, False: 76.8M]
  ------------------
 1409|       |            // We should have bailed out before.
 1410|      0|            Assume(false);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1411|      0|            break;
 1412|  76.8M|        }
 1413|       |        // Make sure we have made progress before continuing.
 1414|  76.8M|        Assume(max_read > 0);
  ------------------
  |  |  128|  76.8M|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1415|  76.8M|    }
 1416|       |
 1417|    600|    return true;
 1418|  19.3k|}
_ZN11V2Transport18GetReceivedMessageENSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1000000EEEEEEERb:
 1461|     23|{
 1462|     23|    AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|     23|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1463|     23|    LOCK(m_recv_mutex);
  ------------------
  |  |  268|     23|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     23|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     23|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     23|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1464|     23|    if (m_recv_state == RecvState::V1) return m_v1_fallback.GetReceivedMessage(time, reject_message);
  ------------------
  |  Branch (1464:9): [True: 23, False: 0]
  ------------------
 1465|       |
 1466|      0|    Assume(m_recv_state == RecvState::APP_READY);
  ------------------
  |  |  128|      0|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1467|      0|    std::span<const uint8_t> contents{m_recv_decode_buffer};
 1468|      0|    auto msg_type = GetMessageType(contents);
 1469|      0|    CNetMessage msg{DataStream{}};
 1470|       |    // Note that BIP324Cipher::EXPANSION also includes the length descriptor size.
 1471|      0|    msg.m_raw_message_size = m_recv_decode_buffer.size() + BIP324Cipher::EXPANSION;
 1472|      0|    if (msg_type) {
  ------------------
  |  Branch (1472:9): [True: 0, False: 0]
  ------------------
 1473|      0|        reject_message = false;
 1474|      0|        msg.m_type = std::move(*msg_type);
 1475|      0|        msg.m_time = time;
 1476|      0|        msg.m_message_size = contents.size();
 1477|      0|        msg.m_recv.resize(contents.size());
 1478|      0|        std::copy(contents.begin(), contents.end(), UCharCast(msg.m_recv.data()));
 1479|      0|    } else {
 1480|      0|        LogDebug(BCLog::NET, "V2 transport error: invalid message type (%u bytes contents), peer=%d\n", m_recv_decode_buffer.size(), m_nodeid);
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1481|      0|        reject_message = true;
 1482|      0|    }
 1483|      0|    ClearShrink(m_recv_decode_buffer);
 1484|      0|    SetReceiveState(RecvState::APP);
 1485|       |
 1486|      0|    return msg;
 1487|     23|}
_ZNK11V2Transport14GetBytesToSendEb:
 1522|  1.41M|{
 1523|  1.41M|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|  1.41M|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1524|  1.41M|    LOCK(m_send_mutex);
  ------------------
  |  |  268|  1.41M|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.41M|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.41M|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.41M|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1525|  1.41M|    if (m_send_state == SendState::V1) return m_v1_fallback.GetBytesToSend(have_next_message);
  ------------------
  |  Branch (1525:9): [True: 341, False: 1.41M]
  ------------------
 1526|       |
 1527|  1.41M|    if (m_send_state == SendState::MAYBE_V1) Assume(m_send_buffer.empty());
  ------------------
  |  |  128|  1.10M|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (1527:9): [True: 1.10M, False: 305k]
  ------------------
 1528|  1.41M|    Assume(m_send_pos <= m_send_buffer.size());
  ------------------
  |  |  128|  1.41M|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1529|  1.41M|    return {
 1530|  1.41M|        std::span{m_send_buffer}.subspan(m_send_pos),
 1531|       |        // We only have more to send after the current m_send_buffer if there is a (next)
 1532|       |        // message to be sent, and we're capable of sending packets. */
 1533|  1.41M|        have_next_message && m_send_state == SendState::READY,
  ------------------
  |  Branch (1533:9): [True: 0, False: 1.41M]
  |  Branch (1533:30): [True: 0, False: 0]
  ------------------
 1534|  1.41M|        m_send_type
 1535|  1.41M|    };
 1536|  1.41M|}
_ZN11V2Transport13MarkBytesSentEm:
 1539|    464|{
 1540|    464|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|    464|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1541|    464|    LOCK(m_send_mutex);
  ------------------
  |  |  268|    464|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    464|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    464|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    464|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1542|    464|    if (m_send_state == SendState::V1) return m_v1_fallback.MarkBytesSent(bytes_sent);
  ------------------
  |  Branch (1542:9): [True: 0, False: 464]
  ------------------
 1543|       |
 1544|    464|    if (m_send_state == SendState::AWAITING_KEY && m_send_pos == 0 && bytes_sent > 0) {
  ------------------
  |  Branch (1544:9): [True: 366, False: 98]
  |  Branch (1544:52): [True: 211, False: 155]
  |  Branch (1544:71): [True: 211, False: 0]
  ------------------
 1545|    211|        LogDebug(BCLog::NET, "start sending v2 handshake to peer=%d\n", m_nodeid);
  ------------------
  |  |  143|    211|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    211|    do {                                                                                      \
  |  |  |  |  137|    211|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 211]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    211|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 211]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1546|    211|    }
 1547|       |
 1548|    464|    m_send_pos += bytes_sent;
 1549|    464|    Assume(m_send_pos <= m_send_buffer.size());
  ------------------
  |  |  128|    464|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1550|    464|    if (m_send_pos >= CMessageHeader::HEADER_SIZE) {
  ------------------
  |  Branch (1550:9): [True: 436, False: 28]
  ------------------
 1551|    436|        m_sent_v1_header_worth = true;
 1552|    436|    }
 1553|       |    // Wipe the buffer when everything is sent.
 1554|    464|    if (m_send_pos == m_send_buffer.size()) {
  ------------------
  |  Branch (1554:9): [True: 99, False: 365]
  ------------------
 1555|     99|        m_send_pos = 0;
 1556|     99|        ClearShrink(m_send_buffer);
 1557|     99|    }
 1558|    464|}
_ZNK11V2Transport18GetSendMemoryUsageEv:
 1578|  4.16k|{
 1579|  4.16k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  149|  4.16k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1580|  4.16k|    LOCK(m_send_mutex);
  ------------------
  |  |  268|  4.16k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.16k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.16k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.16k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1581|  4.16k|    if (m_send_state == SendState::V1) return m_v1_fallback.GetSendMemoryUsage();
  ------------------
  |  Branch (1581:9): [True: 0, False: 4.16k]
  ------------------
 1582|       |
 1583|  4.16k|    return sizeof(m_send_buffer) + memusage::DynamicUsage(m_send_buffer);
 1584|  4.16k|}
_ZNK11V2Transport7GetInfoEv:
 1587|   256k|{
 1588|   256k|    AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|   256k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1589|   256k|    LOCK(m_recv_mutex);
  ------------------
  |  |  268|   256k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   256k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   256k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   256k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1590|   256k|    if (m_recv_state == RecvState::V1) return m_v1_fallback.GetInfo();
  ------------------
  |  Branch (1590:9): [True: 84, False: 256k]
  ------------------
 1591|       |
 1592|   256k|    Transport::Info info;
 1593|       |
 1594|       |    // Do not report v2 and session ID until the version packet has been received
 1595|       |    // and verified (confirming that the other side very likely has the same keys as us).
 1596|   256k|    if (m_recv_state != RecvState::KEY_MAYBE_V1 && m_recv_state != RecvState::KEY &&
  ------------------
  |  Branch (1596:9): [True: 19.8k, False: 236k]
  |  Branch (1596:52): [True: 18.8k, False: 955]
  ------------------
 1597|  18.8k|        m_recv_state != RecvState::GARB_GARBTERM && m_recv_state != RecvState::VERSION) {
  ------------------
  |  Branch (1597:9): [True: 0, False: 18.8k]
  |  Branch (1597:53): [True: 0, False: 0]
  ------------------
 1598|      0|        info.transport_type = TransportProtocolType::V2;
 1599|      0|        info.session_id = uint256(MakeUCharSpan(m_cipher.GetSessionID()));
 1600|   256k|    } else {
 1601|   256k|        info.transport_type = TransportProtocolType::DETECTING;
 1602|   256k|    }
 1603|       |
 1604|   256k|    return info;
 1605|   256k|}
_ZNK8CConnman14SocketSendDataER5CNode:
 1608|  90.9k|{
 1609|  90.9k|    auto it = node.vSendMsg.begin();
 1610|  90.9k|    size_t nSentSize = 0;
 1611|  90.9k|    bool data_left{false}; //!< second return value (whether unsent data remains)
 1612|  90.9k|    std::optional<bool> expected_more;
 1613|       |
 1614|   236k|    while (true) {
  ------------------
  |  Branch (1614:12): [True: 236k, Folded]
  ------------------
 1615|   236k|        if (it != node.vSendMsg.end()) {
  ------------------
  |  Branch (1615:13): [True: 86.7k, False: 149k]
  ------------------
 1616|       |            // If possible, move one message from the send queue to the transport. This fails when
 1617|       |            // there is an existing message still being sent, or (for v2 transports) when the
 1618|       |            // handshake has not yet completed.
 1619|  86.7k|            size_t memusage = it->GetMemoryUsage();
 1620|  86.7k|            if (node.m_transport->SetMessageToSend(*it)) {
  ------------------
  |  Branch (1620:17): [True: 86.7k, False: 0]
  ------------------
 1621|       |                // Update memory usage of send buffer (as *it will be deleted).
 1622|  86.7k|                node.m_send_memusage -= memusage;
 1623|  86.7k|                ++it;
 1624|  86.7k|            }
 1625|  86.7k|        }
 1626|   236k|        const auto& [data, more, msg_type] = node.m_transport->GetBytesToSend(it != node.vSendMsg.end());
 1627|       |        // We rely on the 'more' value returned by GetBytesToSend to correctly predict whether more
 1628|       |        // bytes are still to be sent, to correctly set the MSG_MORE flag. As a sanity check,
 1629|       |        // verify that the previously returned 'more' was correct.
 1630|   236k|        if (expected_more.has_value()) Assume(!data.empty() == *expected_more);
  ------------------
  |  |  128|   145k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (1630:13): [True: 145k, False: 90.9k]
  ------------------
 1631|   236k|        expected_more = more;
 1632|   236k|        data_left = !data.empty(); // will be overwritten on next loop if all of data gets sent
 1633|   236k|        int nBytes = 0;
 1634|   236k|        if (!data.empty()) {
  ------------------
  |  Branch (1634:13): [True: 146k, False: 90.0k]
  ------------------
 1635|   146k|            LOCK(node.m_sock_mutex);
  ------------------
  |  |  268|   146k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   146k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   146k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   146k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1636|       |            // There is no socket in case we've already disconnected, or in test cases without
 1637|       |            // real connections. In these cases, we bail out immediately and just leave things
 1638|       |            // in the send queue and transport.
 1639|   146k|            if (!node.m_sock) {
  ------------------
  |  Branch (1639:17): [True: 0, False: 146k]
  ------------------
 1640|      0|                break;
 1641|      0|            }
 1642|   146k|            int flags = MSG_NOSIGNAL | MSG_DONTWAIT;
 1643|   146k|#ifdef MSG_MORE
 1644|   146k|            if (more) {
  ------------------
  |  Branch (1644:17): [True: 59.5k, False: 87.1k]
  ------------------
 1645|  59.5k|                flags |= MSG_MORE;
 1646|  59.5k|            }
 1647|   146k|#endif
 1648|   146k|            nBytes = node.m_sock->Send(data.data(), data.size(), flags);
 1649|   146k|        }
 1650|   236k|        if (nBytes > 0) {
  ------------------
  |  Branch (1650:13): [True: 146k, False: 90.3k]
  ------------------
 1651|   146k|            node.m_last_send = NodeClock::now();
 1652|   146k|            node.nSendBytes += nBytes;
 1653|       |            // Notify transport that bytes have been processed.
 1654|   146k|            node.m_transport->MarkBytesSent(nBytes);
 1655|       |            // Update statistics per message type.
 1656|   146k|            if (!msg_type.empty()) { // don't report v2 handshake bytes for now
  ------------------
  |  Branch (1656:17): [True: 114k, False: 31.5k]
  ------------------
 1657|   114k|                node.AccountForSentBytes(msg_type, nBytes);
 1658|   114k|            }
 1659|   146k|            nSentSize += nBytes;
 1660|   146k|            if ((size_t)nBytes != data.size()) {
  ------------------
  |  Branch (1660:17): [True: 650, False: 145k]
  ------------------
 1661|       |                // could not send full message; stop sending more
 1662|    650|                break;
 1663|    650|            }
 1664|   146k|        } else {
 1665|  90.3k|            if (nBytes < 0) {
  ------------------
  |  Branch (1665:17): [True: 252, False: 90.0k]
  ------------------
 1666|       |                // error
 1667|    252|                int nErr = WSAGetLastError();
  ------------------
  |  |   59|    252|#define WSAGetLastError()   errno
  ------------------
 1668|    252|                if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   61|    504|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   63|    495|#define WSAEMSGSIZE         EMSGSIZE
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   64|    478|#define WSAEINTR            EINTR
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   65|    225|#define WSAEINPROGRESS      EINPROGRESS
  ------------------
  |  Branch (1668:21): [True: 243, False: 9]
  |  Branch (1668:47): [True: 226, False: 17]
  |  Branch (1668:70): [True: 225, False: 1]
  |  Branch (1668:90): [True: 225, False: 0]
  ------------------
 1669|    225|                    LogDebug(BCLog::NET, "socket send error, %s: %s", node.DisconnectMsg(), NetworkErrorString(nErr));
  ------------------
  |  |  143|    225|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    225|    do {                                                                                      \
  |  |  |  |  137|    225|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 225]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    225|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 225]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1670|    225|                    node.CloseSocketDisconnect();
 1671|    225|                }
 1672|    252|            }
 1673|  90.3k|            break;
 1674|  90.3k|        }
 1675|   236k|    }
 1676|       |
 1677|  90.9k|    node.fPauseSend = node.m_send_memusage + node.m_transport->GetSendMemoryUsage() > nSendBufferMaxSize;
 1678|       |
 1679|  90.9k|    if (it == node.vSendMsg.end()) {
  ------------------
  |  Branch (1679:9): [True: 90.9k, False: 0]
  ------------------
 1680|  90.9k|        assert(node.m_send_memusage == 0);
  ------------------
  |  Branch (1680:9): [True: 90.9k, False: 0]
  ------------------
 1681|  90.9k|    }
 1682|  90.9k|    node.vSendMsg.erase(node.vSendMsg.begin(), it);
 1683|  90.9k|    return {nSentSize, data_left};
 1684|  90.9k|}
_ZN8CConnman24AttemptToEvictConnectionEbNSt3__18optionalIlEE:
 1695|   177k|{
 1696|   177k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|   177k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1697|       |
 1698|   177k|    std::vector<NodeEvictionCandidate> vEvictionCandidates;
 1699|   177k|    {
 1700|       |
 1701|   177k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|   177k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   177k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   177k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   177k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1702|   240M|        for (const CNode* node : m_nodes) {
  ------------------
  |  Branch (1702:32): [True: 240M, False: 177k]
  ------------------
 1703|   240M|            if (node->fDisconnect)
  ------------------
  |  Branch (1703:17): [True: 198M, False: 41.6M]
  ------------------
 1704|   198M|                continue;
 1705|  41.6M|            if (protect_peer.has_value() && node->GetId() == protect_peer) {
  ------------------
  |  Branch (1705:17): [True: 0, False: 41.6M]
  |  Branch (1705:17): [True: 0, False: 41.6M]
  |  Branch (1705:45): [True: 0, False: 0]
  ------------------
 1706|      0|                continue;
 1707|      0|            }
 1708|  41.6M|            if (evict_tx_relay_peer_only && !node->m_relays_txs) {
  ------------------
  |  Branch (1708:17): [True: 0, False: 41.6M]
  |  Branch (1708:45): [True: 0, False: 0]
  ------------------
 1709|      0|                continue;
 1710|      0|            }
 1711|  41.6M|            NodeEvictionCandidate candidate{
 1712|  41.6M|                .id = node->GetId(),
 1713|  41.6M|                .m_connected = node->m_connected,
 1714|  41.6M|                .m_min_ping_time = node->m_min_ping_time,
 1715|  41.6M|                .m_last_block_time = node->m_last_block_time,
 1716|  41.6M|                .m_last_tx_time = node->m_last_tx_time,
 1717|  41.6M|                .fRelevantServices = node->m_has_all_wanted_services,
 1718|  41.6M|                .m_relay_txs = node->m_relays_txs.load(),
 1719|  41.6M|                .fBloomFilter = node->m_bloom_filter_loaded.load(),
 1720|  41.6M|                .nKeyedNetGroup = node->nKeyedNetGroup,
 1721|  41.6M|                .prefer_evict = node->m_prefer_evict,
 1722|  41.6M|                .m_is_local = node->addr.IsLocal(),
 1723|  41.6M|                .m_network = node->ConnectedThroughNetwork(),
 1724|  41.6M|                .m_noban = node->HasPermission(NetPermissionFlags::NoBan),
 1725|  41.6M|                .m_conn_type = node->m_conn_type,
 1726|  41.6M|            };
 1727|  41.6M|            vEvictionCandidates.push_back(candidate);
 1728|  41.6M|        }
 1729|   177k|    }
 1730|   177k|    const std::optional<NodeId> node_id_to_evict = SelectNodeToEvict(std::move(vEvictionCandidates));
 1731|   177k|    if (!node_id_to_evict) {
  ------------------
  |  Branch (1731:9): [True: 15.5k, False: 162k]
  ------------------
 1732|  15.5k|        return false;
 1733|  15.5k|    }
 1734|   162k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|   162k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   162k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   162k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   162k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1735|   218M|    for (CNode* pnode : m_nodes) {
  ------------------
  |  Branch (1735:23): [True: 218M, False: 0]
  ------------------
 1736|   218M|        if (pnode->GetId() == *node_id_to_evict) {
  ------------------
  |  Branch (1736:13): [True: 162k, False: 217M]
  ------------------
 1737|   162k|            LogDebug(BCLog::NET, "selected %s connection for eviction, %s", pnode->ConnectionTypeAsString(), pnode->DisconnectMsg());
  ------------------
  |  |  143|   162k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|   162k|    do {                                                                                      \
  |  |  |  |  137|   162k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 162k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|   162k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 162k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1738|   162k|            TRACEPOINT(net, evicted_inbound_connection,
 1739|   162k|                pnode->GetId(),
 1740|   162k|                pnode->m_addr_name.c_str(),
 1741|   162k|                pnode->ConnectionTypeAsString().c_str(),
 1742|   162k|                pnode->ConnectedThroughNetwork(),
 1743|   162k|                TicksSinceEpoch<std::chrono::seconds>(pnode->m_connected));
 1744|   162k|            pnode->fDisconnect = true;
 1745|   162k|            return true;
 1746|   162k|        }
 1747|   218M|    }
 1748|      0|    return false;
 1749|   162k|}
_ZN8CConnman16AcceptConnectionERKNS_12ListenSocketE:
 1751|  2.75k|void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
 1752|  2.75k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  2.75k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1753|       |
 1754|  2.75k|    struct sockaddr_storage sockaddr;
 1755|  2.75k|    socklen_t len = sizeof(sockaddr);
 1756|  2.75k|    auto sock = hListenSocket.sock->Accept((struct sockaddr*)&sockaddr, &len);
 1757|       |
 1758|  2.75k|    if (!sock) {
  ------------------
  |  Branch (1758:9): [True: 202, False: 2.55k]
  ------------------
 1759|    202|        const int nErr = WSAGetLastError();
  ------------------
  |  |   59|    202|#define WSAGetLastError()   errno
  ------------------
 1760|    202|        if (nErr != WSAEWOULDBLOCK) {
  ------------------
  |  |   61|    202|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
  |  Branch (1760:13): [True: 202, False: 0]
  ------------------
 1761|    202|            LogInfo("socket error accept failed: %s\n", NetworkErrorString(nErr));
  ------------------
  |  |  125|    202|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|    202|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1762|    202|        }
 1763|    202|        return;
 1764|    202|    }
 1765|       |
 1766|  2.55k|    CService addr;
 1767|  2.55k|    if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr, len)) {
  ------------------
  |  Branch (1767:9): [True: 0, False: 2.55k]
  ------------------
 1768|      0|        LogWarning("Unknown socket family\n");
  ------------------
  |  |  126|      0|#define LogWarning(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Warning, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1769|  2.55k|    } else {
 1770|  2.55k|        addr = MaybeFlipIPv6toCJDNS(addr);
 1771|  2.55k|    }
 1772|       |
 1773|  2.55k|    const CService addr_bind{MaybeFlipIPv6toCJDNS(GetBindAddress(*sock))};
 1774|       |
 1775|  2.55k|    NetPermissionFlags permission_flags = NetPermissionFlags::None;
 1776|  2.55k|    hListenSocket.AddSocketPermissionFlags(permission_flags);
 1777|       |
 1778|  2.55k|    CreateNodeFromAcceptedSocket(std::move(sock), permission_flags, addr_bind, addr);
 1779|  2.55k|}
_ZN8CConnman28CreateNodeFromAcceptedSocketEONSt3__110unique_ptrI4SockNS0_14default_deleteIS2_EEEE18NetPermissionFlagsRK8CServiceSA_:
 1785|   353k|{
 1786|   353k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|   353k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1787|       |
 1788|   353k|    int nInbound = 0;
 1789|       |
 1790|   353k|    const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
 1791|       |
 1792|       |    // Tor inbound connections do not reveal the peer's actual network address.
 1793|       |    // Therefore do not apply address-based whitelist permissions to them.
 1794|   353k|    AddWhitelistPermissionFlags(permission_flags, inbound_onion ? std::optional<CNetAddr>{} : addr, vWhitelistedRangeIncoming);
  ------------------
  |  Branch (1794:51): [True: 0, False: 353k]
  ------------------
 1795|       |
 1796|   353k|    {
 1797|   353k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|   353k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   353k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   353k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   353k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1798|   267M|        for (const CNode* pnode : m_nodes) {
  ------------------
  |  Branch (1798:33): [True: 267M, False: 353k]
  ------------------
 1799|   267M|            if (pnode->IsInboundConn()) nInbound++;
  ------------------
  |  Branch (1799:17): [True: 260M, False: 6.81M]
  ------------------
 1800|   267M|        }
 1801|   353k|    }
 1802|       |
 1803|   353k|    if (!fNetworkActive) {
  ------------------
  |  Branch (1803:9): [True: 3.31k, False: 350k]
  ------------------
 1804|  3.31k|        LogDebug(BCLog::NET, "connection from %s dropped: not accepting new connections\n", addr.ToStringAddrPort());
  ------------------
  |  |  143|  3.31k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  3.31k|    do {                                                                                      \
  |  |  |  |  137|  3.31k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 3.31k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  3.31k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 3.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1805|  3.31k|        return;
 1806|  3.31k|    }
 1807|       |
 1808|   350k|    if (!sock->IsSelectable()) {
  ------------------
  |  Branch (1808:9): [True: 4.31k, False: 345k]
  ------------------
 1809|  4.31k|        LogInfo("connection from %s dropped: non-selectable socket\n", addr.ToStringAddrPort());
  ------------------
  |  |  125|  4.31k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  4.31k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1810|  4.31k|        return;
 1811|  4.31k|    }
 1812|       |
 1813|       |    // According to the internet TCP_NODELAY is not carried into accepted sockets
 1814|       |    // on all platforms.  Set it again here just to be sure.
 1815|   345k|    const int on{1};
 1816|   345k|    if (sock->SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == SOCKET_ERROR) {
  ------------------
  |  |   68|   345k|#define SOCKET_ERROR        -1
  ------------------
  |  Branch (1816:9): [True: 341k, False: 4.66k]
  ------------------
 1817|   341k|        LogDebug(BCLog::NET, "connection from %s: unable to set TCP_NODELAY, continuing anyway\n",
  ------------------
  |  |  143|   341k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|   341k|    do {                                                                                      \
  |  |  |  |  137|   341k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 341k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|   341k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 341k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1818|   341k|                 addr.ToStringAddrPort());
 1819|   341k|    }
 1820|       |
 1821|       |    // Don't accept connections from banned peers.
 1822|   345k|    bool banned = m_banman && m_banman->IsBanned(addr);
  ------------------
  |  Branch (1822:19): [True: 0, False: 345k]
  |  Branch (1822:31): [True: 0, False: 0]
  ------------------
 1823|   345k|    if (!NetPermissions::HasFlag(permission_flags, NetPermissionFlags::NoBan) && banned)
  ------------------
  |  Branch (1823:9): [True: 332k, False: 12.9k]
  |  Branch (1823:82): [True: 0, False: 332k]
  ------------------
 1824|      0|    {
 1825|      0|        LogDebug(BCLog::NET, "connection from %s dropped (banned)\n", addr.ToStringAddrPort());
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1826|      0|        return;
 1827|      0|    }
 1828|       |
 1829|       |    // Only accept connections from discouraged peers if our inbound slots aren't (almost) full.
 1830|   345k|    bool discouraged = m_banman && m_banman->IsDiscouraged(addr);
  ------------------
  |  Branch (1830:24): [True: 0, False: 345k]
  |  Branch (1830:36): [True: 0, False: 0]
  ------------------
 1831|   345k|    if (!NetPermissions::HasFlag(permission_flags, NetPermissionFlags::NoBan) && nInbound + 1 >= m_max_inbound && discouraged)
  ------------------
  |  Branch (1831:9): [True: 332k, False: 12.9k]
  |  Branch (1831:82): [True: 173k, False: 159k]
  |  Branch (1831:115): [True: 0, False: 173k]
  ------------------
 1832|      0|    {
 1833|      0|        LogDebug(BCLog::NET, "connection from %s dropped (discouraged)\n", addr.ToStringAddrPort());
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1834|      0|        return;
 1835|      0|    }
 1836|       |
 1837|   345k|    if (nInbound >= m_max_inbound)
  ------------------
  |  Branch (1837:9): [True: 177k, False: 167k]
  ------------------
 1838|   177k|    {
 1839|   177k|        if (!AttemptToEvictConnection(/*evict_tx_relay_peer_only=*/false)) {
  ------------------
  |  Branch (1839:13): [True: 15.5k, False: 162k]
  ------------------
 1840|       |            // No connection to evict, disconnect the new connection
 1841|  15.5k|            LogDebug(BCLog::NET, "failed to find an eviction candidate - connection dropped (full)\n");
  ------------------
  |  |  143|  15.5k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  15.5k|    do {                                                                                      \
  |  |  |  |  137|  15.5k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 15.5k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  15.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|  15.5k|            return;
 1843|  15.5k|        }
 1844|   177k|    }
 1845|       |
 1846|   330k|    NodeId id = GetNewNodeId();
 1847|   330k|    uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
 1848|       |
 1849|       |    // The V2Transport transparently falls back to V1 behavior when an incoming V1 connection is
 1850|       |    // detected, so use it whenever we signal NODE_P2P_V2.
 1851|   330k|    ServiceFlags local_services = GetLocalServices();
 1852|   330k|    const bool use_v2transport(local_services & NODE_P2P_V2);
 1853|       |
 1854|   330k|    uint64_t network_id = GetDeterministicRandomizer(RANDOMIZER_ID_NETWORKKEY)
 1855|   330k|                        .Write(inbound_onion ? NET_ONION : addr.GetNetClass())
  ------------------
  |  Branch (1855:32): [True: 0, False: 330k]
  ------------------
 1856|   330k|                        .Write(addr_bind.GetAddrBytes())
 1857|   330k|                        .Write(addr_bind.GetPort()) // inbound connections use bind port
 1858|   330k|                        .Finalize();
 1859|   330k|    CNode* pnode = new CNode(id,
 1860|   330k|                             std::move(sock),
 1861|   330k|                             CAddress{addr, NODE_NONE},
 1862|   330k|                             CalculateKeyedNetGroup(addr),
 1863|   330k|                             nonce,
 1864|   330k|                             addr_bind,
 1865|   330k|                             /*addrNameIn=*/"",
 1866|   330k|                             ConnectionType::INBOUND,
 1867|   330k|                             inbound_onion,
 1868|   330k|                             network_id,
 1869|   330k|                             CNodeOptions{
 1870|   330k|                                 .permission_flags = permission_flags,
 1871|   330k|                                 .prefer_evict = discouraged,
 1872|   330k|                                 .recv_flood_size = nReceiveFloodSize,
 1873|   330k|                                 .use_v2transport = use_v2transport,
 1874|   330k|                             });
 1875|   330k|    pnode->AddRef();
 1876|   330k|    m_msgproc->InitializeNode(*pnode, local_services);
 1877|   330k|    {
 1878|   330k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|   330k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   330k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   330k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   330k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1879|   330k|        m_nodes.push_back(pnode);
 1880|   330k|    }
 1881|   330k|    LogDebug(BCLog::NET, "connection from %s accepted\n", addr.ToStringAddrPort());
  ------------------
  |  |  143|   330k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|   330k|    do {                                                                                      \
  |  |  |  |  137|   330k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 330k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|   330k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 330k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1882|   330k|    TRACEPOINT(net, inbound_connection,
 1883|   330k|        pnode->GetId(),
 1884|   330k|        pnode->m_addr_name.c_str(),
 1885|   330k|        pnode->ConnectionTypeAsString().c_str(),
 1886|   330k|        pnode->ConnectedThroughNetwork(),
 1887|   330k|        GetNodeCount(ConnectionDirection::In));
 1888|       |
 1889|       |    // We received a new connection, harvest entropy from the time (and our peer count)
 1890|   330k|    RandAddEvent((uint32_t)id);
 1891|   330k|}
_ZNK8CConnman25ShouldRunInactivityChecksERK5CNodeNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1000000EEEEEEE:
 2036|  37.5k|{
 2037|  37.5k|    return node.m_connected + m_peer_connect_timeout < now;
 2038|  37.5k|}
_ZNK8CConnman15InactivityCheckERK5CNodeNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1000000EEEEEEE:
 2041|  37.5k|{
 2042|       |    // Tests that see disconnects after using mocktime can start nodes with a
 2043|       |    // large timeout. For example, -peertimeout=999999999.
 2044|  37.5k|    const auto last_send{node.m_last_send.load()};
 2045|  37.5k|    const auto last_recv{node.m_last_recv.load()};
 2046|       |
 2047|  37.5k|    if (!ShouldRunInactivityChecks(node, now)) return false;
  ------------------
  |  Branch (2047:9): [True: 37.4k, False: 41]
  ------------------
 2048|       |
 2049|     41|    bool has_received{last_recv > NodeClock::epoch};
 2050|     41|    bool has_sent{last_send > NodeClock::epoch};
 2051|       |
 2052|     41|    if (!has_received || !has_sent) {
  ------------------
  |  Branch (2052:9): [True: 0, False: 41]
  |  Branch (2052:26): [True: 41, False: 0]
  ------------------
 2053|     41|        std::string has_never;
 2054|     41|        if (!has_received) has_never += ", never received from peer";
  ------------------
  |  Branch (2054:13): [True: 0, False: 41]
  ------------------
 2055|     41|        if (!has_sent) has_never += ", never sent to peer";
  ------------------
  |  Branch (2055:13): [True: 41, False: 0]
  ------------------
 2056|     41|        LogDebug(BCLog::NET,
  ------------------
  |  |  143|     41|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|     41|    do {                                                                                      \
  |  |  |  |  137|     41|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 41]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|     41|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2057|     41|            "socket no message in first %i seconds%s, %s",
 2058|     41|            count_seconds(m_peer_connect_timeout),
 2059|     41|            has_never,
 2060|     41|            node.DisconnectMsg()
 2061|     41|        );
 2062|     41|        return true;
 2063|     41|    }
 2064|       |
 2065|      0|    if (now > last_send + TIMEOUT_INTERVAL) {
  ------------------
  |  Branch (2065:9): [True: 0, False: 0]
  ------------------
 2066|      0|        LogDebug(BCLog::NET,
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2067|      0|            "socket sending timeout: %is, %s", Ticks<std::chrono::seconds>(now - last_send),
 2068|      0|            node.DisconnectMsg()
 2069|      0|        );
 2070|      0|        return true;
 2071|      0|    }
 2072|       |
 2073|      0|    if (now > last_recv + TIMEOUT_INTERVAL) {
  ------------------
  |  Branch (2073:9): [True: 0, False: 0]
  ------------------
 2074|      0|        LogDebug(BCLog::NET,
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2075|      0|            "socket receive timeout: %is, %s", Ticks<std::chrono::seconds>(now - last_recv),
 2076|      0|            node.DisconnectMsg()
 2077|      0|        );
 2078|      0|        return true;
 2079|      0|    }
 2080|       |
 2081|      0|    if (!node.fSuccessfullyConnected) {
  ------------------
  |  Branch (2081:9): [True: 0, False: 0]
  ------------------
 2082|      0|        if (node.m_transport->GetInfo().transport_type == TransportProtocolType::DETECTING) {
  ------------------
  |  Branch (2082:13): [True: 0, False: 0]
  ------------------
 2083|      0|            LogDebug(BCLog::NET, "V2 handshake timeout, %s", node.DisconnectMsg());
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2084|      0|        } else {
 2085|      0|            LogDebug(BCLog::NET, "version handshake timeout, %s", node.DisconnectMsg());
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2086|      0|        }
 2087|      0|        return true;
 2088|      0|    }
 2089|       |
 2090|      0|    return false;
 2091|      0|}
_ZN8CConnman19GenerateWaitSocketsENSt3__14spanIKP5CNodeLm18446744073709551615EEE:
 2094|  28.6k|{
 2095|  28.6k|    Sock::EventsPerSock events_per_sock;
 2096|       |
 2097|  28.6k|    for (const ListenSocket& hListenSocket : vhListenSocket) {
  ------------------
  |  Branch (2097:44): [True: 20.3k, False: 28.6k]
  ------------------
 2098|  20.3k|        events_per_sock.emplace(hListenSocket.sock, Sock::Events{Sock::RecvEvent});
 2099|  20.3k|    }
 2100|       |
 2101|  2.02M|    for (CNode* pnode : nodes) {
  ------------------
  |  Branch (2101:23): [True: 2.02M, False: 28.6k]
  ------------------
 2102|  2.02M|        bool select_recv = !pnode->fPauseRecv;
 2103|  2.02M|        bool select_send;
 2104|  2.02M|        {
 2105|  2.02M|            LOCK(pnode->cs_vSend);
  ------------------
  |  |  268|  2.02M|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.02M|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.02M|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.02M|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2106|       |            // Sending is possible if either there are bytes to send right now, or if there will be
 2107|       |            // once a potential message from vSendMsg is handed to the transport. GetBytesToSend
 2108|       |            // determines both of these in a single call.
 2109|  2.02M|            const auto& [to_send, more, _msg_type] = pnode->m_transport->GetBytesToSend(!pnode->vSendMsg.empty());
 2110|  2.02M|            select_send = !to_send.empty() || more;
  ------------------
  |  Branch (2110:27): [True: 303k, False: 1.71M]
  |  Branch (2110:47): [True: 0, False: 1.71M]
  ------------------
 2111|  2.02M|        }
 2112|  2.02M|        if (!select_recv && !select_send) continue;
  ------------------
  |  Branch (2112:13): [True: 3.27k, False: 2.01M]
  |  Branch (2112:29): [True: 3.27k, False: 0]
  ------------------
 2113|       |
 2114|  2.01M|        LOCK(pnode->m_sock_mutex);
  ------------------
  |  |  268|  2.01M|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.01M|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.01M|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.01M|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2115|  2.01M|        if (pnode->m_sock) {
  ------------------
  |  Branch (2115:13): [True: 1.65M, False: 360k]
  ------------------
 2116|  1.65M|            Sock::Event event = (select_send ? Sock::SendEvent : 0) | (select_recv ? Sock::RecvEvent : 0);
  ------------------
  |  Branch (2116:34): [True: 7.05k, False: 1.64M]
  |  Branch (2116:72): [True: 1.65M, False: 0]
  ------------------
 2117|  1.65M|            events_per_sock.emplace(pnode->m_sock, Sock::Events{event});
 2118|  1.65M|        }
 2119|  2.01M|    }
 2120|       |
 2121|  28.6k|    return events_per_sock;
 2122|  28.6k|}
_ZN8CConnman13SocketHandlerEv:
 2125|  28.6k|{
 2126|  28.6k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  28.6k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2127|  28.6k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  28.6k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2128|       |
 2129|  28.6k|    Sock::EventsPerSock events_per_sock;
 2130|       |
 2131|  28.6k|    {
 2132|  28.6k|        const NodesSnapshot snap{*this, /*shuffle=*/false};
 2133|       |
 2134|  28.6k|        const auto timeout = std::chrono::milliseconds(SELECT_TIMEOUT_MILLISECONDS);
 2135|       |
 2136|       |        // Check for the readiness of the already connected sockets and the
 2137|       |        // listening sockets in one call ("readiness" as in poll(2) or
 2138|       |        // select(2)). If none are ready, wait for a short while and return
 2139|       |        // empty sets.
 2140|  28.6k|        events_per_sock = GenerateWaitSockets(snap.Nodes());
 2141|  28.6k|        if (events_per_sock.empty() || !events_per_sock.begin()->first->WaitMany(timeout, events_per_sock)) {
  ------------------
  |  Branch (2141:13): [True: 3.28k, False: 25.4k]
  |  Branch (2141:13): [True: 3.28k, False: 25.4k]
  |  Branch (2141:40): [True: 0, False: 25.4k]
  ------------------
 2142|  3.28k|            m_interrupt_net->sleep_for(timeout);
 2143|  3.28k|        }
 2144|       |
 2145|       |        // Service (send/receive) each of the already connected nodes.
 2146|  28.6k|        SocketHandlerConnected(snap.Nodes(), events_per_sock);
 2147|  28.6k|    }
 2148|       |
 2149|       |    // Accept new connections from listening sockets.
 2150|  28.6k|    SocketHandlerListening(events_per_sock);
 2151|  28.6k|}
_ZN8CConnman22SocketHandlerConnectedERKNSt3__16vectorIP5CNodeNS0_9allocatorIS3_EEEERKNS0_13unordered_mapINS0_10shared_ptrIK4SockEENSB_6EventsENSB_17HashSharedPtrSockENSB_18EqualSharedPtrSockENS4_INS0_4pairIKSD_SE_EEEEEE:
 2155|  28.6k|{
 2156|  28.6k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  28.6k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2157|       |
 2158|  28.6k|    const auto now{NodeClock::now()};
 2159|       |
 2160|  67.7k|    for (CNode* pnode : nodes) {
  ------------------
  |  Branch (2160:23): [True: 67.7k, False: 4.95k]
  ------------------
 2161|  67.7k|        if (m_interrupt_net->interrupted()) {
  ------------------
  |  Branch (2161:13): [True: 23.7k, False: 43.9k]
  ------------------
 2162|  23.7k|            return;
 2163|  23.7k|        }
 2164|       |
 2165|       |        //
 2166|       |        // Receive
 2167|       |        //
 2168|  43.9k|        bool recvSet = false;
 2169|  43.9k|        bool sendSet = false;
 2170|  43.9k|        bool errorSet = false;
 2171|  43.9k|        {
 2172|  43.9k|            LOCK(pnode->m_sock_mutex);
  ------------------
  |  |  268|  43.9k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  43.9k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  43.9k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  43.9k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2173|  43.9k|            if (!pnode->m_sock) {
  ------------------
  |  Branch (2173:17): [True: 6.37k, False: 37.6k]
  ------------------
 2174|  6.37k|                continue;
 2175|  6.37k|            }
 2176|  37.6k|            const auto it = events_per_sock.find(pnode->m_sock);
 2177|  37.6k|            if (it != events_per_sock.end()) {
  ------------------
  |  Branch (2177:17): [True: 37.5k, False: 63]
  ------------------
 2178|  37.5k|                recvSet = it->second.occurred & Sock::RecvEvent;
 2179|  37.5k|                sendSet = it->second.occurred & Sock::SendEvent;
 2180|  37.5k|                errorSet = it->second.occurred & Sock::ErrorEvent;
 2181|  37.5k|            }
 2182|  37.6k|        }
 2183|       |
 2184|  37.6k|        if (sendSet) {
  ------------------
  |  Branch (2184:13): [True: 4.17k, False: 33.4k]
  ------------------
 2185|       |            // Send data
 2186|  4.17k|            auto [bytes_sent, data_left] = WITH_LOCK(pnode->cs_vSend, return SocketSendData(*pnode));
  ------------------
  |  |  299|  4.17k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 2187|  4.17k|            if (bytes_sent) {
  ------------------
  |  Branch (2187:17): [True: 464, False: 3.70k]
  ------------------
 2188|    464|                RecordBytesSent(bytes_sent);
 2189|       |
 2190|       |                // If both receiving and (non-optimistic) sending were possible, we first attempt
 2191|       |                // sending. If that succeeds, but does not fully drain the send queue, do not
 2192|       |                // attempt to receive. This avoids needlessly queueing data if the remote peer
 2193|       |                // is slow at receiving data, by means of TCP flow control. We only do this when
 2194|       |                // sending actually succeeded to make sure progress is always made; otherwise a
 2195|       |                // deadlock would be possible when both sides have data to send, but neither is
 2196|       |                // receiving.
 2197|    464|                if (data_left) recvSet = false;
  ------------------
  |  Branch (2197:21): [True: 365, False: 99]
  ------------------
 2198|    464|            }
 2199|  4.17k|        }
 2200|       |
 2201|  37.6k|        if (recvSet || errorSet)
  ------------------
  |  Branch (2201:13): [True: 36.5k, False: 1.03k]
  |  Branch (2201:24): [True: 0, False: 1.03k]
  ------------------
 2202|  36.5k|        {
 2203|       |            // typical socket buffer is 8K-64K
 2204|  36.5k|            uint8_t pchBuf[0x10000];
 2205|  36.5k|            int nBytes = 0;
 2206|  36.5k|            {
 2207|  36.5k|                LOCK(pnode->m_sock_mutex);
  ------------------
  |  |  268|  36.5k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  36.5k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  36.5k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  36.5k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2208|  36.5k|                if (!pnode->m_sock) {
  ------------------
  |  Branch (2208:21): [True: 79, False: 36.5k]
  ------------------
 2209|     79|                    continue;
 2210|     79|                }
 2211|  36.5k|                nBytes = pnode->m_sock->Recv(pchBuf, sizeof(pchBuf), MSG_DONTWAIT);
 2212|  36.5k|            }
 2213|  36.5k|            if (nBytes > 0)
  ------------------
  |  Branch (2213:17): [True: 23.7k, False: 12.7k]
  ------------------
 2214|  23.7k|            {
 2215|  23.7k|                bool notify = false;
 2216|  23.7k|                if (!pnode->ReceiveMsgBytes({pchBuf, (size_t)nBytes}, notify)) {
  ------------------
  |  Branch (2216:21): [True: 22.8k, False: 853]
  ------------------
 2217|  22.8k|                    LogDebug(BCLog::NET,
  ------------------
  |  |  143|  22.8k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  22.8k|    do {                                                                                      \
  |  |  |  |  137|  22.8k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 22.8k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  22.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 22.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2218|  22.8k|                        "receiving message bytes failed, %s",
 2219|  22.8k|                        pnode->DisconnectMsg()
 2220|  22.8k|                    );
 2221|  22.8k|                    pnode->CloseSocketDisconnect();
 2222|  22.8k|                }
 2223|  23.7k|                RecordBytesRecv(nBytes);
 2224|  23.7k|                if (notify) {
  ------------------
  |  Branch (2224:21): [True: 64, False: 23.6k]
  ------------------
 2225|     64|                    pnode->MarkReceivedMsgsForProcessing();
 2226|     64|                    WakeMessageHandler();
 2227|     64|                }
 2228|  23.7k|            }
 2229|  12.7k|            else if (nBytes == 0)
  ------------------
  |  Branch (2229:22): [True: 11.9k, False: 811]
  ------------------
 2230|  11.9k|            {
 2231|       |                // socket closed gracefully
 2232|  11.9k|                if (!pnode->fDisconnect) {
  ------------------
  |  Branch (2232:21): [True: 10.1k, False: 1.78k]
  ------------------
 2233|  10.1k|                    LogDebug(BCLog::NET, "socket closed, %s", pnode->DisconnectMsg());
  ------------------
  |  |  143|  10.1k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  10.1k|    do {                                                                                      \
  |  |  |  |  137|  10.1k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 10.1k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  10.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2234|  10.1k|                }
 2235|  11.9k|                pnode->CloseSocketDisconnect();
 2236|  11.9k|            }
 2237|    811|            else if (nBytes < 0)
  ------------------
  |  Branch (2237:22): [True: 811, False: 0]
  ------------------
 2238|    811|            {
 2239|       |                // error
 2240|    811|                int nErr = WSAGetLastError();
  ------------------
  |  |   59|    811|#define WSAGetLastError()   errno
  ------------------
 2241|    811|                if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
  ------------------
  |  |   61|  1.62k|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
  ------------------
  |  |   63|  1.41k|#define WSAEMSGSIZE         EMSGSIZE
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
  ------------------
  |  |   64|  1.41k|#define WSAEINTR            EINTR
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
  ------------------
  |  |   65|    489|#define WSAEINPROGRESS      EINPROGRESS
  ------------------
  |  Branch (2241:21): [True: 604, False: 207]
  |  Branch (2241:47): [True: 604, False: 0]
  |  Branch (2241:70): [True: 489, False: 115]
  |  Branch (2241:90): [True: 489, False: 0]
  ------------------
 2242|    489|                {
 2243|    489|                    if (!pnode->fDisconnect) {
  ------------------
  |  Branch (2243:25): [True: 474, False: 15]
  ------------------
 2244|    474|                        LogDebug(BCLog::NET, "socket recv error, %s: %s", pnode->DisconnectMsg(), NetworkErrorString(nErr));
  ------------------
  |  |  143|    474|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    474|    do {                                                                                      \
  |  |  |  |  137|    474|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 474]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    474|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 474]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2245|    474|                    }
 2246|    489|                    pnode->CloseSocketDisconnect();
 2247|    489|                }
 2248|    811|            }
 2249|  36.5k|        }
 2250|       |
 2251|  37.5k|        if (InactivityCheck(*pnode, now)) pnode->fDisconnect = true;
  ------------------
  |  Branch (2251:13): [True: 41, False: 37.4k]
  ------------------
 2252|  37.5k|    }
 2253|  28.6k|}
_ZN8CConnman22SocketHandlerListeningERKNSt3__113unordered_mapINS0_10shared_ptrIK4SockEENS3_6EventsENS3_17HashSharedPtrSockENS3_18EqualSharedPtrSockENS0_9allocatorINS0_4pairIKS5_S6_EEEEEE:
 2256|  28.6k|{
 2257|  28.6k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  28.6k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2258|       |
 2259|  28.6k|    for (const ListenSocket& listen_socket : vhListenSocket) {
  ------------------
  |  Branch (2259:44): [True: 6.51k, False: 25.6k]
  ------------------
 2260|  6.51k|        if (m_interrupt_net->interrupted()) {
  ------------------
  |  Branch (2260:13): [True: 3.03k, False: 3.48k]
  ------------------
 2261|  3.03k|            return;
 2262|  3.03k|        }
 2263|  3.48k|        const auto it = events_per_sock.find(listen_socket.sock);
 2264|  3.48k|        if (it != events_per_sock.end() && it->second.occurred & Sock::RecvEvent) {
  ------------------
  |  Branch (2264:13): [True: 3.48k, False: 0]
  |  Branch (2264:13): [True: 2.75k, False: 730]
  |  Branch (2264:44): [True: 2.75k, False: 730]
  ------------------
 2265|  2.75k|            AcceptConnection(listen_socket);
 2266|  2.75k|        }
 2267|  3.48k|    }
 2268|  28.6k|}
_ZN8CConnman18WakeMessageHandlerEv:
 2282|     64|{
 2283|     64|    {
 2284|     64|        LOCK(mutexMsgProc);
  ------------------
  |  |  268|     64|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     64|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     64|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     64|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2285|     64|        fMsgProcWake = true;
 2286|     64|    }
 2287|     64|    condMsgProc.notify_one();
 2288|     64|}
_ZNK8CConnman21GetTryNewOutboundPeerEv:
 2469|  9.89k|{
 2470|  9.89k|    return m_try_another_outbound_peer;
 2471|  9.89k|}
_ZN8CConnman21SetTryNewOutboundPeerEb:
 2474|   226k|{
 2475|   226k|    m_try_another_outbound_peer = flag;
 2476|   226k|    LogDebug(BCLog::NET, "setting try another outbound peer=%s\n", flag ? "true" : "false");
  ------------------
  |  |  143|   226k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|   226k|    do {                                                                                      \
  |  |  |  |  137|   226k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 226k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (119:129): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|   226k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 226k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2477|   226k|}
_ZNK8CConnman25GetExtraFullOutboundCountEv:
 2507|  9.89k|{
 2508|  9.89k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2509|       |
 2510|  9.89k|    int full_outbound_peers = 0;
 2511|  9.89k|    {
 2512|  9.89k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2513|   379k|        for (const CNode* pnode : m_nodes) {
  ------------------
  |  Branch (2513:33): [True: 379k, False: 9.89k]
  ------------------
 2514|   379k|            if (pnode->fSuccessfullyConnected && !pnode->fDisconnect && pnode->IsFullOutboundConn()) {
  ------------------
  |  Branch (2514:17): [True: 47.8k, False: 331k]
  |  Branch (2514:50): [True: 41.8k, False: 5.94k]
  |  Branch (2514:73): [True: 2.25k, False: 39.6k]
  ------------------
 2515|  2.25k|                ++full_outbound_peers;
 2516|  2.25k|            }
 2517|   379k|        }
 2518|  9.89k|    }
 2519|  9.89k|    return std::max(full_outbound_peers - m_max_outbound_full_relay, 0);
 2520|  9.89k|}
_ZNK8CConnman16GetAddedNodeInfoEb:
 2991|  91.8k|{
 2992|  91.8k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  91.8k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2993|       |
 2994|  91.8k|    std::vector<AddedNodeInfo> ret;
 2995|       |
 2996|  91.8k|    std::list<AddedNodeParams> lAddresses(0);
 2997|  91.8k|    {
 2998|  91.8k|        LOCK(m_added_nodes_mutex);
  ------------------
  |  |  268|  91.8k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  91.8k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  91.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  91.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2999|  91.8k|        ret.reserve(m_added_node_params.size());
 3000|  91.8k|        std::copy(m_added_node_params.cbegin(), m_added_node_params.cend(), std::back_inserter(lAddresses));
 3001|  91.8k|    }
 3002|       |
 3003|       |
 3004|       |    // Build a map of all already connected addresses (by IP:port and by name) to inbound/outbound and resolved CService
 3005|  91.8k|    std::map<CService, bool> mapConnected;
 3006|  91.8k|    std::map<std::string, std::pair<bool, CService>> mapConnectedByName;
 3007|  91.8k|    {
 3008|  91.8k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  91.8k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  91.8k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  91.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  91.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3009|  7.01M|        for (const CNode* pnode : m_nodes) {
  ------------------
  |  Branch (3009:33): [True: 7.01M, False: 91.8k]
  ------------------
 3010|  7.01M|            if (pnode->addr.IsValid()) {
  ------------------
  |  Branch (3010:17): [True: 5.72M, False: 1.28M]
  ------------------
 3011|  5.72M|                mapConnected[pnode->addr] = pnode->IsInboundConn();
 3012|  5.72M|            }
 3013|  7.01M|            std::string addrName{pnode->m_addr_name};
 3014|  7.01M|            if (!addrName.empty()) {
  ------------------
  |  Branch (3014:17): [True: 7.01M, False: 0]
  ------------------
 3015|  7.01M|                mapConnectedByName[std::move(addrName)] = std::make_pair(pnode->IsInboundConn(), static_cast<const CService&>(pnode->addr));
 3016|  7.01M|            }
 3017|  7.01M|        }
 3018|  91.8k|    }
 3019|       |
 3020|  95.1k|    for (const auto& addr : lAddresses) {
  ------------------
  |  Branch (3020:27): [True: 95.1k, False: 91.8k]
  ------------------
 3021|  95.1k|        CService service{MaybeFlipIPv6toCJDNS(LookupNumeric(addr.m_added_node, GetDefaultPort(addr.m_added_node)))};
 3022|  95.1k|        AddedNodeInfo addedNode{addr, CService(), false, false};
 3023|  95.1k|        if (service.IsValid()) {
  ------------------
  |  Branch (3023:13): [True: 10.4k, False: 84.6k]
  ------------------
 3024|       |            // strAddNode is an IP:port
 3025|  10.4k|            auto it = mapConnected.find(service);
 3026|  10.4k|            if (it != mapConnected.end()) {
  ------------------
  |  Branch (3026:17): [True: 3.67k, False: 6.80k]
  ------------------
 3027|  3.67k|                if (!include_connected) {
  ------------------
  |  Branch (3027:21): [True: 45, False: 3.63k]
  ------------------
 3028|     45|                    continue;
 3029|     45|                }
 3030|  3.63k|                addedNode.resolvedAddress = service;
 3031|  3.63k|                addedNode.fConnected = true;
 3032|  3.63k|                addedNode.fInbound = it->second;
 3033|  3.63k|            }
 3034|  84.6k|        } else {
 3035|       |            // strAddNode is a name
 3036|  84.6k|            auto it = mapConnectedByName.find(addr.m_added_node);
 3037|  84.6k|            if (it != mapConnectedByName.end()) {
  ------------------
  |  Branch (3037:17): [True: 13.1k, False: 71.5k]
  ------------------
 3038|  13.1k|                if (!include_connected) {
  ------------------
  |  Branch (3038:21): [True: 154, False: 12.9k]
  ------------------
 3039|    154|                    continue;
 3040|    154|                }
 3041|  12.9k|                addedNode.resolvedAddress = it->second.second;
 3042|  12.9k|                addedNode.fConnected = true;
 3043|  12.9k|                addedNode.fInbound = it->second.first;
 3044|  12.9k|            }
 3045|  84.6k|        }
 3046|  94.9k|        ret.emplace_back(std::move(addedNode));
 3047|  94.9k|    }
 3048|       |
 3049|  91.8k|    return ret;
 3050|  91.8k|}
_ZN8CConnman21OpenNetworkConnectionERK8CAddressbO22CountingSemaphoreGrantILl9223372036854775807EEPKc14ConnectionTypebRKNSt3__18optionalI5ProxyEE:
 3097|  58.2k|{
 3098|  58.2k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  58.2k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3099|  58.2k|    AssertLockNotHeld(m_unused_i2p_sessions_mutex);
  ------------------
  |  |  149|  58.2k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3100|  58.2k|    assert(conn_type != ConnectionType::INBOUND);
  ------------------
  |  Branch (3100:5): [True: 58.2k, False: 0]
  ------------------
 3101|       |
 3102|       |    //
 3103|       |    // Initiate outbound network connection
 3104|       |    //
 3105|  58.2k|    if (m_interrupt_net->interrupted()) {
  ------------------
  |  Branch (3105:9): [True: 44.9k, False: 13.3k]
  ------------------
 3106|  44.9k|        return false;
 3107|  44.9k|    }
 3108|  13.3k|    if (!fNetworkActive) {
  ------------------
  |  Branch (3108:9): [True: 905, False: 12.4k]
  ------------------
 3109|    905|        return false;
 3110|    905|    }
 3111|  12.4k|    if (!pszDest) {
  ------------------
  |  Branch (3111:9): [True: 5.66k, False: 6.77k]
  ------------------
 3112|  5.66k|        bool banned_or_discouraged = m_banman && (m_banman->IsDiscouraged(addrConnect) || m_banman->IsBanned(addrConnect));
  ------------------
  |  Branch (3112:38): [True: 0, False: 5.66k]
  |  Branch (3112:51): [True: 0, False: 0]
  |  Branch (3112:91): [True: 0, False: 0]
  ------------------
 3113|  5.66k|        if (IsLocal(addrConnect) || banned_or_discouraged || AlreadyConnectedToAddress(addrConnect)) {
  ------------------
  |  Branch (3113:13): [True: 383, False: 5.28k]
  |  Branch (3113:37): [True: 0, False: 5.28k]
  |  Branch (3113:62): [True: 444, False: 4.83k]
  ------------------
 3114|    827|            return false;
 3115|    827|        }
 3116|  6.77k|    } else if (AlreadyConnectedToHost(pszDest)) {
  ------------------
  |  Branch (3116:16): [True: 180, False: 6.59k]
  ------------------
 3117|    180|        return false;
 3118|    180|    }
 3119|       |
 3120|  11.4k|    CNode* pnode = ConnectNode(addrConnect, pszDest, fCountFailure, conn_type, use_v2transport, proxy_override);
 3121|       |
 3122|  11.4k|    if (!pnode)
  ------------------
  |  Branch (3122:9): [True: 10.4k, False: 938]
  ------------------
 3123|  10.4k|        return false;
 3124|    938|    pnode->grantOutbound = std::move(grant_outbound);
 3125|       |
 3126|    938|    m_msgproc->InitializeNode(*pnode, m_local_services);
 3127|    938|    {
 3128|    938|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|    938|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    938|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    938|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    938|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3129|    938|        m_nodes.push_back(pnode);
 3130|       |
 3131|       |        // update connection count by network
 3132|    938|        if (pnode->IsManualOrFullOutboundConn()) ++m_network_conn_counts[pnode->addr.GetNetwork()];
  ------------------
  |  Branch (3132:13): [True: 363, False: 575]
  ------------------
 3133|    938|    }
 3134|       |
 3135|    938|    TRACEPOINT(net, outbound_connection,
 3136|    938|        pnode->GetId(),
 3137|    938|        pnode->m_addr_name.c_str(),
 3138|    938|        pnode->ConnectionTypeAsString().c_str(),
 3139|    938|        pnode->ConnectedThroughNetwork(),
 3140|    938|        GetNodeCount(ConnectionDirection::Out));
 3141|       |
 3142|    938|    return true;
 3143|  11.4k|}
_ZN8CConnman16PrivateBroadcast12NumToOpenAddEm:
 3184|  9.89k|{
 3185|  9.89k|    m_num_to_open += n;
 3186|  9.89k|    m_num_to_open.notify_all();
 3187|  9.89k|}
_ZN8CConnman14BindListenPortERK8CServiceR13bilingual_str18NetPermissionFlags:
 3372|  55.2k|{
 3373|  55.2k|    int nOne = 1;
 3374|       |
 3375|       |    // Create socket for listening for incoming connections
 3376|  55.2k|    struct sockaddr_storage sockaddr;
 3377|  55.2k|    socklen_t len = sizeof(sockaddr);
 3378|  55.2k|    if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len))
  ------------------
  |  Branch (3378:9): [True: 27.5k, False: 27.6k]
  ------------------
 3379|  27.5k|    {
 3380|  27.5k|        strError = Untranslated(strprintf("Bind address family for %s not supported", addrBind.ToStringAddrPort()));
  ------------------
  |  | 1172|  27.5k|#define strprintf tfm::format
  ------------------
 3381|  27.5k|        LogError("%s\n", strError.original);
  ------------------
  |  |  127|  27.5k|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  27.5k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3382|  27.5k|        return false;
 3383|  27.5k|    }
 3384|       |
 3385|  27.6k|    std::unique_ptr<Sock> sock = CreateSock(addrBind.GetSAFamily(), SOCK_STREAM, IPPROTO_TCP);
 3386|  27.6k|    if (!sock) {
  ------------------
  |  Branch (3386:9): [True: 0, False: 27.6k]
  ------------------
 3387|      0|        strError = Untranslated(strprintf("Couldn't open socket for incoming connections (socket returned error %s)", NetworkErrorString(WSAGetLastError())));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
                      strError = Untranslated(strprintf("Couldn't open socket for incoming connections (socket returned error %s)", NetworkErrorString(WSAGetLastError())));
  ------------------
  |  |   59|      0|#define WSAGetLastError()   errno
  ------------------
 3388|      0|        LogError("%s\n", strError.original);
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3389|      0|        return false;
 3390|      0|    }
 3391|       |
 3392|       |    // Allow binding if the port is still in TIME_WAIT state after
 3393|       |    // the program was closed and restarted.
 3394|  27.6k|    if (sock->SetSockOpt(SOL_SOCKET, SO_REUSEADDR, &nOne, sizeof(int)) == SOCKET_ERROR) {
  ------------------
  |  |   68|  27.6k|#define SOCKET_ERROR        -1
  ------------------
  |  Branch (3394:9): [True: 13.1k, False: 14.4k]
  ------------------
 3395|  13.1k|        strError = Untranslated(strprintf("Error setting SO_REUSEADDR on socket: %s, continuing anyway", NetworkErrorString(WSAGetLastError())));
  ------------------
  |  | 1172|  13.1k|#define strprintf tfm::format
  ------------------
                      strError = Untranslated(strprintf("Error setting SO_REUSEADDR on socket: %s, continuing anyway", NetworkErrorString(WSAGetLastError())));
  ------------------
  |  |   59|  13.1k|#define WSAGetLastError()   errno
  ------------------
 3396|  13.1k|        LogInfo("%s\n", strError.original);
  ------------------
  |  |  125|  13.1k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  13.1k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3397|  13.1k|    }
 3398|       |
 3399|       |    // some systems don't have IPV6_V6ONLY but are always v6only; others do have the option
 3400|       |    // and enable it by default or not. Try to enable it, if possible.
 3401|  27.6k|    if (addrBind.IsIPv6()) {
  ------------------
  |  Branch (3401:9): [True: 14.7k, False: 12.9k]
  ------------------
 3402|  14.7k|#ifdef IPV6_V6ONLY
 3403|  14.7k|        if (sock->SetSockOpt(IPPROTO_IPV6, IPV6_V6ONLY, &nOne, sizeof(int)) == SOCKET_ERROR) {
  ------------------
  |  |   68|  14.7k|#define SOCKET_ERROR        -1
  ------------------
  |  Branch (3403:13): [True: 8.81k, False: 5.91k]
  ------------------
 3404|  8.81k|            strError = Untranslated(strprintf("Error setting IPV6_V6ONLY on socket: %s, continuing anyway", NetworkErrorString(WSAGetLastError())));
  ------------------
  |  | 1172|  8.81k|#define strprintf tfm::format
  ------------------
                          strError = Untranslated(strprintf("Error setting IPV6_V6ONLY on socket: %s, continuing anyway", NetworkErrorString(WSAGetLastError())));
  ------------------
  |  |   59|  8.81k|#define WSAGetLastError()   errno
  ------------------
 3405|  8.81k|            LogInfo("%s\n", strError.original);
  ------------------
  |  |  125|  8.81k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  8.81k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3406|  8.81k|        }
 3407|  14.7k|#endif
 3408|       |#ifdef WIN32
 3409|       |        int nProtLevel = PROTECTION_LEVEL_UNRESTRICTED;
 3410|       |        if (sock->SetSockOpt(IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, &nProtLevel, sizeof(int)) == SOCKET_ERROR) {
 3411|       |            strError = Untranslated(strprintf("Error setting IPV6_PROTECTION_LEVEL on socket: %s, continuing anyway", NetworkErrorString(WSAGetLastError())));
 3412|       |            LogInfo("%s\n", strError.original);
 3413|       |        }
 3414|       |#endif
 3415|  14.7k|    }
 3416|       |
 3417|  27.6k|    if (sock->Bind(reinterpret_cast<struct sockaddr*>(&sockaddr), len) == SOCKET_ERROR) {
  ------------------
  |  |   68|  27.6k|#define SOCKET_ERROR        -1
  ------------------
  |  Branch (3417:9): [True: 14.0k, False: 13.5k]
  ------------------
 3418|  14.0k|        int nErr = WSAGetLastError();
  ------------------
  |  |   59|  14.0k|#define WSAGetLastError()   errno
  ------------------
 3419|  14.0k|        if (nErr == WSAEADDRINUSE)
  ------------------
  |  |   66|  14.0k|#define WSAEADDRINUSE       EADDRINUSE
  ------------------
  |  Branch (3419:13): [True: 1.97k, False: 12.0k]
  ------------------
 3420|  1.97k|            strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToStringAddrPort(), CLIENT_NAME);
  ------------------
  |  | 1172|  1.97k|#define strprintf tfm::format
  ------------------
                          strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToStringAddrPort(), CLIENT_NAME);
  ------------------
  |  |  101|  1.97k|#define CLIENT_NAME "Bitcoin Core"
  ------------------
 3421|  12.0k|        else
 3422|  12.0k|            strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToStringAddrPort(), NetworkErrorString(nErr));
  ------------------
  |  | 1172|  12.0k|#define strprintf tfm::format
  ------------------
 3423|  14.0k|        LogError("%s\n", strError.original);
  ------------------
  |  |  127|  14.0k|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  14.0k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3424|  14.0k|        return false;
 3425|  14.0k|    }
 3426|  13.5k|    LogInfo("Bound to %s\n", addrBind.ToStringAddrPort());
  ------------------
  |  |  125|  13.5k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  13.5k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3427|       |
 3428|       |    // Listen for incoming connections
 3429|  13.5k|    if (sock->Listen(SOMAXCONN) == SOCKET_ERROR)
  ------------------
  |  |   68|  13.5k|#define SOCKET_ERROR        -1
  ------------------
  |  Branch (3429:9): [True: 4.65k, False: 8.91k]
  ------------------
 3430|  4.65k|    {
 3431|  4.65k|        strError = strprintf(_("Listening for incoming connections failed (listen returned error %s)"), NetworkErrorString(WSAGetLastError()));
  ------------------
  |  | 1172|  4.65k|#define strprintf tfm::format
  ------------------
                      strError = strprintf(_("Listening for incoming connections failed (listen returned error %s)"), NetworkErrorString(WSAGetLastError()));
  ------------------
  |  |   59|  4.65k|#define WSAGetLastError()   errno
  ------------------
 3432|  4.65k|        LogError("%s\n", strError.original);
  ------------------
  |  |  127|  4.65k|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  4.65k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3433|  4.65k|        return false;
 3434|  4.65k|    }
 3435|       |
 3436|  8.91k|    vhListenSocket.emplace_back(std::move(sock), permissions);
 3437|  8.91k|    return true;
 3438|  13.5k|}
_ZN8CConnman16SetNetworkActiveEb:
 3453|   373k|{
 3454|   373k|    LogInfo("%s: %s\n", __func__, active);
  ------------------
  |  |  125|   373k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|   373k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 3455|       |
 3456|   373k|    if (fNetworkActive == active) {
  ------------------
  |  Branch (3456:9): [True: 362k, False: 11.0k]
  ------------------
 3457|   362k|        return;
 3458|   362k|    }
 3459|       |
 3460|  11.0k|    fNetworkActive = active;
 3461|       |
 3462|  11.0k|    if (m_client_interface) {
  ------------------
  |  Branch (3462:9): [True: 0, False: 11.0k]
  ------------------
 3463|      0|        m_client_interface->NotifyNetworkActiveChanged(fNetworkActive);
 3464|      0|    }
 3465|  11.0k|}
_ZN8CConnmanC2EmmR7AddrManRK15NetGroupManagerRK12CChainParamsbNSt3__110shared_ptrI16CThreadInterruptEE:
 3474|  9.89k|    : addrman(addrman_in)
 3475|  9.89k|    , m_netgroupman{netgroupman}
 3476|  9.89k|    , nSeed0(nSeed0In)
 3477|  9.89k|    , nSeed1(nSeed1In)
 3478|  9.89k|    , m_interrupt_net{interrupt_net}
 3479|  9.89k|    , m_params(params)
 3480|  9.89k|{
 3481|  9.89k|    SetTryNewOutboundPeer(false);
 3482|       |
 3483|  9.89k|    Options connOptions;
 3484|  9.89k|    Init(connOptions);
 3485|  9.89k|    SetNetworkActive(network_active);
 3486|  9.89k|}
_ZN8CConnman12GetNewNodeIdEv:
 3489|   331k|{
 3490|   331k|    return nLastNodeId.fetch_add(1, std::memory_order_relaxed);
 3491|   331k|}
_ZNK8CConnman14GetDefaultPortE7Network:
 3494|  1.15k|{
 3495|  1.15k|    return net == NET_I2P ? I2P_SAM31_PORT : m_params.GetDefaultPort();
  ------------------
  |  Branch (3495:12): [True: 113, False: 1.04k]
  ------------------
 3496|  1.15k|}
_ZNK8CConnman14GetDefaultPortERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 3499|   162k|{
 3500|   162k|    CNetAddr a;
 3501|   162k|    return a.SetSpecial(addr) ? GetDefaultPort(a.GetNetwork()) : m_params.GetDefaultPort();
  ------------------
  |  Branch (3501:12): [True: 1.15k, False: 161k]
  ------------------
 3502|   162k|}
_ZN8CConnman4BindERK8CServicej18NetPermissionFlags:
 3505|  55.2k|{
 3506|  55.2k|    const CService addr{MaybeFlipIPv6toCJDNS(addr_)};
 3507|       |
 3508|  55.2k|    bilingual_str strError;
 3509|  55.2k|    if (!BindListenPort(addr, strError, permissions)) {
  ------------------
  |  Branch (3509:9): [True: 46.3k, False: 8.91k]
  ------------------
 3510|  46.3k|        if ((flags & BF_REPORT_ERROR) && m_client_interface) {
  ------------------
  |  Branch (3510:13): [True: 41.9k, False: 4.41k]
  |  Branch (3510:42): [True: 0, False: 41.9k]
  ------------------
 3511|      0|            m_client_interface->ThreadSafeMessageBox(strError, CClientUIInterface::MSG_ERROR);
 3512|      0|        }
 3513|  46.3k|        return false;
 3514|  46.3k|    }
 3515|       |
 3516|  8.91k|    if (addr.IsRoutable() && fDiscover && !(flags & BF_DONT_ADVERTISE) && !NetPermissions::HasFlag(permissions, NetPermissionFlags::NoBan)) {
  ------------------
  |  Branch (3516:9): [True: 5.81k, False: 3.09k]
  |  Branch (3516:30): [True: 5.81k, False: 0]
  |  Branch (3516:43): [True: 4.89k, False: 925]
  |  Branch (3516:75): [True: 4.70k, False: 192]
  ------------------
 3517|  4.70k|        AddLocal(addr, LOCAL_BIND);
 3518|  4.70k|    }
 3519|       |
 3520|  8.91k|    return true;
 3521|  55.2k|}
_ZN8CConnman9InitBindsERKNS_7OptionsE:
 3524|  42.5k|{
 3525|  42.5k|    for (const auto& addrBind : options.vBinds) {
  ------------------
  |  Branch (3525:31): [True: 37.1k, False: 8.88k]
  ------------------
 3526|  37.1k|        if (!Bind(addrBind, BF_REPORT_ERROR, NetPermissionFlags::None)) {
  ------------------
  |  Branch (3526:13): [True: 33.6k, False: 3.47k]
  ------------------
 3527|  33.6k|            return false;
 3528|  33.6k|        }
 3529|  37.1k|    }
 3530|  8.88k|    for (const auto& addrBind : options.vWhiteBinds) {
  ------------------
  |  Branch (3530:31): [True: 3.35k, False: 7.46k]
  ------------------
 3531|  3.35k|        if (!Bind(addrBind.m_service, BF_REPORT_ERROR, addrBind.m_flags)) {
  ------------------
  |  Branch (3531:13): [True: 1.42k, False: 1.93k]
  ------------------
 3532|  1.42k|            return false;
 3533|  1.42k|        }
 3534|  3.35k|    }
 3535|  7.46k|    for (const auto& addr_bind : options.onion_binds) {
  ------------------
  |  Branch (3535:32): [True: 1.43k, False: 7.07k]
  ------------------
 3536|  1.43k|        if (!Bind(addr_bind, BF_REPORT_ERROR | BF_DONT_ADVERTISE, NetPermissionFlags::None)) {
  ------------------
  |  Branch (3536:13): [True: 390, False: 1.04k]
  ------------------
 3537|    390|            return false;
 3538|    390|        }
 3539|  1.43k|    }
 3540|  7.07k|    if (options.bind_on_any) {
  ------------------
  |  Branch (3540:9): [True: 6.67k, False: 398]
  ------------------
 3541|       |        // Don't consider errors to bind on IPv6 "::" fatal because the host OS
 3542|       |        // may not have IPv6 support and the user did not explicitly ask us to
 3543|       |        // bind on that.
 3544|  6.67k|        const CService ipv6_any{in6_addr(COMPAT_IN6ADDR_ANY_INIT), GetListenPort()}; // ::
  ------------------
  |  |   45|  6.67k|#define COMPAT_IN6ADDR_ANY_INIT IN6ADDR_ANY_INIT
  ------------------
 3545|  6.67k|        Bind(ipv6_any, BF_NONE, NetPermissionFlags::None);
 3546|       |
 3547|  6.67k|        struct in_addr inaddr_any;
 3548|  6.67k|        inaddr_any.s_addr = htonl(INADDR_ANY);
 3549|  6.67k|        const CService ipv4_any{inaddr_any, GetListenPort()}; // 0.0.0.0
 3550|  6.67k|        if (!Bind(ipv4_any, BF_REPORT_ERROR, NetPermissionFlags::None)) {
  ------------------
  |  Branch (3550:13): [True: 6.47k, False: 200]
  ------------------
 3551|  6.47k|            return false;
 3552|  6.47k|        }
 3553|  6.67k|    }
 3554|    598|    return true;
 3555|  7.07k|}
_ZN8CConnman9InterruptEv:
 3686|  9.89k|{
 3687|  9.89k|    {
 3688|  9.89k|        LOCK(mutexMsgProc);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3689|  9.89k|        flagInterruptMsgProc = true;
 3690|  9.89k|    }
 3691|  9.89k|    condMsgProc.notify_all();
 3692|       |
 3693|  9.89k|    (*m_interrupt_net)();
 3694|  9.89k|    g_socks5_interrupt();
 3695|       |
 3696|  9.89k|    if (semOutbound) {
  ------------------
  |  Branch (3696:9): [True: 0, False: 9.89k]
  ------------------
 3697|      0|        for (int i=0; i<m_max_automatic_outbound; i++) {
  ------------------
  |  Branch (3697:23): [True: 0, False: 0]
  ------------------
 3698|      0|            semOutbound->release();
 3699|      0|        }
 3700|      0|    }
 3701|       |
 3702|  9.89k|    if (semAddnode) {
  ------------------
  |  Branch (3702:9): [True: 0, False: 9.89k]
  ------------------
 3703|      0|        for (int i=0; i<m_max_addnode; i++) {
  ------------------
  |  Branch (3703:23): [True: 0, False: 0]
  ------------------
 3704|      0|            semAddnode->release();
 3705|      0|        }
 3706|      0|    }
 3707|       |
 3708|  9.89k|    m_private_broadcast.m_sem_conn_max.release();
 3709|  9.89k|    m_private_broadcast.NumToOpenAdd(1); // Just unblock NumToOpenWait() to be able to continue with shutdown.
 3710|  9.89k|}
_ZN8CConnman11StopThreadsEv:
 3713|  9.89k|{
 3714|  9.89k|    if (threadPrivateBroadcast.joinable()) {
  ------------------
  |  Branch (3714:9): [True: 0, False: 9.89k]
  ------------------
 3715|      0|        threadPrivateBroadcast.join();
 3716|      0|    }
 3717|  9.89k|    if (threadI2PAcceptIncoming.joinable()) {
  ------------------
  |  Branch (3717:9): [True: 0, False: 9.89k]
  ------------------
 3718|      0|        threadI2PAcceptIncoming.join();
 3719|      0|    }
 3720|  9.89k|    if (threadMessageHandler.joinable())
  ------------------
  |  Branch (3720:9): [True: 0, False: 9.89k]
  ------------------
 3721|      0|        threadMessageHandler.join();
 3722|  9.89k|    if (threadOpenConnections.joinable())
  ------------------
  |  Branch (3722:9): [True: 0, False: 9.89k]
  ------------------
 3723|      0|        threadOpenConnections.join();
 3724|  9.89k|    if (threadOpenAddedConnections.joinable())
  ------------------
  |  Branch (3724:9): [True: 0, False: 9.89k]
  ------------------
 3725|      0|        threadOpenAddedConnections.join();
 3726|  9.89k|    if (threadDNSAddressSeed.joinable())
  ------------------
  |  Branch (3726:9): [True: 0, False: 9.89k]
  ------------------
 3727|      0|        threadDNSAddressSeed.join();
 3728|  9.89k|    if (threadSocketHandler.joinable())
  ------------------
  |  Branch (3728:9): [True: 0, False: 9.89k]
  ------------------
 3729|      0|        threadSocketHandler.join();
 3730|  9.89k|}
_ZN8CConnman9StopNodesEv:
 3733|  9.89k|{
 3734|  9.89k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3735|  9.89k|    AssertLockNotHeld(m_reconnections_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3736|       |
 3737|  9.89k|    if (fAddressesInitialized) {
  ------------------
  |  Branch (3737:9): [True: 0, False: 9.89k]
  ------------------
 3738|      0|        DumpAddresses();
 3739|      0|        fAddressesInitialized = false;
 3740|       |
 3741|      0|        if (m_use_addrman_outgoing) {
  ------------------
  |  Branch (3741:13): [True: 0, False: 0]
  ------------------
 3742|       |            // Anchor connections are only dumped during clean shutdown.
 3743|      0|            std::vector<CAddress> anchors_to_dump = GetCurrentBlockRelayOnlyConns();
 3744|      0|            if (anchors_to_dump.size() > MAX_BLOCK_RELAY_ONLY_ANCHORS) {
  ------------------
  |  Branch (3744:17): [True: 0, False: 0]
  ------------------
 3745|      0|                anchors_to_dump.resize(MAX_BLOCK_RELAY_ONLY_ANCHORS);
 3746|      0|            }
 3747|      0|            DumpAnchors(gArgs.GetDataDirNet() / ANCHORS_DATABASE_FILENAME, anchors_to_dump);
 3748|      0|        }
 3749|      0|    }
 3750|       |
 3751|       |    // Delete peer connections.
 3752|  9.89k|    std::vector<CNode*> nodes;
 3753|  9.89k|    WITH_LOCK(m_nodes_mutex, nodes.swap(m_nodes));
  ------------------
  |  |  299|  9.89k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 3754|  9.89k|    for (CNode* pnode : nodes) {
  ------------------
  |  Branch (3754:23): [True: 0, False: 9.89k]
  ------------------
 3755|      0|        LogDebug(BCLog::NET, "Stopping node, %s", pnode->DisconnectMsg());
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3756|      0|        pnode->CloseSocketDisconnect();
 3757|      0|        DeleteNode(pnode);
 3758|      0|    }
 3759|       |
 3760|  9.89k|    for (CNode* pnode : m_nodes_disconnected) {
  ------------------
  |  Branch (3760:23): [True: 0, False: 9.89k]
  ------------------
 3761|      0|        DeleteNode(pnode);
 3762|      0|    }
 3763|  9.89k|    m_nodes_disconnected.clear();
 3764|  9.89k|    WITH_LOCK(m_reconnections_mutex, m_reconnections.clear());
  ------------------
  |  |  299|  9.89k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 3765|  9.89k|    vhListenSocket.clear();
 3766|  9.89k|    semOutbound.reset();
 3767|  9.89k|    semAddnode.reset();
 3768|  9.89k|}
_ZN8CConnmanD2Ev:
 3778|  9.89k|{
 3779|  9.89k|    Interrupt();
 3780|  9.89k|    Stop();
 3781|  9.89k|}
_ZNK8CConnman18GetAddressesUnsafeEmmNSt3__18optionalI7NetworkEEb:
 3784|  47.8k|{
 3785|  47.8k|    std::vector<CAddress> addresses = addrman.get().GetAddr(max_addresses, max_pct, network, filtered);
 3786|  47.8k|    if (m_banman) {
  ------------------
  |  Branch (3786:9): [True: 0, False: 47.8k]
  ------------------
 3787|      0|        addresses.erase(std::remove_if(addresses.begin(), addresses.end(),
 3788|      0|                        [this](const CAddress& addr){return m_banman->IsDiscouraged(addr) || m_banman->IsBanned(addr);}),
 3789|      0|                        addresses.end());
 3790|      0|    }
 3791|  47.8k|    return addresses;
 3792|  47.8k|}
_ZN8CConnman12GetAddressesER5CNodemm:
 3795|  8.02k|{
 3796|  8.02k|    uint64_t network_id = requestor.m_network_key;
 3797|  8.02k|    const auto current_time = GetTime<std::chrono::microseconds>();
 3798|  8.02k|    auto r = m_addr_response_caches.emplace(network_id, CachedAddrResponse{});
 3799|  8.02k|    CachedAddrResponse& cache_entry = r.first->second;
 3800|  8.02k|    if (cache_entry.m_cache_entry_expiration < current_time) { // If emplace() added new one it has expiration 0.
  ------------------
  |  Branch (3800:9): [True: 1.04k, False: 6.98k]
  ------------------
 3801|  1.04k|        cache_entry.m_addrs_response_cache = GetAddressesUnsafe(max_addresses, max_pct, /*network=*/std::nullopt);
 3802|       |        // Choosing a proper cache lifetime is a trade-off between the privacy leak minimization
 3803|       |        // and the usefulness of ADDR responses to honest users.
 3804|       |        //
 3805|       |        // Longer cache lifetime makes it more difficult for an attacker to scrape
 3806|       |        // enough AddrMan data to maliciously infer something useful.
 3807|       |        // By the time an attacker scraped enough AddrMan records, most of
 3808|       |        // the records should be old enough to not leak topology info by
 3809|       |        // e.g. analyzing real-time changes in timestamps.
 3810|       |        //
 3811|       |        // It takes only several hundred requests to scrape everything from an AddrMan containing 100,000 nodes,
 3812|       |        // so ~24 hours of cache lifetime indeed makes the data less inferable by the time
 3813|       |        // most of it could be scraped (considering that timestamps are updated via
 3814|       |        // ADDR self-announcements and when nodes communicate).
 3815|       |        // We also should be robust to those attacks which may not require scraping *full* victim's AddrMan
 3816|       |        // (because even several timestamps of the same handful of nodes may leak privacy).
 3817|       |        //
 3818|       |        // On the other hand, longer cache lifetime makes ADDR responses
 3819|       |        // outdated and less useful for an honest requestor, e.g. if most nodes
 3820|       |        // in the ADDR response are no longer active.
 3821|       |        //
 3822|       |        // However, the churn in the network is known to be rather low. Since we consider
 3823|       |        // nodes to be "terrible" (see IsTerrible()) if the timestamps are older than 30 days,
 3824|       |        // max. 24 hours of "penalty" due to cache shouldn't make any meaningful difference
 3825|       |        // in terms of the freshness of the response.
 3826|  1.04k|        cache_entry.m_cache_entry_expiration = current_time +
 3827|  1.04k|            21h + FastRandomContext().randrange<std::chrono::microseconds>(6h);
 3828|  1.04k|    }
 3829|  8.02k|    return cache_entry.m_addrs_response_cache;
 3830|  8.02k|}
_ZN8CConnman7AddNodeERK15AddedNodeParams:
 3833|  57.3k|{
 3834|  57.3k|    const CService resolved(LookupNumeric(add.m_added_node, GetDefaultPort(add.m_added_node)));
 3835|  57.3k|    const bool resolved_is_valid{resolved.IsValid()};
 3836|       |
 3837|  57.3k|    LOCK(m_added_nodes_mutex);
  ------------------
  |  |  268|  57.3k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  57.3k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  57.3k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  57.3k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3838|  81.7k|    for (const auto& it : m_added_node_params) {
  ------------------
  |  Branch (3838:25): [True: 81.7k, False: 25.8k]
  ------------------
 3839|  81.7k|        if (add.m_added_node == it.m_added_node || (resolved_is_valid && resolved == LookupNumeric(it.m_added_node, GetDefaultPort(it.m_added_node)))) return false;
  ------------------
  |  Branch (3839:13): [True: 31.4k, False: 50.3k]
  |  Branch (3839:13): [True: 31.5k, False: 50.2k]
  |  Branch (3839:53): [True: 3.71k, False: 46.6k]
  |  Branch (3839:74): [True: 92, False: 3.62k]
  ------------------
 3840|  81.7k|    }
 3841|       |
 3842|  25.8k|    m_added_node_params.push_back(add);
 3843|  25.8k|    return true;
 3844|  57.3k|}
_ZN8CConnman15RemoveAddedNodeENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
 3847|   125k|{
 3848|   125k|    LOCK(m_added_nodes_mutex);
  ------------------
  |  |  268|   125k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   125k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   125k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   125k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3849|   152k|    for (auto it = m_added_node_params.begin(); it != m_added_node_params.end(); ++it) {
  ------------------
  |  Branch (3849:49): [True: 51.4k, False: 100k]
  ------------------
 3850|  51.4k|        if (node == it->m_added_node) {
  ------------------
  |  Branch (3850:13): [True: 24.7k, False: 26.6k]
  ------------------
 3851|  24.7k|            m_added_node_params.erase(it);
 3852|  24.7k|            return true;
 3853|  24.7k|        }
 3854|  51.4k|    }
 3855|   100k|    return false;
 3856|   125k|}
_ZNK8CConnman12GetNodeCountE19ConnectionDirection:
 3870|  14.1k|{
 3871|  14.1k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  14.1k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  14.1k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  14.1k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  14.1k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3872|  14.1k|    if (flags == ConnectionDirection::Both) // Shortcut if we want total
  ------------------
  |  Branch (3872:9): [True: 2.11k, False: 12.0k]
  ------------------
 3873|  2.11k|        return m_nodes.size();
 3874|       |
 3875|  12.0k|    int nNum = 0;
 3876|   464k|    for (const auto& pnode : m_nodes) {
  ------------------
  |  Branch (3876:28): [True: 464k, False: 12.0k]
  ------------------
 3877|   464k|        if (flags & (pnode->IsInboundConn() ? ConnectionDirection::In : ConnectionDirection::Out)) {
  ------------------
  |  Branch (3877:13): [True: 329k, False: 134k]
  |  Branch (3877:22): [True: 338k, False: 125k]
  ------------------
 3878|   329k|            nNum++;
 3879|   329k|        }
 3880|   464k|    }
 3881|       |
 3882|  12.0k|    return nNum;
 3883|  14.1k|}
_ZNK8CConnman11GetMappedASERK8CNetAddr:
 3893|   379k|{
 3894|   379k|    return m_netgroupman.GetMappedAS(addr);
 3895|   379k|}
_ZNK8CConnman12GetNodeStatsERNSt3__16vectorI10CNodeStatsNS0_9allocatorIS2_EEEE:
 3898|  9.89k|{
 3899|  9.89k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3900|       |
 3901|  9.89k|    vstats.clear();
 3902|  9.89k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3903|  9.89k|    vstats.reserve(m_nodes.size());
 3904|   379k|    for (CNode* pnode : m_nodes) {
  ------------------
  |  Branch (3904:23): [True: 379k, False: 9.89k]
  ------------------
 3905|   379k|        vstats.emplace_back();
 3906|   379k|        pnode->CopyStats(vstats.back());
 3907|   379k|        vstats.back().m_mapped_as = GetMappedAS(pnode->addr);
 3908|   379k|    }
 3909|  9.89k|}
_ZN8CConnman14DisconnectNodeENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
 3912|  89.8k|{
 3913|  89.8k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  89.8k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  89.8k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  89.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  89.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3914|  89.8k|    auto it = std::ranges::find_if(m_nodes, [&strNode](CNode* node) { return node->m_addr_name == strNode; });
 3915|  89.8k|    if (it != m_nodes.end()) {
  ------------------
  |  Branch (3915:9): [True: 256, False: 89.5k]
  ------------------
 3916|    256|        CNode* node{*it};
 3917|    256|        LogDebug(BCLog::NET, "disconnect by address%s match, %s", (fLogIPs ? strprintf("=%s", strNode) : ""), node->DisconnectMsg());
  ------------------
  |  |  143|    256|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    256|    do {                                                                                      \
  |  |  |  |  137|    256|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 256]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (119:129): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    256|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 256]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3918|    256|        node->fDisconnect = true;
 3919|    256|        return true;
 3920|    256|    }
 3921|  89.5k|    return false;
 3922|  89.8k|}
_ZN8CConnman14DisconnectNodeERK7CSubNet:
 3925|  62.1k|{
 3926|  62.1k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  62.1k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3927|  62.1k|    bool disconnected = false;
 3928|  62.1k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  62.1k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  62.1k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  62.1k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  62.1k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3929|  2.35M|    for (CNode* pnode : m_nodes) {
  ------------------
  |  Branch (3929:23): [True: 2.35M, False: 62.1k]
  ------------------
 3930|  2.35M|        if (subnet.Match(pnode->addr)) {
  ------------------
  |  Branch (3930:13): [True: 698, False: 2.35M]
  ------------------
 3931|    698|            LogDebug(BCLog::NET, "disconnect by subnet%s match, %s", (fLogIPs ? strprintf("=%s", subnet.ToString()) : ""), pnode->DisconnectMsg());
  ------------------
  |  |  143|    698|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    698|    do {                                                                                      \
  |  |  |  |  137|    698|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 698]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (119:129): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    698|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 698]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3932|    698|            pnode->fDisconnect = true;
 3933|    698|            disconnected = true;
 3934|    698|        }
 3935|  2.35M|    }
 3936|  62.1k|    return disconnected;
 3937|  62.1k|}
_ZN8CConnman14DisconnectNodeERK8CNetAddr:
 3940|  15.3k|{
 3941|  15.3k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  15.3k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3942|  15.3k|    return DisconnectNode(CSubNet(addr));
 3943|  15.3k|}
_ZN8CConnman14DisconnectNodeEl:
 3946|  6.81k|{
 3947|  6.81k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  6.81k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  6.81k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  6.81k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  6.81k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3948|  2.89M|    for(CNode* pnode : m_nodes) {
  ------------------
  |  Branch (3948:22): [True: 2.89M, False: 6.37k]
  ------------------
 3949|  2.89M|        if (id == pnode->GetId()) {
  ------------------
  |  Branch (3949:13): [True: 443, False: 2.89M]
  ------------------
 3950|    443|            LogDebug(BCLog::NET, "disconnect by id, %s", pnode->DisconnectMsg());
  ------------------
  |  |  143|    443|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    443|    do {                                                                                      \
  |  |  |  |  137|    443|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 443]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    443|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 443]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3951|    443|            pnode->fDisconnect = true;
 3952|    443|            return true;
 3953|    443|        }
 3954|  2.89M|    }
 3955|  6.37k|    return false;
 3956|  6.81k|}
_ZN8CConnman15RecordBytesRecvEm:
 3959|  23.7k|{
 3960|  23.7k|    nTotalBytesRecv += bytes;
 3961|  23.7k|}
_ZN8CConnman15RecordBytesSentEm:
 3964|  87.1k|{
 3965|  87.1k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  87.1k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3966|  87.1k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|  87.1k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  87.1k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  87.1k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  87.1k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3967|       |
 3968|  87.1k|    nTotalBytesSent += bytes;
 3969|       |
 3970|  87.1k|    const auto now = GetTime<std::chrono::seconds>();
 3971|  87.1k|    if (nMaxOutboundCycleStartTime + MAX_UPLOAD_TIMEFRAME < now)
  ------------------
  |  Branch (3971:9): [True: 1.12k, False: 85.9k]
  ------------------
 3972|  1.12k|    {
 3973|       |        // timeframe expired, reset cycle
 3974|  1.12k|        nMaxOutboundCycleStartTime = now;
 3975|  1.12k|        nMaxOutboundTotalBytesSentInCycle = 0;
 3976|  1.12k|    }
 3977|       |
 3978|  87.1k|    nMaxOutboundTotalBytesSentInCycle += bytes;
 3979|  87.1k|}
_ZNK8CConnman20GetMaxOutboundTargetEv:
 3982|  9.89k|{
 3983|  9.89k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3984|  9.89k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3985|  9.89k|    return nMaxOutboundLimit;
 3986|  9.89k|}
_ZNK8CConnman29GetMaxOutboundTimeLeftInCycleEv:
 3994|  9.89k|{
 3995|  9.89k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3996|  9.89k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3997|  9.89k|    return GetMaxOutboundTimeLeftInCycle_();
 3998|  9.89k|}
_ZNK8CConnman30GetMaxOutboundTimeLeftInCycle_Ev:
 4001|   205k|{
 4002|   205k|    AssertLockHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  144|   205k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4003|       |
 4004|   205k|    if (nMaxOutboundLimit == 0)
  ------------------
  |  Branch (4004:9): [True: 3.21k, False: 202k]
  ------------------
 4005|  3.21k|        return 0s;
 4006|       |
 4007|   202k|    if (nMaxOutboundCycleStartTime.count() == 0)
  ------------------
  |  Branch (4007:9): [True: 173k, False: 28.6k]
  ------------------
 4008|   173k|        return MAX_UPLOAD_TIMEFRAME;
 4009|       |
 4010|  28.6k|    const std::chrono::seconds cycleEndTime = nMaxOutboundCycleStartTime + MAX_UPLOAD_TIMEFRAME;
 4011|  28.6k|    const auto now = GetTime<std::chrono::seconds>();
 4012|  28.6k|    return (cycleEndTime < now) ? 0s : cycleEndTime - now;
  ------------------
  |  Branch (4012:12): [True: 606, False: 28.0k]
  ------------------
 4013|   202k|}
_ZNK8CConnman21OutboundTargetReachedEb:
 4016|   208k|{
 4017|   208k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|   208k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4018|   208k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|   208k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   208k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   208k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   208k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4019|   208k|    if (nMaxOutboundLimit == 0)
  ------------------
  |  Branch (4019:9): [True: 10.8k, False: 197k]
  ------------------
 4020|  10.8k|        return false;
 4021|       |
 4022|   197k|    if (historicalBlockServingLimit)
  ------------------
  |  Branch (4022:9): [True: 195k, False: 1.95k]
  ------------------
 4023|   195k|    {
 4024|       |        // keep a large enough buffer to at least relay each block once
 4025|   195k|        const std::chrono::seconds timeLeftInCycle = GetMaxOutboundTimeLeftInCycle_();
 4026|   195k|        const uint64_t buffer = timeLeftInCycle / std::chrono::minutes{10} * MAX_BLOCK_SERIALIZED_SIZE;
 4027|   195k|        if (buffer >= nMaxOutboundLimit || nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit - buffer)
  ------------------
  |  Branch (4027:13): [True: 29.2k, False: 166k]
  |  Branch (4027:44): [True: 442, False: 166k]
  ------------------
 4028|  29.7k|            return true;
 4029|   195k|    }
 4030|  1.95k|    else if (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit)
  ------------------
  |  Branch (4030:14): [True: 566, False: 1.39k]
  ------------------
 4031|    566|        return true;
 4032|       |
 4033|   167k|    return false;
 4034|   197k|}
_ZNK8CConnman26GetOutboundTargetBytesLeftEv:
 4037|  9.89k|{
 4038|  9.89k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4039|  9.89k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4040|  9.89k|    if (nMaxOutboundLimit == 0)
  ------------------
  |  Branch (4040:9): [True: 3.21k, False: 6.68k]
  ------------------
 4041|  3.21k|        return 0;
 4042|       |
 4043|  6.68k|    return (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit) ? 0 : nMaxOutboundLimit - nMaxOutboundTotalBytesSentInCycle;
  ------------------
  |  Branch (4043:12): [True: 27, False: 6.65k]
  ------------------
 4044|  9.89k|}
_ZNK8CConnman17GetTotalBytesRecvEv:
 4047|  19.7k|{
 4048|  19.7k|    return nTotalBytesRecv;
 4049|  19.7k|}
_ZNK8CConnman17GetTotalBytesSentEv:
 4052|  19.7k|{
 4053|  19.7k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  19.7k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4054|  19.7k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|  19.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  19.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  19.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  19.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4055|  19.7k|    return nTotalBytesSent;
 4056|  19.7k|}
_ZNK8CConnman16GetLocalServicesEv:
 4059|   365k|{
 4060|   365k|    return m_local_services;
 4061|   365k|}
_ZN5CNodeC2ElNSt3__110shared_ptrI4SockEERK8CAddressmmRK8CServiceRKNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE14ConnectionTypebmO12CNodeOptions:
 4083|   388k|    : m_transport{MakeTransport(idIn, node_opts.use_v2transport, conn_type_in == ConnectionType::INBOUND)},
 4084|   388k|      m_permission_flags{node_opts.permission_flags},
 4085|   388k|      m_sock{sock},
 4086|   388k|      m_connected{NodeClock::now()},
 4087|   388k|      m_proxy_override{std::move(node_opts.proxy_override)},
 4088|   388k|      addr{addrIn},
 4089|   388k|      addrBind{addrBindIn},
 4090|   388k|      m_addr_name{addrNameIn.empty() ? addr.ToStringAddrPort() : addrNameIn},
  ------------------
  |  Branch (4090:19): [True: 339k, False: 49.6k]
  ------------------
 4091|   388k|      m_dest(addrNameIn),
 4092|   388k|      m_inbound_onion{inbound_onion},
 4093|   388k|      m_prefer_evict{node_opts.prefer_evict},
 4094|   388k|      nKeyedNetGroup{nKeyedNetGroupIn},
 4095|   388k|      m_network_key{network_key},
 4096|   388k|      m_conn_type{conn_type_in},
 4097|   388k|      id{idIn},
 4098|   388k|      nLocalHostNonce{nLocalHostNonceIn},
 4099|   388k|      m_recv_flood_size{node_opts.recv_flood_size},
 4100|   388k|      m_i2p_sam_session{std::move(node_opts.i2p_sam_session)}
 4101|   388k|{
 4102|   388k|    if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND);
  ------------------
  |  Branch (4102:9): [True: 11.2k, False: 377k]
  |  Branch (4102:24): [True: 11.2k, False: 0]
  ------------------
 4103|       |
 4104|  14.0M|    for (const auto& msg : ALL_NET_MESSAGE_TYPES) {
  ------------------
  |  Branch (4104:26): [True: 14.0M, False: 388k]
  ------------------
 4105|  14.0M|        mapRecvBytesPerMsgType[msg] = 0;
 4106|  14.0M|    }
 4107|   388k|    mapRecvBytesPerMsgType[NET_MESSAGE_TYPE_OTHER] = 0;
 4108|       |
 4109|   388k|    if (fLogIPs) {
  ------------------
  |  Branch (4109:9): [True: 0, False: 388k]
  ------------------
 4110|      0|        LogDebug(BCLog::NET, "Added connection to %s peer=%d\n", m_addr_name, id);
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4111|   388k|    } else {
 4112|   388k|        LogDebug(BCLog::NET, "Added connection peer=%d\n", id);
  ------------------
  |  |  143|   388k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|   388k|    do {                                                                                      \
  |  |  |  |  137|   388k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 388k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|   388k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 388k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4113|   388k|    }
 4114|   388k|}
_ZN5CNode29MarkReceivedMsgsForProcessingEv:
 4117|     64|{
 4118|     64|    AssertLockNotHeld(m_msg_process_queue_mutex);
  ------------------
  |  |  149|     64|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4119|       |
 4120|     64|    size_t nSizeAdded = 0;
 4121|     72|    for (const auto& msg : vRecvMsg) {
  ------------------
  |  Branch (4121:26): [True: 72, False: 64]
  ------------------
 4122|       |        // vRecvMsg contains only completed CNetMessage
 4123|       |        // the single possible partially deserialized message are held by TransportDeserializer
 4124|     72|        nSizeAdded += msg.GetMemoryUsage();
 4125|     72|    }
 4126|       |
 4127|     64|    LOCK(m_msg_process_queue_mutex);
  ------------------
  |  |  268|     64|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     64|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     64|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     64|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4128|     64|    m_msg_process_queue.splice(m_msg_process_queue.end(), vRecvMsg);
 4129|     64|    m_msg_process_queue_size += nSizeAdded;
 4130|     64|    fPauseRecv = m_msg_process_queue_size > m_recv_flood_size;
 4131|     64|}
_ZN8CConnman18NodeFullyConnectedEPK5CNode:
 4148|   381k|{
 4149|   381k|    return pnode && pnode->fSuccessfullyConnected && !pnode->fDisconnect;
  ------------------
  |  Branch (4149:12): [True: 381k, False: 0]
  |  Branch (4149:21): [True: 50.3k, False: 331k]
  |  Branch (4149:54): [True: 43.8k, False: 6.55k]
  ------------------
 4150|   381k|}
_ZN8CConnman11PushMessageEP5CNodeO17CSerializedNetMsg:
 4164|   138k|{
 4165|   138k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|   138k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4166|       |
 4167|   138k|    if (pnode->IsPrivateBroadcastConn() && !IsOutboundMessageAllowedInPrivateBroadcast(msg.m_type)) {
  ------------------
  |  Branch (4167:9): [True: 17.3k, False: 120k]
  |  Branch (4167:44): [True: 17.1k, False: 176]
  ------------------
 4168|  17.1k|        LogDebug(BCLog::PRIVBROADCAST, "Omitting send of message '%s', %s", msg.m_type, pnode->LogPeer());
  ------------------
  |  |  143|  17.1k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  17.1k|    do {                                                                                      \
  |  |  |  |  137|  17.1k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 17.1k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  17.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4169|  17.1k|        return;
 4170|  17.1k|    }
 4171|       |
 4172|   120k|    if (!m_private_broadcast.m_outbound_tor_ok_at_least_once.load() && !pnode->IsInboundConn() &&
  ------------------
  |  Branch (4172:9): [True: 120k, False: 222]
  |  Branch (4172:72): [True: 117k, False: 3.58k]
  ------------------
 4173|   117k|        pnode->addr.IsTor() && msg.m_type == NetMsgType::VERACK) {
  ------------------
  |  Branch (4173:9): [True: 9.80k, False: 107k]
  |  Branch (4173:32): [True: 12, False: 9.79k]
  ------------------
 4174|       |        // If we are sending the peer VERACK that means we successfully sent
 4175|       |        // and received another message to/from that peer (VERSION).
 4176|     12|        m_private_broadcast.m_outbound_tor_ok_at_least_once.store(true);
 4177|     12|    }
 4178|       |
 4179|   120k|    size_t nMessageSize = msg.data.size();
 4180|   120k|    LogDebug(BCLog::NET, "sending %s (%d bytes) peer=%d\n", msg.m_type, nMessageSize, pnode->GetId());
  ------------------
  |  |  143|   120k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|   120k|    do {                                                                                      \
  |  |  |  |  137|   120k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 120k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|   120k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 120k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4181|   120k|    if (m_capture_messages) {
  ------------------
  |  Branch (4181:9): [True: 0, False: 120k]
  ------------------
 4182|      0|        CaptureMessage(pnode->addr, msg.m_type, msg.data, /*is_incoming=*/false);
 4183|      0|    }
 4184|       |
 4185|   120k|    TRACEPOINT(net, outbound_message,
 4186|   120k|        pnode->GetId(),
 4187|   120k|        pnode->m_addr_name.c_str(),
 4188|   120k|        pnode->ConnectionTypeAsString().c_str(),
 4189|   120k|        msg.m_type.c_str(),
 4190|   120k|        msg.data.size(),
 4191|   120k|        msg.data.data()
 4192|   120k|    );
 4193|       |
 4194|   120k|    size_t nBytesSent = 0;
 4195|   120k|    {
 4196|   120k|        LOCK(pnode->cs_vSend);
  ------------------
  |  |  268|   120k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   120k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   120k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   120k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4197|       |        // Check if the transport still has unsent bytes, and indicate to it that we're about to
 4198|       |        // give it a message to send.
 4199|   120k|        const auto& [to_send, more, _msg_type] =
 4200|   120k|            pnode->m_transport->GetBytesToSend(/*have_next_message=*/true);
 4201|   120k|        const bool queue_was_empty{to_send.empty() && pnode->vSendMsg.empty()};
  ------------------
  |  Branch (4201:36): [True: 86.7k, False: 34.1k]
  |  Branch (4201:55): [True: 86.7k, False: 0]
  ------------------
 4202|       |
 4203|       |        // Update memory usage of send buffer.
 4204|   120k|        pnode->m_send_memusage += msg.GetMemoryUsage();
 4205|   120k|        if (pnode->m_send_memusage + pnode->m_transport->GetSendMemoryUsage() > nSendBufferMaxSize) pnode->fPauseSend = true;
  ------------------
  |  Branch (4205:13): [True: 120k, False: 0]
  ------------------
 4206|       |        // Move message to vSendMsg queue.
 4207|   120k|        pnode->vSendMsg.push_back(std::move(msg));
 4208|       |
 4209|       |        // If there was nothing to send before, and there is now (predicted by the "more" value
 4210|       |        // returned by the GetBytesToSend call above), attempt "optimistic write":
 4211|       |        // because the poll/select loop may pause for SELECT_TIMEOUT_MILLISECONDS before actually
 4212|       |        // doing a send, try sending from the calling thread if the queue was empty before.
 4213|       |        // With a V1Transport, more will always be true here, because adding a message always
 4214|       |        // results in sendable bytes there, but with V2Transport this is not the case (it may
 4215|       |        // still be in the handshake).
 4216|   120k|        if (queue_was_empty && more) {
  ------------------
  |  Branch (4216:13): [True: 86.7k, False: 34.1k]
  |  Branch (4216:32): [True: 86.7k, False: 0]
  ------------------
 4217|  86.7k|            std::tie(nBytesSent, std::ignore) = SocketSendData(*pnode);
 4218|  86.7k|        }
 4219|   120k|    }
 4220|   120k|    if (nBytesSent) RecordBytesSent(nBytesSent);
  ------------------
  |  Branch (4220:9): [True: 86.6k, False: 34.2k]
  ------------------
 4221|   120k|}
_ZN8CConnman7ForNodeElNSt3__18functionIFbP5CNodeEEE:
 4224|  5.89k|{
 4225|  5.89k|    AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  5.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4226|       |
 4227|  5.89k|    CNode* found = nullptr;
 4228|  5.89k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  5.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4229|  65.6k|    for (auto&& pnode : m_nodes) {
  ------------------
  |  Branch (4229:23): [True: 65.6k, False: 3.36k]
  ------------------
 4230|  65.6k|        if(pnode->GetId() == id) {
  ------------------
  |  Branch (4230:12): [True: 2.53k, False: 63.1k]
  ------------------
 4231|  2.53k|            found = pnode;
 4232|  2.53k|            break;
 4233|  2.53k|        }
 4234|  65.6k|    }
 4235|  5.89k|    return found != nullptr && NodeFullyConnected(found) && func(found);
  ------------------
  |  Branch (4235:12): [True: 2.53k, False: 3.36k]
  |  Branch (4235:32): [True: 1.91k, False: 618]
  |  Branch (4235:61): [True: 1.91k, False: 0]
  ------------------
 4236|  5.89k|}
_ZNK8CConnman26GetDeterministicRandomizerEm:
 4239|   997k|{
 4240|   997k|    return CSipHasher(nSeed0, nSeed1).Write(id);
 4241|   997k|}
_ZNK8CConnman22CalculateKeyedNetGroupERK8CNetAddr:
 4244|   331k|{
 4245|   331k|    std::vector<unsigned char> vchNetGroup(m_netgroupman.GetGroup(address));
 4246|       |
 4247|   331k|    return GetDeterministicRandomizer(RANDOMIZER_ID_NETGROUP).Write(vchNetGroup).Finalize();
 4248|   331k|}
_ZN8CConnman16ASMapHealthCheckEv:
 4280|  9.89k|{
 4281|  9.89k|    const std::vector<CAddress> v4_addrs{GetAddressesUnsafe(/*max_addresses=*/0, /*max_pct=*/0, Network::NET_IPV4, /*filtered=*/false)};
 4282|  9.89k|    const std::vector<CAddress> v6_addrs{GetAddressesUnsafe(/*max_addresses=*/0, /*max_pct=*/0, Network::NET_IPV6, /*filtered=*/false)};
 4283|  9.89k|    std::vector<CNetAddr> clearnet_addrs;
 4284|  9.89k|    clearnet_addrs.reserve(v4_addrs.size() + v6_addrs.size());
 4285|  9.89k|    std::transform(v4_addrs.begin(), v4_addrs.end(), std::back_inserter(clearnet_addrs),
 4286|  9.89k|        [](const CAddress& addr) { return static_cast<CNetAddr>(addr); });
 4287|  9.89k|    std::transform(v6_addrs.begin(), v6_addrs.end(), std::back_inserter(clearnet_addrs),
 4288|  9.89k|        [](const CAddress& addr) { return static_cast<CNetAddr>(addr); });
 4289|  9.89k|    m_netgroupman.ASMapHealthCheck(clearnet_addrs);
 4290|  9.89k|}
net.cpp:_ZZNK8CConnman22AlreadyConnectedToHostENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEENK3$_0clEP5CNode:
  344|  28.0k|    return std::ranges::any_of(m_nodes, [&host](CNode* node) { return node->m_addr_name == host; });
net.cpp:_ZZNK8CConnman29AlreadyConnectedToAddressPortERK8CServiceENK3$_0clEP5CNode:
  350|  96.0k|    return std::ranges::any_of(m_nodes, [&addr_port](CNode* node) { return node->addr == addr_port; });
net.cpp:_ZZNK8CConnman25AlreadyConnectedToAddressERK8CNetAddrENK3$_0clEP5CNode:
  356|   103k|    return std::ranges::any_of(m_nodes, [&addr](CNode* node) { return node->addr == addr; });
net.cpp:_ZN12_GLOBAL__N_121GenerateRandomGarbageEv:
  984|   256k|{
  985|   256k|    std::vector<uint8_t> ret;
  986|   256k|    FastRandomContext rng;
  987|   256k|    ret.resize(rng.randrange(V2Transport::MAX_GARBAGE_LEN + 1));
  988|   256k|    rng.fillrand(MakeWritableByteSpan(ret));
  989|   256k|    return ret;
  990|   256k|}
_ZN11CNetCleanupD2Ev:
 3676|      2|    {
 3677|       |#ifdef WIN32
 3678|       |        // Shutdown Windows Sockets
 3679|       |        WSACleanup();
 3680|       |#endif
 3681|      2|    }
net.cpp:_ZZN8CConnman14DisconnectNodeENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEENK3$_0clEP5CNode:
 3914|  25.2M|    auto it = std::ranges::find_if(m_nodes, [&strNode](CNode* node) { return node->m_addr_name == strNode; });
net.cpp:_ZL13MakeTransportlbb:
 4064|   388k|{
 4065|   388k|    if (use_v2transport) {
  ------------------
  |  Branch (4065:9): [True: 256k, False: 132k]
  ------------------
 4066|   256k|        return std::make_unique<V2Transport>(id, /*initiating=*/!inbound);
 4067|   256k|    } else {
 4068|   132k|        return std::make_unique<V1Transport>(id);
 4069|   132k|    }
 4070|   388k|}
net.cpp:_ZL42IsOutboundMessageAllowedInPrivateBroadcastNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
 4155|  17.3k|{
 4156|  17.3k|    return type == NetMsgType::VERSION ||
  ------------------
  |  Branch (4156:12): [True: 73, False: 17.2k]
  ------------------
 4157|  17.2k|           type == NetMsgType::VERACK ||
  ------------------
  |  Branch (4157:12): [True: 46, False: 17.2k]
  ------------------
 4158|  17.2k|           type == NetMsgType::INV ||
  ------------------
  |  Branch (4158:12): [True: 38, False: 17.1k]
  ------------------
 4159|  17.1k|           type == NetMsgType::TX ||
  ------------------
  |  Branch (4159:12): [True: 12, False: 17.1k]
  ------------------
 4160|  17.1k|           type == NetMsgType::PING;
  ------------------
  |  Branch (4160:12): [True: 7, False: 17.1k]
  ------------------
 4161|  17.3k|}
net.cpp:_ZZN8CConnman16ASMapHealthCheckEvENK3$_0clERK8CAddress:
 4286|    156|        [](const CAddress& addr) { return static_cast<CNetAddr>(addr); });
net.cpp:_ZZN8CConnman16ASMapHealthCheckEvENK3$_1clERK8CAddress:
 4288|  2.05k|        [](const CAddress& addr) { return static_cast<CNetAddr>(addr); });

_ZN5CNode6AddRefEv:
  968|  2.35M|    {
  969|  2.35M|        nRefCount++;
  970|  2.35M|        return this;
  971|  2.35M|    }
_ZN9TransportD2Ev:
  265|   645k|    virtual ~Transport() = default;
_ZN11V1Transport5ResetEv:
  395|   393k|    void Reset() EXCLUSIVE_LOCKS_REQUIRED(m_recv_mutex) {
  396|   393k|        AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|   393k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  397|   393k|        vRecv.clear();
  398|   393k|        hdrbuf.clear();
  399|   393k|        hdrbuf.resize(24);
  400|   393k|        in_data = false;
  401|   393k|        nHdrPos = 0;
  402|   393k|        nDataPos = 0;
  403|   393k|        data_hash.SetNull();
  404|   393k|        hasher.Reset();
  405|   393k|    }
_ZNK11V1Transport16CompleteInternalEv:
  408|  1.29k|    {
  409|  1.29k|        AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  144|  1.29k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  410|  1.29k|        if (!in_data) return false;
  ------------------
  |  Branch (410:13): [True: 231, False: 1.06k]
  ------------------
  411|  1.06k|        return hdr.nMessageSize == nDataPos;
  412|  1.29k|    }
_ZN11CNetMessageC2EO10DataStream:
  248|    335|    explicit CNetMessage(DataStream&& recv_in) : m_recv(std::move(recv_in)) {}
_ZNK11V1Transport23ReceivedMessageCompleteEv:
  429|    963|    {
  430|    963|        AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|    963|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  431|    963|        return WITH_LOCK(m_recv_mutex, return CompleteInternal());
  ------------------
  |  |  299|    963|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  432|    963|    }
_ZN11V1Transport13ReceivedBytesERNSt3__14spanIKhLm18446744073709551615EEE:
  437|  5.16k|    {
  438|  5.16k|        AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  149|  5.16k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  439|  5.16k|        LOCK(m_recv_mutex);
  ------------------
  |  |  268|  5.16k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.16k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.16k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.16k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  440|  5.16k|        int ret = in_data ? readData(msg_bytes) : readHeader(msg_bytes);
  ------------------
  |  Branch (440:19): [True: 324, False: 4.83k]
  ------------------
  441|  5.16k|        if (ret < 0) {
  ------------------
  |  Branch (441:13): [True: 4.19k, False: 963]
  ------------------
  442|  4.19k|            Reset();
  443|  4.19k|        } else {
  444|    963|            msg_bytes = msg_bytes.subspan(ret);
  445|    963|        }
  446|  5.16k|        return ret >= 0;
  447|  5.16k|    }
_ZN5CNode19AccountForSentBytesERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
  774|   114k|    {
  775|   114k|        mapSendBytesPerMsgType[msg_type] += sent_bytes;
  776|   114k|    }
_ZNK8CConnman12ListenSocket24AddSocketPermissionFlagsER18NetPermissionFlags:
 1436|  2.55k|        inline void AddSocketPermissionFlags(NetPermissionFlags& flags) const { NetPermissions::AddFlag(flags, m_permissions); }
_ZNK5CNode26IsManualOrFullOutboundConnEv:
  803|  48.7k|    {
  804|  48.7k|        switch (m_conn_type) {
  ------------------
  |  Branch (804:17): [True: 48.7k, False: 0]
  ------------------
  805|  21.8k|        case ConnectionType::INBOUND:
  ------------------
  |  Branch (805:9): [True: 21.8k, False: 26.9k]
  ------------------
  806|  24.4k|        case ConnectionType::FEELER:
  ------------------
  |  Branch (806:9): [True: 2.63k, False: 46.1k]
  ------------------
  807|  30.0k|        case ConnectionType::BLOCK_RELAY:
  ------------------
  |  Branch (807:9): [True: 5.58k, False: 43.2k]
  ------------------
  808|  33.2k|        case ConnectionType::ADDR_FETCH:
  ------------------
  |  Branch (808:9): [True: 3.25k, False: 45.5k]
  ------------------
  809|  38.9k|        case ConnectionType::PRIVATE_BROADCAST:
  ------------------
  |  Branch (809:9): [True: 5.66k, False: 43.1k]
  ------------------
  810|  38.9k|                return false;
  811|  2.47k|        case ConnectionType::OUTBOUND_FULL_RELAY:
  ------------------
  |  Branch (811:9): [True: 2.47k, False: 46.3k]
  ------------------
  812|  9.82k|        case ConnectionType::MANUAL:
  ------------------
  |  Branch (812:9): [True: 7.34k, False: 41.4k]
  ------------------
  813|  9.82k|                return true;
  814|  48.7k|        } // no default case, so the compiler can warn about missing cases
  815|       |
  816|  48.7k|        assert(false);
  ------------------
  |  Branch (816:9): [Folded, False: 0]
  ------------------
  817|      0|    }
_ZN5CNode7ReleaseEv:
  974|  2.02M|    {
  975|  2.02M|        nRefCount--;
  976|  2.02M|    }
_ZN8CConnman13NodesSnapshotC2ERKS_b:
 1870|  28.6k|        {
 1871|  28.6k|            {
 1872|  28.6k|                LOCK(connman.m_nodes_mutex);
  ------------------
  |  |  268|  28.6k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  28.6k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  28.6k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  28.6k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1873|  28.6k|                m_nodes_copy = connman.m_nodes;
 1874|  2.02M|                for (auto& node : m_nodes_copy) {
  ------------------
  |  Branch (1874:33): [True: 2.02M, False: 28.6k]
  ------------------
 1875|  2.02M|                    node->AddRef();
 1876|  2.02M|                }
 1877|  28.6k|            }
 1878|  28.6k|            if (shuffle) {
  ------------------
  |  Branch (1878:17): [True: 0, False: 28.6k]
  ------------------
 1879|      0|                std::shuffle(m_nodes_copy.begin(), m_nodes_copy.end(), FastRandomContext{});
 1880|      0|            }
 1881|  28.6k|        }
_ZNK8CConnman13NodesSnapshot5NodesEv:
 1891|  57.3k|        {
 1892|  57.3k|            return m_nodes_copy;
 1893|  57.3k|        }
_ZN8CConnman13NodesSnapshotD2Ev:
 1884|  28.6k|        {
 1885|  2.02M|            for (auto& node : m_nodes_copy) {
  ------------------
  |  Branch (1885:29): [True: 2.02M, False: 28.6k]
  ------------------
 1886|  2.02M|                node->Release();
 1887|  2.02M|            }
 1888|  28.6k|        }
_ZN8CConnman12ListenSocketC2ENSt3__110shared_ptrI4SockEE18NetPermissionFlags:
 1438|  8.91k|            : sock{sock_}, m_permissions{permissions_}
 1439|  8.91k|        {
 1440|  8.91k|        }
_ZN8CConnman4InitERKNS_7OptionsE:
 1119|  19.7k|    {
 1120|  19.7k|        AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  149|  19.7k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1121|       |
 1122|  19.7k|        m_local_services = connOptions.m_local_services;
 1123|  19.7k|        m_max_automatic_connections = connOptions.m_max_automatic_connections;
 1124|  19.7k|        m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, m_max_automatic_connections);
 1125|  19.7k|        m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, m_max_automatic_connections - m_max_outbound_full_relay);
 1126|  19.7k|        m_max_automatic_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + m_max_feeler;
 1127|  19.7k|        m_max_inbound = std::max(0, m_max_automatic_connections - m_max_automatic_outbound);
 1128|  19.7k|        m_max_inbound_full_relay = std::max(0, static_cast<int>(connOptions.m_full_relay_inbound_percent / 100.0 * m_max_inbound));
 1129|  19.7k|        m_use_addrman_outgoing = connOptions.m_use_addrman_outgoing;
 1130|  19.7k|        m_client_interface = connOptions.uiInterface;
 1131|  19.7k|        m_banman = connOptions.m_banman;
 1132|  19.7k|        m_msgproc = connOptions.m_msgproc;
 1133|  19.7k|        nSendBufferMaxSize = connOptions.nSendBufferMaxSize;
 1134|  19.7k|        nReceiveFloodSize = connOptions.nReceiveFloodSize;
 1135|  19.7k|        m_peer_connect_timeout = std::chrono::seconds{connOptions.m_peer_connect_timeout};
 1136|  19.7k|        {
 1137|  19.7k|            LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  268|  19.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  19.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  19.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  19.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1138|  19.7k|            nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
 1139|  19.7k|        }
 1140|  19.7k|        vWhitelistedRangeIncoming = connOptions.vWhitelistedRangeIncoming;
 1141|  19.7k|        vWhitelistedRangeOutgoing = connOptions.vWhitelistedRangeOutgoing;
 1142|  19.7k|        {
 1143|  19.7k|            LOCK(m_added_nodes_mutex);
  ------------------
  |  |  268|  19.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  19.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  19.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  19.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1144|       |            // Attempt v2 connection if we support v2 - we'll reconnect with v1 if our
 1145|       |            // peer doesn't support it or immediately disconnects us for another reason.
 1146|  19.7k|            const bool use_v2transport(GetLocalServices() & NODE_P2P_V2);
 1147|  19.7k|            for (const std::string& added_node : connOptions.m_added_nodes) {
  ------------------
  |  Branch (1147:48): [True: 0, False: 19.7k]
  ------------------
 1148|      0|                m_added_node_params.push_back({added_node, use_v2transport});
 1149|      0|            }
 1150|  19.7k|        }
 1151|  19.7k|        m_onion_binds = connOptions.onion_binds;
 1152|  19.7k|        whitelist_forcerelay = connOptions.whitelist_forcerelay;
 1153|  19.7k|        whitelist_relay = connOptions.whitelist_relay;
 1154|  19.7k|        m_capture_messages = connOptions.m_capture_messages;
 1155|  19.7k|    }
_ZN8CConnman4StopEv:
 1175|  9.89k|    {
 1176|  9.89k|        AssertLockNotHeld(m_nodes_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1177|  9.89k|        AssertLockNotHeld(m_reconnections_mutex);
  ------------------
  |  |  149|  9.89k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1178|  9.89k|        StopThreads();
 1179|  9.89k|        StopNodes();
 1180|  9.89k|    };
_ZN11CNetMessageC2EOS_:
  253|     72|    CNetMessage(CNetMessage&&) = default;
_ZNK5CNode5GetIdEv:
  928|   263M|    NodeId GetId() const {
  929|   263M|        return id;
  930|   263M|    }
_ZN17CSerializedNetMsgC2EOS_:
  124|   120k|    CSerializedNetMsg(CSerializedNetMsg&&) = default;
_ZN8CConnman11ForEachNodeERKNSt3__18functionIFvP5CNodeEEE:
 1286|  9.89k|    {
 1287|  9.89k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1288|   379k|        for (auto&& node : m_nodes) {
  ------------------
  |  Branch (1288:26): [True: 379k, False: 9.89k]
  ------------------
 1289|   379k|            if (NodeFullyConnected(node))
  ------------------
  |  Branch (1289:17): [True: 41.8k, False: 337k]
  ------------------
 1290|  41.8k|                func(node);
 1291|   379k|        }
 1292|  9.89k|    };
_ZNK5CNode18IsFullOutboundConnEv:
  794|  85.7k|    bool IsFullOutboundConn() const {
  795|  85.7k|        return m_conn_type == ConnectionType::OUTBOUND_FULL_RELAY;
  796|  85.7k|    }
_ZNK8CConnman21GetUseAddrmanOutgoingEv:
 1184|  9.89k|    bool GetUseAddrmanOutgoing() const { return m_use_addrman_outgoing; };
_ZNK5CNode13IsInboundConnEv:
  843|   280M|    bool IsInboundConn() const {
  844|   280M|        return m_conn_type == ConnectionType::INBOUND;
  845|   280M|    }
_ZNK5CNode22IsPrivateBroadcastConnEv:
  832|   138k|    {
  833|   138k|        return m_conn_type == ConnectionType::PRIVATE_BROADCAST;
  834|   138k|    }
_ZNK5CNode13HasPermissionE18NetPermissionFlags:
  738|  41.6M|    bool HasPermission(NetPermissionFlags permission) const {
  739|  41.6M|        return NetPermissions::HasFlag(m_permission_flags, permission);
  740|  41.6M|    }
_ZNK5CNode13GetLocalNonceEv:
  932|    556|    uint64_t GetLocalNonce() const {
  933|    556|        return nLocalHostNonce;
  934|    556|    }
_ZNK5CNode22ConnectionTypeAsStringEv:
  982|  41.8k|    std::string ConnectionTypeAsString() const { return ::ConnectionTypeAsString(m_conn_type); }
_ZN17CSerializedNetMsgaSEOS_:
  125|  86.7k|    CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;
_ZN8CConnman19RemoveLocalServicesE12ServiceFlags:
 1403|  1.99k|    void RemoveLocalServices(ServiceFlags services) { m_local_services = ServiceFlags(m_local_services & ~services); }
_ZN8CConnman16AddLocalServicesE12ServiceFlags:
 1402|  1.99k|    void AddLocalServices(ServiceFlags services) { m_local_services = ServiceFlags(m_local_services | services); };
_ZNK8CConnman16GetNetworkActiveEv:
 1183|  12.8k|    bool GetNetworkActive() const { return fNetworkActive; };
_ZN17CSerializedNetMsgC2Ev:
  123|   527k|    CSerializedNetMsg() = default;

_ZN14NetPermissions7AddFlagER18NetPermissionFlagsS0_:
   66|  49.9k|    {
   67|  49.9k|        flags = flags | f;
   68|  49.9k|    }
_Zor18NetPermissionFlagsS_:
   50|  49.9k|{
   51|  49.9k|    using t = std::underlying_type_t<NetPermissionFlags>;
   52|  49.9k|    return static_cast<NetPermissionFlags>(static_cast<t>(a) | static_cast<t>(b));
   53|  49.9k|}
_ZN14NetPermissions9ClearFlagER18NetPermissionFlagsS0_:
   75|  8.23k|    {
   76|  8.23k|        assert(f == NetPermissionFlags::Implicit);
  ------------------
  |  Branch (76:9): [True: 8.23k, False: 0]
  ------------------
   77|  8.23k|        using t = std::underlying_type_t<NetPermissionFlags>;
   78|  8.23k|        flags = static_cast<NetPermissionFlags>(static_cast<t>(flags) & ~static_cast<t>(f));
   79|  8.23k|    }
_ZN14NetPermissions7HasFlagE18NetPermissionFlagsS0_:
   61|  42.6M|    {
   62|  42.6M|        using t = std::underlying_type_t<NetPermissionFlags>;
   63|  42.6M|        return (static_cast<t>(flags) & static_cast<t>(f)) == static_cast<t>(f);
   64|  42.6M|    }

_ZN11PeerManagerD2Ev:
  117|      2|    virtual ~PeerManager() = default;

_ZN8CNetAddr23SetNetFromBIP155NetworkEhm:
   50|  1.45M|{
   51|  1.45M|    switch (possible_bip155_net) {
  ------------------
  |  Branch (51:13): [True: 1.27M, False: 178k]
  ------------------
   52|  93.9k|    case BIP155Network::IPV4:
  ------------------
  |  Branch (52:5): [True: 93.9k, False: 1.35M]
  ------------------
   53|  93.9k|        if (address_size == ADDR_IPV4_SIZE) {
  ------------------
  |  Branch (53:13): [True: 93.8k, False: 6]
  ------------------
   54|  93.8k|            m_net = NET_IPV4;
   55|  93.8k|            return true;
   56|  93.8k|        }
   57|      6|        throw std::ios_base::failure(
   58|      6|            strprintf("BIP155 IPv4 address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      6|#define strprintf tfm::format
  ------------------
   59|      6|                      ADDR_IPV4_SIZE));
   60|   798k|    case BIP155Network::IPV6:
  ------------------
  |  Branch (60:5): [True: 798k, False: 654k]
  ------------------
   61|   798k|        if (address_size == ADDR_IPV6_SIZE) {
  ------------------
  |  Branch (61:13): [True: 798k, False: 5]
  ------------------
   62|   798k|            m_net = NET_IPV6;
   63|   798k|            return true;
   64|   798k|        }
   65|      5|        throw std::ios_base::failure(
   66|      5|            strprintf("BIP155 IPv6 address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
   67|      5|                      ADDR_IPV6_SIZE));
   68|  28.9k|    case BIP155Network::TORV3:
  ------------------
  |  Branch (68:5): [True: 28.9k, False: 1.42M]
  ------------------
   69|  28.9k|        if (address_size == ADDR_TORV3_SIZE) {
  ------------------
  |  Branch (69:13): [True: 28.9k, False: 5]
  ------------------
   70|  28.9k|            m_net = NET_ONION;
   71|  28.9k|            return true;
   72|  28.9k|        }
   73|      5|        throw std::ios_base::failure(
   74|      5|            strprintf("BIP155 TORv3 address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
   75|      5|                      ADDR_TORV3_SIZE));
   76|   337k|    case BIP155Network::I2P:
  ------------------
  |  Branch (76:5): [True: 337k, False: 1.11M]
  ------------------
   77|   337k|        if (address_size == ADDR_I2P_SIZE) {
  ------------------
  |  Branch (77:13): [True: 337k, False: 4]
  ------------------
   78|   337k|            m_net = NET_I2P;
   79|   337k|            return true;
   80|   337k|        }
   81|      4|        throw std::ios_base::failure(
   82|      4|            strprintf("BIP155 I2P address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      4|#define strprintf tfm::format
  ------------------
   83|      4|                      ADDR_I2P_SIZE));
   84|  15.7k|    case BIP155Network::CJDNS:
  ------------------
  |  Branch (84:5): [True: 15.7k, False: 1.43M]
  ------------------
   85|  15.7k|        if (address_size == ADDR_CJDNS_SIZE) {
  ------------------
  |  Branch (85:13): [True: 15.7k, False: 2]
  ------------------
   86|  15.7k|            m_net = NET_CJDNS;
   87|  15.7k|            return true;
   88|  15.7k|        }
   89|      2|        throw std::ios_base::failure(
   90|      2|            strprintf("BIP155 CJDNS address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
   91|      2|                      ADDR_CJDNS_SIZE));
   92|  1.45M|    }
   93|       |
   94|       |    // Don't throw on addresses with unknown network ids (maybe from the future).
   95|       |    // Instead silently drop them and have the unserialization code consume
   96|       |    // subsequent ones which may be known to us.
   97|   178k|    return false;
   98|  1.45M|}
_ZN8CNetAddrC2Ev:
  105|  7.31M|CNetAddr::CNetAddr() = default;
_ZN8CNetAddr13SetLegacyIPv6ENSt3__14spanIKhLm18446744073709551615EEE:
  139|   294k|{
  140|   294k|    assert(ipv6.size() == ADDR_IPV6_SIZE);
  ------------------
  |  Branch (140:5): [True: 294k, False: 0]
  ------------------
  141|       |
  142|   294k|    size_t skip{0};
  143|       |
  144|   294k|    if (HasPrefix(ipv6, IPV4_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (144:9): [True: 2.01k, False: 292k]
  ------------------
  145|       |        // IPv4-in-IPv6
  146|  2.01k|        m_net = NET_IPV4;
  147|  2.01k|        skip = sizeof(IPV4_IN_IPV6_PREFIX);
  148|   292k|    } else if (HasPrefix(ipv6, TORV2_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (148:16): [True: 103, False: 292k]
  ------------------
  149|       |        // TORv2-in-IPv6 (unsupported). Unserialize as !IsValid(), thus ignoring them.
  150|       |        // Mimic a default-constructed CNetAddr object which is !IsValid() and thus
  151|       |        // will not be gossiped, but continue reading next addresses from the stream.
  152|    103|        m_net = NET_IPV6;
  153|    103|        m_addr.assign(ADDR_IPV6_SIZE, 0x0);
  154|    103|        return;
  155|   292k|    } else if (HasPrefix(ipv6, INTERNAL_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (155:16): [True: 986, False: 291k]
  ------------------
  156|       |        // Internal-in-IPv6
  157|    986|        m_net = NET_INTERNAL;
  158|    986|        skip = sizeof(INTERNAL_IN_IPV6_PREFIX);
  159|   291k|    } else {
  160|       |        // IPv6
  161|   291k|        m_net = NET_IPV6;
  162|   291k|    }
  163|       |
  164|   294k|    m_addr.assign(ipv6.begin() + skip, ipv6.end());
  165|   294k|}
_ZN8CNetAddr11SetInternalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  174|  72.9k|{
  175|  72.9k|    if (name.empty()) {
  ------------------
  |  Branch (175:9): [True: 14, False: 72.9k]
  ------------------
  176|     14|        return false;
  177|     14|    }
  178|  72.9k|    m_net = NET_INTERNAL;
  179|  72.9k|    unsigned char hash[32] = {};
  180|  72.9k|    CSHA256().Write((const unsigned char*)name.data(), name.size()).Finalize(hash);
  181|  72.9k|    m_addr.assign(hash, hash + ADDR_INTERNAL_SIZE);
  182|  72.9k|    return true;
  183|  72.9k|}
_ZN8CNetAddr10SetSpecialENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  213|   201k|{
  214|   201k|    if (ContainsNUL(addr)) {
  ------------------
  |  Branch (214:9): [True: 92.1k, False: 109k]
  ------------------
  215|  92.1k|        return false;
  216|  92.1k|    }
  217|       |
  218|   109k|    if (SetTor(addr)) {
  ------------------
  |  Branch (218:9): [True: 4.78k, False: 104k]
  ------------------
  219|  4.78k|        return true;
  220|  4.78k|    }
  221|       |
  222|   104k|    if (SetI2P(addr)) {
  ------------------
  |  Branch (222:9): [True: 6.70k, False: 97.8k]
  ------------------
  223|  6.70k|        return true;
  224|  6.70k|    }
  225|       |
  226|  97.8k|    return false;
  227|   104k|}
_ZN8CNetAddr6SetTorENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  230|   109k|{
  231|   109k|    if (!addr.ends_with(".onion")) return false;
  ------------------
  |  Branch (231:9): [True: 102k, False: 6.72k]
  ------------------
  232|  6.72k|    addr.remove_suffix(6);
  233|  6.72k|    auto input = DecodeBase32(addr);
  234|       |
  235|  6.72k|    if (!input) {
  ------------------
  |  Branch (235:9): [True: 1.11k, False: 5.60k]
  ------------------
  236|  1.11k|        return false;
  237|  1.11k|    }
  238|       |
  239|  5.60k|    if (input->size() == torv3::TOTAL_LEN) {
  ------------------
  |  Branch (239:9): [True: 5.39k, False: 214]
  ------------------
  240|  5.39k|        std::span<const uint8_t> input_pubkey{input->data(), ADDR_TORV3_SIZE};
  241|  5.39k|        std::span<const uint8_t> input_checksum{input->data() + ADDR_TORV3_SIZE, torv3::CHECKSUM_LEN};
  242|  5.39k|        std::span<const uint8_t> input_version{input->data() + ADDR_TORV3_SIZE + torv3::CHECKSUM_LEN, sizeof(torv3::VERSION)};
  243|       |
  244|  5.39k|        if (!std::ranges::equal(input_version, torv3::VERSION)) {
  ------------------
  |  Branch (244:13): [True: 200, False: 5.19k]
  ------------------
  245|    200|            return false;
  246|    200|        }
  247|       |
  248|  5.19k|        uint8_t calculated_checksum[torv3::CHECKSUM_LEN];
  249|  5.19k|        torv3::Checksum(input_pubkey, calculated_checksum);
  250|       |
  251|  5.19k|        if (!std::ranges::equal(input_checksum, calculated_checksum)) {
  ------------------
  |  Branch (251:13): [True: 405, False: 4.78k]
  ------------------
  252|    405|            return false;
  253|    405|        }
  254|       |
  255|  4.78k|        m_net = NET_ONION;
  256|  4.78k|        m_addr.assign(input_pubkey.begin(), input_pubkey.end());
  257|  4.78k|        return true;
  258|  5.19k|    }
  259|       |
  260|    214|    return false;
  261|  5.60k|}
_ZN8CNetAddr6SetI2PENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  264|   104k|{
  265|       |    // I2P addresses that we support consist of 52 base32 characters + ".b32.i2p".
  266|   104k|    static constexpr size_t b32_len{52};
  267|   104k|    static const char* suffix{".b32.i2p"};
  268|   104k|    static constexpr size_t suffix_len{8};
  269|       |
  270|   104k|    if (addr.size() != b32_len + suffix_len || ToLower(addr.substr(b32_len)) != suffix) {
  ------------------
  |  Branch (270:9): [True: 97.0k, False: 7.56k]
  |  Branch (270:9): [True: 97.5k, False: 7.07k]
  |  Branch (270:48): [True: 486, False: 7.07k]
  ------------------
  271|  97.5k|        return false;
  272|  97.5k|    }
  273|       |
  274|       |    // Remove the ".b32.i2p" suffix and pad to a multiple of 8 chars, so DecodeBase32()
  275|       |    // can decode it.
  276|  7.07k|    const std::string b32_padded{tfm::format("%s====", addr.substr(0, b32_len))};
  277|       |
  278|  7.07k|    auto address_bytes = DecodeBase32(b32_padded);
  279|       |
  280|  7.07k|    if (!address_bytes || address_bytes->size() != ADDR_I2P_SIZE) {
  ------------------
  |  Branch (280:9): [True: 307, False: 6.77k]
  |  Branch (280:27): [True: 68, False: 6.70k]
  ------------------
  281|    375|        return false;
  282|    375|    }
  283|       |
  284|  6.70k|    m_net = NET_I2P;
  285|  6.70k|    m_addr.assign(address_bytes->begin(), address_bytes->end());
  286|       |
  287|  6.70k|    return true;
  288|  7.07k|}
_ZN8CNetAddrC2ERK7in_addr:
  291|  7.13k|{
  292|  7.13k|    m_net = NET_IPV4;
  293|  7.13k|    const uint8_t* ptr = reinterpret_cast<const uint8_t*>(&ipv4Addr);
  294|  7.13k|    m_addr.assign(ptr, ptr + ADDR_IPV4_SIZE);
  295|  7.13k|}
_ZN8CNetAddrC2ERK8in6_addrj:
  298|  8.77k|{
  299|  8.77k|    SetLegacyIPv6({reinterpret_cast<const uint8_t*>(&ipv6Addr), sizeof(ipv6Addr)});
  300|  8.77k|    m_scope_id = scope;
  301|  8.77k|}
_ZNK8CNetAddr9IsRFC1918Ev:
  312|  75.7M|{
  313|  75.7M|    return IsIPv4() && (
  ------------------
  |  Branch (313:12): [True: 4.62M, False: 71.0M]
  ------------------
  314|  4.62M|        m_addr[0] == 10 ||
  ------------------
  |  Branch (314:9): [True: 3.07k, False: 4.62M]
  ------------------
  315|  4.62M|        (m_addr[0] == 192 && m_addr[1] == 168) ||
  ------------------
  |  Branch (315:10): [True: 38.4k, False: 4.58M]
  |  Branch (315:30): [True: 81, False: 38.3k]
  ------------------
  316|  4.62M|        (m_addr[0] == 172 && m_addr[1] >= 16 && m_addr[1] <= 31));
  ------------------
  |  Branch (316:10): [True: 630, False: 4.62M]
  |  Branch (316:30): [True: 404, False: 226]
  |  Branch (316:49): [True: 32, False: 372]
  ------------------
  317|  75.7M|}
_ZNK8CNetAddr9IsRFC2544Ev:
  320|  75.7M|{
  321|  75.7M|    return IsIPv4() && m_addr[0] == 198 && (m_addr[1] == 18 || m_addr[1] == 19);
  ------------------
  |  Branch (321:12): [True: 4.62M, False: 71.0M]
  |  Branch (321:24): [True: 3.48k, False: 4.61M]
  |  Branch (321:45): [True: 206, False: 3.27k]
  |  Branch (321:64): [True: 794, False: 2.48k]
  ------------------
  322|  75.7M|}
_ZNK8CNetAddr9IsRFC3927Ev:
  325|  75.7M|{
  326|  75.7M|    return IsIPv4() && HasPrefix(m_addr, std::array<uint8_t, 2>{169, 254});
  ------------------
  |  Branch (326:12): [True: 4.62M, False: 71.0M]
  |  Branch (326:24): [True: 801, False: 4.62M]
  ------------------
  327|  75.7M|}
_ZNK8CNetAddr9IsRFC6598Ev:
  330|  75.6M|{
  331|  75.6M|    return IsIPv4() && m_addr[0] == 100 && m_addr[1] >= 64 && m_addr[1] <= 127;
  ------------------
  |  Branch (331:12): [True: 4.62M, False: 71.0M]
  |  Branch (331:24): [True: 24.3k, False: 4.59M]
  |  Branch (331:44): [True: 15.0k, False: 9.31k]
  |  Branch (331:63): [True: 2.73k, False: 12.3k]
  ------------------
  332|  75.6M|}
_ZNK8CNetAddr9IsRFC5737Ev:
  335|  75.6M|{
  336|  75.6M|    return IsIPv4() && (HasPrefix(m_addr, std::array<uint8_t, 3>{192, 0, 2}) ||
  ------------------
  |  Branch (336:12): [True: 4.61M, False: 71.0M]
  |  Branch (336:25): [True: 347, False: 4.61M]
  ------------------
  337|  4.61M|                        HasPrefix(m_addr, std::array<uint8_t, 3>{198, 51, 100}) ||
  ------------------
  |  Branch (337:25): [True: 275, False: 4.61M]
  ------------------
  338|  4.61M|                        HasPrefix(m_addr, std::array<uint8_t, 3>{203, 0, 113}));
  ------------------
  |  Branch (338:25): [True: 112, False: 4.61M]
  ------------------
  339|  75.6M|}
_ZNK8CNetAddr9IsRFC3849Ev:
  342|  83.5M|{
  343|  83.5M|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 4>{0x20, 0x01, 0x0D, 0xB8});
  ------------------
  |  Branch (343:12): [True: 72.8M, False: 10.7M]
  |  Branch (343:24): [True: 302, False: 72.8M]
  ------------------
  344|  83.5M|}
_ZNK8CNetAddr9IsRFC3964Ev:
  347|  35.5M|{
  348|  35.5M|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 2>{0x20, 0x02});
  ------------------
  |  Branch (348:12): [True: 33.8M, False: 1.64M]
  |  Branch (348:24): [True: 1.69k, False: 33.8M]
  ------------------
  349|  35.5M|}
_ZNK8CNetAddr9IsRFC6052Ev:
  352|  35.5M|{
  353|  35.5M|    return IsIPv6() &&
  ------------------
  |  Branch (353:12): [True: 33.8M, False: 1.64M]
  ------------------
  354|  33.8M|           HasPrefix(m_addr, std::array<uint8_t, 12>{0x00, 0x64, 0xFF, 0x9B, 0x00, 0x00,
  ------------------
  |  Branch (354:12): [True: 2.32k, False: 33.8M]
  ------------------
  355|  33.8M|                                                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00});
  356|  35.5M|}
_ZNK8CNetAddr9IsRFC4380Ev:
  359|  35.5M|{
  360|  35.5M|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 4>{0x20, 0x01, 0x00, 0x00});
  ------------------
  |  Branch (360:12): [True: 33.8M, False: 1.64M]
  |  Branch (360:24): [True: 8.30k, False: 33.8M]
  ------------------
  361|  35.5M|}
_ZNK8CNetAddr9IsRFC4862Ev:
  364|  75.6M|{
  365|  75.6M|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 8>{0xFE, 0x80, 0x00, 0x00,
  ------------------
  |  Branch (365:12): [True: 67.7M, False: 7.92M]
  |  Branch (365:24): [True: 3.38k, False: 67.7M]
  ------------------
  366|  67.7M|                                                                0x00, 0x00, 0x00, 0x00});
  367|  75.6M|}
_ZNK8CNetAddr9IsRFC4193Ev:
  370|  75.6M|{
  371|  75.6M|    return IsIPv6() && (m_addr[0] & 0xFE) == 0xFC;
  ------------------
  |  Branch (371:12): [True: 67.7M, False: 7.92M]
  |  Branch (371:24): [True: 26.7k, False: 67.7M]
  ------------------
  372|  75.6M|}
_ZNK8CNetAddr9IsRFC6145Ev:
  375|  35.5M|{
  376|  35.5M|    return IsIPv6() &&
  ------------------
  |  Branch (376:12): [True: 33.8M, False: 1.64M]
  ------------------
  377|  33.8M|           HasPrefix(m_addr, std::array<uint8_t, 12>{0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  ------------------
  |  Branch (377:12): [True: 7.44k, False: 33.8M]
  ------------------
  378|  33.8M|                                                     0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00});
  379|  35.5M|}
_ZNK8CNetAddr9IsRFC4843Ev:
  382|  75.6M|{
  383|  75.6M|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 3>{0x20, 0x01, 0x00}) &&
  ------------------
  |  Branch (383:12): [True: 67.7M, False: 7.92M]
  |  Branch (383:24): [True: 11.0k, False: 67.7M]
  ------------------
  384|  11.0k|           (m_addr[3] & 0xF0) == 0x10;
  ------------------
  |  Branch (384:12): [True: 619, False: 10.4k]
  ------------------
  385|  75.6M|}
_ZNK8CNetAddr9IsRFC7343Ev:
  388|  75.6M|{
  389|  75.6M|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 3>{0x20, 0x01, 0x00}) &&
  ------------------
  |  Branch (389:12): [True: 67.7M, False: 7.92M]
  |  Branch (389:24): [True: 10.4k, False: 67.7M]
  ------------------
  390|  10.4k|           (m_addr[3] & 0xF0) == 0x20;
  ------------------
  |  Branch (390:12): [True: 633, False: 9.82k]
  ------------------
  391|  75.6M|}
_ZNK8CNetAddr7IsHeNetEv:
  394|   332k|{
  395|   332k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 4>{0x20, 0x01, 0x04, 0x70});
  ------------------
  |  Branch (395:12): [True: 332k, False: 0]
  |  Branch (395:24): [True: 241, False: 332k]
  ------------------
  396|   332k|}
_ZNK8CNetAddr7IsLocalEv:
  399|   117M|{
  400|       |    // IPv4 loopback (127.0.0.0/8 or 0.0.0.0/8)
  401|   117M|    if (IsIPv4() && (m_addr[0] == 127 || m_addr[0] == 0)) {
  ------------------
  |  Branch (401:9): [True: 7.22M, False: 110M]
  |  Branch (401:22): [True: 47.4k, False: 7.17M]
  |  Branch (401:42): [True: 432k, False: 6.74M]
  ------------------
  402|   480k|        return true;
  403|   480k|    }
  404|       |
  405|       |    // IPv6 loopback (::1/128)
  406|   117M|    static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
  407|   117M|    if (IsIPv6() && memcmp(m_addr.data(), pchLocal, sizeof(pchLocal)) == 0) {
  ------------------
  |  Branch (407:9): [True: 105M, False: 11.7M]
  |  Branch (407:21): [True: 2.70k, False: 105M]
  ------------------
  408|  2.70k|        return true;
  409|  2.70k|    }
  410|       |
  411|   117M|    return false;
  412|   117M|}
_ZNK8CNetAddr7IsValidEv:
  425|  90.0M|{
  426|       |    // unspecified IPv6 address (::/128)
  427|  90.0M|    unsigned char ipNone6[16] = {};
  428|  90.0M|    if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) {
  ------------------
  |  Branch (428:9): [True: 79.2M, False: 10.7M]
  |  Branch (428:21): [True: 6.43M, False: 72.8M]
  ------------------
  429|  6.43M|        return false;
  430|  6.43M|    }
  431|       |
  432|  83.5M|    if (IsCJDNS() && !HasCJDNSPrefix()) {
  ------------------
  |  Branch (432:9): [True: 1.21M, False: 82.3M]
  |  Branch (432:22): [True: 489, False: 1.21M]
  ------------------
  433|    489|        return false;
  434|    489|    }
  435|       |
  436|       |    // documentation IPv6 address
  437|  83.5M|    if (IsRFC3849())
  ------------------
  |  Branch (437:9): [True: 302, False: 83.5M]
  ------------------
  438|    302|        return false;
  439|       |
  440|  83.5M|    if (IsInternal())
  ------------------
  |  Branch (440:9): [True: 930k, False: 82.6M]
  ------------------
  441|   930k|        return false;
  442|       |
  443|  82.6M|    if (IsIPv4()) {
  ------------------
  |  Branch (443:9): [True: 5.39M, False: 77.2M]
  ------------------
  444|  5.39M|        const uint32_t addr = ReadBE32(m_addr.data());
  445|  5.39M|        if (addr == INADDR_ANY || addr == INADDR_NONE) {
  ------------------
  |  Branch (445:13): [True: 354k, False: 5.03M]
  |  Branch (445:35): [True: 53.5k, False: 4.98M]
  ------------------
  446|   408k|            return false;
  447|   408k|        }
  448|  5.39M|    }
  449|       |
  450|  82.2M|    return true;
  451|  82.6M|}
_ZNK8CNetAddr10IsRoutableEv:
  463|  81.6M|{
  464|  81.6M|    return IsValid() && !(IsRFC1918() || IsRFC2544() || IsRFC3927() || IsRFC4862() || IsRFC6598() || IsRFC5737() || IsRFC4193() || IsRFC4843() || IsRFC7343() || IsLocal() || IsInternal());
  ------------------
  |  Branch (464:12): [True: 75.7M, False: 5.91M]
  |  Branch (464:27): [True: 3.18k, False: 75.7M]
  |  Branch (464:42): [True: 1.00k, False: 75.7M]
  |  Branch (464:57): [True: 801, False: 75.6M]
  |  Branch (464:72): [True: 3.38k, False: 75.6M]
  |  Branch (464:87): [True: 2.73k, False: 75.6M]
  |  Branch (464:102): [True: 734, False: 75.6M]
  |  Branch (464:117): [True: 26.7k, False: 75.6M]
  |  Branch (464:132): [True: 619, False: 75.6M]
  |  Branch (464:147): [True: 633, False: 75.6M]
  |  Branch (464:162): [True: 121k, False: 75.5M]
  |  Branch (464:175): [True: 0, False: 75.5M]
  ------------------
  465|  81.6M|}
_ZNK8CNetAddr10IsInternalEv:
  473|   203M|{
  474|   203M|   return m_net == NET_INTERNAL;
  475|   203M|}
_ZNK8CNetAddr18IsAddrV1CompatibleEv:
  478|   869k|{
  479|   869k|    switch (m_net) {
  ------------------
  |  Branch (479:13): [True: 869k, False: 0]
  ------------------
  480|  9.47k|    case NET_IPV4:
  ------------------
  |  Branch (480:5): [True: 9.47k, False: 859k]
  ------------------
  481|   820k|    case NET_IPV6:
  ------------------
  |  Branch (481:5): [True: 810k, False: 58.4k]
  ------------------
  482|   826k|    case NET_INTERNAL:
  ------------------
  |  Branch (482:5): [True: 6.32k, False: 863k]
  ------------------
  483|   826k|        return true;
  484|  5.47k|    case NET_ONION:
  ------------------
  |  Branch (484:5): [True: 5.47k, False: 863k]
  ------------------
  485|  38.8k|    case NET_I2P:
  ------------------
  |  Branch (485:5): [True: 33.3k, False: 835k]
  ------------------
  486|  42.6k|    case NET_CJDNS:
  ------------------
  |  Branch (486:5): [True: 3.78k, False: 865k]
  ------------------
  487|  42.6k|        return false;
  488|      0|    case NET_UNROUTABLE: // m_net is never and should not be set to NET_UNROUTABLE
  ------------------
  |  Branch (488:5): [True: 0, False: 869k]
  ------------------
  489|      0|    case NET_MAX:        // m_net is never and should not be set to NET_MAX
  ------------------
  |  Branch (489:5): [True: 0, False: 869k]
  ------------------
  490|      0|        assert(false);
  ------------------
  |  Branch (490:9): [Folded, False: 0]
  ------------------
  491|   869k|    } // no default case, so the compiler can warn about missing cases
  492|       |
  493|   869k|    assert(false);
  ------------------
  |  Branch (493:5): [Folded, False: 0]
  ------------------
  494|      0|}
_ZNK8CNetAddr10GetNetworkEv:
  497|   342k|{
  498|   342k|    if (IsInternal())
  ------------------
  |  Branch (498:9): [True: 1.51k, False: 340k]
  ------------------
  499|  1.51k|        return NET_INTERNAL;
  500|       |
  501|   340k|    if (!IsRoutable())
  ------------------
  |  Branch (501:9): [True: 285k, False: 55.1k]
  ------------------
  502|   285k|        return NET_UNROUTABLE;
  503|       |
  504|  55.1k|    return m_net;
  505|   340k|}
_Z13OnionToStringNSt3__14spanIKhLm18446744073709551615EEE:
  570|  5.88k|{
  571|  5.88k|    uint8_t checksum[torv3::CHECKSUM_LEN];
  572|  5.88k|    torv3::Checksum(addr, checksum);
  573|       |    // TORv3 onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"
  574|  5.88k|    prevector<torv3::TOTAL_LEN, uint8_t> address{addr.begin(), addr.end()};
  575|  5.88k|    address.insert(address.end(), checksum, checksum + torv3::CHECKSUM_LEN);
  576|  5.88k|    address.insert(address.end(), torv3::VERSION, torv3::VERSION + sizeof(torv3::VERSION));
  577|  5.88k|    return EncodeBase32(address) + ".onion";
  578|  5.88k|}
_ZNK8CNetAddr12ToStringAddrEv:
  581|   411k|{
  582|   411k|    switch (m_net) {
  ------------------
  |  Branch (582:13): [True: 411k, False: 0]
  ------------------
  583|  35.9k|    case NET_IPV4:
  ------------------
  |  Branch (583:5): [True: 35.9k, False: 375k]
  ------------------
  584|  35.9k|        return IPv4ToString(m_addr);
  585|   325k|    case NET_IPV6:
  ------------------
  |  Branch (585:5): [True: 325k, False: 85.7k]
  ------------------
  586|   325k|        return IPv6ToString(m_addr, m_scope_id);
  587|  5.88k|    case NET_ONION:
  ------------------
  |  Branch (587:5): [True: 5.88k, False: 405k]
  ------------------
  588|  5.88k|        return OnionToString(m_addr);
  589|  8.92k|    case NET_I2P:
  ------------------
  |  Branch (589:5): [True: 8.92k, False: 402k]
  ------------------
  590|  8.92k|        return EncodeBase32(m_addr, false /* don't pad with = */) + ".b32.i2p";
  591|  7.49k|    case NET_CJDNS:
  ------------------
  |  Branch (591:5): [True: 7.49k, False: 404k]
  ------------------
  592|  7.49k|        return IPv6ToString(m_addr, 0);
  593|  27.4k|    case NET_INTERNAL:
  ------------------
  |  Branch (593:5): [True: 27.4k, False: 384k]
  ------------------
  594|  27.4k|        return EncodeBase32(m_addr) + ".internal";
  595|      0|    case NET_UNROUTABLE: // m_net is never and should not be set to NET_UNROUTABLE
  ------------------
  |  Branch (595:5): [True: 0, False: 411k]
  ------------------
  596|      0|    case NET_MAX:        // m_net is never and should not be set to NET_MAX
  ------------------
  |  Branch (596:5): [True: 0, False: 411k]
  ------------------
  597|      0|        assert(false);
  ------------------
  |  Branch (597:9): [Folded, False: 0]
  ------------------
  598|   411k|    } // no default case, so the compiler can warn about missing cases
  599|       |
  600|   411k|    assert(false);
  ------------------
  |  Branch (600:5): [Folded, False: 0]
  ------------------
  601|      0|}
_ZeqRK8CNetAddrS1_:
  604|  20.4M|{
  605|  20.4M|    return a.m_net == b.m_net && a.m_addr == b.m_addr;
  ------------------
  |  Branch (605:12): [True: 18.9M, False: 1.46M]
  |  Branch (605:34): [True: 7.83M, False: 11.1M]
  ------------------
  606|  20.4M|}
_ZltRK8CNetAddrS1_:
  609|  46.9M|{
  610|  46.9M|    return std::tie(a.m_net, a.m_addr) < std::tie(b.m_net, b.m_addr);
  611|  46.9M|}
_ZNK8CNetAddr9GetInAddrEP7in_addr:
  624|  11.5k|{
  625|  11.5k|    if (!IsIPv4())
  ------------------
  |  Branch (625:9): [True: 0, False: 11.5k]
  ------------------
  626|      0|        return false;
  627|  11.5k|    assert(sizeof(*pipv4Addr) == m_addr.size());
  ------------------
  |  Branch (627:5): [True: 11.5k, False: 0]
  ------------------
  628|  11.5k|    memcpy(pipv4Addr, m_addr.data(), m_addr.size());
  629|  11.5k|    return true;
  630|  11.5k|}
_ZNK8CNetAddr10GetIn6AddrEP8in6_addr:
  643|  22.8k|{
  644|  22.8k|    if (!IsIPv6() && !IsCJDNS()) {
  ------------------
  |  Branch (644:9): [True: 4.29k, False: 18.5k]
  |  Branch (644:22): [True: 0, False: 4.29k]
  ------------------
  645|      0|        return false;
  646|      0|    }
  647|  22.8k|    assert(sizeof(*pipv6Addr) == m_addr.size());
  ------------------
  |  Branch (647:5): [True: 22.8k, False: 0]
  ------------------
  648|  22.8k|    memcpy(pipv6Addr, m_addr.data(), m_addr.size());
  649|  22.8k|    return true;
  650|  22.8k|}
_ZNK8CNetAddr13HasLinkedIPv4Ev:
  653|  37.7M|{
  654|  37.7M|    return IsRoutable() && (IsIPv4() || IsRFC6145() || IsRFC6052() || IsRFC3964() || IsRFC4380());
  ------------------
  |  Branch (654:12): [True: 37.7M, False: 0]
  |  Branch (654:29): [True: 2.24M, False: 35.5M]
  |  Branch (654:41): [True: 5.25k, False: 35.5M]
  |  Branch (654:56): [True: 1.67k, False: 35.5M]
  |  Branch (654:71): [True: 1.38k, False: 35.5M]
  |  Branch (654:86): [True: 5.67k, False: 35.4M]
  ------------------
  655|  37.7M|}
_ZNK8CNetAddr13GetLinkedIPv4Ev:
  658|  24.8k|{
  659|  24.8k|    if (IsIPv4()) {
  ------------------
  |  Branch (659:9): [True: 19.0k, False: 5.76k]
  ------------------
  660|  19.0k|        return ReadBE32(m_addr.data());
  661|  19.0k|    } else if (IsRFC6052() || IsRFC6145()) {
  ------------------
  |  Branch (661:16): [True: 655, False: 5.11k]
  |  Branch (661:31): [True: 2.18k, False: 2.92k]
  ------------------
  662|       |        // mapped IPv4, SIIT translated IPv4: the IPv4 address is the last 4 bytes of the address
  663|  2.84k|        return ReadBE32(std::span{m_addr}.last(ADDR_IPV4_SIZE).data());
  664|  2.92k|    } else if (IsRFC3964()) {
  ------------------
  |  Branch (664:16): [True: 306, False: 2.62k]
  ------------------
  665|       |        // 6to4 tunneled IPv4: the IPv4 address is in bytes 2-6
  666|    306|        return ReadBE32(std::span{m_addr}.subspan(2, ADDR_IPV4_SIZE).data());
  667|  2.62k|    } else if (IsRFC4380()) {
  ------------------
  |  Branch (667:16): [True: 2.62k, False: 0]
  ------------------
  668|       |        // Teredo tunneled IPv4: the IPv4 address is in the last 4 bytes of the address, but bitflipped
  669|  2.62k|        return ~ReadBE32(std::span{m_addr}.last(ADDR_IPV4_SIZE).data());
  670|  2.62k|    }
  671|  24.8k|    assert(false);
  ------------------
  |  Branch (671:5): [Folded, False: 0]
  ------------------
  672|      0|}
_ZNK8CNetAddr11GetNetClassEv:
  675|  43.1M|{
  676|       |    // Make sure that if we return NET_IPV6, then IsIPv6() is true. The callers expect that.
  677|       |
  678|       |    // Check for "internal" first because such addresses are also !IsRoutable()
  679|       |    // and we don't want to return NET_UNROUTABLE in that case.
  680|  43.1M|    if (IsInternal()) {
  ------------------
  |  Branch (680:9): [True: 81.7k, False: 43.1M]
  ------------------
  681|  81.7k|        return NET_INTERNAL;
  682|  81.7k|    }
  683|  43.1M|    if (!IsRoutable()) {
  ------------------
  |  Branch (683:9): [True: 5.75M, False: 37.3M]
  ------------------
  684|  5.75M|        return NET_UNROUTABLE;
  685|  5.75M|    }
  686|  37.3M|    if (HasLinkedIPv4()) {
  ------------------
  |  Branch (686:9): [True: 2.23M, False: 35.1M]
  ------------------
  687|  2.23M|        return NET_IPV4;
  688|  2.23M|    }
  689|  35.1M|    return m_net;
  690|  37.3M|}
_ZNK8CNetAddr12GetAddrBytesEv:
  693|   869k|{
  694|   869k|    if (IsAddrV1Compatible()) {
  ------------------
  |  Branch (694:9): [True: 826k, False: 42.6k]
  ------------------
  695|   826k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  696|   826k|        SerializeV1Array(serialized);
  697|   826k|        return {std::begin(serialized), std::end(serialized)};
  698|   826k|    }
  699|  42.6k|    return std::vector<unsigned char>(m_addr.begin(), m_addr.end());
  700|   869k|}
_ZN8CServiceC2Ev:
  780|  5.38M|CService::CService() : port(0)
  781|  5.38M|{
  782|  5.38M|}
_ZN8CServiceC2ERK8CNetAddrt:
  784|  1.22M|CService::CService(const CNetAddr& cip, uint16_t portIn) : CNetAddr(cip), port(portIn)
  785|  1.22M|{
  786|  1.22M|}
_ZN8CServiceC2ERK7in_addrt:
  788|  6.67k|CService::CService(const struct in_addr& ipv4Addr, uint16_t portIn) : CNetAddr(ipv4Addr), port(portIn)
  789|  6.67k|{
  790|  6.67k|}
_ZN8CServiceC2ERK8in6_addrt:
  792|  6.67k|CService::CService(const struct in6_addr& ipv6Addr, uint16_t portIn) : CNetAddr(ipv6Addr), port(portIn)
  793|  6.67k|{
  794|  6.67k|}
_ZN8CServiceC2ERK11sockaddr_in:
  796|    458|CService::CService(const struct sockaddr_in& addr) : CNetAddr(addr.sin_addr), port(ntohs(addr.sin_port))
  797|    458|{
  798|       |    assert(addr.sin_family == AF_INET);
  ------------------
  |  Branch (798:5): [True: 458, False: 0]
  ------------------
  799|    458|}
_ZN8CServiceC2ERK12sockaddr_in6:
  801|  2.09k|CService::CService(const struct sockaddr_in6 &addr) : CNetAddr(addr.sin6_addr, addr.sin6_scope_id), port(ntohs(addr.sin6_port))
  802|  2.09k|{
  803|       |   assert(addr.sin6_family == AF_INET6);
  ------------------
  |  Branch (803:4): [True: 2.09k, False: 0]
  ------------------
  804|  2.09k|}
_ZN8CService11SetSockAddrEPK8sockaddrj:
  807|  3.19k|{
  808|  3.19k|    switch (paddr->sa_family) {
  809|    476|    case AF_INET:
  ------------------
  |  Branch (809:5): [True: 476, False: 2.72k]
  ------------------
  810|    476|        if (addrlen != sizeof(struct sockaddr_in)) return false;
  ------------------
  |  Branch (810:13): [True: 18, False: 458]
  ------------------
  811|    458|        *this = CService(*(const struct sockaddr_in*)paddr);
  812|    458|        return true;
  813|  2.10k|    case AF_INET6:
  ------------------
  |  Branch (813:5): [True: 2.10k, False: 1.09k]
  ------------------
  814|  2.10k|        if (addrlen != sizeof(struct sockaddr_in6)) return false;
  ------------------
  |  Branch (814:13): [True: 6, False: 2.09k]
  ------------------
  815|  2.09k|        *this = CService(*(const struct sockaddr_in6*)paddr);
  816|  2.09k|        return true;
  817|    620|    default:
  ------------------
  |  Branch (817:5): [True: 620, False: 2.57k]
  ------------------
  818|    620|        return false;
  819|  3.19k|    }
  820|  3.19k|}
_ZNK8CService11GetSAFamilyEv:
  823|  36.2k|{
  824|  36.2k|    switch (m_net) {
  825|  11.5k|    case NET_IPV4:
  ------------------
  |  Branch (825:5): [True: 11.5k, False: 24.6k]
  ------------------
  826|  11.5k|        return AF_INET;
  827|  18.5k|    case NET_IPV6:
  ------------------
  |  Branch (827:5): [True: 18.5k, False: 17.6k]
  ------------------
  828|  22.8k|    case NET_CJDNS:
  ------------------
  |  Branch (828:5): [True: 4.29k, False: 31.9k]
  ------------------
  829|  22.8k|        return AF_INET6;
  830|  1.85k|    default:
  ------------------
  |  Branch (830:5): [True: 1.85k, False: 34.3k]
  ------------------
  831|       |        return AF_UNSPEC;
  832|  36.2k|    }
  833|  36.2k|}
_ZNK8CService7GetPortEv:
  836|   338k|{
  837|   338k|    return port;
  838|   338k|}
_ZeqRK8CServiceS1_:
  841|   301k|{
  842|   301k|    return static_cast<CNetAddr>(a) == static_cast<CNetAddr>(b) && a.port == b.port;
  ------------------
  |  Branch (842:12): [True: 202k, False: 99.5k]
  |  Branch (842:68): [True: 202k, False: 131]
  ------------------
  843|   301k|}
_ZltRK8CServiceS1_:
  846|  46.7M|{
  847|  46.7M|    return static_cast<CNetAddr>(a) < static_cast<CNetAddr>(b) || (static_cast<CNetAddr>(a) == static_cast<CNetAddr>(b) && a.port < b.port);
  ------------------
  |  Branch (847:12): [True: 26.7M, False: 20.0M]
  |  Branch (847:68): [True: 7.62M, False: 12.3M]
  |  Branch (847:124): [True: 892k, False: 6.73M]
  ------------------
  848|  46.7M|}
_ZNK8CService11GetSockAddrEP8sockaddrPj:
  863|  63.8k|{
  864|  63.8k|    if (IsIPv4()) {
  ------------------
  |  Branch (864:9): [True: 11.5k, False: 52.2k]
  ------------------
  865|  11.5k|        if (*addrlen < (socklen_t)sizeof(struct sockaddr_in))
  ------------------
  |  Branch (865:13): [True: 0, False: 11.5k]
  ------------------
  866|      0|            return false;
  867|  11.5k|        *addrlen = sizeof(struct sockaddr_in);
  868|  11.5k|        struct sockaddr_in *paddrin = (struct sockaddr_in*)paddr;
  869|  11.5k|        memset(paddrin, 0, *addrlen);
  870|  11.5k|        if (!GetInAddr(&paddrin->sin_addr))
  ------------------
  |  Branch (870:13): [True: 0, False: 11.5k]
  ------------------
  871|      0|            return false;
  872|  11.5k|        paddrin->sin_family = AF_INET;
  873|  11.5k|        paddrin->sin_port = htons(port);
  874|  11.5k|        return true;
  875|  11.5k|    }
  876|  52.2k|    if (IsIPv6() || IsCJDNS()) {
  ------------------
  |  Branch (876:9): [True: 18.5k, False: 33.7k]
  |  Branch (876:21): [True: 4.29k, False: 29.4k]
  ------------------
  877|  22.8k|        if (*addrlen < (socklen_t)sizeof(struct sockaddr_in6))
  ------------------
  |  Branch (877:13): [True: 0, False: 22.8k]
  ------------------
  878|      0|            return false;
  879|  22.8k|        *addrlen = sizeof(struct sockaddr_in6);
  880|  22.8k|        struct sockaddr_in6 *paddrin6 = (struct sockaddr_in6*)paddr;
  881|  22.8k|        memset(paddrin6, 0, *addrlen);
  882|  22.8k|        if (!GetIn6Addr(&paddrin6->sin6_addr))
  ------------------
  |  Branch (882:13): [True: 0, False: 22.8k]
  ------------------
  883|      0|            return false;
  884|  22.8k|        paddrin6->sin6_scope_id = m_scope_id;
  885|  22.8k|        paddrin6->sin6_family = AF_INET6;
  886|  22.8k|        paddrin6->sin6_port = htons(port);
  887|  22.8k|        return true;
  888|  22.8k|    }
  889|  29.4k|    return false;
  890|  52.2k|}
_ZNK8CService6GetKeyEv:
  896|   123k|{
  897|   123k|    auto key = GetAddrBytes();
  898|   123k|    key.push_back(port / 0x100); // most significant byte of our port
  899|   123k|    key.push_back(port & 0x0FF); // least significant byte of our port
  900|   123k|    return key;
  901|   123k|}
_ZNK8CService16ToStringAddrPortEv:
  904|   408k|{
  905|   408k|    const auto port_str = strprintf("%u", port);
  ------------------
  |  | 1172|   408k|#define strprintf tfm::format
  ------------------
  906|       |
  907|   408k|    if (IsIPv4() || IsTor() || IsI2P() || IsInternal()) {
  ------------------
  |  Branch (907:9): [True: 34.8k, False: 373k]
  |  Branch (907:21): [True: 5.22k, False: 368k]
  |  Branch (907:32): [True: 8.92k, False: 359k]
  |  Branch (907:43): [True: 27.4k, False: 331k]
  ------------------
  908|  76.4k|        return ToStringAddr() + ":" + port_str;
  909|   331k|    } else {
  910|   331k|        return "[" + ToStringAddr() + "]:" + port_str;
  911|   331k|    }
  912|   408k|}
_ZN7CSubNetC2Ev:
  915|   140k|    valid(false)
  916|   140k|{
  917|   140k|    memset(netmask, 0, sizeof(netmask));
  918|   140k|}
_ZN7CSubNetC2ERK8CNetAddrh:
  920|   102k|CSubNet::CSubNet(const CNetAddr& addr, uint8_t mask) : CSubNet()
  921|   102k|{
  922|   102k|    valid = (addr.IsIPv4() && mask <= ADDR_IPV4_SIZE * 8) ||
  ------------------
  |  Branch (922:14): [True: 3.20k, False: 99.4k]
  |  Branch (922:31): [True: 2.36k, False: 843]
  ------------------
  923|   100k|            (addr.IsIPv6() && mask <= ADDR_IPV6_SIZE * 8);
  ------------------
  |  Branch (923:14): [True: 8.07k, False: 92.1k]
  |  Branch (923:31): [True: 5.67k, False: 2.39k]
  ------------------
  924|   102k|    if (!valid) {
  ------------------
  |  Branch (924:9): [True: 94.5k, False: 8.03k]
  ------------------
  925|  94.5k|        return;
  926|  94.5k|    }
  927|       |
  928|   102k|    assert(mask <= sizeof(netmask) * 8);
  ------------------
  |  Branch (928:5): [True: 8.03k, False: 0]
  ------------------
  929|       |
  930|  8.03k|    network = addr;
  931|       |
  932|  8.03k|    uint8_t n = mask;
  933|   108k|    for (size_t i = 0; i < network.m_addr.size(); ++i) {
  ------------------
  |  Branch (933:24): [True: 100k, False: 8.03k]
  ------------------
  934|   100k|        const uint8_t bits = n < 8 ? n : 8;
  ------------------
  |  Branch (934:30): [True: 38.6k, False: 61.6k]
  ------------------
  935|   100k|        netmask[i] = (uint8_t)((uint8_t)0xFF << (8 - bits)); // Set first bits.
  936|   100k|        network.m_addr[i] &= netmask[i]; // Normalize network according to netmask.
  937|   100k|        n -= bits;
  938|   100k|    }
  939|  8.03k|}
_ZN7CSubNetC2ERK8CNetAddr:
  992|  15.3k|CSubNet::CSubNet(const CNetAddr& addr) : CSubNet()
  993|  15.3k|{
  994|  15.3k|    switch (addr.m_net) {
  ------------------
  |  Branch (994:13): [True: 15.3k, False: 0]
  ------------------
  995|    615|    case NET_IPV4:
  ------------------
  |  Branch (995:5): [True: 615, False: 14.7k]
  ------------------
  996|  13.1k|    case NET_IPV6:
  ------------------
  |  Branch (996:5): [True: 12.5k, False: 2.88k]
  ------------------
  997|  13.1k|        valid = true;
  998|  13.1k|        assert(addr.m_addr.size() <= sizeof(netmask));
  ------------------
  |  Branch (998:9): [True: 13.1k, False: 0]
  ------------------
  999|  13.1k|        memset(netmask, 0xFF, addr.m_addr.size());
 1000|  13.1k|        break;
 1001|    526|    case NET_ONION:
  ------------------
  |  Branch (1001:5): [True: 526, False: 14.8k]
  ------------------
 1002|  1.23k|    case NET_I2P:
  ------------------
  |  Branch (1002:5): [True: 713, False: 14.6k]
  ------------------
 1003|  2.01k|    case NET_CJDNS:
  ------------------
  |  Branch (1003:5): [True: 776, False: 14.6k]
  ------------------
 1004|  2.01k|        valid = true;
 1005|  2.01k|        break;
 1006|    254|    case NET_INTERNAL:
  ------------------
  |  Branch (1006:5): [True: 254, False: 15.1k]
  ------------------
 1007|    254|    case NET_UNROUTABLE:
  ------------------
  |  Branch (1007:5): [True: 0, False: 15.3k]
  ------------------
 1008|    254|    case NET_MAX:
  ------------------
  |  Branch (1008:5): [True: 0, False: 15.3k]
  ------------------
 1009|    254|        return;
 1010|  15.3k|    }
 1011|       |
 1012|  15.1k|    network = addr;
 1013|  15.1k|}
_ZNK7CSubNet5MatchERK8CNetAddr:
 1020|  2.64M|{
 1021|  2.64M|    if (!valid || !addr.IsValid() || network.m_net != addr.m_net)
  ------------------
  |  Branch (1021:9): [True: 1.90M, False: 735k]
  |  Branch (1021:19): [True: 23.6k, False: 712k]
  |  Branch (1021:38): [True: 60.2k, False: 651k]
  ------------------
 1022|  1.98M|        return false;
 1023|       |
 1024|   651k|    switch (network.m_net) {
  ------------------
  |  Branch (1024:13): [True: 651k, False: 0]
  ------------------
 1025|    734|    case NET_IPV4:
  ------------------
  |  Branch (1025:5): [True: 734, False: 651k]
  ------------------
 1026|   649k|    case NET_IPV6:
  ------------------
  |  Branch (1026:5): [True: 649k, False: 2.67k]
  ------------------
 1027|   649k|        break;
 1028|    541|    case NET_ONION:
  ------------------
  |  Branch (1028:5): [True: 541, False: 651k]
  ------------------
 1029|  1.25k|    case NET_I2P:
  ------------------
  |  Branch (1029:5): [True: 713, False: 651k]
  ------------------
 1030|  1.94k|    case NET_CJDNS:
  ------------------
  |  Branch (1030:5): [True: 690, False: 651k]
  ------------------
 1031|  1.94k|    case NET_INTERNAL:
  ------------------
  |  Branch (1031:5): [True: 0, False: 651k]
  ------------------
 1032|  1.94k|        return addr == network;
 1033|      0|    case NET_UNROUTABLE:
  ------------------
  |  Branch (1033:5): [True: 0, False: 651k]
  ------------------
 1034|      0|    case NET_MAX:
  ------------------
  |  Branch (1034:5): [True: 0, False: 651k]
  ------------------
 1035|      0|        return false;
 1036|   651k|    }
 1037|       |
 1038|   651k|    assert(network.m_addr.size() == addr.m_addr.size());
  ------------------
  |  Branch (1038:5): [True: 649k, False: 0]
  ------------------
 1039|  1.14M|    for (size_t x = 0; x < addr.m_addr.size(); ++x) {
  ------------------
  |  Branch (1039:24): [True: 1.12M, False: 23.0k]
  ------------------
 1040|  1.12M|        if ((addr.m_addr[x] & netmask[x]) != network.m_addr[x]) {
  ------------------
  |  Branch (1040:13): [True: 626k, False: 497k]
  ------------------
 1041|   626k|            return false;
 1042|   626k|        }
 1043|  1.12M|    }
 1044|  23.0k|    return true;
 1045|   649k|}
netaddress.cpp:_ZN5torv3L8ChecksumENSt3__14spanIKhLm18446744073709551615EEERA2_h:
  192|  11.0k|{
  193|       |    // TORv3 CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]
  194|  11.0k|    static const unsigned char prefix[] = ".onion checksum";
  195|  11.0k|    static constexpr size_t prefix_len = 15;
  196|       |
  197|  11.0k|    SHA3_256 hasher;
  198|       |
  199|  11.0k|    hasher.Write(std::span{prefix}.first(prefix_len));
  200|  11.0k|    hasher.Write(addr_pubkey);
  201|  11.0k|    hasher.Write(VERSION);
  202|       |
  203|  11.0k|    uint8_t checksum_full[SHA3_256::OUTPUT_SIZE];
  204|       |
  205|  11.0k|    hasher.Finalize(checksum_full);
  206|       |
  207|  11.0k|    memcpy(checksum, checksum_full, sizeof(checksum));
  208|  11.0k|}
netaddress.cpp:_ZL12IPv4ToStringNSt3__14spanIKhLm18446744073709551615EEE:
  508|  35.9k|{
  509|  35.9k|    return strprintf("%u.%u.%u.%u", a[0], a[1], a[2], a[3]);
  ------------------
  |  | 1172|  35.9k|#define strprintf tfm::format
  ------------------
  510|  35.9k|}
netaddress.cpp:_ZL12IPv6ToStringNSt3__14spanIKhLm18446744073709551615EEEj:
  515|   333k|{
  516|   333k|    assert(a.size() == ADDR_IPV6_SIZE);
  ------------------
  |  Branch (516:5): [True: 333k, False: 0]
  ------------------
  517|   333k|    const std::array groups{
  518|   333k|        ReadBE16(&a[0]),
  519|   333k|        ReadBE16(&a[2]),
  520|   333k|        ReadBE16(&a[4]),
  521|   333k|        ReadBE16(&a[6]),
  522|   333k|        ReadBE16(&a[8]),
  523|   333k|        ReadBE16(&a[10]),
  524|   333k|        ReadBE16(&a[12]),
  525|   333k|        ReadBE16(&a[14]),
  526|   333k|    };
  527|       |
  528|       |    // The zero compression implementation is inspired by Rust's std::net::Ipv6Addr, see
  529|       |    // https://github.com/rust-lang/rust/blob/cc4103089f40a163f6d143f06359cba7043da29b/library/std/src/net/ip.rs#L1635-L1683
  530|   333k|    struct ZeroSpan {
  531|   333k|        size_t start_index{0};
  532|   333k|        size_t len{0};
  533|   333k|    };
  534|       |
  535|       |    // Find longest sequence of consecutive all-zero fields. Use first zero sequence if two or more
  536|       |    // zero sequences of equal length are found.
  537|   333k|    ZeroSpan longest, current;
  538|  3.00M|    for (size_t i{0}; i < groups.size(); ++i) {
  ------------------
  |  Branch (538:23): [True: 2.66M, False: 333k]
  ------------------
  539|  2.66M|        if (groups[i] != 0) {
  ------------------
  |  Branch (539:13): [True: 2.47M, False: 193k]
  ------------------
  540|  2.47M|            current = {i + 1, 0};
  541|  2.47M|            continue;
  542|  2.47M|        }
  543|   193k|        current.len += 1;
  544|   193k|        if (current.len > longest.len) {
  ------------------
  |  Branch (544:13): [True: 183k, False: 9.66k]
  ------------------
  545|   183k|            longest = current;
  546|   183k|        }
  547|   193k|    }
  548|       |
  549|   333k|    std::string r;
  550|   333k|    r.reserve(39);
  551|  3.00M|    for (size_t i{0}; i < groups.size(); ++i) {
  ------------------
  |  Branch (551:23): [True: 2.66M, False: 333k]
  ------------------
  552|       |        // Replace the longest sequence of consecutive all-zero fields with two colons ("::").
  553|  2.66M|        if (longest.len >= 2 && i >= longest.start_index && i < longest.start_index + longest.len) {
  ------------------
  |  Branch (553:13): [True: 240k, False: 2.42M]
  |  Branch (553:33): [True: 206k, False: 34.1k]
  |  Branch (553:61): [True: 170k, False: 35.4k]
  ------------------
  554|   170k|            if (i == longest.start_index) {
  ------------------
  |  Branch (554:17): [True: 30.0k, False: 140k]
  ------------------
  555|  30.0k|                r += "::";
  556|  30.0k|            }
  557|   170k|            continue;
  558|   170k|        }
  559|  2.49M|        r += strprintf("%s%x", ((!r.empty() && r.back() != ':') ? ":" : ""), groups[i]);
  ------------------
  |  | 1172|  2.49M|#define strprintf tfm::format
  ------------------
  |  Branch (559:34): [True: 2.18M, False: 314k]
  |  Branch (559:48): [True: 2.17M, False: 10.3k]
  ------------------
  560|  2.49M|    }
  561|       |
  562|   333k|    if (scope_id != 0) {
  ------------------
  |  Branch (562:9): [True: 0, False: 333k]
  ------------------
  563|      0|        r += strprintf("%%%u", scope_id);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  564|      0|    }
  565|       |
  566|   333k|    return r;
  567|   333k|}

_ZNK8CNetAddr14HasCJDNSPrefixEv:
  178|  1.32M|    [[nodiscard]] bool HasCJDNSPrefix() const { return m_addr[0] == CJDNS_PREFIX; }
_ZN12CServiceHashC2Ev:
  575|  12.9k|        : m_salt_k0{FastRandomContext().rand64()},
  576|  12.9k|          m_salt_k1{FastRandomContext().rand64()}
  577|  12.9k|    {
  578|  12.9k|    }
_ZN8CNetAddr11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  252|  1.50M|    {
  253|  1.50M|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (253:13): [True: 1.44M, False: 61.0k]
  ------------------
  254|  1.44M|            UnserializeV2Stream(s);
  255|  1.44M|        } else {
  256|  61.0k|            UnserializeV1Stream(s);
  257|  61.0k|        }
  258|  1.50M|    }
_ZN8CNetAddr19UnserializeV2StreamI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  424|  1.44M|    {
  425|  1.44M|        uint8_t bip155_net;
  426|  1.44M|        s >> bip155_net;
  427|       |
  428|  1.44M|        size_t address_size;
  429|  1.44M|        s >> COMPACTSIZE(address_size);
  ------------------
  |  |  495|  1.44M|#define COMPACTSIZE(obj) Using<CompactSizeFormatter<true>>(obj)
  ------------------
  430|       |
  431|  1.44M|        if (address_size > MAX_ADDRV2_SIZE) {
  ------------------
  |  Branch (431:13): [True: 20, False: 1.44M]
  ------------------
  432|     20|            throw std::ios_base::failure(strprintf(
  ------------------
  |  | 1172|     20|#define strprintf tfm::format
  ------------------
  433|     20|                "Address too long: %u > %u", address_size, MAX_ADDRV2_SIZE));
  434|     20|        }
  435|       |
  436|  1.44M|        m_scope_id = 0;
  437|       |
  438|  1.44M|        if (SetNetFromBIP155Network(bip155_net, address_size)) {
  ------------------
  |  Branch (438:13): [True: 1.27M, False: 172k]
  ------------------
  439|  1.27M|            m_addr.resize(address_size);
  440|  1.27M|            s >> std::span{m_addr};
  441|       |
  442|  1.27M|            if (m_net != NET_IPV6) {
  ------------------
  |  Branch (442:17): [True: 473k, False: 797k]
  ------------------
  443|   473k|                return;
  444|   473k|            }
  445|       |
  446|       |            // Do some special checks on IPv6 addresses.
  447|       |
  448|       |            // Recognize NET_INTERNAL embedded in IPv6, such addresses are not
  449|       |            // gossiped but could be coming from addrman, when unserializing from
  450|       |            // disk.
  451|   797k|            if (util::HasPrefix(m_addr, INTERNAL_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (451:17): [True: 179, False: 797k]
  ------------------
  452|    179|                m_net = NET_INTERNAL;
  453|    179|                memmove(m_addr.data(), m_addr.data() + INTERNAL_IN_IPV6_PREFIX.size(),
  454|    179|                        ADDR_INTERNAL_SIZE);
  455|    179|                m_addr.resize(ADDR_INTERNAL_SIZE);
  456|    179|                return;
  457|    179|            }
  458|       |
  459|   797k|            if (!util::HasPrefix(m_addr, IPV4_IN_IPV6_PREFIX) &&
  ------------------
  |  Branch (459:17): [True: 796k, False: 179]
  ------------------
  460|   796k|                !util::HasPrefix(m_addr, TORV2_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (460:17): [True: 796k, False: 245]
  ------------------
  461|   796k|                return;
  462|   796k|            }
  463|       |
  464|       |            // IPv4 and TORv2 are not supposed to be embedded in IPv6 (like in V1
  465|       |            // encoding). Unserialize as !IsValid(), thus ignoring them.
  466|   797k|        } else {
  467|       |            // If we receive an unknown BIP155 network id (from the future?) then
  468|       |            // ignore the address - unserialize as !IsValid().
  469|   172k|            s.ignore(address_size);
  470|   172k|        }
  471|       |
  472|       |        // Mimic a default-constructed CNetAddr object which is !IsValid() and thus
  473|       |        // will not be gossiped, but continue reading next addresses from the stream.
  474|   173k|        m_net = NET_IPV6;
  475|   173k|        m_addr.assign(ADDR_IPV6_SIZE, 0x0);
  476|   173k|    }
_ZN8CNetAddr19UnserializeV1StreamI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  411|  61.0k|    {
  412|  61.0k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  413|       |
  414|  61.0k|        s >> serialized;
  415|       |
  416|  61.0k|        UnserializeV1Array(serialized);
  417|  61.0k|    }
_ZN8CNetAddr18UnserializeV1ArrayERA16_h:
  400|   286k|    {
  401|       |        // Use SetLegacyIPv6() so that m_net is set correctly. For example
  402|       |        // ::FFFF:0102:0304 should be set as m_net=NET_IPV4 (1.2.3.4).
  403|   286k|        SetLegacyIPv6(arr);
  404|   286k|    }
_ZNK8CNetAddr16SerializeV1ArrayERA16_h:
  325|   826k|    {
  326|   826k|        size_t prefix_size;
  327|       |
  328|   826k|        switch (m_net) {
  ------------------
  |  Branch (328:17): [True: 826k, False: 0]
  ------------------
  329|   810k|        case NET_IPV6:
  ------------------
  |  Branch (329:9): [True: 810k, False: 15.8k]
  ------------------
  330|   810k|            assert(m_addr.size() == sizeof(arr));
  ------------------
  |  Branch (330:13): [True: 810k, False: 0]
  ------------------
  331|   810k|            memcpy(arr, m_addr.data(), m_addr.size());
  332|   810k|            return;
  333|  9.47k|        case NET_IPV4:
  ------------------
  |  Branch (333:9): [True: 9.47k, False: 817k]
  ------------------
  334|  9.47k|            prefix_size = sizeof(IPV4_IN_IPV6_PREFIX);
  335|  9.47k|            assert(prefix_size + m_addr.size() == sizeof(arr));
  ------------------
  |  Branch (335:13): [True: 9.47k, False: 0]
  ------------------
  336|  9.47k|            memcpy(arr, IPV4_IN_IPV6_PREFIX.data(), prefix_size);
  337|  9.47k|            memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
  338|  9.47k|            return;
  339|  6.32k|        case NET_INTERNAL:
  ------------------
  |  Branch (339:9): [True: 6.32k, False: 820k]
  ------------------
  340|  6.32k|            prefix_size = sizeof(INTERNAL_IN_IPV6_PREFIX);
  341|  6.32k|            assert(prefix_size + m_addr.size() == sizeof(arr));
  ------------------
  |  Branch (341:13): [True: 6.32k, False: 0]
  ------------------
  342|  6.32k|            memcpy(arr, INTERNAL_IN_IPV6_PREFIX.data(), prefix_size);
  343|  6.32k|            memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
  344|  6.32k|            return;
  345|      0|        case NET_ONION:
  ------------------
  |  Branch (345:9): [True: 0, False: 826k]
  ------------------
  346|      0|        case NET_I2P:
  ------------------
  |  Branch (346:9): [True: 0, False: 826k]
  ------------------
  347|      0|        case NET_CJDNS:
  ------------------
  |  Branch (347:9): [True: 0, False: 826k]
  ------------------
  348|      0|            break;
  349|      0|        case NET_UNROUTABLE:
  ------------------
  |  Branch (349:9): [True: 0, False: 826k]
  ------------------
  350|      0|        case NET_MAX:
  ------------------
  |  Branch (350:9): [True: 0, False: 826k]
  ------------------
  351|      0|            assert(false);
  ------------------
  |  Branch (351:13): [Folded, False: 0]
  ------------------
  352|   826k|        } // no default case, so the compiler can warn about missing cases
  353|       |
  354|       |        // Serialize ONION, I2P and CJDNS as all-zeros.
  355|      0|        memset(arr, 0x0, V1_SERIALIZATION_SIZE);
  356|      0|    }
_ZN8CService16SerializationOpsI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_:
  563|   234k|    {
  564|   234k|        READWRITE(AsBase<CNetAddr>(obj), Using<BigEndianFormatter<2>>(obj.port));
  ------------------
  |  |  148|   234k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  565|   234k|    }
_ZN8CNetAddr11UnserializeI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  252|   234k|    {
  253|   234k|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (253:13): [True: 9.49k, False: 225k]
  ------------------
  254|  9.49k|            UnserializeV2Stream(s);
  255|   225k|        } else {
  256|   225k|            UnserializeV1Stream(s);
  257|   225k|        }
  258|   234k|    }
_ZN8CNetAddr19UnserializeV2StreamI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  424|  9.49k|    {
  425|  9.49k|        uint8_t bip155_net;
  426|  9.49k|        s >> bip155_net;
  427|       |
  428|  9.49k|        size_t address_size;
  429|  9.49k|        s >> COMPACTSIZE(address_size);
  ------------------
  |  |  495|  9.49k|#define COMPACTSIZE(obj) Using<CompactSizeFormatter<true>>(obj)
  ------------------
  430|       |
  431|  9.49k|        if (address_size > MAX_ADDRV2_SIZE) {
  ------------------
  |  Branch (431:13): [True: 24, False: 9.47k]
  ------------------
  432|     24|            throw std::ios_base::failure(strprintf(
  ------------------
  |  | 1172|     24|#define strprintf tfm::format
  ------------------
  433|     24|                "Address too long: %u > %u", address_size, MAX_ADDRV2_SIZE));
  434|     24|        }
  435|       |
  436|  9.47k|        m_scope_id = 0;
  437|       |
  438|  9.47k|        if (SetNetFromBIP155Network(bip155_net, address_size)) {
  ------------------
  |  Branch (438:13): [True: 3.74k, False: 5.72k]
  ------------------
  439|  3.74k|            m_addr.resize(address_size);
  440|  3.74k|            s >> std::span{m_addr};
  441|       |
  442|  3.74k|            if (m_net != NET_IPV6) {
  ------------------
  |  Branch (442:17): [True: 2.77k, False: 967]
  ------------------
  443|  2.77k|                return;
  444|  2.77k|            }
  445|       |
  446|       |            // Do some special checks on IPv6 addresses.
  447|       |
  448|       |            // Recognize NET_INTERNAL embedded in IPv6, such addresses are not
  449|       |            // gossiped but could be coming from addrman, when unserializing from
  450|       |            // disk.
  451|    967|            if (util::HasPrefix(m_addr, INTERNAL_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (451:17): [True: 630, False: 337]
  ------------------
  452|    630|                m_net = NET_INTERNAL;
  453|    630|                memmove(m_addr.data(), m_addr.data() + INTERNAL_IN_IPV6_PREFIX.size(),
  454|    630|                        ADDR_INTERNAL_SIZE);
  455|    630|                m_addr.resize(ADDR_INTERNAL_SIZE);
  456|    630|                return;
  457|    630|            }
  458|       |
  459|    337|            if (!util::HasPrefix(m_addr, IPV4_IN_IPV6_PREFIX) &&
  ------------------
  |  Branch (459:17): [True: 261, False: 76]
  ------------------
  460|    261|                !util::HasPrefix(m_addr, TORV2_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (460:17): [True: 227, False: 34]
  ------------------
  461|    227|                return;
  462|    227|            }
  463|       |
  464|       |            // IPv4 and TORv2 are not supposed to be embedded in IPv6 (like in V1
  465|       |            // encoding). Unserialize as !IsValid(), thus ignoring them.
  466|  5.72k|        } else {
  467|       |            // If we receive an unknown BIP155 network id (from the future?) then
  468|       |            // ignore the address - unserialize as !IsValid().
  469|  5.72k|            s.ignore(address_size);
  470|  5.72k|        }
  471|       |
  472|       |        // Mimic a default-constructed CNetAddr object which is !IsValid() and thus
  473|       |        // will not be gossiped, but continue reading next addresses from the stream.
  474|  5.83k|        m_net = NET_IPV6;
  475|  5.83k|        m_addr.assign(ADDR_IPV6_SIZE, 0x0);
  476|  5.83k|    }
_ZN8CNetAddr19UnserializeV1StreamI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  411|   225k|    {
  412|   225k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  413|       |
  414|   225k|        s >> serialized;
  415|       |
  416|   225k|        UnserializeV1Array(serialized);
  417|   225k|    }
_ZNK8CNetAddr6IsIPv4Ev:
  158|   617M|    [[nodiscard]] bool IsIPv4() const { return m_net == NET_IPV4; } // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0)
_ZNK12CServiceHashclERK8CService:
  583|   306k|    {
  584|   306k|        CSipHasher hasher(m_salt_k0, m_salt_k1);
  585|   306k|        hasher.Write(a.m_net);
  586|   306k|        hasher.Write(a.port);
  587|   306k|        hasher.Write(a.m_addr);
  588|   306k|        return static_cast<size_t>(hasher.Finalize());
  589|   306k|    }
_ZNK8CNetAddr5IsTorEv:
  175|   836k|    [[nodiscard]] bool IsTor() const { return m_net == NET_ONION; }
_ZNK8CNetAddr5IsI2PEv:
  176|   719k|    [[nodiscard]] bool IsI2P() const { return m_net == NET_I2P; }
_ZNK8CNetAddr7IsCJDNSEv:
  177|  83.9M|    [[nodiscard]] bool IsCJDNS() const { return m_net == NET_CJDNS; }
_ZNK8CNetAddr6IsIPv6Ev:
  159|   736M|    [[nodiscard]] bool IsIPv6() const { return m_net == NET_IPV6; } // IPv6 address (not mapped IPv4, not Tor)

_Z6LookupRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEtbjNS_8functionIFNS_6vectorI8CNetAddrNS3_ISA_EEEES7_bEEE:
  192|  70.6k|{
  193|  70.6k|    if (name.empty() || ContainsNUL(name)) {
  ------------------
  |  Branch (193:9): [True: 31.9k, False: 38.6k]
  |  Branch (193:25): [True: 0, False: 38.6k]
  ------------------
  194|  31.9k|        return {};
  195|  31.9k|    }
  196|  38.6k|    uint16_t port{portDefault};
  197|  38.6k|    std::string hostname;
  198|  38.6k|    SplitHostPort(name, port, hostname);
  199|       |
  200|  38.6k|    const std::vector<CNetAddr> addresses{LookupIntern(hostname, nMaxSolutions, fAllowLookup, dns_lookup_function)};
  201|  38.6k|    if (addresses.empty()) return {};
  ------------------
  |  Branch (201:9): [True: 10.8k, False: 27.8k]
  ------------------
  202|  27.8k|    std::vector<CService> services;
  203|  27.8k|    services.reserve(addresses.size());
  204|  27.8k|    for (const auto& addr : addresses)
  ------------------
  |  Branch (204:27): [True: 27.8k, False: 27.8k]
  ------------------
  205|  27.8k|        services.emplace_back(addr, port);
  206|  27.8k|    return services;
  207|  38.6k|}
_Z6LookupRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEtbNS_8functionIFNS_6vectorI8CNetAddrNS3_ISA_EEEES7_bEEE:
  210|  64.0k|{
  211|  64.0k|    const std::vector<CService> services{Lookup(name, portDefault, fAllowLookup, 1, dns_lookup_function)};
  212|       |
  213|  64.0k|    return services.empty() ? std::nullopt : std::make_optional(services.front());
  ------------------
  |  Branch (213:12): [True: 37.8k, False: 26.2k]
  ------------------
  214|  64.0k|}
_Z13LookupNumericRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEtNS_8functionIFNS_6vectorI8CNetAddrNS3_ISA_EEEES7_bEEE:
  217|   156k|{
  218|   156k|    if (ContainsNUL(name)) {
  ------------------
  |  Branch (218:9): [True: 92.1k, False: 64.0k]
  ------------------
  219|  92.1k|        return {};
  220|  92.1k|    }
  221|       |    // "1.2:345" will fail to resolve the ip, but will still set the port.
  222|       |    // If the ip fails to resolve, re-init the result.
  223|  64.0k|    return Lookup(name, portDefault, /*fAllowLookup=*/false, dns_lookup_function).value_or(CService{});
  224|   156k|}
_Z6Socks5RKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEtPK16ProxyCredentialsRK4Sock:
  393|  2.04k|{
  394|  2.04k|    try {
  395|  2.04k|        IntrRecvError recvr;
  396|  2.04k|        LogDebug(BCLog::NET, "SOCKS5 connecting %s\n", strDest);
  ------------------
  |  |  143|  2.04k|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|  2.04k|    do {                                                                                      \
  |  |  |  |  137|  2.04k|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 2.04k]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|  2.04k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 2.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|  2.04k|        if (strDest.size() > 255) {
  ------------------
  |  Branch (397:13): [True: 0, False: 2.04k]
  ------------------
  398|      0|            LogError("Hostname too long\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  399|      0|            return false;
  400|      0|        }
  401|       |        // Construct the version identifier/method selection message
  402|  2.04k|        std::vector<uint8_t> vSocks5Init;
  403|  2.04k|        vSocks5Init.push_back(SOCKSVersion::SOCKS5); // We want the SOCK5 protocol
  404|  2.04k|        if (auth) {
  ------------------
  |  Branch (404:13): [True: 0, False: 2.04k]
  ------------------
  405|      0|            vSocks5Init.push_back(0x02); // 2 method identifiers follow...
  406|      0|            vSocks5Init.push_back(SOCKS5Method::NOAUTH);
  407|      0|            vSocks5Init.push_back(SOCKS5Method::USER_PASS);
  408|  2.04k|        } else {
  409|  2.04k|            vSocks5Init.push_back(0x01); // 1 method identifier follows...
  410|  2.04k|            vSocks5Init.push_back(SOCKS5Method::NOAUTH);
  411|  2.04k|        }
  412|  2.04k|        sock.SendComplete(vSocks5Init, g_socks5_recv_timeout, g_socks5_interrupt);
  413|  2.04k|        uint8_t pchRet1[2];
  414|  2.04k|        if (InterruptibleRecv(pchRet1, 2, g_socks5_recv_timeout, sock) != IntrRecvError::OK) {
  ------------------
  |  Branch (414:13): [True: 635, False: 1.40k]
  ------------------
  415|    635|            LogInfo("Socks5() connect to %s:%d failed: InterruptibleRecv() timeout or other failure\n", strDest, port);
  ------------------
  |  |  125|    635|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|    635|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  416|    635|            return false;
  417|    635|        }
  418|  1.40k|        if (pchRet1[0] != SOCKSVersion::SOCKS5) {
  ------------------
  |  Branch (418:13): [True: 0, False: 1.40k]
  ------------------
  419|      0|            LogError("Proxy failed to initialize\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  420|      0|            return false;
  421|      0|        }
  422|  1.40k|        if (pchRet1[1] == SOCKS5Method::USER_PASS && auth) {
  ------------------
  |  Branch (422:13): [True: 0, False: 1.40k]
  |  Branch (422:54): [True: 0, False: 0]
  ------------------
  423|       |            // Perform username/password authentication (as described in RFC1929)
  424|      0|            std::vector<uint8_t> vAuth;
  425|      0|            vAuth.push_back(0x01); // Current (and only) version of user/pass subnegotiation
  426|      0|            if (auth->username.size() > 255 || auth->password.size() > 255) {
  ------------------
  |  Branch (426:17): [True: 0, False: 0]
  |  Branch (426:48): [True: 0, False: 0]
  ------------------
  427|      0|                LogError("Proxy username or password too long\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  428|      0|                return false;
  429|      0|            }
  430|      0|            vAuth.push_back(auth->username.size());
  431|      0|            vAuth.insert(vAuth.end(), auth->username.begin(), auth->username.end());
  432|      0|            vAuth.push_back(auth->password.size());
  433|      0|            vAuth.insert(vAuth.end(), auth->password.begin(), auth->password.end());
  434|      0|            LogDebug(BCLog::PROXY, "SOCKS5 sending username/password authentication\n");
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|      0|            sock.SendComplete(vAuth, g_socks5_recv_timeout, g_socks5_interrupt);
  436|      0|            uint8_t pchRetA[2];
  437|      0|            if (InterruptibleRecv(pchRetA, 2, g_socks5_recv_timeout, sock) != IntrRecvError::OK) {
  ------------------
  |  Branch (437:17): [True: 0, False: 0]
  ------------------
  438|      0|                LogError("Error reading proxy authentication response\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  439|      0|                return false;
  440|      0|            }
  441|      0|            if (pchRetA[0] != 0x01 || pchRetA[1] != 0x00) {
  ------------------
  |  Branch (441:17): [True: 0, False: 0]
  |  Branch (441:39): [True: 0, False: 0]
  ------------------
  442|      0|                LogError("Proxy authentication unsuccessful\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  443|      0|                return false;
  444|      0|            }
  445|  1.40k|        } else if (pchRet1[1] == SOCKS5Method::NOAUTH) {
  ------------------
  |  Branch (445:20): [True: 0, False: 1.40k]
  ------------------
  446|       |            // Perform no authentication
  447|  1.40k|        } else {
  448|  1.40k|            LogError("Proxy requested wrong authentication method %02x\n", pchRet1[1]);
  ------------------
  |  |  127|  1.40k|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  1.40k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  449|  1.40k|            return false;
  450|  1.40k|        }
  451|      0|        std::vector<uint8_t> vSocks5;
  452|      0|        vSocks5.push_back(SOCKSVersion::SOCKS5);   // VER protocol version
  453|      0|        vSocks5.push_back(SOCKS5Command::CONNECT); // CMD CONNECT
  454|      0|        vSocks5.push_back(0x00);                   // RSV Reserved must be 0
  455|      0|        vSocks5.push_back(SOCKS5Atyp::DOMAINNAME); // ATYP DOMAINNAME
  456|      0|        vSocks5.push_back(strDest.size());         // Length<=255 is checked at beginning of function
  457|      0|        vSocks5.insert(vSocks5.end(), strDest.begin(), strDest.end());
  458|      0|        vSocks5.push_back((port >> 8) & 0xFF);
  459|      0|        vSocks5.push_back((port >> 0) & 0xFF);
  460|      0|        sock.SendComplete(vSocks5, g_socks5_recv_timeout, g_socks5_interrupt);
  461|      0|        uint8_t pchRet2[4];
  462|      0|        if ((recvr = InterruptibleRecv(pchRet2, 4, g_socks5_recv_timeout, sock)) != IntrRecvError::OK) {
  ------------------
  |  Branch (462:13): [True: 0, False: 0]
  ------------------
  463|      0|            if (recvr == IntrRecvError::Timeout) {
  ------------------
  |  Branch (463:17): [True: 0, False: 0]
  ------------------
  464|       |                /* If a timeout happens here, this effectively means we timed out while connecting
  465|       |                 * to the remote node. This is very common for Tor, so do not print an
  466|       |                 * error message. */
  467|      0|                return false;
  468|      0|            } else {
  469|      0|                LogError("Error while reading proxy response\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  470|      0|                return false;
  471|      0|            }
  472|      0|        }
  473|      0|        if (pchRet2[0] != SOCKSVersion::SOCKS5) {
  ------------------
  |  Branch (473:13): [True: 0, False: 0]
  ------------------
  474|      0|            LogError("Proxy failed to accept request\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  475|      0|            return false;
  476|      0|        }
  477|      0|        if (pchRet2[1] != SOCKS5Reply::SUCCEEDED) {
  ------------------
  |  Branch (477:13): [True: 0, False: 0]
  ------------------
  478|       |            // Failures to connect to a peer that are not proxy errors
  479|      0|            LogDebug(BCLog::NET,
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|      0|                          "Socks5() connect to %s:%d failed: %s\n", strDest, port, Socks5ErrorString(pchRet2[1]));
  481|      0|            return false;
  482|      0|        }
  483|      0|        if (pchRet2[2] != 0x00) { // Reserved field must be 0
  ------------------
  |  Branch (483:13): [True: 0, False: 0]
  ------------------
  484|      0|            LogError("Error: malformed proxy response\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  485|      0|            return false;
  486|      0|        }
  487|      0|        uint8_t pchRet3[256];
  488|      0|        switch (pchRet2[3]) {
  489|      0|        case SOCKS5Atyp::IPV4: recvr = InterruptibleRecv(pchRet3, 4, g_socks5_recv_timeout, sock); break;
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  ------------------
  490|      0|        case SOCKS5Atyp::IPV6: recvr = InterruptibleRecv(pchRet3, 16, g_socks5_recv_timeout, sock); break;
  ------------------
  |  Branch (490:9): [True: 0, False: 0]
  ------------------
  491|      0|        case SOCKS5Atyp::DOMAINNAME: {
  ------------------
  |  Branch (491:9): [True: 0, False: 0]
  ------------------
  492|      0|            recvr = InterruptibleRecv(pchRet3, 1, g_socks5_recv_timeout, sock);
  493|      0|            if (recvr != IntrRecvError::OK) {
  ------------------
  |  Branch (493:17): [True: 0, False: 0]
  ------------------
  494|      0|                LogError("Error reading from proxy\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  495|      0|                return false;
  496|      0|            }
  497|      0|            int nRecv = pchRet3[0];
  498|      0|            recvr = InterruptibleRecv(pchRet3, nRecv, g_socks5_recv_timeout, sock);
  499|      0|            break;
  500|      0|        }
  501|      0|        default: {
  ------------------
  |  Branch (501:9): [True: 0, False: 0]
  ------------------
  502|      0|            LogError("Error: malformed proxy response\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  503|      0|            return false;
  504|      0|        }
  505|      0|        }
  506|      0|        if (recvr != IntrRecvError::OK) {
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  ------------------
  507|      0|            LogError("Error reading from proxy\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  508|      0|            return false;
  509|      0|        }
  510|      0|        if (InterruptibleRecv(pchRet3, 2, g_socks5_recv_timeout, sock) != IntrRecvError::OK) {
  ------------------
  |  Branch (510:13): [True: 0, False: 0]
  ------------------
  511|      0|            LogError("Error reading from proxy\n");
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  512|      0|            return false;
  513|      0|        }
  514|      0|        LogDebug(BCLog::NET, "SOCKS5 connected %s\n", strDest);
  ------------------
  |  |  143|      0|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|      0|    do {                                                                                      \
  |  |  |  |  137|      0|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  515|      0|        return true;
  516|  1.40k|    } catch (const std::runtime_error& e) {
  517|  1.40k|        LogError("Error during SOCKS5 proxy handshake: %s\n", e.what());
  ------------------
  |  |  127|  1.40k|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  1.40k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  518|  1.40k|        return false;
  519|  1.40k|    }
  520|  2.04k|}
_Z15ConnectDirectlyRK8CServiceb:
  651|  8.59k|{
  652|  8.59k|    return ConnectDirectly(dest, manual_connection, std::chrono::milliseconds{nConnectTimeout});
  653|  8.59k|}
_Z15ConnectDirectlyRK8CServicebNSt3__16chrono8durationIxNS2_5ratioILl1ELl1000EEEEE:
  658|  8.59k|{
  659|  8.59k|    auto sock = CreateSock(dest.GetSAFamily(), SOCK_STREAM, IPPROTO_TCP);
  660|  8.59k|    if (!sock) {
  ------------------
  |  Branch (660:9): [True: 0, False: 8.59k]
  ------------------
  661|      0|        LogError("Cannot create a socket for connecting to %s\n", dest.ToStringAddrPort());
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  662|      0|        return {};
  663|      0|    }
  664|       |
  665|       |    // Create a sockaddr from the specified service.
  666|  8.59k|    struct sockaddr_storage sockaddr;
  667|  8.59k|    socklen_t len = sizeof(sockaddr);
  668|  8.59k|    if (!dest.GetSockAddr((struct sockaddr*)&sockaddr, &len)) {
  ------------------
  |  Branch (668:9): [True: 1.85k, False: 6.73k]
  ------------------
  669|  1.85k|        LogInfo("Cannot get sockaddr for %s: unsupported network\n", dest.ToStringAddrPort());
  ------------------
  |  |  125|  1.85k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  1.85k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  670|  1.85k|        return {};
  671|  1.85k|    }
  672|       |
  673|  6.73k|    if (!ConnectToSocket(*sock, (struct sockaddr*)&sockaddr, len, dest.ToStringAddrPort(), manual_connection, timeout)) {
  ------------------
  |  Branch (673:9): [True: 2.57k, False: 4.16k]
  ------------------
  674|  2.57k|        return {};
  675|  2.57k|    }
  676|       |
  677|  4.16k|    return sock;
  678|  6.73k|}
_ZNK5Proxy7ConnectEv:
  681|  5.31k|{
  682|  5.31k|    if (!IsValid()) return {};
  ------------------
  |  Branch (682:9): [True: 278, False: 5.03k]
  ------------------
  683|       |
  684|  5.03k|    if (!m_is_unix_socket) return ConnectDirectly(proxy, /*manual_connection=*/true);
  ------------------
  |  Branch (684:9): [True: 5.03k, False: 0]
  ------------------
  685|       |
  686|      0|#ifdef HAVE_SOCKADDR_UN
  687|      0|    auto sock = CreateSock(AF_UNIX, SOCK_STREAM, 0);
  688|      0|    if (!sock) {
  ------------------
  |  Branch (688:9): [True: 0, False: 0]
  ------------------
  689|      0|        LogError("Cannot create a socket for connecting to %s\n", m_unix_socket_path);
  ------------------
  |  |  127|      0|#define LogError(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  690|      0|        return {};
  691|      0|    }
  692|       |
  693|      0|    const std::string path{m_unix_socket_path.substr(ADDR_PREFIX_UNIX.length())};
  694|       |
  695|      0|    struct sockaddr_un addrun;
  696|      0|    memset(&addrun, 0, sizeof(addrun));
  697|      0|    addrun.sun_family = AF_UNIX;
  698|       |    // leave the last char in addrun.sun_path[] to be always '\0'
  699|      0|    memcpy(addrun.sun_path, path.c_str(), std::min(sizeof(addrun.sun_path) - 1, path.length()));
  700|      0|    socklen_t len = sizeof(addrun);
  701|       |
  702|      0|    if (!ConnectToSocket(*sock,
  ------------------
  |  Branch (702:9): [True: 0, False: 0]
  ------------------
  703|      0|                         (struct sockaddr*)&addrun,
  704|      0|                         len,
  705|      0|                         path,
  706|      0|                         /*manual_connection=*/true,
  707|      0|                         std::chrono::milliseconds{nConnectTimeout})) {
  708|      0|        return {};
  709|      0|    }
  710|       |
  711|      0|    return sock;
  712|       |#else
  713|       |    return {};
  714|       |#endif
  715|      0|}
_Z8GetProxy7Network:
  727|  3.55k|{
  728|  3.55k|    assert(net >= 0 && net < NET_MAX);
  ------------------
  |  Branch (728:5): [True: 3.55k, False: 0]
  |  Branch (728:5): [True: 3.55k, False: 0]
  |  Branch (728:5): [True: 3.55k, False: 0]
  ------------------
  729|  3.55k|    LOCK(g_proxyinfo_mutex);
  ------------------
  |  |  268|  3.55k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.55k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.55k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.55k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|  3.55k|    if (!proxyInfo[net].IsValid()) {
  ------------------
  |  Branch (730:9): [True: 3.55k, False: 0]
  ------------------
  731|  3.55k|        return std::nullopt;
  732|  3.55k|    }
  733|      0|    return proxyInfo[net];
  734|  3.55k|}
_Z12GetNameProxyv:
  745|    469|{
  746|    469|    LOCK(g_proxyinfo_mutex);
  ------------------
  |  |  268|    469|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    469|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    469|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    469|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|    469|    if (!nameProxy.IsValid()) {
  ------------------
  |  Branch (747:9): [True: 469, False: 0]
  ------------------
  748|    469|        return std::nullopt;
  749|    469|    }
  750|      0|    return nameProxy;
  751|    469|}
_Z13HaveNameProxyv:
  753|  6.59k|bool HaveNameProxy() {
  754|  6.59k|    LOCK(g_proxyinfo_mutex);
  ------------------
  |  |  268|  6.59k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  6.59k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  6.59k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  6.59k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|  6.59k|    return nameProxy.IsValid();
  756|  6.59k|}
_Z19ConnectThroughProxyRK5ProxyRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEtRb:
  808|  3.15k|{
  809|       |    // first connect to proxy server
  810|  3.15k|    auto sock = proxy.Connect();
  811|  3.15k|    if (!sock) {
  ------------------
  |  Branch (811:9): [True: 1.11k, False: 2.04k]
  ------------------
  812|  1.11k|        proxy_connection_failed = true;
  813|  1.11k|        return {};
  814|  1.11k|    }
  815|       |
  816|       |    // do socks negotiation
  817|  2.04k|    if (proxy.m_tor_stream_isolation) {
  ------------------
  |  Branch (817:9): [True: 0, False: 2.04k]
  ------------------
  818|      0|        static TorStreamIsolationCredentialsGenerator generator;
  819|      0|        ProxyCredentials random_auth{generator.Generate()};
  820|      0|        if (!Socks5(dest, port, &random_auth, *sock)) {
  ------------------
  |  Branch (820:13): [True: 0, False: 0]
  ------------------
  821|      0|            return {};
  822|      0|        }
  823|  2.04k|    } else {
  824|  2.04k|        if (!Socks5(dest, port, nullptr, *sock)) {
  ------------------
  |  Branch (824:13): [True: 2.04k, False: 0]
  ------------------
  825|  2.04k|            return {};
  826|  2.04k|        }
  827|  2.04k|    }
  828|      0|    return sock;
  829|  2.04k|}
_Z20MaybeFlipIPv6toCJDNSRK8CService:
  962|   161k|{
  963|   161k|    CService ret{service};
  964|   161k|    if (ret.IsIPv6() && ret.HasCJDNSPrefix() && g_reachable_nets.Contains(NET_CJDNS)) {
  ------------------
  |  Branch (964:9): [True: 109k, False: 52.4k]
  |  Branch (964:25): [True: 81, False: 109k]
  |  Branch (964:49): [True: 81, False: 0]
  ------------------
  965|     81|        ret.m_net = NET_CJDNS;
  966|     81|    }
  967|   161k|    return ret;
  968|   161k|}
_Z14GetBindAddressRK4Sock:
  971|  3.49k|{
  972|  3.49k|    CService addr_bind;
  973|  3.49k|    sockaddr_storage storage;
  974|  3.49k|    socklen_t len = sizeof(storage);
  975|       |
  976|  3.49k|    auto sa = reinterpret_cast<sockaddr*>(&storage);
  977|       |
  978|  3.49k|    if (sock.GetSockName(sa, &len) == 0) {
  ------------------
  |  Branch (978:9): [True: 645, False: 2.84k]
  ------------------
  979|    645|        addr_bind.SetSockAddr(sa, len);
  980|  2.84k|    } else {
  981|  2.84k|        LogWarning("getsockname failed\n");
  ------------------
  |  |  126|  2.84k|#define LogWarning(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Warning, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  2.84k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  982|  2.84k|    }
  983|  3.49k|    return addr_bind;
  984|  3.49k|}
netbase.cpp:_ZL12LookupInternRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEjbNS_8functionIFNS_6vectorI8CNetAddrNS3_ISA_EEEES7_bEEE:
  145|  38.6k|{
  146|  38.6k|    if (ContainsNUL(name)) return {};
  ------------------
  |  Branch (146:9): [True: 0, False: 38.6k]
  ------------------
  147|  38.6k|    {
  148|  38.6k|        CNetAddr addr;
  149|       |        // From our perspective, onion addresses are not hostnames but rather
  150|       |        // direct encodings of CNetAddr much like IPv4 dotted-decimal notation
  151|       |        // or IPv6 colon-separated hextet notation. Since we can't use
  152|       |        // getaddrinfo to decode them and it wouldn't make sense to resolve
  153|       |        // them, we return a network address representing it instead. See
  154|       |        // CNetAddr::SetSpecial(const std::string&) for more details.
  155|  38.6k|        if (addr.SetSpecial(name)) return {addr};
  ------------------
  |  Branch (155:13): [True: 10.3k, False: 28.3k]
  ------------------
  156|  38.6k|    }
  157|       |
  158|  28.3k|    std::vector<CNetAddr> addresses;
  159|       |
  160|  28.3k|    for (const CNetAddr& resolved : dns_lookup_function(name, fAllowLookup)) {
  ------------------
  |  Branch (160:35): [True: 28.3k, False: 28.3k]
  ------------------
  161|  28.3k|        if (nMaxSolutions > 0 && addresses.size() >= nMaxSolutions) {
  ------------------
  |  Branch (161:13): [True: 28.3k, False: 0]
  |  Branch (161:34): [True: 0, False: 28.3k]
  ------------------
  162|      0|            break;
  163|      0|        }
  164|       |        /* Never allow resolving to an internal address. Consider any such result invalid */
  165|  28.3k|        if (!resolved.IsInternal()) {
  ------------------
  |  Branch (165:13): [True: 17.4k, False: 10.8k]
  ------------------
  166|  17.4k|            addresses.push_back(resolved);
  167|  17.4k|        }
  168|  28.3k|    }
  169|       |
  170|  28.3k|    return addresses;
  171|  38.6k|}
netbase.cpp:_ZL17InterruptibleRecvPhmNSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEERK4Sock:
  319|    635|{
  320|    635|    auto curTime{Now<SteadyMilliseconds>()};
  321|    635|    const auto endTime{curTime + timeout};
  322|    635|    while (len > 0 && curTime < endTime) {
  ------------------
  |  Branch (322:12): [True: 635, False: 0]
  |  Branch (322:23): [True: 635, False: 0]
  ------------------
  323|    635|        ssize_t ret = sock.Recv(data, len, 0); // Optimistically try the recv first
  324|    635|        if (ret > 0) {
  ------------------
  |  Branch (324:13): [True: 44, False: 591]
  ------------------
  325|     44|            len -= ret;
  326|     44|            data += ret;
  327|    591|        } else if (ret == 0) { // Unexpected disconnection
  ------------------
  |  Branch (327:20): [True: 416, False: 175]
  ------------------
  328|    416|            return IntrRecvError::Disconnected;
  329|    416|        } else { // Other error or blocking
  330|    175|            int nErr = WSAGetLastError();
  ------------------
  |  |   59|    175|#define WSAGetLastError()   errno
  ------------------
  331|    175|            if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) {
  ------------------
  |  |   65|    350|#define WSAEINPROGRESS      EINPROGRESS
  ------------------
                          if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) {
  ------------------
  |  |   61|    350|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
                          if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) {
  ------------------
  |  |   60|    103|#define WSAEINVAL           EINVAL
  ------------------
  |  Branch (331:17): [True: 0, False: 175]
  |  Branch (331:43): [True: 72, False: 103]
  |  Branch (331:69): [True: 20, False: 83]
  ------------------
  332|       |                // Only wait at most MAX_WAIT_FOR_IO at a time, unless
  333|       |                // we're approaching the end of the specified total timeout
  334|     92|                const auto remaining = std::chrono::milliseconds{endTime - curTime};
  335|     92|                const auto timeout = std::min(remaining, std::chrono::milliseconds{MAX_WAIT_FOR_IO});
  336|     92|                if (!sock.Wait(timeout, Sock::RecvEvent)) {
  ------------------
  |  Branch (336:21): [True: 21, False: 71]
  ------------------
  337|     21|                    return IntrRecvError::NetworkError;
  338|     21|                }
  339|     92|            } else {
  340|     83|                return IntrRecvError::NetworkError;
  341|     83|            }
  342|    175|        }
  343|    115|        if (g_socks5_interrupt) {
  ------------------
  |  Branch (343:13): [True: 115, False: 0]
  ------------------
  344|    115|            return IntrRecvError::Interrupted;
  345|    115|        }
  346|      0|        curTime = Now<SteadyMilliseconds>();
  347|      0|    }
  348|      0|    return len == 0 ? IntrRecvError::OK : IntrRecvError::Timeout;
  ------------------
  |  Branch (348:12): [True: 0, False: 0]
  ------------------
  349|    635|}
netbase.cpp:_ZL15ConnectToSocketRK4SockP8sockaddrjRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEbNS4_6chrono8durationIxNS4_5ratioILl1ELl1000EEEEE:
  596|  6.73k|{
  597|       |    // Connect to `sockaddr` using `sock`.
  598|  6.73k|    if (sock.Connect(sockaddr, len) == SOCKET_ERROR) {
  ------------------
  |  |   68|  6.73k|#define SOCKET_ERROR        -1
  ------------------
  |  Branch (598:9): [True: 2.59k, False: 4.14k]
  ------------------
  599|  2.59k|        int nErr = WSAGetLastError();
  ------------------
  |  |   59|  2.59k|#define WSAGetLastError()   errno
  ------------------
  600|       |        // WSAEINVAL is here because some legacy version of winsock uses it
  601|  2.59k|        if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL)
  ------------------
  |  |   65|  5.18k|#define WSAEINPROGRESS      EINPROGRESS
  ------------------
                      if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL)
  ------------------
  |  |   61|  4.42k|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
                      if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL)
  ------------------
  |  |   60|    787|#define WSAEINVAL           EINVAL
  ------------------
  |  Branch (601:13): [True: 752, False: 1.83k]
  |  Branch (601:39): [True: 1.05k, False: 787]
  |  Branch (601:65): [True: 0, False: 787]
  ------------------
  602|  1.80k|        {
  603|       |            // Connection didn't actually fail, but is being established
  604|       |            // asynchronously. Thus, use async I/O api (select/poll)
  605|       |            // synchronously to check for successful connection with a timeout.
  606|  1.80k|            const Sock::Event requested = Sock::RecvEvent | Sock::SendEvent;
  607|  1.80k|            Sock::Event occurred;
  608|  1.80k|            if (!sock.Wait(timeout, requested, &occurred)) {
  ------------------
  |  Branch (608:17): [True: 1.18k, False: 622]
  ------------------
  609|  1.18k|                LogInfo("wait for connect to %s failed: %s\n",
  ------------------
  |  |  125|  1.18k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  1.18k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  610|  1.18k|                          dest_str,
  611|  1.18k|                          NetworkErrorString(WSAGetLastError()));
  612|  1.18k|                return false;
  613|  1.18k|            } else if (occurred == 0) {
  ------------------
  |  Branch (613:24): [True: 238, False: 384]
  ------------------
  614|    238|                LogDebug(BCLog::NET, "connection attempt to %s timed out\n", dest_str);
  ------------------
  |  |  143|    238|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    238|    do {                                                                                      \
  |  |  |  |  137|    238|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 238]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    238|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  615|    238|                return false;
  616|    238|            }
  617|       |
  618|       |            // Even if the wait was successful, the connect might not
  619|       |            // have been successful. The reason for this failure is hidden away
  620|       |            // in the SO_ERROR for the socket in modern systems. We read it into
  621|       |            // sockerr here.
  622|    384|            int sockerr;
  623|    384|            socklen_t sockerr_len = sizeof(sockerr);
  624|    384|            if (sock.GetSockOpt(SOL_SOCKET, SO_ERROR, &sockerr, &sockerr_len) ==
  ------------------
  |  Branch (624:17): [True: 260, False: 124]
  ------------------
  625|    384|                SOCKET_ERROR) {
  ------------------
  |  |   68|    384|#define SOCKET_ERROR        -1
  ------------------
  626|    260|                LogInfo("getsockopt() for %s failed: %s\n", dest_str, NetworkErrorString(WSAGetLastError()));
  ------------------
  |  |  125|    260|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|    260|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  627|    260|                return false;
  628|    260|            }
  629|    124|            if (sockerr != 0) {
  ------------------
  |  Branch (629:17): [True: 105, False: 19]
  ------------------
  630|    105|                LogConnectFailure(manual_connection,
  631|    105|                                  "connect() to %s failed after wait: %s",
  632|    105|                                  dest_str,
  633|    105|                                  NetworkErrorString(sockerr));
  634|    105|                return false;
  635|    105|            }
  636|    124|        }
  637|       |#ifdef WIN32
  638|       |        else if (WSAGetLastError() != WSAEISCONN)
  639|       |#else
  640|    787|        else
  641|    787|#endif
  642|    787|        {
  643|    787|            LogConnectFailure(manual_connection, "connect() to %s failed: %s", dest_str, NetworkErrorString(WSAGetLastError()));
  ------------------
  |  |   59|    787|#define WSAGetLastError()   errno
  ------------------
  644|    787|            return false;
  645|    787|        }
  646|  2.59k|    }
  647|  4.16k|    return true;
  648|  6.73k|}
netbase.cpp:_ZL17LogConnectFailureIJNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES6_EEvbN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  581|    892|{
  582|    892|    std::string error_message = tfm::format(fmt, args...);
  583|    892|    if (manual_connection) {
  ------------------
  |  Branch (583:9): [True: 443, False: 449]
  ------------------
  584|    443|        LogInfo("%s\n", error_message);
  ------------------
  |  |  125|    443|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|    443|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  585|    449|    } else {
  586|    449|        LogDebug(BCLog::NET, "%s\n", error_message);
  ------------------
  |  |  143|    449|#define LogDebug(category, ...) detail_LogIfCategoryAndLevelEnabled(category, util::log::ShouldDebugLog, util::log::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  136|    449|    do {                                                                                      \
  |  |  |  |  137|    449|        if (shouldlog(category)) {                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (137:13): [True: 0, False: 449]
  |  |  |  |  ------------------
  |  |  |  |  138|      0|            detail_LogWithSrcLoc((category), (level), util::log::NO_RATE_LIMIT, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  139|      0|        }                                                                                     \
  |  |  |  |  140|    449|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:14): [Folded, False: 449]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  587|    449|    }
  588|    892|}

_ZNK5Proxy7IsValidEv:
   74|  15.9k|    {
   75|  15.9k|        if (m_is_unix_socket) return IsUnixSocketPath(m_unix_socket_path);
  ------------------
  |  Branch (75:13): [True: 0, False: 15.9k]
  ------------------
   76|  15.9k|        return proxy.IsValid();
   77|  15.9k|    }
net.cpp:_Zan19ConnectionDirectionS_:
   46|   464k|static inline bool operator&(ConnectionDirection a, ConnectionDirection b) {
   47|   464k|    using underlying = std::underlying_type_t<ConnectionDirection>;
   48|   464k|    return (underlying(a) & underlying(b));
   49|   464k|}
_ZNK13ReachableNets8ContainsERK8CNetAddr:
  142|  4.70k|    {
  143|  4.70k|        AssertLockNotHeld(m_mutex);
  ------------------
  |  |  149|  4.70k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  144|  4.70k|        return Contains(addr.GetNetwork());
  145|  4.70k|    }
_ZNK13ReachableNets8ContainsE7Network:
  135|  4.78k|    {
  136|  4.78k|        AssertLockNotHeld(m_mutex);
  ------------------
  |  |  149|  4.78k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  137|  4.78k|        LOCK(m_mutex);
  ------------------
  |  |  268|  4.78k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.78k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.78k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.78k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|  4.78k|        return m_reachable.contains(net);
  139|  4.78k|    }
_ZNK5Proxy8ToStringEv:
   86|    976|    {
   87|    976|        if (m_is_unix_socket) return m_unix_socket_path;
  ------------------
  |  Branch (87:13): [True: 0, False: 976]
  ------------------
   88|    976|        return proxy.ToStringAddrPort();
   89|    976|    }
_ZN5ProxyC2ERK8CServiceb:
   64|  50.9k|    explicit Proxy(const CService& _proxy, bool tor_stream_isolation = false) : proxy(_proxy), m_is_unix_socket(false), m_tor_stream_isolation(tor_stream_isolation) {}

_ZNK15NetGroupManager15GetAsmapVersionEv:
   15|  1.40k|{
   16|  1.40k|    return AsmapVersion(m_asmap);
   17|  1.40k|}
_ZNK15NetGroupManager8GetGroupERK8CNetAddr:
   20|   419k|{
   21|   419k|    std::vector<unsigned char> vchRet;
   22|       |    // If non-empty asmap is supplied and the address is IPv4/IPv6,
   23|       |    // return ASN to be used for bucketing.
   24|   419k|    uint32_t asn = GetMappedAS(address);
   25|   419k|    if (asn != 0) { // Either asmap was empty, or address has non-asmappable net class (e.g. TOR).
  ------------------
  |  Branch (25:9): [True: 19.8k, False: 399k]
  ------------------
   26|  19.8k|        vchRet.push_back(NET_IPV6); // IPv4 and IPv6 with same ASN should be in the same bucket
   27|  99.4k|        for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (27:25): [True: 79.5k, False: 19.8k]
  ------------------
   28|  79.5k|            vchRet.push_back((asn >> (8 * i)) & 0xFF);
   29|  79.5k|        }
   30|  19.8k|        return vchRet;
   31|  19.8k|    }
   32|       |
   33|   399k|    vchRet.push_back(address.GetNetClass());
   34|   399k|    int nStartByte{0};
   35|   399k|    int nBits{0};
   36|       |
   37|   399k|    if (address.IsLocal()) {
  ------------------
  |  Branch (37:9): [True: 1.99k, False: 397k]
  ------------------
   38|       |        // all local addresses belong to the same group
   39|   397k|    } else if (address.IsInternal()) {
  ------------------
  |  Branch (39:16): [True: 2.99k, False: 394k]
  ------------------
   40|       |        // All internal-usage addresses get their own group.
   41|       |        // Skip over the INTERNAL_IN_IPV6_PREFIX returned by CAddress::GetAddrBytes().
   42|  2.99k|        nStartByte = INTERNAL_IN_IPV6_PREFIX.size();
   43|  2.99k|        nBits = ADDR_INTERNAL_SIZE * 8;
   44|   394k|    } else if (!address.IsRoutable()) {
  ------------------
  |  Branch (44:16): [True: 28.8k, False: 366k]
  ------------------
   45|       |        // all other unroutable addresses belong to the same group
   46|   366k|    } else if (address.HasLinkedIPv4()) {
  ------------------
  |  Branch (46:16): [True: 20.2k, False: 345k]
  ------------------
   47|       |        // IPv4 addresses (and mapped IPv4 addresses) use /16 groups
   48|  20.2k|        uint32_t ipv4 = address.GetLinkedIPv4();
   49|  20.2k|        vchRet.push_back((ipv4 >> 24) & 0xFF);
   50|  20.2k|        vchRet.push_back((ipv4 >> 16) & 0xFF);
   51|  20.2k|        return vchRet;
   52|   345k|    } else if (address.IsTor() || address.IsI2P()) {
  ------------------
  |  Branch (52:16): [True: 3.94k, False: 341k]
  |  Branch (52:35): [True: 6.00k, False: 335k]
  ------------------
   53|  9.95k|        nBits = 4;
   54|   335k|    } else if (address.IsCJDNS()) {
  ------------------
  |  Branch (54:16): [True: 2.95k, False: 332k]
  ------------------
   55|       |        // Treat in the same way as Tor and I2P because the address in all of
   56|       |        // them is "random" bytes (derived from a public key). However in CJDNS
   57|       |        // the first byte is a constant (see CJDNS_PREFIX), so the random bytes
   58|       |        // come after it. Thus skip the constant 8 bits at the start.
   59|  2.95k|        nBits = 12;
   60|   332k|    } else if (address.IsHeNet()) {
  ------------------
  |  Branch (60:16): [True: 241, False: 332k]
  ------------------
   61|       |        // for he.net, use /36 groups
   62|    241|        nBits = 36;
   63|   332k|    } else {
   64|       |        // for the rest of the IPv6 network, use /32 groups
   65|   332k|        nBits = 32;
   66|   332k|    }
   67|       |
   68|       |    // Push our address onto vchRet.
   69|   379k|    auto addr_bytes = address.GetAddrBytes();
   70|   379k|    const size_t num_bytes = nBits / 8;
   71|   379k|    vchRet.insert(vchRet.end(), addr_bytes.begin() + nStartByte, addr_bytes.begin() + nStartByte + num_bytes);
   72|   379k|    nBits %= 8;
   73|       |    // ...for the last byte, push nBits and for the rest of the byte push 1's
   74|   379k|    if (nBits > 0) {
  ------------------
  |  Branch (74:9): [True: 13.1k, False: 366k]
  ------------------
   75|  13.1k|        assert(num_bytes < addr_bytes.size());
  ------------------
  |  Branch (75:9): [True: 13.1k, False: 0]
  ------------------
   76|  13.1k|        vchRet.push_back(addr_bytes[num_bytes + nStartByte] | ((1 << (8 - nBits)) - 1));
   77|  13.1k|    }
   78|       |
   79|   379k|    return vchRet;
   80|   379k|}
_ZNK15NetGroupManager11GetMappedASERK8CNetAddr:
   83|   801k|{
   84|   801k|    uint32_t net_class = address.GetNetClass();
   85|   801k|    if (m_asmap.empty() || (net_class != NET_IPV4 && net_class != NET_IPV6)) {
  ------------------
  |  Branch (85:9): [True: 756k, False: 44.8k]
  |  Branch (85:29): [True: 40.3k, False: 4.54k]
  |  Branch (85:54): [True: 5.42k, False: 34.9k]
  ------------------
   86|   761k|        return 0; // Indicates not found, safe because AS0 is reserved per RFC7607.
   87|   761k|    }
   88|  39.4k|    std::vector<std::byte> ip_bytes(16);
   89|  39.4k|    if (address.HasLinkedIPv4()) {
  ------------------
  |  Branch (89:9): [True: 4.54k, False: 34.9k]
  ------------------
   90|       |        // For lookup, treat as if it was just an IPv4 address (IPV4_IN_IPV6_PREFIX + IPv4 bits)
   91|  4.54k|        std::copy_n(std::as_bytes(std::span{IPV4_IN_IPV6_PREFIX}).begin(),
   92|  4.54k|                    IPV4_IN_IPV6_PREFIX.size(), ip_bytes.begin());
   93|  4.54k|        uint32_t ipv4 = address.GetLinkedIPv4();
   94|  22.7k|        for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (94:25): [True: 18.1k, False: 4.54k]
  ------------------
   95|  18.1k|            ip_bytes[12 + i] = std::byte((ipv4 >> (24 - i * 8)) & 0xFF);
   96|  18.1k|        }
   97|  34.9k|    } else {
   98|       |        // Use all 128 bits of the IPv6 address otherwise
   99|  34.9k|        assert(address.IsIPv6());
  ------------------
  |  Branch (99:9): [True: 34.9k, False: 0]
  ------------------
  100|  34.9k|        auto addr_bytes = address.GetAddrBytes();
  101|  34.9k|        assert(addr_bytes.size() == ip_bytes.size());
  ------------------
  |  Branch (101:9): [True: 34.9k, False: 0]
  ------------------
  102|  34.9k|        std::copy_n(std::as_bytes(std::span{addr_bytes}).begin(),
  103|  34.9k|                    addr_bytes.size(), ip_bytes.begin());
  104|  34.9k|    }
  105|  39.4k|    uint32_t mapped_as = Interpret(m_asmap, ip_bytes);
  106|  39.4k|    return mapped_as;
  107|  39.4k|}
_ZNK15NetGroupManager16ASMapHealthCheckERKNSt3__16vectorI8CNetAddrNS0_9allocatorIS2_EEEE:
  109|  9.89k|void NetGroupManager::ASMapHealthCheck(const std::vector<CNetAddr>& clearnet_addrs) const {
  110|  9.89k|    std::set<uint32_t> clearnet_asns{};
  111|  9.89k|    int unmapped_count{0};
  112|       |
  113|  9.89k|    for (const auto& addr : clearnet_addrs) {
  ------------------
  |  Branch (113:27): [True: 2.21k, False: 9.89k]
  ------------------
  114|  2.21k|        uint32_t asn = GetMappedAS(addr);
  115|  2.21k|        if (asn == 0) {
  ------------------
  |  Branch (115:13): [True: 1.65k, False: 564]
  ------------------
  116|  1.65k|            ++unmapped_count;
  117|  1.65k|            continue;
  118|  1.65k|        }
  119|    564|        clearnet_asns.insert(asn);
  120|    564|    }
  121|       |
  122|  9.89k|    LogInfo("ASMap Health Check: %i clearnet peers are mapped to %i ASNs with %i peers being unmapped\n", clearnet_addrs.size(), clearnet_asns.size(), unmapped_count);
  ------------------
  |  |  125|  9.89k|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  9.89k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  123|  9.89k|}

_ZN15NetGroupManager15WithLoadedAsmapEONSt3__16vectorISt4byteNS0_9allocatorIS2_EEEE:
   28|    616|    static NetGroupManager WithLoadedAsmap(std::vector<std::byte>&& asmap) {
   29|    616|        return NetGroupManager(std::span{asmap}, std::move(asmap));
   30|    616|    }
_ZN15NetGroupManagerC2ENSt3__14spanIKSt4byteLm18446744073709551615EEEONS0_6vectorIS2_NS0_9allocatorIS2_EEEE:
   97|  9.89k|        : m_asmap{embedded_asmap},
   98|  9.89k|          m_loaded_asmap{std::move(loaded_asmap)}
   99|  9.89k|    {
  100|       |        assert(m_loaded_asmap.empty() || m_asmap.data() == m_loaded_asmap.data());
  ------------------
  |  Branch (100:9): [True: 9.27k, False: 616]
  |  Branch (100:9): [True: 616, False: 0]
  |  Branch (100:9): [True: 9.89k, False: 0]
  ------------------
  101|  9.89k|    }
_ZN15NetGroupManager7NoAsmapEv:
   32|  9.27k|    static NetGroupManager NoAsmap() {
   33|  9.27k|        return NetGroupManager({}, {});
   34|  9.27k|    }

_Z22ConnectionTypeAsString14ConnectionType:
    9|  41.8k|{
   10|  41.8k|    switch (conn_type) {
  ------------------
  |  Branch (10:13): [True: 41.8k, False: 0]
  ------------------
   11|  18.2k|    case ConnectionType::INBOUND:
  ------------------
  |  Branch (11:5): [True: 18.2k, False: 23.6k]
  ------------------
   12|  18.2k|        return "inbound";
   13|  6.20k|    case ConnectionType::MANUAL:
  ------------------
  |  Branch (13:5): [True: 6.20k, False: 35.6k]
  ------------------
   14|  6.20k|        return "manual";
   15|  2.27k|    case ConnectionType::FEELER:
  ------------------
  |  Branch (15:5): [True: 2.27k, False: 39.6k]
  ------------------
   16|  2.27k|        return "feeler";
   17|  2.25k|    case ConnectionType::OUTBOUND_FULL_RELAY:
  ------------------
  |  Branch (17:5): [True: 2.25k, False: 39.6k]
  ------------------
   18|  2.25k|        return "outbound-full-relay";
   19|  5.18k|    case ConnectionType::BLOCK_RELAY:
  ------------------
  |  Branch (19:5): [True: 5.18k, False: 36.7k]
  ------------------
   20|  5.18k|        return "block-relay-only";
   21|  2.52k|    case ConnectionType::ADDR_FETCH:
  ------------------
  |  Branch (21:5): [True: 2.52k, False: 39.3k]
  ------------------
   22|  2.52k|        return "addr-fetch";
   23|  5.22k|    case ConnectionType::PRIVATE_BROADCAST:
  ------------------
  |  Branch (23:5): [True: 5.22k, False: 36.6k]
  ------------------
   24|  5.22k|        return "private-broadcast";
   25|  41.8k|    } // no default case, so the compiler can warn about missing cases
   26|       |
   27|  41.8k|    assert(false);
  ------------------
  |  Branch (27:5): [Folded, False: 0]
  ------------------
   28|      0|}

_ZN4node11NodeContextD2Ev:
   27|      2|NodeContext::~NodeContext() = default;

_Z23ProtectNoBanConnectionsRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEE:
   88|   177k|{
   89|   177k|    eviction_candidates.erase(std::remove_if(eviction_candidates.begin(), eviction_candidates.end(),
   90|   177k|                                             [](NodeEvictionCandidate const& n) {
   91|   177k|                                                 return n.m_noban;
   92|   177k|                                             }),
   93|   177k|                              eviction_candidates.end());
   94|   177k|}
_Z26ProtectOutboundConnectionsRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEE:
   97|   177k|{
   98|   177k|    eviction_candidates.erase(std::remove_if(eviction_candidates.begin(), eviction_candidates.end(),
   99|   177k|                                             [](NodeEvictionCandidate const& n) {
  100|   177k|                                                 return n.m_conn_type != ConnectionType::INBOUND;
  101|   177k|                                             }),
  102|   177k|                              eviction_candidates.end());
  103|   177k|}
_Z32ProtectEvictionCandidatesByRatioRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEE:
  106|   177k|{
  107|       |    // Protect the half of the remaining nodes which have been connected the longest.
  108|       |    // This replicates the non-eviction implicit behavior, and precludes attacks that start later.
  109|       |    // To favorise the diversity of our peer connections, reserve up to half of these protected
  110|       |    // spots for Tor/onion, localhost, I2P, and CJDNS peers, even if they're not longest uptime
  111|       |    // overall. This helps protect these higher-latency peers that tend to be otherwise
  112|       |    // disadvantaged under our eviction criteria.
  113|   177k|    const size_t initial_size = eviction_candidates.size();
  114|   177k|    const size_t total_protect_size{initial_size / 2};
  115|       |
  116|       |    // Disadvantaged networks to protect. In the case of equal counts, earlier array members
  117|       |    // have the first opportunity to recover unused slots from the previous iteration.
  118|   177k|    struct Net { bool is_local; Network id; size_t count; };
  119|   177k|    std::array<Net, 4> networks{
  120|   177k|        {{false, NET_CJDNS, 0}, {false, NET_I2P, 0}, {/*localhost=*/true, NET_MAX, 0}, {false, NET_ONION, 0}}};
  121|       |
  122|       |    // Count and store the number of eviction candidates per network.
  123|   711k|    for (Net& n : networks) {
  ------------------
  |  Branch (123:17): [True: 711k, False: 177k]
  ------------------
  124|   711k|        n.count = std::count_if(eviction_candidates.cbegin(), eviction_candidates.cend(),
  125|   711k|                                [&n](const NodeEvictionCandidate& c) {
  126|   711k|                                    return n.is_local ? c.m_is_local : c.m_network == n.id;
  127|   711k|                                });
  128|   711k|    }
  129|       |    // Sort `networks` by ascending candidate count, to give networks having fewer candidates
  130|       |    // the first opportunity to recover unused protected slots from the previous iteration.
  131|   177k|    std::stable_sort(networks.begin(), networks.end(), [](Net a, Net b) { return a.count < b.count; });
  132|       |
  133|       |    // Protect up to 25% of the eviction candidates by disadvantaged network.
  134|   177k|    const size_t max_protect_by_network{total_protect_size / 2};
  135|   177k|    size_t num_protected{0};
  136|       |
  137|   324k|    while (num_protected < max_protect_by_network) {
  ------------------
  |  Branch (137:12): [True: 228k, False: 96.2k]
  ------------------
  138|       |        // Count the number of disadvantaged networks from which we have peers to protect.
  139|   228k|        auto num_networks = std::count_if(networks.begin(), networks.end(), [](const Net& n) { return n.count; });
  140|   228k|        if (num_networks == 0) {
  ------------------
  |  Branch (140:13): [True: 74.2k, False: 154k]
  ------------------
  141|  74.2k|            break;
  142|  74.2k|        }
  143|   154k|        const size_t disadvantaged_to_protect{max_protect_by_network - num_protected};
  144|   154k|        const size_t protect_per_network{std::max(disadvantaged_to_protect / num_networks, static_cast<size_t>(1))};
  145|       |        // Early exit flag if there are no remaining candidates by disadvantaged network.
  146|   154k|        bool protected_at_least_one{false};
  147|       |
  148|   612k|        for (Net& n : networks) {
  ------------------
  |  Branch (148:21): [True: 612k, False: 74.3k]
  ------------------
  149|   612k|            if (n.count == 0) continue;
  ------------------
  |  Branch (149:17): [True: 372k, False: 240k]
  ------------------
  150|   240k|            const size_t before = eviction_candidates.size();
  151|   240k|            EraseLastKElements(eviction_candidates, CompareNodeNetworkTime(n.is_local, n.id),
  152|   240k|                               protect_per_network, [&n](const NodeEvictionCandidate& c) {
  153|   240k|                                   return n.is_local ? c.m_is_local : c.m_network == n.id;
  154|   240k|                               });
  155|   240k|            const size_t after = eviction_candidates.size();
  156|   240k|            if (before > after) {
  ------------------
  |  Branch (156:17): [True: 231k, False: 9.79k]
  ------------------
  157|   231k|                protected_at_least_one = true;
  158|   231k|                const size_t delta{before - after};
  159|   231k|                num_protected += delta;
  160|   231k|                if (num_protected >= max_protect_by_network) {
  ------------------
  |  Branch (160:21): [True: 80.1k, False: 151k]
  ------------------
  161|  80.1k|                    break;
  162|  80.1k|                }
  163|   151k|                n.count -= delta;
  164|   151k|            }
  165|   240k|        }
  166|   154k|        if (!protected_at_least_one) {
  ------------------
  |  Branch (166:13): [True: 7.43k, False: 147k]
  ------------------
  167|  7.43k|            break;
  168|  7.43k|        }
  169|   154k|    }
  170|       |
  171|       |    // Calculate how many we removed, and update our total number of peers that
  172|       |    // we want to protect based on uptime accordingly.
  173|   177k|    assert(num_protected == initial_size - eviction_candidates.size());
  ------------------
  |  Branch (173:5): [True: 177k, False: 0]
  ------------------
  174|   177k|    const size_t remaining_to_protect{total_protect_size - num_protected};
  175|   177k|    EraseLastKElements(eviction_candidates, ReverseCompareNodeTimeConnected, remaining_to_protect);
  176|   177k|}
_Z17SelectNodeToEvictONSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEE:
  179|   177k|{
  180|       |    // Protect connections with certain characteristics
  181|       |
  182|   177k|    ProtectNoBanConnections(vEvictionCandidates);
  183|       |
  184|   177k|    ProtectOutboundConnections(vEvictionCandidates);
  185|       |
  186|       |    // Deterministically select 4 peers to protect by netgroup.
  187|       |    // An attacker cannot predict which netgroups will be protected
  188|   177k|    EraseLastKElements(vEvictionCandidates, CompareNetGroupKeyed, 4);
  189|       |    // Protect the 8 nodes with the lowest minimum ping time.
  190|       |    // An attacker cannot manipulate this metric without physically moving nodes closer to the target.
  191|   177k|    EraseLastKElements(vEvictionCandidates, ReverseCompareNodeMinPingTime, 8);
  192|       |    // Protect 4 nodes that most recently sent us novel transactions accepted into our mempool.
  193|       |    // An attacker cannot manipulate this metric without performing useful work.
  194|   177k|    EraseLastKElements(vEvictionCandidates, CompareNodeTXTime, 4);
  195|       |    // Protect up to 8 non-tx-relay peers that have sent us novel blocks.
  196|   177k|    EraseLastKElements(vEvictionCandidates, CompareNodeBlockRelayOnlyTime, 8,
  197|   177k|                       [](const NodeEvictionCandidate& n) { return !n.m_relay_txs && n.fRelevantServices; });
  198|       |
  199|       |    // Protect 4 nodes that most recently sent us novel blocks.
  200|       |    // An attacker cannot manipulate this metric without performing useful work.
  201|   177k|    EraseLastKElements(vEvictionCandidates, CompareNodeBlockTime, 4);
  202|       |
  203|       |    // Protect some of the remaining eviction candidates by ratios of desirable
  204|       |    // or disadvantaged characteristics.
  205|   177k|    ProtectEvictionCandidatesByRatio(vEvictionCandidates);
  206|       |
  207|   177k|    if (vEvictionCandidates.empty()) return std::nullopt;
  ------------------
  |  Branch (207:9): [True: 15.5k, False: 162k]
  ------------------
  208|       |
  209|       |    // If any remaining peers are preferred for eviction consider only them.
  210|       |    // This happens after the other preferences since if a peer is really the best by other criteria (esp relaying blocks)
  211|       |    //  then we probably don't want to evict it no matter what.
  212|   162k|    if (std::any_of(vEvictionCandidates.begin(),vEvictionCandidates.end(),[](NodeEvictionCandidate const &n){return n.prefer_evict;})) {
  ------------------
  |  Branch (212:9): [True: 0, False: 162k]
  ------------------
  213|      0|        vEvictionCandidates.erase(std::remove_if(vEvictionCandidates.begin(),vEvictionCandidates.end(),
  214|      0|                                  [](NodeEvictionCandidate const &n){return !n.prefer_evict;}),vEvictionCandidates.end());
  215|      0|    }
  216|       |
  217|       |    // Identify the network group with the most connections and youngest member.
  218|       |    // (vEvictionCandidates is already sorted by reverse connect time)
  219|   162k|    uint64_t naMostConnections;
  220|   162k|    unsigned int nMostConnections = 0;
  221|   162k|    NodeClock::time_point nMostConnectionsTime{NodeClock::epoch};
  222|   162k|    std::map<uint64_t, std::vector<NodeEvictionCandidate> > mapNetGroupNodes;
  223|  16.1M|    for (const NodeEvictionCandidate &node : vEvictionCandidates) {
  ------------------
  |  Branch (223:44): [True: 16.1M, False: 162k]
  ------------------
  224|  16.1M|        std::vector<NodeEvictionCandidate> &group = mapNetGroupNodes[node.nKeyedNetGroup];
  225|  16.1M|        group.push_back(node);
  226|  16.1M|        const auto grouptime{group[0].m_connected};
  227|       |
  228|  16.1M|        if (group.size() > nMostConnections || (group.size() == nMostConnections && grouptime > nMostConnectionsTime)) {
  ------------------
  |  Branch (228:13): [True: 11.5M, False: 4.55M]
  |  Branch (228:49): [True: 1.88M, False: 2.67M]
  |  Branch (228:85): [True: 0, False: 1.88M]
  ------------------
  229|  11.5M|            nMostConnections = group.size();
  230|  11.5M|            nMostConnectionsTime = grouptime;
  231|  11.5M|            naMostConnections = node.nKeyedNetGroup;
  232|  11.5M|        }
  233|  16.1M|    }
  234|       |
  235|       |    // Reduce to the network group with the most connections
  236|   162k|    vEvictionCandidates = std::move(mapNetGroupNodes[naMostConnections]);
  237|       |
  238|       |    // Disconnect from the network group with the most connections
  239|   162k|    return vEvictionCandidates.front().id;
  240|   177k|}
eviction.cpp:_ZZ23ProtectNoBanConnectionsRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_0clERKS1_:
   90|  41.6M|                                             [](NodeEvictionCandidate const& n) {
   91|  41.6M|                                                 return n.m_noban;
   92|  41.6M|                                             }),
eviction.cpp:_ZZ26ProtectOutboundConnectionsRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_0clERKS1_:
   99|  39.5M|                                             [](NodeEvictionCandidate const& n) {
  100|  39.5M|                                                 return n.m_conn_type != ConnectionType::INBOUND;
  101|  39.5M|                                             }),
eviction.cpp:_ZZ32ProtectEvictionCandidatesByRatioRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_0clERKS1_:
  125|   128M|                                [&n](const NodeEvictionCandidate& c) {
  126|   128M|                                    return n.is_local ? c.m_is_local : c.m_network == n.id;
  ------------------
  |  Branch (126:44): [True: 32.1M, False: 96.5M]
  ------------------
  127|   128M|                                });
eviction.cpp:_ZZ32ProtectEvictionCandidatesByRatioRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_1clERKZ32ProtectEvictionCandidatesByRatioS5_E3Net:
  139|   914k|        auto num_networks = std::count_if(networks.begin(), networks.end(), [](const Net& n) { return n.count; });
_ZN22CompareNodeNetworkTimeC2Eb7Network:
   67|   240k|    CompareNodeNetworkTime(bool is_local, Network network) : m_is_local(is_local), m_network(network) {}
eviction.cpp:_ZL31ReverseCompareNodeTimeConnectedRK21NodeEvictionCandidateS1_:
   22|   774M|{
   23|   774M|    return a.m_connected > b.m_connected;
   24|   774M|}
eviction.cpp:_ZL20CompareNetGroupKeyedRK21NodeEvictionCandidateS1_:
   26|  1.53G|static bool CompareNetGroupKeyed(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) {
   27|  1.53G|    return a.nKeyedNetGroup < b.nKeyedNetGroup;
   28|  1.53G|}
eviction.cpp:_ZL29ReverseCompareNodeMinPingTimeRK21NodeEvictionCandidateS1_:
   17|   916M|{
   18|   916M|    return a.m_min_ping_time > b.m_min_ping_time;
   19|   916M|}
eviction.cpp:_ZL17CompareNodeTXTimeRK21NodeEvictionCandidateS1_:
   39|   860M|{
   40|       |    // There is a fall-through here because it is common for a node to have more than a few peers that have not yet relayed txn.
   41|   860M|    if (a.m_last_tx_time != b.m_last_tx_time) return a.m_last_tx_time < b.m_last_tx_time;
  ------------------
  |  Branch (41:9): [True: 0, False: 860M]
  ------------------
   42|   860M|    if (a.m_relay_txs != b.m_relay_txs) return b.m_relay_txs;
  ------------------
  |  Branch (42:9): [True: 0, False: 860M]
  ------------------
   43|   860M|    if (a.fBloomFilter != b.fBloomFilter) return a.fBloomFilter;
  ------------------
  |  Branch (43:9): [True: 0, False: 860M]
  ------------------
   44|   860M|    return a.m_connected > b.m_connected;
   45|   860M|}
eviction.cpp:_ZL29CompareNodeBlockRelayOnlyTimeRK21NodeEvictionCandidateS1_:
   49|   836M|{
   50|   836M|    if (a.m_relay_txs != b.m_relay_txs) return a.m_relay_txs;
  ------------------
  |  Branch (50:9): [True: 0, False: 836M]
  ------------------
   51|   836M|    if (a.m_last_block_time != b.m_last_block_time) return a.m_last_block_time < b.m_last_block_time;
  ------------------
  |  Branch (51:9): [True: 0, False: 836M]
  ------------------
   52|   836M|    if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;
  ------------------
  |  Branch (52:9): [True: 0, False: 836M]
  ------------------
   53|   836M|    return a.m_connected > b.m_connected;
   54|   836M|}
eviction.cpp:_ZL20CompareNodeBlockTimeRK21NodeEvictionCandidateS1_:
   31|   836M|{
   32|       |    // There is a fall-through here because it is common for a node to have many peers which have not yet relayed a block.
   33|   836M|    if (a.m_last_block_time != b.m_last_block_time) return a.m_last_block_time < b.m_last_block_time;
  ------------------
  |  Branch (33:9): [True: 0, False: 836M]
  ------------------
   34|   836M|    if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;
  ------------------
  |  Branch (34:9): [True: 0, False: 836M]
  ------------------
   35|   836M|    return a.m_connected > b.m_connected;
   36|   836M|}
eviction.cpp:_ZZ17SelectNodeToEvictONSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_1clERKS1_:
  212|  16.1M|    if (std::any_of(vEvictionCandidates.begin(),vEvictionCandidates.end(),[](NodeEvictionCandidate const &n){return n.prefer_evict;})) {
eviction.cpp:_ZZ32ProtectEvictionCandidatesByRatioRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_3clEZ32ProtectEvictionCandidatesByRatioS5_E3NetS7_:
  131|  5.58M|    std::stable_sort(networks.begin(), networks.end(), [](Net a, Net b) { return a.count < b.count; });
eviction.cpp:_ZL18EraseLastKElementsI21NodeEvictionCandidate22CompareNodeNetworkTimeEvRNSt3__16vectorIT_NS2_9allocatorIS4_EEEET0_mNS2_8functionIFbRKS0_EEE:
   81|   240k|{
   82|   240k|    std::sort(elements.begin(), elements.end(), comparator);
   83|   240k|    size_t eraseSize = std::min(k, elements.size());
   84|   240k|    elements.erase(std::remove_if(elements.end() - eraseSize, elements.end(), predicate), elements.end());
   85|   240k|}
_ZNK22CompareNodeNetworkTimeclERK21NodeEvictionCandidateS2_:
   69|  1.47G|    {
   70|  1.47G|        if (m_is_local && a.m_is_local != b.m_is_local) return b.m_is_local;
  ------------------
  |  Branch (70:13): [True: 419M, False: 1.05G]
  |  Branch (70:27): [True: 37.5M, False: 381M]
  ------------------
   71|  1.44G|        if ((a.m_network == m_network) != (b.m_network == m_network)) return b.m_network == m_network;
  ------------------
  |  Branch (71:13): [True: 57.8M, False: 1.38G]
  ------------------
   72|  1.38G|        return a.m_connected > b.m_connected;
   73|  1.44G|    };
eviction.cpp:_ZZ32ProtectEvictionCandidatesByRatioRNSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_2clERKS1_:
  152|  2.52M|                               protect_per_network, [&n](const NodeEvictionCandidate& c) {
  153|  2.52M|                                   return n.is_local ? c.m_is_local : c.m_network == n.id;
  ------------------
  |  Branch (153:43): [True: 468k, False: 2.05M]
  ------------------
  154|  2.52M|                               });
eviction.cpp:_ZL18EraseLastKElementsI21NodeEvictionCandidatePFbRKS0_S2_EEvRNSt3__16vectorIT_NS5_9allocatorIS7_EEEET0_mNS5_8functionIFbS2_EEE:
   81|  1.06M|{
   82|  1.06M|    std::sort(elements.begin(), elements.end(), comparator);
   83|  1.06M|    size_t eraseSize = std::min(k, elements.size());
   84|  1.06M|    elements.erase(std::remove_if(elements.end() - eraseSize, elements.end(), predicate), elements.end());
   85|  1.06M|}
eviction.cpp:_ZZL18EraseLastKElementsI21NodeEvictionCandidatePFbRKS0_S2_EEvRNSt3__16vectorIT_NS5_9allocatorIS7_EEEET0_mNS5_8functionIFbS2_EEEENK3$_0clES2_:
   80|  18.5M|    std::function<bool(const NodeEvictionCandidate&)> predicate = [](const NodeEvictionCandidate& n) { return true; })
eviction.cpp:_ZZ17SelectNodeToEvictONSt3__16vectorI21NodeEvictionCandidateNS_9allocatorIS1_EEEEENK3$_0clERKS1_:
  197|  1.31M|                       [](const NodeEvictionCandidate& n) { return !n.m_relay_txs && n.fRelevantServices; });
  ------------------
  |  Branch (197:68): [True: 1.31M, False: 0]
  |  Branch (197:86): [True: 0, False: 1.31M]
  ------------------

_ZN4node17TxDownloadManagerD2Ev:
   20|      2|TxDownloadManager::~TxDownloadManager() = default;

_ZN4node15TxOrphanageImplD2Ev:
  197|      2|    ~TxOrphanageImpl() noexcept override = default;

_ZN4node11TxOrphanageD2Ev:
   56|      2|    virtual ~TxOrphanage() = default;

_ZN9prevectorILj35EhjiE4dataEv:
  464|  5.88k|    value_type* data() {
  465|  5.88k|        return item_ptr(0);
  466|  5.88k|    }
_ZN9prevectorILj35EhjiE8item_ptrEi:
  159|  47.0k|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (159:47): [True: 47.0k, False: 0]
  ------------------
_ZNK9prevectorILj35EhjiE9is_directEv:
  126|   111k|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj35EhjiE10direct_ptrEi:
  122|  47.0k|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZNK9prevectorILj35EhjiE4sizeEv:
  247|  41.1k|    size_type size() const {
  248|  41.1k|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (248:16): [True: 41.1k, False: 0]
  ------------------
  249|  41.1k|    }
_ZNK9prevectorILj16EhjiEeqERKS0_:
  429|  18.9M|    constexpr bool operator==(const prevector& other) const {
  430|  18.9M|        return std::ranges::equal(*this, other);
  431|  18.9M|    }
_ZNK9prevectorILj16EhjiEltERKS0_:
  433|  61.5M|    bool operator<(const prevector<N, T, Size, Diff>& other) const {
  434|  61.5M|        if (size() < other.size()) {
  ------------------
  |  Branch (434:13): [True: 0, False: 61.5M]
  ------------------
  435|      0|            return true;
  436|      0|        }
  437|  61.5M|        if (size() > other.size()) {
  ------------------
  |  Branch (437:13): [True: 0, False: 61.5M]
  ------------------
  438|      0|            return false;
  439|      0|        }
  440|  61.5M|        const_iterator b1 = begin();
  441|  61.5M|        const_iterator b2 = other.begin();
  442|  61.5M|        const_iterator e1 = end();
  443|   372M|        while (b1 != e1) {
  ------------------
  |  Branch (443:16): [True: 357M, False: 15.2M]
  ------------------
  444|   357M|            if ((*b1) < (*b2)) {
  ------------------
  |  Branch (444:17): [True: 35.1M, False: 322M]
  ------------------
  445|  35.1M|                return true;
  446|  35.1M|            }
  447|   322M|            if ((*b2) < (*b1)) {
  ------------------
  |  Branch (447:17): [True: 11.1M, False: 311M]
  ------------------
  448|  11.1M|                return false;
  449|  11.1M|            }
  450|   311M|            ++b1;
  451|   311M|            ++b2;
  452|   311M|        }
  453|  15.2M|        return false;
  454|  61.5M|    }
_ZN9prevectorILj16EhjiEC2EjRKh:
  202|  7.33M|    explicit prevector(size_type n, const T& val) {
  203|  7.33M|        change_capacity(n);
  204|  7.33M|        _size += n;
  205|  7.33M|        fill(item_ptr(0), n, val);
  206|  7.33M|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvT_S7_:
  186|   299k|    void assign(InputIterator first, InputIterator last) {
  187|   299k|        size_type n = last - first;
  188|   299k|        clear();
  189|   299k|        if (capacity() < n) {
  ------------------
  |  Branch (189:13): [True: 4.78k, False: 294k]
  ------------------
  190|  4.78k|            change_capacity(n);
  191|  4.78k|        }
  192|   299k|        _size += n;
  193|   299k|        fill(item_ptr(0), first, last);
  194|   299k|    }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  167|   299k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  5.13M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 4.83M, False: 299k]
  ------------------
  169|  4.83M|            new(static_cast<void*>(dst)) T(*first);
  170|  4.83M|            ++dst;
  171|  4.83M|            ++first;
  172|  4.83M|        }
  173|   299k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorEPhEEvT_S4_:
  186|  72.9k|    void assign(InputIterator first, InputIterator last) {
  187|  72.9k|        size_type n = last - first;
  188|  72.9k|        clear();
  189|  72.9k|        if (capacity() < n) {
  ------------------
  |  Branch (189:13): [True: 0, False: 72.9k]
  ------------------
  190|      0|            change_capacity(n);
  191|      0|        }
  192|  72.9k|        _size += n;
  193|  72.9k|        fill(item_ptr(0), first, last);
  194|  72.9k|    }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorEPhEEvS3_T_S4_:
  167|  72.9k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|   802k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 729k, False: 72.9k]
  ------------------
  169|   729k|            new(static_cast<void*>(dst)) T(*first);
  170|   729k|            ++dst;
  171|   729k|            ++first;
  172|   729k|        }
  173|  72.9k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEEvT_S6_:
  186|  6.70k|    void assign(InputIterator first, InputIterator last) {
  187|  6.70k|        size_type n = last - first;
  188|  6.70k|        clear();
  189|  6.70k|        if (capacity() < n) {
  ------------------
  |  Branch (189:13): [True: 6.70k, False: 0]
  ------------------
  190|  6.70k|            change_capacity(n);
  191|  6.70k|        }
  192|  6.70k|        _size += n;
  193|  6.70k|        fill(item_ptr(0), first, last);
  194|  6.70k|    }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEEvS4_T_S6_:
  167|  6.70k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|   221k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 214k, False: 6.70k]
  ------------------
  169|   214k|            new(static_cast<void*>(dst)) T(*first);
  170|   214k|            ++dst;
  171|   214k|            ++first;
  172|   214k|        }
  173|  6.70k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorEPKhEEvT_S5_:
  186|  7.13k|    void assign(InputIterator first, InputIterator last) {
  187|  7.13k|        size_type n = last - first;
  188|  7.13k|        clear();
  189|  7.13k|        if (capacity() < n) {
  ------------------
  |  Branch (189:13): [True: 0, False: 7.13k]
  ------------------
  190|      0|            change_capacity(n);
  191|      0|        }
  192|  7.13k|        _size += n;
  193|  7.13k|        fill(item_ptr(0), first, last);
  194|  7.13k|    }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorEPKhEEvPhT_S6_:
  167|  7.13k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  35.6k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 28.5k, False: 7.13k]
  ------------------
  169|  28.5k|            new(static_cast<void*>(dst)) T(*first);
  170|  28.5k|            ++dst;
  171|  28.5k|            ++first;
  172|  28.5k|        }
  173|  7.13k|    }
_ZN9prevectorILj35EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEET_S7_:
  209|  5.88k|    prevector(InputIterator first, InputIterator last) {
  210|  5.88k|        size_type n = last - first;
  211|  5.88k|        change_capacity(n);
  212|  5.88k|        _size += n;
  213|  5.88k|        fill(item_ptr(0), first, last);
  214|  5.88k|    }
_ZN9prevectorILj35EhjiE15change_capacityEj:
  128|  5.88k|    void change_capacity(size_type new_capacity) {
  129|  5.88k|        if (new_capacity <= N) {
  ------------------
  |  Branch (129:13): [True: 5.88k, False: 0]
  ------------------
  130|  5.88k|            if (!is_direct()) {
  ------------------
  |  Branch (130:17): [True: 0, False: 5.88k]
  ------------------
  131|      0|                T* indirect = indirect_ptr(0);
  132|      0|                T* src = indirect;
  133|      0|                T* dst = direct_ptr(0);
  134|      0|                memcpy(dst, src, size() * sizeof(T));
  135|      0|                free(indirect);
  136|      0|                _size -= N + 1;
  137|      0|            }
  138|  5.88k|        } else {
  139|      0|            if (!is_direct()) {
  ------------------
  |  Branch (139:17): [True: 0, False: 0]
  ------------------
  140|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  141|       |                    success. These should instead use an allocator or new/delete so that handlers
  142|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  143|      0|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  144|      0|                assert(_union.indirect_contents.indirect);
  ------------------
  |  Branch (144:17): [True: 0, False: 0]
  ------------------
  145|      0|                _union.indirect_contents.capacity = new_capacity;
  146|      0|            } else {
  147|      0|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  148|      0|                assert(new_indirect);
  ------------------
  |  Branch (148:17): [True: 0, False: 0]
  ------------------
  149|      0|                T* src = direct_ptr(0);
  150|      0|                T* dst = reinterpret_cast<T*>(new_indirect);
  151|      0|                memcpy(dst, src, size() * sizeof(T));
  152|      0|                _union.indirect_contents.indirect = new_indirect;
  153|      0|                _union.indirect_contents.capacity = new_capacity;
  154|      0|                _size += N + 1;
  155|      0|            }
  156|      0|        }
  157|  5.88k|    }
_ZN9prevectorILj35EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  167|  5.88k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|   194k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 188k, False: 5.88k]
  ------------------
  169|   188k|            new(static_cast<void*>(dst)) T(*first);
  170|   188k|            ++dst;
  171|   188k|            ++first;
  172|   188k|        }
  173|  5.88k|    }
_ZN9prevectorILj35EhjiED2Ev:
  422|  5.88k|    ~prevector() {
  423|  5.88k|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 0, False: 5.88k]
  ------------------
  424|      0|            free(_union.indirect_contents.indirect);
  425|      0|            _union.indirect_contents.indirect = nullptr;
  426|      0|        }
  427|  5.88k|    }
_ZN9prevectorILj35EhjiE3endEv:
  257|  11.7k|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj35EhjiE8iteratorC2EPh:
   60|  23.5k|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj35EhjiE6insertITkNSt3__114input_iteratorEPhEEvNS0_8iteratorET_S5_:
  335|  5.88k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  336|  5.88k|        size_type p = pos - begin();
  337|  5.88k|        difference_type count = last - first;
  338|  5.88k|        size_type new_size = size() + count;
  339|  5.88k|        if (capacity() < new_size) {
  ------------------
  |  Branch (339:13): [True: 0, False: 5.88k]
  ------------------
  340|      0|            change_capacity(new_size + (new_size >> 1));
  341|      0|        }
  342|  5.88k|        T* ptr = item_ptr(p);
  343|  5.88k|        T* dst = ptr + count;
  344|  5.88k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  345|  5.88k|        _size += count;
  346|  5.88k|        fill(ptr, first, last);
  347|  5.88k|    }
_ZmiN9prevectorILj35EhjiE8iteratorES1_:
   68|  11.7k|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj35EhjiE8iteratordeEv:
   61|  23.5k|        T& operator*() const { return *ptr; }
_ZN9prevectorILj35EhjiE5beginEv:
  255|  11.7k|    iterator begin() { return iterator(item_ptr(0)); }
_ZNK9prevectorILj35EhjiE8capacityEv:
  260|  11.7k|    size_t capacity() const {
  261|  11.7k|        if (is_direct()) {
  ------------------
  |  Branch (261:13): [True: 11.7k, False: 0]
  ------------------
  262|  11.7k|            return N;
  263|  11.7k|        } else {
  264|      0|            return _union.indirect_contents.capacity;
  265|      0|        }
  266|  11.7k|    }
_ZN9prevectorILj35EhjiE4fillITkNSt3__114input_iteratorEPhEEvS3_T_S4_:
  167|  5.88k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  17.6k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 11.7k, False: 5.88k]
  ------------------
  169|  11.7k|            new(static_cast<void*>(dst)) T(*first);
  170|  11.7k|            ++dst;
  171|  11.7k|            ++first;
  172|  11.7k|        }
  173|  5.88k|    }
_ZN9prevectorILj35EhjiE6insertITkNSt3__114input_iteratorEPKhEEvNS0_8iteratorET_S6_:
  335|  5.88k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  336|  5.88k|        size_type p = pos - begin();
  337|  5.88k|        difference_type count = last - first;
  338|  5.88k|        size_type new_size = size() + count;
  339|  5.88k|        if (capacity() < new_size) {
  ------------------
  |  Branch (339:13): [True: 0, False: 5.88k]
  ------------------
  340|      0|            change_capacity(new_size + (new_size >> 1));
  341|      0|        }
  342|  5.88k|        T* ptr = item_ptr(p);
  343|  5.88k|        T* dst = ptr + count;
  344|  5.88k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  345|  5.88k|        _size += count;
  346|  5.88k|        fill(ptr, first, last);
  347|  5.88k|    }
_ZN9prevectorILj35EhjiE4fillITkNSt3__114input_iteratorEPKhEEvPhT_S6_:
  167|  5.88k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  11.7k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 5.88k, False: 5.88k]
  ------------------
  169|  5.88k|            new(static_cast<void*>(dst)) T(*first);
  170|  5.88k|            ++dst;
  171|  5.88k|            ++first;
  172|  5.88k|        }
  173|  5.88k|    }
_ZN9prevectorILj16EhjiEixEj:
  268|   100k|    T& operator[](size_type pos) {
  269|   100k|        return *item_ptr(pos);
  270|   100k|    }
_ZNK9prevectorILj16EhjiEixEj:
  272|   108M|    const T& operator[](size_type pos) const {
  273|   108M|        return *item_ptr(pos);
  274|   108M|    }
_ZNK9prevectorILj16EhjiE14const_iteratorptEv:
   90|   508M|        const T* operator->() const { return ptr; }
_ZN9prevectorILj16EhjiE4dataEv:
  464|  1.27M|    value_type* data() {
  465|  1.27M|        return item_ptr(0);
  466|  1.27M|    }
_ZN9prevectorILj16EhjiE6assignEjRKh:
  176|   178k|    void assign(size_type n, const T& val) {
  177|   178k|        clear();
  178|   178k|        if (capacity() < n) {
  ------------------
  |  Branch (178:13): [True: 0, False: 178k]
  ------------------
  179|      0|            change_capacity(n);
  180|      0|        }
  181|   178k|        _size += n;
  182|   178k|        fill(item_ptr(0), n, val);
  183|   178k|    }
_ZNK9prevectorILj16EhjiE4dataEv:
  468|   191M|    const value_type* data() const {
  469|   191M|        return item_ptr(0);
  470|   191M|    }
_ZN9prevectorILj16EhjiEaSERKS0_:
  229|   808k|    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
  230|   808k|        if (&other == this) {
  ------------------
  |  Branch (230:13): [True: 0, False: 808k]
  ------------------
  231|      0|            return *this;
  232|      0|        }
  233|   808k|        assign(other.begin(), other.end());
  234|   808k|        return *this;
  235|   808k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorENS0_14const_iteratorEEEvT_S4_:
  186|   808k|    void assign(InputIterator first, InputIterator last) {
  187|   808k|        size_type n = last - first;
  188|   808k|        clear();
  189|   808k|        if (capacity() < n) {
  ------------------
  |  Branch (189:13): [True: 57.6k, False: 750k]
  ------------------
  190|  57.6k|            change_capacity(n);
  191|  57.6k|        }
  192|   808k|        _size += n;
  193|   808k|        fill(item_ptr(0), first, last);
  194|   808k|    }
_ZmiN9prevectorILj16EhjiE14const_iteratorES1_:
   96|   851k|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj16EhjiE5clearEv:
  303|  1.37M|    void clear() {
  304|  1.37M|        resize(0);
  305|  1.37M|    }
_ZN9prevectorILj16EhjiE6resizeEj:
  276|  2.64M|    void resize(size_type new_size) {
  277|  2.64M|        size_type cur_size = size();
  278|  2.64M|        if (cur_size == new_size) {
  ------------------
  |  Branch (278:13): [True: 814k, False: 1.83M]
  ------------------
  279|   814k|            return;
  280|   814k|        }
  281|  1.83M|        if (cur_size > new_size) {
  ------------------
  |  Branch (281:13): [True: 1.46M, False: 366k]
  ------------------
  282|  1.46M|            erase(item_ptr(new_size), end());
  283|  1.46M|            return;
  284|  1.46M|        }
  285|   366k|        if (new_size > capacity()) {
  ------------------
  |  Branch (285:13): [True: 366k, False: 0]
  ------------------
  286|   366k|            change_capacity(new_size);
  287|   366k|        }
  288|   366k|        ptrdiff_t increase = new_size - cur_size;
  289|   366k|        fill(item_ptr(cur_size), increase);
  290|   366k|        _size += increase;
  291|   366k|    }
_ZN9prevectorILj16EhjiE5eraseENS0_8iteratorES1_:
  368|  1.46M|    iterator erase(iterator first, iterator last) {
  369|       |        // Erase is not allowed to the change the object's capacity. That means
  370|       |        // that when starting with an indirectly allocated prevector with
  371|       |        // size and capacity > N, the result may be a still indirectly allocated
  372|       |        // prevector with size <= N and capacity > N. A shrink_to_fit() call is
  373|       |        // necessary to switch to the (more efficient) directly allocated
  374|       |        // representation (with capacity N and size <= N).
  375|  1.46M|        iterator p = first;
  376|  1.46M|        char* endp = (char*)&(*end());
  377|  1.46M|        _size -= last - p;
  378|  1.46M|        memmove(&(*first), &(*last), endp - ((char*)(&(*last))));
  379|  1.46M|        return first;
  380|  1.46M|    }
_ZNK9prevectorILj16EhjiE8iteratordeEv:
   61|  8.81M|        T& operator*() const { return *ptr; }
_ZmiN9prevectorILj16EhjiE8iteratorES1_:
   68|  1.46M|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj16EhjiE8iteratorC2EPh:
   60|  4.40M|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj16EhjiE3endEv:
  257|  2.93M|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj16EhjiE4fillEPhlRKh:
  162|  7.87M|    void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
  163|  7.87M|        std::fill_n(dst, count, value);
  164|  7.87M|    }
_ZNK9prevectorILj16EhjiE8capacityEv:
  260|  1.74M|    size_t capacity() const {
  261|  1.74M|        if (is_direct()) {
  ------------------
  |  Branch (261:13): [True: 1.74M, False: 0]
  ------------------
  262|  1.74M|            return N;
  263|  1.74M|        } else {
  264|      0|            return _union.indirect_contents.capacity;
  265|      0|        }
  266|  1.74M|    }
_ZN9prevectorILj16EhjiEC2EOS0_:
  224|   297k|        : _union(std::move(other._union)), _size(other._size)
  225|   297k|    {
  226|   297k|        other._size = 0;
  227|   297k|    }
_ZN9prevectorILj16EhjiEC2ERKS0_:
  216|   148M|    prevector(const prevector<N, T, Size, Diff>& other) {
  217|   148M|        size_type n = other.size();
  218|   148M|        change_capacity(n);
  219|   148M|        _size += n;
  220|   148M|        fill(item_ptr(0), other.begin(),  other.end());
  221|   148M|    }
_ZNK9prevectorILj16EhjiE4sizeEv:
  247|  1.15G|    size_type size() const {
  248|  1.15G|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (248:16): [True: 1.04G, False: 104M]
  ------------------
  249|  1.15G|    }
_ZNK9prevectorILj16EhjiE9is_directEv:
  126|  2.92G|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj16EhjiE15change_capacityEj:
  128|   156M|    void change_capacity(size_type new_capacity) {
  129|   156M|        if (new_capacity <= N) {
  ------------------
  |  Branch (129:13): [True: 131M, False: 24.7M]
  ------------------
  130|   131M|            if (!is_direct()) {
  ------------------
  |  Branch (130:17): [True: 0, False: 131M]
  ------------------
  131|      0|                T* indirect = indirect_ptr(0);
  132|      0|                T* src = indirect;
  133|      0|                T* dst = direct_ptr(0);
  134|      0|                memcpy(dst, src, size() * sizeof(T));
  135|      0|                free(indirect);
  136|      0|                _size -= N + 1;
  137|      0|            }
  138|   131M|        } else {
  139|  24.7M|            if (!is_direct()) {
  ------------------
  |  Branch (139:17): [True: 0, False: 24.7M]
  ------------------
  140|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  141|       |                    success. These should instead use an allocator or new/delete so that handlers
  142|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  143|      0|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  144|      0|                assert(_union.indirect_contents.indirect);
  ------------------
  |  Branch (144:17): [True: 0, False: 0]
  ------------------
  145|      0|                _union.indirect_contents.capacity = new_capacity;
  146|  24.7M|            } else {
  147|  24.7M|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  148|  24.7M|                assert(new_indirect);
  ------------------
  |  Branch (148:17): [True: 24.7M, False: 0]
  ------------------
  149|  24.7M|                T* src = direct_ptr(0);
  150|  24.7M|                T* dst = reinterpret_cast<T*>(new_indirect);
  151|  24.7M|                memcpy(dst, src, size() * sizeof(T));
  152|  24.7M|                _union.indirect_contents.indirect = new_indirect;
  153|  24.7M|                _union.indirect_contents.capacity = new_capacity;
  154|  24.7M|                _size += N + 1;
  155|  24.7M|            }
  156|  24.7M|        }
  157|   156M|    }
_ZN9prevectorILj16EhjiE12indirect_ptrEi:
  124|  25.0M|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj16EhjiE10direct_ptrEi:
  122|   163M|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  167|   149M|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  2.83G|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 2.68G, False: 149M]
  ------------------
  169|  2.68G|            new(static_cast<void*>(dst)) T(*first);
  170|  2.68G|            ++dst;
  171|  2.68G|            ++first;
  172|  2.68G|        }
  173|   149M|    }
_ZNK9prevectorILj16EhjiE14const_iteratoreqES1_:
  102|  3.20G|        bool operator==(const_iterator x) const { return ptr == x.ptr; }
_ZNK9prevectorILj16EhjiE14const_iteratordeEv:
   89|  4.04G|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj16EhjiE14const_iteratorppEv:
   92|  3.30G|        const_iterator& operator++() { ptr++; return *this; }
_ZN9prevectorILj16EhjiE8item_ptrEi:
  159|   163M|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (159:47): [True: 138M, False: 25.0M]
  ------------------
_ZNK9prevectorILj16EhjiE5beginEv:
  256|   743M|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj16EhjiE8item_ptrEi:
  160|  1.29G|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (160:59): [True: 1.20G, False: 86.0M]
  ------------------
_ZNK9prevectorILj16EhjiE10direct_ptrEi:
  123|  1.20G|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj16EhjiE12indirect_ptrEi:
  125|  86.0M|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj16EhjiE14const_iteratorC2EPKh:
   87|   992M|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZNK9prevectorILj16EhjiE3endEv:
  258|   248M|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZN9prevectorILj16EhjiED2Ev:
  422|   156M|    ~prevector() {
  423|   156M|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 24.4M, False: 131M]
  ------------------
  424|  24.4M|            free(_union.indirect_contents.indirect);
  425|  24.4M|            _union.indirect_contents.indirect = nullptr;
  426|  24.4M|        }
  427|   156M|    }
_ZN9prevectorILj16EhjiEaSEOS0_:
  237|  7.33M|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  238|  7.33M|        if (!is_direct()) {
  ------------------
  |  Branch (238:13): [True: 255k, False: 7.07M]
  ------------------
  239|   255k|            free(_union.indirect_contents.indirect);
  240|   255k|        }
  241|  7.33M|        _union = std::move(other._union);
  242|  7.33M|        _size = other._size;
  243|  7.33M|        other._size = 0;
  244|  7.33M|        return *this;
  245|  7.33M|    }
_ZNK9prevectorILj36EhjiE9is_directEv:
  126|     24|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj36EhjiED2Ev:
  422|     24|    ~prevector() {
  423|     24|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 4, False: 20]
  ------------------
  424|      4|            free(_union.indirect_contents.indirect);
  425|      4|            _union.indirect_contents.indirect = nullptr;
  426|      4|        }
  427|     24|    }

_ZN14CMessageHeaderC2ERKNSt3__15arrayIhLm4EEEPKcj:
   11|  86.7k|    : pchMessageStart{pchMessageStartIn}
   12|  86.7k|{
   13|       |    // Copy the message type name
   14|  86.7k|    size_t i = 0;
   15|   407k|    for (; i < MESSAGE_TYPE_SIZE && msg_type[i] != 0; ++i) m_msg_type[i] = msg_type[i];
  ------------------
  |  Branch (15:12): [True: 398k, False: 9.67k]
  |  Branch (15:37): [True: 321k, False: 77.1k]
  ------------------
   16|  86.7k|    assert(msg_type[i] == 0); // Assert that the message type name passed in is not longer than MESSAGE_TYPE_SIZE
  ------------------
  |  Branch (16:5): [True: 86.7k, False: 0]
  ------------------
   17|       |
   18|  86.7k|    nMessageSize = nMessageSizeIn;
   19|  86.7k|}
_ZNK14CMessageHeader14GetMessageTypeEv:
   22|    335|{
   23|    335|    return std::string(m_msg_type, m_msg_type + strnlen(m_msg_type, MESSAGE_TYPE_SIZE));
   24|    335|}
_ZNK14CMessageHeader18IsMessageTypeValidEv:
   27|    108|{
   28|       |    // Check the message type string for errors
   29|  1.02k|    for (const char* p1 = m_msg_type; p1 < m_msg_type + MESSAGE_TYPE_SIZE; ++p1) {
  ------------------
  |  Branch (29:39): [True: 949, False: 72]
  ------------------
   30|    949|        if (*p1 == 0) {
  ------------------
  |  Branch (30:13): [True: 56, False: 893]
  ------------------
   31|       |            // Must be all zeros after the first zero
   32|    252|            for (; p1 < m_msg_type + MESSAGE_TYPE_SIZE; ++p1) {
  ------------------
  |  Branch (32:20): [True: 212, False: 40]
  ------------------
   33|    212|                if (*p1 != 0) {
  ------------------
  |  Branch (33:21): [True: 16, False: 196]
  ------------------
   34|     16|                    return false;
   35|     16|                }
   36|    212|            }
   37|    893|        } else if (*p1 < ' ' || *p1 > 0x7E) {
  ------------------
  |  Branch (37:20): [True: 15, False: 878]
  |  Branch (37:33): [True: 5, False: 873]
  ------------------
   38|     20|            return false;
   39|     20|        }
   40|    949|    }
   41|       |
   42|     72|    return true;
   43|    108|}

_ZN14CMessageHeaderC2Ev:
   38|   388k|    explicit CMessageHeader() = default;
_ZN14CMessageHeader16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   48|  4.60k|    SERIALIZE_METHODS(CMessageHeader, obj) { READWRITE(obj.pchMessageStart, obj.m_msg_type, obj.nMessageSize, obj.pchChecksum); }
  ------------------
  |  |  148|  4.60k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN14CMessageHeader16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   48|  86.7k|    SERIALIZE_METHODS(CMessageHeader, obj) { READWRITE(obj.pchMessageStart, obj.m_msg_type, obj.nMessageSize, obj.pchChecksum); }
  ------------------
  |  |  148|  86.7k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN8CAddress16SerializationOpsI12ParamsStreamIR10DataStreamNS_9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_:
  434|   235k|    {
  435|   235k|        bool use_v2;
  436|   235k|        auto& params = SER_PARAMS(SerParams);
  ------------------
  |  |  209|   235k|#define SER_PARAMS(type) (s.template GetParams<type>())
  ------------------
  437|   235k|        if (params.fmt == Format::Disk) {
  ------------------
  |  Branch (437:13): [True: 235k, False: 0]
  ------------------
  438|       |            // In the disk serialization format, the encoding (v1 or v2) is determined by a flag version
  439|       |            // that's part of the serialization itself. ADDRV2_FORMAT in the stream version only determines
  440|       |            // whether V2 is chosen/permitted at all.
  441|   235k|            uint32_t stored_format_version = DISK_VERSION_INIT;
  442|   235k|            if (params.enc == Encoding::V2) stored_format_version |= DISK_VERSION_ADDRV2;
  ------------------
  |  Branch (442:17): [True: 174k, False: 61.1k]
  ------------------
  443|   235k|            READWRITE(stored_format_version);
  ------------------
  |  |  148|   235k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  444|   235k|            stored_format_version &= ~DISK_VERSION_IGNORE_MASK; // ignore low bits
  445|   235k|            if (stored_format_version == 0) {
  ------------------
  |  Branch (445:17): [True: 225k, False: 10.0k]
  ------------------
  446|   225k|                use_v2 = false;
  447|   225k|            } else if (stored_format_version == DISK_VERSION_ADDRV2 && params.enc == Encoding::V2) {
  ------------------
  |  Branch (447:24): [True: 9.53k, False: 521]
  |  Branch (447:72): [True: 9.53k, False: 2]
  ------------------
  448|       |                // Only support v2 deserialization if V2 is set.
  449|  9.53k|                use_v2 = true;
  450|  9.53k|            } else {
  451|    523|                throw std::ios_base::failure("Unsupported CAddress disk format version");
  452|    523|            }
  453|   235k|        } else {
  454|      0|            assert(params.fmt == Format::Network);
  ------------------
  |  Branch (454:13): [True: 0, False: 0]
  ------------------
  455|       |            // In the network serialization format, the encoding (v1 or v2) is determined directly by
  456|       |            // the value of enc in the stream params, as no explicitly encoded version
  457|       |            // exists in the stream.
  458|      0|            use_v2 = params.enc == Encoding::V2;
  459|      0|        }
  460|       |
  461|   234k|        READWRITE(Using<LossyChronoFormatter<uint32_t>>(obj.nTime));
  ------------------
  |  |  148|   234k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  462|       |        // nServices is serialized as CompactSize in V2; as uint64_t in V1.
  463|   234k|        if (use_v2) {
  ------------------
  |  Branch (463:13): [True: 9.53k, False: 225k]
  ------------------
  464|  9.53k|            uint64_t services_tmp;
  465|  9.53k|            SER_WRITE(obj, services_tmp = obj.nServices);
  ------------------
  |  |  150|  9.53k|#define SER_WRITE(obj, code) ser_action.SerWrite(s, obj, [&](Stream& s, const Type& obj) { code; })
  ------------------
  466|  9.53k|            READWRITE(Using<CompactSizeFormatter<false>>(services_tmp));
  ------------------
  |  |  148|  9.53k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  467|  9.53k|            SER_READ(obj, obj.nServices = static_cast<ServiceFlags>(services_tmp));
  ------------------
  |  |  149|  9.53k|#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, std::remove_const_t<Type>& obj) { code; })
  ------------------
  468|   225k|        } else {
  469|   225k|            READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));
  ------------------
  |  |  148|   225k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  470|   225k|        }
  471|       |        // Invoke V1/V2 serializer for CService parent object.
  472|   234k|        const auto ser_params{use_v2 ? CNetAddr::V2 : CNetAddr::V1};
  ------------------
  |  Branch (472:31): [True: 9.49k, False: 225k]
  ------------------
  473|   234k|        READWRITE(ser_params(AsBase<CService>(obj)));
  ------------------
  |  |  148|   234k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  474|   234k|    }
_ZN8CAddressC2E8CService12ServiceFlagsNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEE:
  418|   867k|    CAddress(CService ipIn, ServiceFlags nServicesIn, NodeSeconds time) : CService{ipIn}, nTime{time}, nServices{nServicesIn} {};
_ZN8CAddressC2Ev:
  416|   628k|    CAddress() : CService{} {};
_ZN8CAddressC2E8CService12ServiceFlags:
  417|   331k|    CAddress(CService ipIn, ServiceFlags nServicesIn) : CService{ipIn}, nServices{nServicesIn} {};

_ZN14EllSwiftPubKeyC2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  366|   275k|{
  367|   275k|    assert(ellswift.size() == SIZE);
  ------------------
  |  Branch (367:5): [True: 275k, False: 0]
  ------------------
  368|   275k|    std::copy(ellswift.begin(), ellswift.end(), m_pubkey.begin());
  369|   275k|}

_ZNK14EllSwiftPubKey4dataEv:
  331|  37.7k|    const std::byte* data() const { return m_pubkey.data(); }
_ZN14EllSwiftPubKey4sizeEv:
  332|   116k|    static constexpr size_t size() { return SIZE; }
_ZNK14EllSwiftPubKey5beginEv:
  333|  19.8k|    auto begin() const { return m_pubkey.cbegin(); }
_ZNK14EllSwiftPubKey3endEv:
  334|  19.8k|    auto end() const { return m_pubkey.cend(); }

_Z30MakeRandDeterministicDANGEROUSRK7uint256:
  596|  9.89k|{
  597|  9.89k|    GetRNGState().MakeDeterministic(seed);
  598|  9.89k|}
_Z12GetRandBytesNSt3__14spanIhLm18446744073709551615EEE:
  602|   542k|{
  603|   542k|    g_used_g_prng = true;
  604|   542k|    ProcRand(bytes.data(), bytes.size(), RNGLevel::FAST, /*always_use_real_rng=*/false);
  605|   542k|}
_Z18GetStrongRandBytesNSt3__14spanIhLm18446744073709551615EEE:
  608|   256k|{
  609|   256k|    ProcRand(bytes.data(), bytes.size(), RNGLevel::SLOW, /*always_use_real_rng=*/true);
  610|   256k|}
_Z12RandAddEventj:
  617|   331k|void RandAddEvent(const uint32_t event_info) noexcept { GetRNGState().AddEvent(event_info); }
_ZN17FastRandomContext10RandomSeedEv:
  620|   283k|{
  621|   283k|    uint256 seed = GetRandHash();
  622|   283k|    rng.SetKey(MakeByteSpan(seed));
  623|   283k|    requires_seed = false;
  624|   283k|}
_ZN17FastRandomContext8fillrandENSt3__14spanISt4byteLm18446744073709551615EEE:
  627|   256k|{
  628|   256k|    if (requires_seed) RandomSeed();
  ------------------
  |  Branch (628:9): [True: 0, False: 256k]
  ------------------
  629|   256k|    rng.Keystream(output);
  630|   256k|}
_ZN17FastRandomContext6ReseedERK7uint256:
  635|  12.9k|{
  636|  12.9k|    FlushCache();
  637|  12.9k|    requires_seed = false;
  638|  12.9k|    rng = {MakeByteSpan(seed)};
  639|  12.9k|}
_ZN17FastRandomContextC2Eb:
  689|   297k|FastRandomContext::FastRandomContext(bool fDeterministic) noexcept : requires_seed(!fDeterministic), rng(ZERO_KEY)
  690|   297k|{
  691|       |    // Note that despite always initializing with ZERO_KEY, requires_seed is set to true if not
  692|       |    // fDeterministic. That means the rng will be reinitialized with a secure random key upon first
  693|       |    // use.
  694|   297k|}
random.cpp:_ZN12_GLOBAL__N_111GetRNGStateEv:
  451|  1.14M|{
  452|       |    // This idiom relies on the guarantee that static variable are initialized
  453|       |    // on first call, even when multiple parallel calls are permitted.
  454|  1.14M|    static std::vector<RNGState, secure_allocator<RNGState>> g_rng(1);
  455|  1.14M|    return g_rng[0];
  456|  1.14M|}
random.cpp:_ZN12_GLOBAL__N_18RNGStateD2Ev:
  367|      2|    ~RNGState() = default;
random.cpp:_ZN12_GLOBAL__N_18RNGState17MakeDeterministicERK7uint256:
  400|  9.89k|    {
  401|  9.89k|        LOCK(m_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|  9.89k|        m_deterministic_prng.emplace(MakeByteSpan(seed));
  403|  9.89k|    }
random.cpp:_ZN12_GLOBAL__N_18ProcRandEPhiNS_8RNGLevelEb:
  563|   798k|{
  564|       |    // Make sure the RNG is initialized first (as all Seed* function possibly need hwrand to be available).
  565|   798k|    RNGState& rng = GetRNGState();
  566|       |
  567|   798k|    assert(num <= 32);
  ------------------
  |  Branch (567:5): [True: 798k, False: 0]
  ------------------
  568|       |
  569|   798k|    CSHA512 hasher;
  570|   798k|    switch (level) {
  ------------------
  |  Branch (570:13): [True: 798k, False: 0]
  ------------------
  571|   542k|    case RNGLevel::FAST:
  ------------------
  |  Branch (571:5): [True: 542k, False: 256k]
  ------------------
  572|   542k|        SeedFast(hasher);
  573|   542k|        break;
  574|   256k|    case RNGLevel::SLOW:
  ------------------
  |  Branch (574:5): [True: 256k, False: 542k]
  ------------------
  575|   256k|        SeedSlow(hasher, rng);
  576|   256k|        break;
  577|      0|    case RNGLevel::PERIODIC:
  ------------------
  |  Branch (577:5): [True: 0, False: 798k]
  ------------------
  578|      0|        SeedPeriodic(hasher, rng);
  579|      0|        break;
  580|   798k|    }
  581|       |
  582|       |    // Combine with and update state
  583|   798k|    if (!rng.MixExtract(out, num, std::move(hasher), false, always_use_real_rng)) {
  ------------------
  |  Branch (583:9): [True: 0, False: 798k]
  ------------------
  584|       |        // On the first invocation, also seed with SeedStartup().
  585|      0|        CSHA512 startup_hasher;
  586|      0|        SeedStartup(startup_hasher, rng);
  587|      0|        rng.MixExtract(out, num, std::move(startup_hasher), true, always_use_real_rng);
  588|      0|    }
  589|   798k|}
random.cpp:_ZN12_GLOBAL__N_18SeedFastER7CSHA512:
  470|   798k|{
  471|   798k|    unsigned char buffer[32];
  472|       |
  473|       |    // Stack pointer to indirectly commit to thread/callstack
  474|   798k|    const unsigned char* ptr = buffer;
  475|   798k|    hasher.Write((const unsigned char*)&ptr, sizeof(ptr));
  476|       |
  477|       |    // Hardware randomness is very fast when available; use it always.
  478|   798k|    SeedHardwareFast(hasher);
  479|       |
  480|       |    // High-precision timestamp
  481|   798k|    SeedTimestamp(hasher);
  482|   798k|}
random.cpp:_ZN12_GLOBAL__N_116SeedHardwareFastER7CSHA512:
  199|   798k|void SeedHardwareFast(CSHA512& hasher) noexcept {
  200|   798k|#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
  201|   798k|    if (g_rdrand_supported) {
  ------------------
  |  Branch (201:9): [True: 798k, False: 0]
  ------------------
  202|   798k|        uint64_t out = GetRdRand();
  203|   798k|        hasher.Write((const unsigned char*)&out, sizeof(out));
  204|   798k|        return;
  205|   798k|    }
  206|   798k|#endif
  207|   798k|}
random.cpp:_ZN12_GLOBAL__N_19GetRdRandEv:
  122|   798k|{
  123|       |    // RdRand may very rarely fail. Invoke it up to 10 times in a loop to reduce this risk.
  124|       |#ifdef __i386__
  125|       |    uint8_t ok = 0;
  126|       |    // Initialize to 0 to silence a compiler warning that r1 or r2 may be used
  127|       |    // uninitialized. Even if rdrand fails (!ok) it will set the output to 0,
  128|       |    // but there is no way that the compiler could know that.
  129|       |    uint32_t r1 = 0, r2 = 0;
  130|       |    for (int i = 0; i < 10; ++i) {
  131|       |        __asm__ volatile (".byte 0x0f, 0xc7, 0xf0; setc %1" : "=a"(r1), "=q"(ok) :: "cc"); // rdrand %eax
  132|       |        if (ok) break;
  133|       |    }
  134|       |    for (int i = 0; i < 10; ++i) {
  135|       |        __asm__ volatile (".byte 0x0f, 0xc7, 0xf0; setc %1" : "=a"(r2), "=q"(ok) :: "cc"); // rdrand %eax
  136|       |        if (ok) break;
  137|       |    }
  138|       |    return (((uint64_t)r2) << 32) | r1;
  139|       |#elif defined(__x86_64__) || defined(__amd64__)
  140|       |    uint8_t ok = 0;
  141|   798k|    uint64_t r1 = 0; // See above why we initialize to 0.
  142|   798k|    for (int i = 0; i < 10; ++i) {
  ------------------
  |  Branch (142:21): [True: 798k, False: 0]
  ------------------
  143|   798k|        __asm__ volatile (".byte 0x48, 0x0f, 0xc7, 0xf0; setc %1" : "=a"(r1), "=q"(ok) :: "cc"); // rdrand %rax
  144|   798k|        if (ok) break;
  ------------------
  |  Branch (144:13): [True: 798k, False: 0]
  ------------------
  145|   798k|    }
  146|   798k|    return r1;
  147|       |#else
  148|       |#error "RdRand is only supported on x86 and x86_64"
  149|       |#endif
  150|   798k|}
random.cpp:_ZN12_GLOBAL__N_113SeedTimestampER7CSHA512:
  464|  1.05M|{
  465|  1.05M|    int64_t perfcounter = GetPerformanceCounter();
  466|  1.05M|    hasher.Write((const unsigned char*)&perfcounter, sizeof(perfcounter));
  467|  1.05M|}
random.cpp:_ZN12_GLOBAL__N_18SeedSlowER7CSHA512RNS_8RNGStateE:
  485|   256k|{
  486|   256k|    unsigned char buffer[32];
  487|       |
  488|       |    // Everything that the 'fast' seeder includes
  489|   256k|    SeedFast(hasher);
  490|       |
  491|       |    // OS randomness
  492|   256k|    GetOSRand(buffer);
  493|   256k|    hasher.Write(buffer, sizeof(buffer));
  494|       |
  495|       |    // Add the events hasher into the mix
  496|   256k|    rng.SeedEvents(hasher);
  497|       |
  498|       |    // High-precision timestamp.
  499|       |    //
  500|       |    // Note that we also commit to a timestamp in the Fast seeder, so we indirectly commit to a
  501|       |    // benchmark of all the entropy gathering sources in this function).
  502|   256k|    SeedTimestamp(hasher);
  503|   256k|}
random.cpp:_ZN12_GLOBAL__N_18RNGState10SeedEventsER7CSHA512:
  384|   256k|    {
  385|       |        // We use only SHA256 for the events hashing to get the ASM speedups we have for SHA256,
  386|       |        // since we want it to be fast as network peers may be able to trigger it repeatedly.
  387|   256k|        LOCK(m_events_mutex);
  ------------------
  |  |  268|   256k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   256k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   256k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   256k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|       |
  389|   256k|        unsigned char events_hash[32];
  390|   256k|        m_events_hasher.Finalize(events_hash);
  391|   256k|        hasher.Write(events_hash, 32);
  392|       |
  393|       |        // Re-initialize the hasher with the finalized state to use later.
  394|   256k|        m_events_hasher.Reset();
  395|   256k|        m_events_hasher.Write(events_hash, 32);
  396|   256k|    }
random.cpp:_ZN12_GLOBAL__N_18RNGState8AddEventEj:
  370|   331k|    {
  371|   331k|        LOCK(m_events_mutex);
  ------------------
  |  |  268|   331k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   331k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   331k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   331k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|       |
  373|   331k|        m_events_hasher.Write((const unsigned char *)&event_info, sizeof(event_info));
  374|       |        // Get the low four bytes of the performance counter. This translates to roughly the
  375|       |        // subsecond part.
  376|   331k|        uint32_t perfcounter = (GetPerformanceCounter() & 0xffffffff);
  377|   331k|        m_events_hasher.Write((const unsigned char*)&perfcounter, sizeof(perfcounter));
  378|   331k|    }
random.cpp:_ZN12_GLOBAL__N_121GetPerformanceCounterEv:
   61|  1.38M|{
   62|       |    // Read the hardware time stamp counter when available.
   63|       |    // See https://en.wikipedia.org/wiki/Time_Stamp_Counter for more information.
   64|       |#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
   65|       |    return __rdtsc();
   66|       |#elif !defined(_MSC_VER) && defined(__i386__)
   67|       |    uint64_t r = 0;
   68|       |    __asm__ volatile ("rdtsc" : "=A"(r)); // Constrain the r variable to the eax:edx pair.
   69|       |    return r;
   70|       |#elif !defined(_MSC_VER) && (defined(__x86_64__) || defined(__amd64__))
   71|       |    uint64_t r1 = 0, r2 = 0;
   72|  1.38M|    __asm__ volatile ("rdtsc" : "=a"(r1), "=d"(r2)); // Constrain r1 to rax and r2 to rdx.
   73|  1.38M|    return (r2 << 32) | r1;
   74|       |#else
   75|       |    // Fall back to using standard library clock (usually microsecond or nanosecond precision)
   76|       |    return std::chrono::high_resolution_clock::now().time_since_epoch().count();
   77|       |#endif
   78|  1.38M|}
random.cpp:_ZN12_GLOBAL__N_19GetOSRandEPh:
  287|   256k|{
  288|       |#if defined(WIN32)
  289|       |    constexpr uint32_t STATUS_SUCCESS{0x00000000};
  290|       |    NTSTATUS status = BCryptGenRandom(/*hAlgorithm=*/NULL,
  291|       |                                      /*pbBuffer=*/ent32,
  292|       |                                      /*cbBuffer=*/NUM_OS_RANDOM_BYTES,
  293|       |                                      /*dwFlags=*/BCRYPT_USE_SYSTEM_PREFERRED_RNG);
  294|       |
  295|       |    if (status != STATUS_SUCCESS) {
  296|       |        RandFailure();
  297|       |    }
  298|       |#elif defined(HAVE_GETRANDOM)
  299|       |    /* Linux. From the getrandom(2) man page:
  300|       |     * "If the urandom source has been initialized, reads of up to 256 bytes
  301|       |     * will always return as many bytes as requested and will not be
  302|       |     * interrupted by signals."
  303|       |     */
  304|   256k|    if (getrandom(ent32, NUM_OS_RANDOM_BYTES, 0) != NUM_OS_RANDOM_BYTES) {
  ------------------
  |  Branch (304:9): [True: 0, False: 256k]
  ------------------
  305|      0|        RandFailure();
  306|      0|    }
  307|       |#elif defined(__OpenBSD__)
  308|       |    /* OpenBSD. From the arc4random(3) man page:
  309|       |       "Use of these functions is encouraged for almost all random number
  310|       |        consumption because the other interfaces are deficient in either
  311|       |        quality, portability, standardization, or availability."
  312|       |       The function call is always successful.
  313|       |     */
  314|       |    arc4random_buf(ent32, NUM_OS_RANDOM_BYTES);
  315|       |#elif defined(HAVE_GETENTROPY_RAND) && defined(__APPLE__)
  316|       |    if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
  317|       |        RandFailure();
  318|       |    }
  319|       |#elif defined(HAVE_SYSCTL_ARND)
  320|       |    /* FreeBSD, NetBSD and similar. It is possible for the call to return less
  321|       |     * bytes than requested, so need to read in a loop.
  322|       |     */
  323|       |    static int name[2] = {CTL_KERN, KERN_ARND};
  324|       |    int have = 0;
  325|       |    do {
  326|       |        size_t len = NUM_OS_RANDOM_BYTES - have;
  327|       |        if (sysctl(name, std::size(name), ent32 + have, &len, nullptr, 0) != 0) {
  328|       |            RandFailure();
  329|       |        }
  330|       |        have += len;
  331|       |    } while (have < NUM_OS_RANDOM_BYTES);
  332|       |#else
  333|       |    /* Fall back to /dev/urandom if there is no specific method implemented to
  334|       |     * get system entropy for this OS.
  335|       |     */
  336|       |    GetDevURandom(ent32);
  337|       |#endif
  338|   256k|}
random.cpp:_ZN12_GLOBAL__N_18RNGState10MixExtractEPhmO7CSHA512bb:
  413|   798k|    {
  414|   798k|        assert(num <= 32);
  ------------------
  |  Branch (414:9): [True: 798k, False: 0]
  ------------------
  415|   798k|        unsigned char buf[64];
  416|   798k|        static_assert(sizeof(buf) == CSHA512::OUTPUT_SIZE, "Buffer needs to have hasher's output size");
  417|   798k|        bool ret;
  418|   798k|        {
  419|   798k|            LOCK(m_mutex);
  ------------------
  |  |  268|   798k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   798k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   798k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   798k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|   798k|            ret = (m_strongly_seeded |= strong_seed);
  421|       |            // Write the current state of the RNG into the hasher
  422|   798k|            hasher.Write(m_state, 32);
  423|       |            // Write a new counter number into the state
  424|   798k|            hasher.Write((const unsigned char*)&m_counter, sizeof(m_counter));
  425|   798k|            ++m_counter;
  426|       |            // Finalize the hasher
  427|   798k|            hasher.Finalize(buf);
  428|       |            // Store the last 32 bytes of the hash output as new RNG state.
  429|   798k|            memcpy(m_state, buf + 32, 32);
  430|       |            // Handle requests for deterministic randomness.
  431|   798k|            if (!always_use_real_rng && m_deterministic_prng.has_value()) [[unlikely]] {
  ------------------
  |  Branch (431:17): [True: 542k, False: 256k]
  |  Branch (431:41): [True: 542k, False: 0]
  ------------------
  432|       |                // Overwrite the beginning of buf, which will be used for output.
  433|   542k|                m_deterministic_prng->Keystream(std::as_writable_bytes(std::span{buf, num}));
  434|       |                // Do not require strong seeding for deterministic output.
  435|   542k|                ret = true;
  436|   542k|            }
  437|   798k|        }
  438|       |        // If desired, copy (up to) the first 32 bytes of the hash output as output.
  439|   798k|        if (num) {
  ------------------
  |  Branch (439:13): [True: 798k, False: 0]
  ------------------
  440|   798k|            assert(out != nullptr);
  ------------------
  |  Branch (440:13): [True: 798k, False: 0]
  ------------------
  441|   798k|            memcpy(out, buf, num);
  442|   798k|        }
  443|       |        // Best effort cleanup of internal state
  444|   798k|        hasher.Reset();
  445|   798k|        memory_cleanse(buf, 64);
  446|   798k|        return ret;
  447|   798k|    }

_ZN11RandomMixinI17FastRandomContextEC2Ev:
  195|   297k|    constexpr RandomMixin() noexcept = default;
_ZN11RandomMixinI17FastRandomContextE10FlushCacheEv:
  189|  12.9k|    {
  190|  12.9k|        bitbuf = 0;
  191|  12.9k|        bitbuf_size = 0;
  192|  12.9k|    }
_ZN11RandomMixinI17FastRandomContextE9randrangeITk17StdChronoDurationNSt3__16chrono8durationIxNS3_5ratioILl1ELl1000000EEEEEEET_NS3_11common_typeIJS9_EE4typeE:
  351|  1.04k|    {
  352|  1.04k|        return Dur{Impl().randrange(range.count())};
  353|  1.04k|    }
_ZN11RandomMixinI17FastRandomContextE9randrangeITkNSt3__18integralEmEET_S4_:
  255|   112k|    {
  256|   112k|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  257|   112k|        Assume(range > 0);
  ------------------
  |  |  128|   112k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  258|   112k|        uint64_t maxval = range - 1U;
  259|   112k|        int bits = std::bit_width(maxval);
  260|   138k|        while (true) {
  ------------------
  |  Branch (260:16): [True: 138k, Folded]
  ------------------
  261|   138k|            uint64_t ret = Impl().randbits(bits);
  262|   138k|            if (ret <= maxval) return ret;
  ------------------
  |  Branch (262:17): [True: 112k, False: 25.1k]
  ------------------
  263|   138k|        }
  264|   112k|    }
_Z11GetRandHashv:
  464|   542k|{
  465|   542k|    uint256 hash;
  466|   542k|    GetRandBytes(hash);
  467|   542k|    return hash;
  468|   542k|}
_ZN11RandomMixinI17FastRandomContextE9randrangeITkNSt3__18integralEjEET_S4_:
  255|   256k|    {
  256|   256k|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  257|   256k|        Assume(range > 0);
  ------------------
  |  |  128|   256k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  258|   256k|        uint64_t maxval = range - 1U;
  259|   256k|        int bits = std::bit_width(maxval);
  260|   256k|        while (true) {
  ------------------
  |  Branch (260:16): [True: 256k, Folded]
  ------------------
  261|   256k|            uint64_t ret = Impl().randbits(bits);
  262|   256k|            if (ret <= maxval) return ret;
  ------------------
  |  Branch (262:17): [True: 256k, False: 0]
  ------------------
  263|   256k|        }
  264|   256k|    }
_ZN11RandomMixinI17FastRandomContextE4ImplEv:
  185|   662k|    RandomNumberGenerator auto& Impl() noexcept { return static_cast<T&>(*this); }
_ZN11RandomMixinI17FastRandomContextE8randbitsEi:
  205|   397k|    {
  206|   397k|        Assume(bits <= 64);
  ------------------
  |  |  128|   397k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  207|       |        // Requests for the full 64 bits are passed through.
  208|   397k|        if (bits == 64) return Impl().rand64();
  ------------------
  |  Branch (208:13): [True: 0, False: 397k]
  ------------------
  209|   397k|        uint64_t ret;
  210|   397k|        if (bits <= bitbuf_size) {
  ------------------
  |  Branch (210:13): [True: 133k, False: 264k]
  ------------------
  211|       |            // If there is enough entropy left in bitbuf, return its bottom bits bits.
  212|   133k|            ret = bitbuf;
  213|   133k|            bitbuf >>= bits;
  214|   133k|            bitbuf_size -= bits;
  215|   264k|        } else {
  216|       |            // If not, return all of bitbuf, supplemented with the (bits - bitbuf_size) bottom
  217|       |            // bits of a newly generated 64-bit number on top. The remainder of that generated
  218|       |            // number becomes the new bitbuf.
  219|   264k|            uint64_t gen = Impl().rand64();
  220|   264k|            ret = (gen << bitbuf_size) | bitbuf;
  221|   264k|            bitbuf = gen >> (bits - bitbuf_size);
  222|   264k|            bitbuf_size = 64 + bitbuf_size - bits;
  223|   264k|        }
  224|       |        // Return the bottom bits bits of ret.
  225|   397k|        return ret & ((uint64_t{1} << bits) - 1);
  226|   397k|    }
_ZN17FastRandomContext6rand64Ev:
  405|   290k|    {
  406|   290k|        if (requires_seed) RandomSeed();
  ------------------
  |  Branch (406:13): [True: 283k, False: 6.76k]
  ------------------
  407|   290k|        std::array<std::byte, 8> buf;
  408|   290k|        rng.Keystream(buf);
  409|   290k|        return ReadLE64(buf.data());
  410|   290k|    }
_ZN11RandomMixinI17FastRandomContextE9randrangeITkNSt3__18integralExEET_S4_:
  255|  1.04k|    {
  256|  1.04k|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  257|  1.04k|        Assume(range > 0);
  ------------------
  |  |  128|  1.04k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  258|  1.04k|        uint64_t maxval = range - 1U;
  259|  1.04k|        int bits = std::bit_width(maxval);
  260|  2.92k|        while (true) {
  ------------------
  |  Branch (260:16): [True: 2.92k, Folded]
  ------------------
  261|  2.92k|            uint64_t ret = Impl().randbits(bits);
  262|  2.92k|            if (ret <= maxval) return ret;
  ------------------
  |  Branch (262:17): [True: 1.04k, False: 1.88k]
  ------------------
  263|  2.92k|        }
  264|  1.04k|    }

_ZN10CSchedulerD2Ev:
   17|      2|{
   18|      2|    assert(nThreadsServicingQueue == 0);
  ------------------
  |  Branch (18:5): [True: 2, False: 0]
  ------------------
   19|      2|    if (stopWhenEmpty) assert(taskQueue.empty());
  ------------------
  |  Branch (19:9): [True: 0, False: 2]
  |  Branch (19:24): [True: 0, False: 0]
  ------------------
   20|      2|}
_ZN10CScheduler12serviceQueueEv:
   24|      0|{
   25|      0|    WAIT_LOCK(newTaskMutex, lock);
  ------------------
  |  |  274|      0|#define WAIT_LOCK(cs, name) UniqueLock name(LOCK_ARGS(cs))
  |  |  ------------------
  |  |  |  |  272|      0|#define LOCK_ARGS(cs) MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__
  |  |  ------------------
  ------------------
   26|      0|    ++nThreadsServicingQueue;
   27|       |
   28|       |    // newTaskMutex is locked throughout this loop EXCEPT
   29|       |    // when the thread is waiting or when the user's function
   30|       |    // is called.
   31|      2|    while (!shouldStop()) {
  ------------------
  |  Branch (31:12): [True: 0, False: 2]
  ------------------
   32|      0|        try {
   33|      0|            while (!shouldStop() && taskQueue.empty()) {
  ------------------
  |  Branch (33:20): [True: 0, False: 0]
  |  Branch (33:37): [True: 0, False: 0]
  ------------------
   34|       |                // Wait until there is something to do.
   35|      0|                newTaskScheduled.wait(lock);
   36|      0|            }
   37|       |
   38|       |            // Wait until either there is a new task, or until
   39|       |            // the time of the first item on the queue:
   40|       |
   41|      0|            while (!shouldStop() && !taskQueue.empty()) {
  ------------------
  |  Branch (41:20): [True: 0, False: 0]
  |  Branch (41:37): [True: 0, False: 0]
  ------------------
   42|      0|                std::chrono::steady_clock::time_point timeToWaitFor = taskQueue.begin()->first;
   43|      0|                if (newTaskScheduled.wait_until(lock, timeToWaitFor) == std::cv_status::timeout) {
  ------------------
  |  Branch (43:21): [True: 0, False: 0]
  ------------------
   44|      0|                    break; // Exit loop after timeout, it means we reached the time of the event
   45|      0|                }
   46|      0|            }
   47|       |
   48|       |            // If there are multiple threads, the queue can empty while we're waiting (another
   49|       |            // thread may service the task we were waiting on).
   50|      0|            if (shouldStop() || taskQueue.empty())
  ------------------
  |  Branch (50:17): [True: 0, False: 0]
  |  Branch (50:33): [True: 0, False: 0]
  ------------------
   51|      2|                continue;
   52|       |
   53|  18.4E|            Function f = taskQueue.begin()->second;
   54|  18.4E|            taskQueue.erase(taskQueue.begin());
   55|       |
   56|  18.4E|            {
   57|       |                // Unlock before calling f, so it can reschedule itself or another task
   58|       |                // without deadlocking:
   59|  18.4E|                REVERSE_LOCK(lock, newTaskMutex);
  ------------------
  |  |  254|  18.4E|#define REVERSE_LOCK(g, cs) typename std::decay<decltype(g)>::type::reverse_lock BITCOIN_UNIQUE_NAME(revlock)(g, cs, #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  18.4E|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  18.4E|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  18.4E|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|  18.4E|                f();
   61|  18.4E|            }
   62|  18.4E|        } catch (...) {
   63|      0|            --nThreadsServicingQueue;
   64|      0|            throw;
   65|      0|        }
   66|      0|    }
   67|      2|    --nThreadsServicingQueue;
   68|      2|    newTaskScheduled.notify_one();
   69|      2|}

_ZNK10CScheduler10shouldStopEv:
  111|      8|    bool shouldStop() const EXCLUSIVE_LOCKS_REQUIRED(newTaskMutex) { return stopRequested || (stopWhenEmpty && taskQueue.empty()); }
  ------------------
  |  Branch (111:77): [True: 8, False: 0]
  |  Branch (111:95): [True: 0, False: 0]
  |  Branch (111:112): [True: 0, False: 0]
  ------------------
_ZN10CScheduler4stopEv:
   80|      2|    {
   81|      2|        WITH_LOCK(newTaskMutex, stopRequested = true);
  ------------------
  |  |  299|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
   82|      2|        newTaskScheduled.notify_all();
   83|      2|        if (m_service_thread.joinable()) m_service_thread.join();
  ------------------
  |  Branch (83:13): [True: 2, False: 0]
  ------------------
   84|      2|    }

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

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

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

secp256k1.c:secp256k1_ecmult_const_xonly:
  268|  18.8k|static int secp256k1_ecmult_const_xonly(secp256k1_fe* r, const secp256k1_fe *n, const secp256k1_fe *d, const secp256k1_scalar *q, int known_on_curve) {
  269|       |
  270|       |    /* This algorithm is a generalization of Peter Dettman's technique for
  271|       |     * avoiding the square root in a random-basepoint x-only multiplication
  272|       |     * on a Weierstrass curve:
  273|       |     * https://mailarchive.ietf.org/arch/msg/cfrg/7DyYY6gg32wDgHAhgSb6XxMDlJA/
  274|       |     *
  275|       |     *
  276|       |     * === Background: the effective affine technique ===
  277|       |     *
  278|       |     * Let phi_u be the isomorphism that maps (x, y) on secp256k1 curve y^2 = x^3 + 7 to
  279|       |     * x' = u^2*x, y' = u^3*y on curve y'^2 = x'^3 + u^6*7. This new curve has the same order as
  280|       |     * the original (it is isomorphic), but moreover, has the same addition/doubling formulas, as
  281|       |     * the curve b=7 coefficient does not appear in those formulas (or at least does not appear in
  282|       |     * the formulas implemented in this codebase, both affine and Jacobian). See also Example 9.5.2
  283|       |     * in https://www.math.auckland.ac.nz/~sgal018/crypto-book/ch9.pdf.
  284|       |     *
  285|       |     * This means any linear combination of secp256k1 points can be computed by applying phi_u
  286|       |     * (with non-zero u) on all input points (including the generator, if used), computing the
  287|       |     * linear combination on the isomorphic curve (using the same group laws), and then applying
  288|       |     * phi_u^{-1} to get back to secp256k1.
  289|       |     *
  290|       |     * Switching to Jacobian coordinates, note that phi_u applied to (X, Y, Z) is simply
  291|       |     * (X, Y, Z/u). Thus, if we want to compute (X1, Y1, Z) + (X2, Y2, Z), with identical Z
  292|       |     * coordinates, we can use phi_Z to transform it to (X1, Y1, 1) + (X2, Y2, 1) on an isomorphic
  293|       |     * curve where the affine addition formula can be used instead.
  294|       |     * If (X3, Y3, Z3) = (X1, Y1) + (X2, Y2) on that curve, then our answer on secp256k1 is
  295|       |     * (X3, Y3, Z3*Z).
  296|       |     *
  297|       |     * This is the effective affine technique: if we have a linear combination of group elements
  298|       |     * to compute, and all those group elements have the same Z coordinate, we can simply pretend
  299|       |     * that all those Z coordinates are 1, perform the computation that way, and then multiply the
  300|       |     * original Z coordinate back in.
  301|       |     *
  302|       |     * The technique works on any a=0 short Weierstrass curve. It is possible to generalize it to
  303|       |     * other curves too, but there the isomorphic curves will have different 'a' coefficients,
  304|       |     * which typically does affect the group laws.
  305|       |     *
  306|       |     *
  307|       |     * === Avoiding the square root for x-only point multiplication ===
  308|       |     *
  309|       |     * In this function, we want to compute the X coordinate of q*(n/d, y), for
  310|       |     * y = sqrt((n/d)^3 + 7). Its negation would also be a valid Y coordinate, but by convention
  311|       |     * we pick whatever sqrt returns (which we assume to be a deterministic function).
  312|       |     *
  313|       |     * Let g = y^2*d^3 = n^3 + 7*d^3. This also means y = sqrt(g/d^3).
  314|       |     * Further let v = sqrt(d*g), which must exist as d*g = y^2*d^4 = (y*d^2)^2.
  315|       |     *
  316|       |     * The input point (n/d, y) also has Jacobian coordinates:
  317|       |     *
  318|       |     *     (n/d, y, 1)
  319|       |     *   = (n/d * v^2, y * v^3, v)
  320|       |     *   = (n/d * d*g, y * sqrt(d^3*g^3), v)
  321|       |     *   = (n/d * d*g, sqrt(y^2 * d^3*g^3), v)
  322|       |     *   = (n*g, sqrt(g/d^3 * d^3*g^3), v)
  323|       |     *   = (n*g, sqrt(g^4), v)
  324|       |     *   = (n*g, g^2, v)
  325|       |     *
  326|       |     * It is easy to verify that both (n*g, g^2, v) and its negation (n*g, -g^2, v) have affine X
  327|       |     * coordinate n/d, and this holds even when the square root function doesn't have a
  328|       |     * deterministic sign. We choose the (n*g, g^2, v) version.
  329|       |     *
  330|       |     * Now switch to the effective affine curve using phi_v, where the input point has coordinates
  331|       |     * (n*g, g^2). Compute (X, Y, Z) = q * (n*g, g^2) there.
  332|       |     *
  333|       |     * Back on secp256k1, that means q * (n*g, g^2, v) = (X, Y, v*Z). This last point has affine X
  334|       |     * coordinate X / (v^2*Z^2) = X / (d*g*Z^2). Determining the affine Y coordinate would involve
  335|       |     * a square root, but as long as we only care about the resulting X coordinate, no square root
  336|       |     * is needed anywhere in this computation.
  337|       |     */
  338|       |
  339|  18.8k|    secp256k1_fe g, i;
  340|  18.8k|    secp256k1_ge p;
  341|  18.8k|    secp256k1_gej rj;
  342|       |
  343|       |    /* Compute g = (n^3 + B*d^3). */
  344|  18.8k|    secp256k1_fe_sqr(&g, n);
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  345|  18.8k|    secp256k1_fe_mul(&g, &g, n);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  346|  18.8k|    if (d) {
  ------------------
  |  Branch (346:9): [True: 18.8k, False: 0]
  ------------------
  347|  18.8k|        secp256k1_fe b;
  348|  18.8k|        VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero(d));
  349|  18.8k|        secp256k1_fe_sqr(&b, d);
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  350|  18.8k|        VERIFY_CHECK(SECP256K1_B <= 8); /* magnitude of b will be <= 8 after the next call */
  351|  18.8k|        secp256k1_fe_mul_int(&b, SECP256K1_B);
  ------------------
  |  |  233|  18.8k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  18.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  18.8k|    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: 18.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  18.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  18.8k|    } \
  |  |  |  |   94|  18.8k|    stmt; \
  |  |  |  |   95|  18.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|  18.8k|        secp256k1_fe_mul(&b, &b, d);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  353|  18.8k|        secp256k1_fe_add(&g, &b);
  ------------------
  |  |   92|  18.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  354|  18.8k|        if (!known_on_curve) {
  ------------------
  |  Branch (354:13): [True: 0, False: 18.8k]
  ------------------
  355|       |            /* We need to determine whether (n/d)^3 + 7 is square.
  356|       |             *
  357|       |             *     is_square((n/d)^3 + 7)
  358|       |             * <=> is_square(((n/d)^3 + 7) * d^4)
  359|       |             * <=> is_square((n^3 + 7*d^3) * d)
  360|       |             * <=> is_square(g * d)
  361|       |             */
  362|      0|            secp256k1_fe c;
  363|      0|            secp256k1_fe_mul(&c, &g, d);
  ------------------
  |  |   93|      0|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  364|      0|            if (!secp256k1_fe_is_square_var(&c)) return 0;
  ------------------
  |  |  103|      0|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (364:17): [True: 0, False: 0]
  ------------------
  365|      0|        }
  366|  18.8k|    } else {
  367|      0|        secp256k1_fe_add_int(&g, SECP256K1_B);
  ------------------
  |  |  102|      0|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                      secp256k1_fe_add_int(&g, SECP256K1_B);
  ------------------
  |  |   73|      0|#define SECP256K1_B 7
  ------------------
  368|      0|        if (!known_on_curve) {
  ------------------
  |  Branch (368:13): [True: 0, False: 0]
  ------------------
  369|       |            /* g at this point equals x^3 + 7. Test if it is square. */
  370|      0|            if (!secp256k1_fe_is_square_var(&g)) return 0;
  ------------------
  |  |  103|      0|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (370:17): [True: 0, False: 0]
  ------------------
  371|      0|        }
  372|      0|    }
  373|       |
  374|  18.8k|    SECP256K1_FE_VERIFY_MAGNITUDE(&g, 2);
  ------------------
  |  |  349|  18.8k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
  375|       |
  376|       |    /* Compute base point P = (n*g, g^2), the effective affine version of
  377|       |     * (n*g, g^2, v), which has corresponding affine X coordinate n/d. */
  378|  18.8k|    {
  379|  18.8k|        secp256k1_fe x, y;
  380|  18.8k|        secp256k1_fe_mul(&x, &g, n);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  381|  18.8k|        secp256k1_fe_sqr(&y, &g);
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  382|  18.8k|        secp256k1_ge_set_xy(&p, &x, &y);
  383|  18.8k|    }
  384|       |
  385|       |    /* Perform x-only EC multiplication of P with q. */
  386|  18.8k|    VERIFY_CHECK(!secp256k1_scalar_is_zero(q));
  387|  18.8k|    secp256k1_ecmult_const(&rj, &p, q);
  388|  18.8k|    VERIFY_CHECK(!secp256k1_gej_is_infinity(&rj));
  389|       |
  390|       |    /* The resulting (X, Y, Z) point on the effective-affine isomorphic curve corresponds to
  391|       |     * (X, Y, Z*v) on the secp256k1 curve. The affine version of that has X coordinate
  392|       |     * (X / (Z^2*d*g)). */
  393|  18.8k|    secp256k1_fe_sqr(&i, &rj.z);
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  394|  18.8k|    secp256k1_fe_mul(&i, &i, &g);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  395|  18.8k|    if (d) secp256k1_fe_mul(&i, &i, d);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  |  Branch (395:9): [True: 18.8k, False: 0]
  ------------------
  396|  18.8k|    secp256k1_fe_inv(&i, &i);
  ------------------
  |  |   98|  18.8k|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  397|  18.8k|    secp256k1_fe_mul(r, &rj.x, &i);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  398|       |
  399|  18.8k|    return 1;
  400|  18.8k|}
secp256k1.c:secp256k1_ecmult_const:
  122|  18.8k|static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q) {
  123|       |    /* The approach below combines the signed-digit logic from Mike Hamburg's
  124|       |     * "Fast and compact elliptic-curve cryptography" (https://eprint.iacr.org/2012/309)
  125|       |     * Section 3.3, with the GLV endomorphism.
  126|       |     *
  127|       |     * The idea there is to interpret the bits of a scalar as signs (1 = +, 0 = -), and compute a
  128|       |     * point multiplication in that fashion. Let v be an n-bit non-negative integer (0 <= v < 2^n),
  129|       |     * and v[i] its i'th bit (so v = sum(v[i] * 2^i, i=0..n-1)). Then define:
  130|       |     *
  131|       |     *   C_l(v, A) = sum((2*v[i] - 1) * 2^i*A, i=0..l-1)
  132|       |     *
  133|       |     * Then it holds that C_l(v, A) = sum((2*v[i] - 1) * 2^i*A, i=0..l-1)
  134|       |     *                              = (2*sum(v[i] * 2^i, i=0..l-1) + 1 - 2^l) * A
  135|       |     *                              = (2*v + 1 - 2^l) * A
  136|       |     *
  137|       |     * Thus, one can compute q*A as C_256((q + 2^256 - 1) / 2, A). This is the basis for the
  138|       |     * paper's signed-digit multi-comb algorithm for multiplication using a precomputed table.
  139|       |     *
  140|       |     * It is appealing to try to combine this with the GLV optimization: the idea that a scalar
  141|       |     * s can be written as s1 + lambda*s2, where lambda is a curve-specific constant such that
  142|       |     * lambda*A is easy to compute, and where s1 and s2 are small. In particular we have the
  143|       |     * secp256k1_scalar_split_lambda function which performs such a split with the resulting s1
  144|       |     * and s2 in range (-2^128, 2^128) mod n. This does work, but is uninteresting:
  145|       |     *
  146|       |     *   To compute q*A:
  147|       |     *   - Let s1, s2 = split_lambda(q)
  148|       |     *   - Let R1 = C_256((s1 + 2^256 - 1) / 2, A)
  149|       |     *   - Let R2 = C_256((s2 + 2^256 - 1) / 2, lambda*A)
  150|       |     *   - Return R1 + R2
  151|       |     *
  152|       |     * The issue is that while s1 and s2 are small-range numbers, (s1 + 2^256 - 1) / 2 (mod n)
  153|       |     * and (s2 + 2^256 - 1) / 2 (mod n) are not, undoing the benefit of the splitting.
  154|       |     *
  155|       |     * To make it work, we want to modify the input scalar q first, before splitting, and then only
  156|       |     * add a 2^128 offset of the split results (so that they end up in the single 129-bit range
  157|       |     * [0,2^129]). A slightly smaller offset would work due to the bounds on the split, but we pick
  158|       |     * 2^128 for simplicity. Let s be the scalar fed to split_lambda, and f(q) the function to
  159|       |     * compute it from q:
  160|       |     *
  161|       |     *   To compute q*A:
  162|       |     *   - Compute s = f(q)
  163|       |     *   - Let s1, s2 = split_lambda(s)
  164|       |     *   - Let v1 = s1 + 2^128 (mod n)
  165|       |     *   - Let v2 = s2 + 2^128 (mod n)
  166|       |     *   - Let R1 = C_l(v1, A)
  167|       |     *   - Let R2 = C_l(v2, lambda*A)
  168|       |     *   - Return R1 + R2
  169|       |     *
  170|       |     * l will thus need to be at least 129, but we may overshoot by a few bits (see
  171|       |     * further), so keep it as a variable.
  172|       |     *
  173|       |     * To solve for s, we reason:
  174|       |     *     q*A  = R1 + R2
  175|       |     * <=> q*A  = C_l(s1 + 2^128, A) + C_l(s2 + 2^128, lambda*A)
  176|       |     * <=> q*A  = (2*(s1 + 2^128) + 1 - 2^l) * A + (2*(s2 + 2^128) + 1 - 2^l) * lambda*A
  177|       |     * <=> q*A  = (2*(s1 + s2*lambda) + (2^129 + 1 - 2^l) * (1 + lambda)) * A
  178|       |     * <=> q    = 2*(s1 + s2*lambda) + (2^129 + 1 - 2^l) * (1 + lambda) (mod n)
  179|       |     * <=> q    = 2*s + (2^129 + 1 - 2^l) * (1 + lambda) (mod n)
  180|       |     * <=> s    = (q + (2^l - 2^129 - 1) * (1 + lambda)) / 2 (mod n)
  181|       |     * <=> f(q) = (q + K) / 2 (mod n)
  182|       |     *            where K = (2^l - 2^129 - 1)*(1 + lambda) (mod n)
  183|       |     *
  184|       |     * We will process the computation of C_l(v1, A) and C_l(v2, lambda*A) in groups of
  185|       |     * ECMULT_CONST_GROUP_SIZE, so we set l to the smallest multiple of ECMULT_CONST_GROUP_SIZE
  186|       |     * that is not less than 129; this equals ECMULT_CONST_BITS.
  187|       |     */
  188|       |
  189|       |    /* The offset to add to s1 and s2 to make them non-negative. Equal to 2^128. */
  190|  18.8k|    static const secp256k1_scalar S_OFFSET = SECP256K1_SCALAR_CONST(0, 0, 0, 1, 0, 0, 0, 0);
  ------------------
  |  |   17|  18.8k|#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)}}
  ------------------
  191|  18.8k|    secp256k1_scalar s, v1, v2;
  192|  18.8k|    secp256k1_ge pre_a[ECMULT_CONST_TABLE_SIZE];
  193|  18.8k|    secp256k1_ge pre_a_lam[ECMULT_CONST_TABLE_SIZE];
  194|  18.8k|    secp256k1_fe global_z;
  195|  18.8k|    int group, i;
  196|       |
  197|       |    /* We're allowed to be non-constant time in the point, and the code below (in particular,
  198|       |     * secp256k1_ecmult_const_odd_multiples_table_globalz) cannot deal with infinity in a
  199|       |     * constant-time manner anyway. */
  200|  18.8k|    if (secp256k1_ge_is_infinity(a)) {
  ------------------
  |  Branch (200:9): [True: 0, False: 18.8k]
  ------------------
  201|      0|        secp256k1_gej_set_infinity(r);
  202|      0|        return;
  203|      0|    }
  204|       |
  205|       |    /* Compute v1 and v2. */
  206|  18.8k|    secp256k1_scalar_add(&s, q, &secp256k1_ecmult_const_K);
  207|  18.8k|    secp256k1_scalar_half(&s, &s);
  208|  18.8k|    secp256k1_scalar_split_lambda(&v1, &v2, &s);
  209|  18.8k|    secp256k1_scalar_add(&v1, &v1, &S_OFFSET);
  210|  18.8k|    secp256k1_scalar_add(&v2, &v2, &S_OFFSET);
  211|       |
  212|       |#ifdef VERIFY
  213|       |    /* Verify that v1 and v2 are in range [0, 2^129-1]. */
  214|       |    for (i = 129; i < 256; ++i) {
  215|       |        VERIFY_CHECK(secp256k1_scalar_get_bits_limb32(&v1, i, 1) == 0);
  216|       |        VERIFY_CHECK(secp256k1_scalar_get_bits_limb32(&v2, i, 1) == 0);
  217|       |    }
  218|       |#endif
  219|       |
  220|       |    /* Calculate odd multiples of A and A*lambda.
  221|       |     * All multiples are brought to the same Z 'denominator', which is stored
  222|       |     * in global_z. Due to secp256k1' isomorphism we can do all operations pretending
  223|       |     * that the Z coordinate was 1, use affine addition formulae, and correct
  224|       |     * the Z coordinate of the result once at the end.
  225|       |     */
  226|  18.8k|    secp256k1_gej_set_ge(r, a);
  227|  18.8k|    secp256k1_ecmult_const_odd_multiples_table_globalz(pre_a, &global_z, r);
  228|   320k|    for (i = 0; i < ECMULT_CONST_TABLE_SIZE; i++) {
  ------------------
  |  |   33|   320k|#define ECMULT_CONST_TABLE_SIZE (1L << (ECMULT_CONST_GROUP_SIZE - 1))
  |  |  ------------------
  |  |  |  |   30|   320k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  ------------------
  |  Branch (228:17): [True: 302k, False: 18.8k]
  ------------------
  229|   302k|        secp256k1_ge_mul_lambda(&pre_a_lam[i], &pre_a[i]);
  230|   302k|    }
  231|       |
  232|       |    /* Next, we compute r = C_l(v1, A) + C_l(v2, lambda*A).
  233|       |     *
  234|       |     * We proceed in groups of ECMULT_CONST_GROUP_SIZE bits, operating on that many bits
  235|       |     * at a time, from high in v1, v2 to low. Call these bits1 (from v1) and bits2 (from v2).
  236|       |     *
  237|       |     * Now note that ECMULT_CONST_TABLE_GET_GE(&t, pre_a, bits1) loads into t a point equal
  238|       |     * to C_{ECMULT_CONST_GROUP_SIZE}(bits1, A), and analogously for pre_lam_a / bits2.
  239|       |     * This means that all we need to do is add these looked up values together, multiplied
  240|       |     * by 2^(ECMULT_GROUP_SIZE * group).
  241|       |     */
  242|   509k|    for (group = ECMULT_CONST_GROUPS - 1; group >= 0; --group) {
  ------------------
  |  |   34|  18.8k|#define ECMULT_CONST_GROUPS ((129 + ECMULT_CONST_GROUP_SIZE - 1) / ECMULT_CONST_GROUP_SIZE)
  |  |  ------------------
  |  |  |  |   30|  18.8k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  |  |               #define ECMULT_CONST_GROUPS ((129 + ECMULT_CONST_GROUP_SIZE - 1) / ECMULT_CONST_GROUP_SIZE)
  |  |  ------------------
  |  |  |  |   30|  18.8k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  ------------------
  |  Branch (242:43): [True: 490k, False: 18.8k]
  ------------------
  243|       |        /* Using the _var get_bits function is ok here, since it's only variable in offset and count, not in the scalar. */
  244|   490k|        unsigned int bits1 = secp256k1_scalar_get_bits_var(&v1, group * ECMULT_CONST_GROUP_SIZE, ECMULT_CONST_GROUP_SIZE);
  ------------------
  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  ------------------
                      unsigned int bits1 = secp256k1_scalar_get_bits_var(&v1, group * ECMULT_CONST_GROUP_SIZE, ECMULT_CONST_GROUP_SIZE);
  ------------------
  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  ------------------
  245|   490k|        unsigned int bits2 = secp256k1_scalar_get_bits_var(&v2, group * ECMULT_CONST_GROUP_SIZE, ECMULT_CONST_GROUP_SIZE);
  ------------------
  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  ------------------
                      unsigned int bits2 = secp256k1_scalar_get_bits_var(&v2, group * ECMULT_CONST_GROUP_SIZE, ECMULT_CONST_GROUP_SIZE);
  ------------------
  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  ------------------
  246|   490k|        secp256k1_ge t;
  247|   490k|        int j;
  248|       |
  249|   490k|        ECMULT_CONST_TABLE_GET_GE(&t, pre_a, bits1);
  ------------------
  |  |   61|   490k|#define ECMULT_CONST_TABLE_GET_GE(r,pre,n) do { \
  |  |   62|   490k|    unsigned int m = 0; \
  |  |   63|   490k|    /* If the top bit of n is 0, we want the negation. */ \
  |  |   64|   490k|    volatile unsigned int negative = ((n) >> (ECMULT_CONST_GROUP_SIZE - 1)) ^ 1; \
  |  |  ------------------
  |  |  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  |  |   65|   490k|    /* Let n[i] be the i-th bit of n, then the index is
  |  |   66|   490k|     *     sum(cnot(n[i]) * 2^i, i=0..l-2)
  |  |   67|   490k|     * where cnot(b) = b if n[l-1] = 1 and 1 - b otherwise.
  |  |   68|   490k|     * For example, if n = 4, in binary 0100, the index is 3, in binary 011.
  |  |   69|   490k|     *
  |  |   70|   490k|     * Proof:
  |  |   71|   490k|     *     Let
  |  |   72|   490k|     *         x = sum((2*n[i] - 1)*2^i, i=0..l-1)
  |  |   73|   490k|     *           = 2*sum(n[i] * 2^i, i=0..l-1) - 2^l + 1
  |  |   74|   490k|     *     be the value represented by n.
  |  |   75|   490k|     *     The index is (x - 1)/2 if x > 0 and -(x + 1)/2 otherwise.
  |  |   76|   490k|     *     Case x > 0:
  |  |   77|   490k|     *         n[l-1] = 1
  |  |   78|   490k|     *         index = sum(n[i] * 2^i, i=0..l-1) - 2^(l-1)
  |  |   79|   490k|     *               = sum(n[i] * 2^i, i=0..l-2)
  |  |   80|   490k|     *     Case x <= 0:
  |  |   81|   490k|     *         n[l-1] = 0
  |  |   82|   490k|     *          index = -(2*sum(n[i] * 2^i, i=0..l-1) - 2^l + 2)/2
  |  |   83|   490k|     *                = 2^(l-1) - 1 - sum(n[i] * 2^i, i=0..l-1)
  |  |   84|   490k|     *                = sum((1 - n[i]) * 2^i, i=0..l-2)
  |  |   85|   490k|     */ \
  |  |   86|   490k|    unsigned int index = ((unsigned int)(-negative) ^ n) & ((1U << (ECMULT_CONST_GROUP_SIZE - 1)) - 1U); \
  |  |  ------------------
  |  |  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  |  |   87|   490k|    secp256k1_fe neg_y; \
  |  |   88|   490k|    VERIFY_CHECK((n) < (1U << ECMULT_CONST_GROUP_SIZE)); \
  |  |   89|   490k|    VERIFY_CHECK(index < (1U << (ECMULT_CONST_GROUP_SIZE - 1))); \
  |  |   90|   490k|    /* Unconditionally set r->x = (pre)[m].x and r->y = (pre)[m].y because it's either the correct one
  |  |   91|   490k|     * or will get replaced in the later iterations, this is needed to make sure `r` is initialized. */ \
  |  |   92|   490k|    secp256k1_ge_set_xy((r), &(pre)[m].x, &(pre)[m].y); \
  |  |   93|  7.85M|    for (m = 1; m < ECMULT_CONST_TABLE_SIZE; m++) { \
  |  |  ------------------
  |  |  |  |   33|  7.85M|#define ECMULT_CONST_TABLE_SIZE (1L << (ECMULT_CONST_GROUP_SIZE - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  7.85M|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (93:17): [True: 7.36M, False: 490k]
  |  |  ------------------
  |  |   94|  7.36M|        /* This loop is used to avoid secret data in array indices. See
  |  |   95|  7.36M|         * the comment in ecmult_gen_impl.h for rationale. */ \
  |  |   96|  7.36M|        secp256k1_fe_cmov(&(r)->x, &(pre)[m].x, m == index); \
  |  |  ------------------
  |  |  |  |   95|  7.36M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  |  |  ------------------
  |  |   97|  7.36M|        secp256k1_fe_cmov(&(r)->y, &(pre)[m].y, m == index); \
  |  |  ------------------
  |  |  |  |   95|  7.36M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  |  |  ------------------
  |  |   98|  7.36M|    } \
  |  |   99|   490k|    secp256k1_fe_negate(&neg_y, &(r)->y, 1); \
  |  |  ------------------
  |  |  |  |  211|   490k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|   490k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |  |  |   88|   490k|    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: 490k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   91|      0|            break; \
  |  |  |  |  |  |   92|   490k|        default: ; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (92:9): [True: 490k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   490k|    } \
  |  |  |  |  |  |   94|   490k|    stmt; \
  |  |  |  |  |  |   95|   490k|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:9): [Folded, False: 490k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  100|   490k|    secp256k1_fe_cmov(&(r)->y, &neg_y, negative); \
  |  |  ------------------
  |  |  |  |   95|   490k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  |  |  ------------------
  |  |  101|   490k|} while(0)
  |  |  ------------------
  |  |  |  Branch (101:9): [Folded, False: 490k]
  |  |  ------------------
  ------------------
  250|   490k|        if (group == ECMULT_CONST_GROUPS - 1) {
  ------------------
  |  |   34|   490k|#define ECMULT_CONST_GROUPS ((129 + ECMULT_CONST_GROUP_SIZE - 1) / ECMULT_CONST_GROUP_SIZE)
  |  |  ------------------
  |  |  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  |  |               #define ECMULT_CONST_GROUPS ((129 + ECMULT_CONST_GROUP_SIZE - 1) / ECMULT_CONST_GROUP_SIZE)
  |  |  ------------------
  |  |  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  ------------------
  |  Branch (250:13): [True: 18.8k, False: 472k]
  ------------------
  251|       |            /* Directly set r in the first iteration. */
  252|  18.8k|            secp256k1_gej_set_ge(r, &t);
  253|   472k|        } else {
  254|       |            /* Shift the result so far up. */
  255|  2.83M|            for (j = 0; j < ECMULT_CONST_GROUP_SIZE; ++j) {
  ------------------
  |  |   30|  2.83M|#  define ECMULT_CONST_GROUP_SIZE 5
  ------------------
  |  Branch (255:25): [True: 2.36M, False: 472k]
  ------------------
  256|  2.36M|                secp256k1_gej_double(r, r);
  257|  2.36M|            }
  258|   472k|            secp256k1_gej_add_ge(r, r, &t);
  259|   472k|        }
  260|   490k|        ECMULT_CONST_TABLE_GET_GE(&t, pre_a_lam, bits2);
  ------------------
  |  |   61|   490k|#define ECMULT_CONST_TABLE_GET_GE(r,pre,n) do { \
  |  |   62|   490k|    unsigned int m = 0; \
  |  |   63|   490k|    /* If the top bit of n is 0, we want the negation. */ \
  |  |   64|   490k|    volatile unsigned int negative = ((n) >> (ECMULT_CONST_GROUP_SIZE - 1)) ^ 1; \
  |  |  ------------------
  |  |  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  |  |   65|   490k|    /* Let n[i] be the i-th bit of n, then the index is
  |  |   66|   490k|     *     sum(cnot(n[i]) * 2^i, i=0..l-2)
  |  |   67|   490k|     * where cnot(b) = b if n[l-1] = 1 and 1 - b otherwise.
  |  |   68|   490k|     * For example, if n = 4, in binary 0100, the index is 3, in binary 011.
  |  |   69|   490k|     *
  |  |   70|   490k|     * Proof:
  |  |   71|   490k|     *     Let
  |  |   72|   490k|     *         x = sum((2*n[i] - 1)*2^i, i=0..l-1)
  |  |   73|   490k|     *           = 2*sum(n[i] * 2^i, i=0..l-1) - 2^l + 1
  |  |   74|   490k|     *     be the value represented by n.
  |  |   75|   490k|     *     The index is (x - 1)/2 if x > 0 and -(x + 1)/2 otherwise.
  |  |   76|   490k|     *     Case x > 0:
  |  |   77|   490k|     *         n[l-1] = 1
  |  |   78|   490k|     *         index = sum(n[i] * 2^i, i=0..l-1) - 2^(l-1)
  |  |   79|   490k|     *               = sum(n[i] * 2^i, i=0..l-2)
  |  |   80|   490k|     *     Case x <= 0:
  |  |   81|   490k|     *         n[l-1] = 0
  |  |   82|   490k|     *          index = -(2*sum(n[i] * 2^i, i=0..l-1) - 2^l + 2)/2
  |  |   83|   490k|     *                = 2^(l-1) - 1 - sum(n[i] * 2^i, i=0..l-1)
  |  |   84|   490k|     *                = sum((1 - n[i]) * 2^i, i=0..l-2)
  |  |   85|   490k|     */ \
  |  |   86|   490k|    unsigned int index = ((unsigned int)(-negative) ^ n) & ((1U << (ECMULT_CONST_GROUP_SIZE - 1)) - 1U); \
  |  |  ------------------
  |  |  |  |   30|   490k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  |  |   87|   490k|    secp256k1_fe neg_y; \
  |  |   88|   490k|    VERIFY_CHECK((n) < (1U << ECMULT_CONST_GROUP_SIZE)); \
  |  |   89|   490k|    VERIFY_CHECK(index < (1U << (ECMULT_CONST_GROUP_SIZE - 1))); \
  |  |   90|   490k|    /* Unconditionally set r->x = (pre)[m].x and r->y = (pre)[m].y because it's either the correct one
  |  |   91|   490k|     * or will get replaced in the later iterations, this is needed to make sure `r` is initialized. */ \
  |  |   92|   490k|    secp256k1_ge_set_xy((r), &(pre)[m].x, &(pre)[m].y); \
  |  |   93|  7.85M|    for (m = 1; m < ECMULT_CONST_TABLE_SIZE; m++) { \
  |  |  ------------------
  |  |  |  |   33|  7.85M|#define ECMULT_CONST_TABLE_SIZE (1L << (ECMULT_CONST_GROUP_SIZE - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  7.85M|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (93:17): [True: 7.36M, False: 490k]
  |  |  ------------------
  |  |   94|  7.36M|        /* This loop is used to avoid secret data in array indices. See
  |  |   95|  7.36M|         * the comment in ecmult_gen_impl.h for rationale. */ \
  |  |   96|  7.36M|        secp256k1_fe_cmov(&(r)->x, &(pre)[m].x, m == index); \
  |  |  ------------------
  |  |  |  |   95|  7.36M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  |  |  ------------------
  |  |   97|  7.36M|        secp256k1_fe_cmov(&(r)->y, &(pre)[m].y, m == index); \
  |  |  ------------------
  |  |  |  |   95|  7.36M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  |  |  ------------------
  |  |   98|  7.36M|    } \
  |  |   99|   490k|    secp256k1_fe_negate(&neg_y, &(r)->y, 1); \
  |  |  ------------------
  |  |  |  |  211|   490k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|   490k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |  |  |   88|   490k|    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: 490k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   91|      0|            break; \
  |  |  |  |  |  |   92|   490k|        default: ; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (92:9): [True: 490k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   490k|    } \
  |  |  |  |  |  |   94|   490k|    stmt; \
  |  |  |  |  |  |   95|   490k|} while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:9): [Folded, False: 490k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  100|   490k|    secp256k1_fe_cmov(&(r)->y, &neg_y, negative); \
  |  |  ------------------
  |  |  |  |   95|   490k|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  |  |  ------------------
  |  |  101|   490k|} while(0)
  |  |  ------------------
  |  |  |  Branch (101:9): [Folded, False: 490k]
  |  |  ------------------
  ------------------
  261|   490k|        secp256k1_gej_add_ge(r, r, &t);
  262|   490k|    }
  263|       |
  264|       |    /* Map the result back to the secp256k1 curve from the isomorphic curve. */
  265|  18.8k|    secp256k1_fe_mul(&r->z, &r->z, &global_z);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  266|  18.8k|}
secp256k1.c:secp256k1_ecmult_const_odd_multiples_table_globalz:
   44|  18.8k|static void secp256k1_ecmult_const_odd_multiples_table_globalz(secp256k1_ge *pre, secp256k1_fe *globalz, const secp256k1_gej *a) {
   45|  18.8k|    secp256k1_fe zr[ECMULT_CONST_TABLE_SIZE];
   46|       |
   47|  18.8k|    secp256k1_ecmult_odd_multiples_table(ECMULT_CONST_TABLE_SIZE, pre, zr, globalz, a);
  ------------------
  |  |   33|  18.8k|#define ECMULT_CONST_TABLE_SIZE (1L << (ECMULT_CONST_GROUP_SIZE - 1))
  |  |  ------------------
  |  |  |  |   30|  18.8k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  ------------------
   48|  18.8k|    secp256k1_ge_table_set_globalz(ECMULT_CONST_TABLE_SIZE, pre, zr);
  ------------------
  |  |   33|  18.8k|#define ECMULT_CONST_TABLE_SIZE (1L << (ECMULT_CONST_GROUP_SIZE - 1))
  |  |  ------------------
  |  |  |  |   30|  18.8k|#  define ECMULT_CONST_GROUP_SIZE 5
  |  |  ------------------
  ------------------
   49|  18.8k|}

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|   256k|static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {
   23|   256k|    return ctx->built;
   24|   256k|}
secp256k1.c:secp256k1_ecmult_gen_gej:
   54|   256k|static void secp256k1_ecmult_gen_gej(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {
   55|   256k|    uint32_t comb_off;
   56|   256k|    secp256k1_ge add;
   57|   256k|    secp256k1_fe neg;
   58|   256k|    secp256k1_ge_storage adds;
   59|   256k|    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|   256k|    uint32_t recoded[(COMB_BITS + 31) >> 5] = {0};
   64|   256k|    int first = 1, i;
   65|       |
   66|   256k|    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|   256k|    secp256k1_scalar_add(&d, &ctx->scalar_offset, gn);
  111|       |    /* Convert to recoded array. */
  112|  2.30M|    for (i = 0; i < 8 && i < ((COMB_BITS + 31) >> 5); ++i) {
  ------------------
  |  |   85|  2.05M|#define COMB_BITS (COMB_BLOCKS * COMB_TEETH * COMB_SPACING)
  |  |  ------------------
  |  |  |  |   79|  2.05M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  190|  2.05M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (112:17): [True: 2.05M, False: 256k]
  |  Branch (112:26): [True: 2.05M, False: 0]
  ------------------
  113|  2.05M|        recoded[i] = secp256k1_scalar_get_bits_limb32(&d, 32 * i, 32);
  114|  2.05M|    }
  115|   256k|    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|   256k|    comb_off = COMB_SPACING - 1;
  ------------------
  |  |   79|   256k|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  190|   256k|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  193|   256k|    while (1) {
  ------------------
  |  Branch (193:12): [True: 256k, Folded]
  ------------------
  194|   256k|        uint32_t block;
  195|   256k|        uint32_t bit_pos = comb_off;
  196|       |        /* Inner loop: for each block, add table entries to the result. */
  197|  11.2M|        for (block = 0; block < COMB_BLOCKS; ++block) {
  ------------------
  |  Branch (197:25): [True: 11.0M, False: 256k]
  ------------------
  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|  11.0M|            uint32_t bits = 0, sign, abs, index, tooth;
  201|       |            /* Instead of reading individual bits here to construct the bits variable,
  202|       |             * build up the result by xoring rotated reads together. In every iteration,
  203|       |             * one additional bit is made correct, starting at the bottom. The bits
  204|       |             * above that contain junk. This reduces leakage by avoiding computations
  205|       |             * on variables that can have only a low number of possible values (e.g.,
  206|       |             * just two values when reading a single bit into a variable.) See:
  207|       |             * https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-alam.pdf
  208|       |             */
  209|  77.2M|            for (tooth = 0; tooth < COMB_TEETH; ++tooth) {
  ------------------
  |  Branch (209:29): [True: 66.1M, False: 11.0M]
  ------------------
  210|       |                /* Construct bitdata s.t. the bottom bit is the bit we'd like to read.
  211|       |                 *
  212|       |                 * We could just set bitdata = recoded[bit_pos >> 5] >> (bit_pos & 0x1f)
  213|       |                 * but this would simply discard the bits that fall off at the bottom,
  214|       |                 * and thus, for example, bitdata could still have only two values if we
  215|       |                 * happen to shift by exactly 31 positions. We use a rotation instead,
  216|       |                 * which ensures that bitdata doesn't lose entropy. This relies on the
  217|       |                 * rotation being atomic, i.e., the compiler emitting an actual rot
  218|       |                 * instruction. */
  219|  66.1M|                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|  66.1M|                uint32_t volatile vmask = ~(1 << tooth);
  223|  66.1M|                bits &= vmask;
  224|       |
  225|       |                /* Write the bit into position tooth (and junk into higher bits). */
  226|  66.1M|                bits ^= bitdata << tooth;
  227|  66.1M|                bit_pos += COMB_SPACING;
  ------------------
  |  |   79|  66.1M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  190|  66.1M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  228|  66.1M|            }
  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|  11.0M|            sign = (bits >> (COMB_TEETH - 1)) & 1;
  233|  11.0M|            abs = (bits ^ -sign) & (COMB_POINTS - 1);
  ------------------
  |  |   87|  11.0M|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  234|  11.0M|            VERIFY_CHECK(sign == 0 || sign == 1);
  235|  11.0M|            VERIFY_CHECK(abs < COMB_POINTS);
  236|       |
  237|       |            /** This uses a conditional move to avoid any secret data in array indexes.
  238|       |             *   _Any_ use of secret indexes has been demonstrated to result in timing
  239|       |             *   sidechannels, even when the cache-line access patterns are uniform.
  240|       |             *  See also:
  241|       |             *   "A word of warning", CHES 2013 Rump Session, by Daniel J. Bernstein and Peter Schwabe
  242|       |             *    (https://cryptojedi.org/peter/data/chesrump-20130822.pdf) and
  243|       |             *   "Cache Attacks and Countermeasures: the Case of AES", RSA 2006,
  244|       |             *    by Dag Arne Osvik, Adi Shamir, and Eran Tromer
  245|       |             *    (https://eprint.iacr.org/2005/271.pdf)
  246|       |             */
  247|   363M|            for (index = 0; index < COMB_POINTS; ++index) {
  ------------------
  |  |   87|   363M|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  |  Branch (247:29): [True: 352M, False: 11.0M]
  ------------------
  248|   352M|                secp256k1_ge_storage_cmov(&adds, &secp256k1_ecmult_gen_prec_table[block][index], index == abs);
  249|   352M|            }
  250|       |
  251|       |            /* Set add=adds or add=-adds, in constant time, based on sign. */
  252|  11.0M|            secp256k1_ge_from_storage(&add, &adds);
  253|  11.0M|            secp256k1_fe_negate(&neg, &add.y, 1);
  ------------------
  |  |  211|  11.0M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  11.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  11.0M|    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: 11.0M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  11.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 11.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  11.0M|    } \
  |  |  |  |   94|  11.0M|    stmt; \
  |  |  |  |   95|  11.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 11.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  11.0M|            secp256k1_fe_cmov(&add.y, &neg, sign);
  ------------------
  |  |   95|  11.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  255|       |
  256|       |            /* Add the looked up and conditionally negated value to r. */
  257|  11.0M|            if (EXPECT(first, 0)) {
  ------------------
  |  |  146|  11.0M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 256k, False: 10.7M]
  |  |  ------------------
  ------------------
  258|       |                /* If this is the first table lookup, we can skip addition. */
  259|   256k|                secp256k1_gej_set_ge(r, &add);
  260|       |                /* Give the entry a random Z coordinate to blind intermediary results. */
  261|   256k|                secp256k1_gej_rescale(r, &ctx->proj_blind);
  262|   256k|                first = 0;
  263|  10.7M|            } else {
  264|  10.7M|                secp256k1_gej_add_ge(r, r, &add);
  265|  10.7M|            }
  266|  11.0M|        }
  267|       |
  268|       |        /* Double the result, except in the last iteration. */
  269|   256k|        if (comb_off-- == 0) break;
  ------------------
  |  Branch (269:13): [True: 256k, 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|   256k|    secp256k1_gej_add_ge(r, r, &ctx->ge_offset);
  276|       |
  277|       |    /* Cleanup. */
  278|   256k|    secp256k1_fe_clear(&neg);
  279|   256k|    secp256k1_ge_clear(&add);
  280|   256k|    secp256k1_memclear_explicit(&adds, sizeof(adds));
  281|   256k|    secp256k1_memclear_explicit(&recoded, sizeof(recoded));
  282|   256k|}
secp256k1.c:secp256k1_ecmult_gen_ge:
  284|   256k|SECP256K1_INLINE static void secp256k1_ecmult_gen_ge(const secp256k1_ecmult_gen_context *ctx, secp256k1_ge *r, const secp256k1_scalar *a) {
  285|   256k|    secp256k1_gej rj;
  286|   256k|    secp256k1_ecmult_gen_gej(ctx, &rj, a);
  287|   256k|    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|   256k|    secp256k1_gej_clear(&rj);
  291|   256k|}

secp256k1.c:secp256k1_ecmult_odd_multiples_table:
   73|  18.8k|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|  18.8k|    secp256k1_gej d, ai;
   75|  18.8k|    secp256k1_ge d_ge;
   76|  18.8k|    size_t i;
   77|       |
   78|  18.8k|    VERIFY_CHECK(!secp256k1_gej_is_infinity(a));
   79|       |
   80|  18.8k|    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|  18.8k|    secp256k1_ge_set_xy(&d_ge, &d.x, &d.y);
   96|  18.8k|    secp256k1_ge_set_gej_zinv(&pre_a[0], a, &d.z);
   97|  18.8k|    secp256k1_gej_set_ge(&ai, &pre_a[0]);
   98|  18.8k|    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|  18.8k|    zr[0] = d.z;
  104|       |
  105|   302k|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (105:17): [True: 283k, False: 18.8k]
  ------------------
  106|   283k|        secp256k1_gej_add_ge_var(&ai, &ai, &d_ge, &zr[i]);
  107|   283k|        secp256k1_ge_set_xy(&pre_a[i], &ai.x, &ai.y);
  108|   283k|    }
  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|  18.8k|    secp256k1_fe_mul(z, &ai.z, &d.z);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  115|  18.8k|}

secp256k1.c:secp256k1_fe_impl_sqr:
  317|   170M|SECP256K1_FORCE_INLINE static void secp256k1_fe_impl_sqr(secp256k1_fe *r, const secp256k1_fe *a) {
  318|   170M|    secp256k1_fe_sqr_inner(r->n, a->n);
  319|   170M|}
secp256k1.c:secp256k1_fe_impl_mul:
  313|   104M|SECP256K1_FORCE_INLINE static void secp256k1_fe_impl_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {
  314|   104M|    secp256k1_fe_mul_inner(r->n, a->n, b->n);
  315|   104M|}
secp256k1.c:secp256k1_fe_impl_add_int:
  301|  1.04M|SECP256K1_INLINE static void secp256k1_fe_impl_add_int(secp256k1_fe *r, int a) {
  302|  1.04M|    r->n[0] += a;
  303|  1.04M|}
secp256k1.c:secp256k1_fe_impl_is_zero:
  206|  1.56M|SECP256K1_INLINE static int secp256k1_fe_impl_is_zero(const secp256k1_fe *a) {
  207|  1.56M|    const uint64_t *t = a->n;
  208|  1.56M|    return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0;
  209|  1.56M|}
secp256k1.c:secp256k1_fe_impl_add:
  305|  97.8M|SECP256K1_INLINE static void secp256k1_fe_impl_add(secp256k1_fe *r, const secp256k1_fe *a) {
  306|  97.8M|    r->n[0] += a->n[0];
  307|  97.8M|    r->n[1] += a->n[1];
  308|  97.8M|    r->n[2] += a->n[2];
  309|  97.8M|    r->n[3] += a->n[3];
  310|  97.8M|    r->n[4] += a->n[4];
  311|  97.8M|}
secp256k1.c:secp256k1_fe_impl_normalize_weak:
   80|  2.06M|static void secp256k1_fe_impl_normalize_weak(secp256k1_fe *r) {
   81|  2.06M|    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|  2.06M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   85|       |
   86|       |    /* The first pass ensures the magnitude is 1, ... */
   87|  2.06M|    t0 += x * 0x1000003D1ULL;
   88|  2.06M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   89|  2.06M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   90|  2.06M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   91|  2.06M|    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|  2.06M|    VERIFY_CHECK(t4 >> 49 == 0);
   95|       |
   96|  2.06M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   97|  2.06M|}
secp256k1.c:secp256k1_fe_impl_negate_unchecked:
  278|  55.7M|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|  55.7M|    VERIFY_CHECK(0xFFFFEFFFFFC2FULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  281|  55.7M|    VERIFY_CHECK(0xFFFFFFFFFFFFFULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  282|  55.7M|    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|  55.7M|    r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0];
  287|  55.7M|    r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1];
  288|  55.7M|    r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2];
  289|  55.7M|    r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3];
  290|  55.7M|    r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4];
  291|  55.7M|}
secp256k1.c:secp256k1_fe_impl_cmov:
  321|   113M|SECP256K1_INLINE static void secp256k1_fe_impl_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag) {
  322|   113M|    uint64_t mask0, mask1;
  323|   113M|    volatile int vflag = flag;
  324|   113M|    VERIFY_CHECK(flag == 0 || flag == 1);
  325|   113M|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->n, sizeof(r->n));
  ------------------
  |  |  114|   113M|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   113M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 113M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  326|   113M|    mask0 = vflag + ~((uint64_t)0);
  327|   113M|    mask1 = ~mask0;
  328|   113M|    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
  329|   113M|    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
  330|   113M|    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
  331|   113M|    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
  332|   113M|    r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);
  333|   113M|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero:
  137|  24.3M|static int secp256k1_fe_impl_normalizes_to_zero(const secp256k1_fe *r) {
  138|  24.3M|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  139|       |
  140|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  141|  24.3M|    uint64_t z0, z1;
  142|       |
  143|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
  144|  24.3M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  145|       |
  146|       |    /* The first pass ensures the magnitude is 1, ... */
  147|  24.3M|    t0 += x * 0x1000003D1ULL;
  148|  24.3M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; z0  = t0; z1  = t0 ^ 0x1000003D0ULL;
  149|  24.3M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  150|  24.3M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  151|  24.3M|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  152|  24.3M|                                                z0 |= t4; z1 &= t4 ^ 0xF000000000000ULL;
  153|       |
  154|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
  155|  24.3M|    VERIFY_CHECK(t4 >> 49 == 0);
  156|       |
  157|  24.3M|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  158|  24.3M|}
secp256k1.c:secp256k1_fe_impl_set_int:
  201|   569k|SECP256K1_INLINE static void secp256k1_fe_impl_set_int(secp256k1_fe *r, int a) {
  202|   569k|    r->n[0] = a;
  203|   569k|    r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0;
  204|   569k|}
secp256k1.c:secp256k1_fe_impl_mul_int_unchecked:
  293|  26.9M|SECP256K1_INLINE static void secp256k1_fe_impl_mul_int_unchecked(secp256k1_fe *r, int a) {
  294|  26.9M|    r->n[0] *= a;
  295|  26.9M|    r->n[1] *= a;
  296|  26.9M|    r->n[2] *= a;
  297|  26.9M|    r->n[3] *= a;
  298|  26.9M|    r->n[4] *= a;
  299|  26.9M|}
secp256k1.c:secp256k1_fe_impl_half:
  335|  14.4M|static SECP256K1_INLINE void secp256k1_fe_impl_half(secp256k1_fe *r) {
  336|  14.4M|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  337|  14.4M|    uint64_t one = (uint64_t)1;
  338|  14.4M|    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|  14.4M|    t0 += 0xFFFFEFFFFFC2FULL & mask;
  351|  14.4M|    t1 += mask;
  352|  14.4M|    t2 += mask;
  353|  14.4M|    t3 += mask;
  354|  14.4M|    t4 += mask >> 4;
  355|       |
  356|  14.4M|    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|  14.4M|    r->n[0] = (t0 >> 1) + ((t1 & one) << 51);
  366|  14.4M|    r->n[1] = (t1 >> 1) + ((t2 & one) << 51);
  367|  14.4M|    r->n[2] = (t2 >> 1) + ((t3 & one) << 51);
  368|  14.4M|    r->n[3] = (t3 >> 1) + ((t4 & one) << 51);
  369|  14.4M|    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|  14.4M|}
secp256k1.c:secp256k1_fe_impl_inv:
  453|   275k|static void secp256k1_fe_impl_inv(secp256k1_fe *r, const secp256k1_fe *x) {
  454|   275k|    secp256k1_fe tmp = *x;
  455|   275k|    secp256k1_modinv64_signed62 s;
  456|       |
  457|   275k|    secp256k1_fe_normalize(&tmp);
  ------------------
  |  |   78|   275k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  458|   275k|    secp256k1_fe_to_signed62(&s, &tmp);
  459|   275k|    secp256k1_modinv64(&s, &secp256k1_const_modinfo_fe);
  460|   275k|    secp256k1_fe_from_signed62(r, &s);
  461|   275k|}
secp256k1.c:secp256k1_fe_to_signed62:
  437|  2.09M|static void secp256k1_fe_to_signed62(secp256k1_modinv64_signed62 *r, const secp256k1_fe *a) {
  438|  2.09M|    const uint64_t M62 = UINT64_MAX >> 2;
  439|  2.09M|    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|  2.09M|    r->v[0] = (a0       | a1 << 52) & M62;
  442|  2.09M|    r->v[1] = (a1 >> 10 | a2 << 42) & M62;
  443|  2.09M|    r->v[2] = (a2 >> 20 | a3 << 32) & M62;
  444|  2.09M|    r->v[3] = (a3 >> 30 | a4 << 22) & M62;
  445|  2.09M|    r->v[4] =  a4 >> 40;
  446|  2.09M|}
secp256k1.c:secp256k1_fe_from_signed62:
  417|   531k|static void secp256k1_fe_from_signed62(secp256k1_fe *r, const secp256k1_modinv64_signed62 *a) {
  418|   531k|    const uint64_t M52 = UINT64_MAX >> 12;
  419|   531k|    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|   531k|    VERIFY_CHECK(a0 >> 62 == 0);
  425|   531k|    VERIFY_CHECK(a1 >> 62 == 0);
  426|   531k|    VERIFY_CHECK(a2 >> 62 == 0);
  427|   531k|    VERIFY_CHECK(a3 >> 62 == 0);
  428|   531k|    VERIFY_CHECK(a4 >> 8 == 0);
  429|       |
  430|   531k|    r->n[0] =  a0                   & M52;
  431|   531k|    r->n[1] = (a0 >> 52 | a1 << 10) & M52;
  432|   531k|    r->n[2] = (a1 >> 42 | a2 << 20) & M52;
  433|   531k|    r->n[3] = (a2 >> 32 | a3 << 30) & M52;
  434|   531k|    r->n[4] = (a3 >> 22 | a4 << 40);
  435|   531k|}
secp256k1.c:secp256k1_fe_impl_get_b32:
  271|   275k|static void secp256k1_fe_impl_get_b32(unsigned char *r, const secp256k1_fe *a) {
  272|   275k|    secp256k1_write_be64(&r[0], (a->n[4] << 16) | (a->n[3] >> 36));
  273|   275k|    secp256k1_write_be64(&r[8], (a->n[3] << 28) | (a->n[2] >> 24));
  274|   275k|    secp256k1_write_be64(&r[16], (a->n[2] << 40) | (a->n[1] >> 12));
  275|   275k|    secp256k1_write_be64(&r[24], (a->n[1] << 52) | a->n[0]);
  276|   275k|}
secp256k1.c:secp256k1_fe_impl_normalize_var:
   99|  2.72M|static void secp256k1_fe_impl_normalize_var(secp256k1_fe *r) {
  100|  2.72M|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  101|       |
  102|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
  103|  2.72M|    uint64_t m;
  104|  2.72M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  105|       |
  106|       |    /* The first pass ensures the magnitude is 1, ... */
  107|  2.72M|    t0 += x * 0x1000003D1ULL;
  108|  2.72M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  109|  2.72M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
  110|  2.72M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
  111|  2.72M|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; m &= t3;
  112|       |
  113|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
  114|  2.72M|    VERIFY_CHECK(t4 >> 49 == 0);
  115|       |
  116|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
  117|  2.72M|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
  118|  2.72M|        & (t0 >= 0xFFFFEFFFFFC2FULL));
  119|       |
  120|  2.72M|    if (x) {
  ------------------
  |  Branch (120:9): [True: 0, False: 2.72M]
  ------------------
  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|  2.72M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
  135|  2.72M|}
secp256k1.c:secp256k1_fe_impl_is_odd:
  211|   512k|SECP256K1_INLINE static int secp256k1_fe_impl_is_odd(const secp256k1_fe *a) {
  212|   512k|    return a->n[0] & 1;
  213|   512k|}
secp256k1.c:secp256k1_fe_impl_from_storage:
  409|  22.0M|static SECP256K1_INLINE void secp256k1_fe_impl_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {
  410|  22.0M|    r->n[0] = a->n[0] & 0xFFFFFFFFFFFFFULL;
  411|  22.0M|    r->n[1] = a->n[0] >> 52 | ((a->n[1] << 12) & 0xFFFFFFFFFFFFFULL);
  412|  22.0M|    r->n[2] = a->n[1] >> 40 | ((a->n[2] << 24) & 0xFFFFFFFFFFFFFULL);
  413|  22.0M|    r->n[3] = a->n[2] >> 28 | ((a->n[3] << 36) & 0xFFFFFFFFFFFFFULL);
  414|  22.0M|    r->n[4] = a->n[3] >> 16;
  415|  22.0M|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero_var:
  160|   531k|static int secp256k1_fe_impl_normalizes_to_zero_var(const secp256k1_fe *r) {
  161|   531k|    uint64_t t0, t1, t2, t3, t4;
  162|   531k|    uint64_t z0, z1;
  163|   531k|    uint64_t x;
  164|       |
  165|   531k|    t0 = r->n[0];
  166|   531k|    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|   531k|    x = t4 >> 48;
  170|       |
  171|       |    /* The first pass ensures the magnitude is 1, ... */
  172|   531k|    t0 += x * 0x1000003D1ULL;
  173|       |
  174|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  175|   531k|    z0 = t0 & 0xFFFFFFFFFFFFFULL;
  176|   531k|    z1 = z0 ^ 0x1000003D0ULL;
  177|       |
  178|       |    /* Fast return path should catch the majority of cases */
  179|   531k|    if ((z0 != 0ULL) & (z1 != 0xFFFFFFFFFFFFFULL)) {
  ------------------
  |  Branch (179:9): [True: 502k, False: 29.1k]
  ------------------
  180|   502k|        return 0;
  181|   502k|    }
  182|       |
  183|  29.1k|    t1 = r->n[1];
  184|  29.1k|    t2 = r->n[2];
  185|  29.1k|    t3 = r->n[3];
  186|       |
  187|  29.1k|    t4 &= 0x0FFFFFFFFFFFFULL;
  188|       |
  189|  29.1k|    t1 += (t0 >> 52);
  190|  29.1k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  191|  29.1k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  192|  29.1k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  193|  29.1k|                                                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|  29.1k|    VERIFY_CHECK(t4 >> 49 == 0);
  197|       |
  198|  29.1k|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  199|   531k|}
secp256k1.c:secp256k1_fe_impl_inv_var:
  463|   256k|static void secp256k1_fe_impl_inv_var(secp256k1_fe *r, const secp256k1_fe *x) {
  464|   256k|    secp256k1_fe tmp = *x;
  465|   256k|    secp256k1_modinv64_signed62 s;
  466|       |
  467|   256k|    secp256k1_fe_normalize_var(&tmp);
  ------------------
  |  |   80|   256k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  468|   256k|    secp256k1_fe_to_signed62(&s, &tmp);
  469|   256k|    secp256k1_modinv64_var(&s, &secp256k1_const_modinfo_fe);
  470|   256k|    secp256k1_fe_from_signed62(r, &s);
  471|   256k|}
secp256k1.c:secp256k1_fe_storage_cmov:
  389|   705M|static SECP256K1_INLINE void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag) {
  390|   705M|    uint64_t mask0, mask1;
  391|   705M|    volatile int vflag = flag;
  392|   705M|    VERIFY_CHECK(flag == 0 || flag == 1);
  393|   705M|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->n, sizeof(r->n));
  ------------------
  |  |  114|   705M|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   705M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 705M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  394|   705M|    mask0 = vflag + ~((uint64_t)0);
  395|   705M|    mask1 = ~mask0;
  396|   705M|    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
  397|   705M|    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
  398|   705M|    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
  399|   705M|    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
  400|   705M|}
secp256k1.c:secp256k1_fe_impl_is_square_var:
  473|  1.56M|static int secp256k1_fe_impl_is_square_var(const secp256k1_fe *x) {
  474|  1.56M|    secp256k1_fe tmp;
  475|  1.56M|    secp256k1_modinv64_signed62 s;
  476|  1.56M|    int jac, ret;
  477|       |
  478|  1.56M|    tmp = *x;
  479|  1.56M|    secp256k1_fe_normalize_var(&tmp);
  ------------------
  |  |   80|  1.56M|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  480|       |    /* secp256k1_jacobi64_maybe_var cannot deal with input 0. */
  481|  1.56M|    if (secp256k1_fe_is_zero(&tmp)) return 1;
  ------------------
  |  |   84|  1.56M|#  define secp256k1_fe_is_zero secp256k1_fe_impl_is_zero
  ------------------
  |  Branch (481:9): [True: 0, False: 1.56M]
  ------------------
  482|  1.56M|    secp256k1_fe_to_signed62(&s, &tmp);
  483|  1.56M|    jac = secp256k1_jacobi64_maybe_var(&s, &secp256k1_const_modinfo_fe);
  484|  1.56M|    if (jac == 0) {
  ------------------
  |  Branch (484:9): [True: 0, False: 1.56M]
  ------------------
  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|  1.56M|    } else {
  491|  1.56M|        ret = jac >= 0;
  492|  1.56M|    }
  493|  1.56M|    return ret;
  494|  1.56M|}
secp256k1.c:secp256k1_fe_impl_set_b32_mod:
  228|  1.06M|static void secp256k1_fe_impl_set_b32_mod(secp256k1_fe *r, const unsigned char *a) {
  229|  1.06M|    r->n[0] = (uint64_t)a[31]
  230|  1.06M|            | ((uint64_t)a[30] << 8)
  231|  1.06M|            | ((uint64_t)a[29] << 16)
  232|  1.06M|            | ((uint64_t)a[28] << 24)
  233|  1.06M|            | ((uint64_t)a[27] << 32)
  234|  1.06M|            | ((uint64_t)a[26] << 40)
  235|  1.06M|            | ((uint64_t)(a[25] & 0xF)  << 48);
  236|  1.06M|    r->n[1] = (uint64_t)((a[25] >> 4) & 0xF)
  237|  1.06M|            | ((uint64_t)a[24] << 4)
  238|  1.06M|            | ((uint64_t)a[23] << 12)
  239|  1.06M|            | ((uint64_t)a[22] << 20)
  240|  1.06M|            | ((uint64_t)a[21] << 28)
  241|  1.06M|            | ((uint64_t)a[20] << 36)
  242|  1.06M|            | ((uint64_t)a[19] << 44);
  243|  1.06M|    r->n[2] = (uint64_t)a[18]
  244|  1.06M|            | ((uint64_t)a[17] << 8)
  245|  1.06M|            | ((uint64_t)a[16] << 16)
  246|  1.06M|            | ((uint64_t)a[15] << 24)
  247|  1.06M|            | ((uint64_t)a[14] << 32)
  248|  1.06M|            | ((uint64_t)a[13] << 40)
  249|  1.06M|            | ((uint64_t)(a[12] & 0xF) << 48);
  250|  1.06M|    r->n[3] = (uint64_t)((a[12] >> 4) & 0xF)
  251|  1.06M|            | ((uint64_t)a[11] << 4)
  252|  1.06M|            | ((uint64_t)a[10] << 12)
  253|  1.06M|            | ((uint64_t)a[9]  << 20)
  254|  1.06M|            | ((uint64_t)a[8]  << 28)
  255|  1.06M|            | ((uint64_t)a[7]  << 36)
  256|  1.06M|            | ((uint64_t)a[6]  << 44);
  257|  1.06M|    r->n[4] = (uint64_t)a[5]
  258|  1.06M|            | ((uint64_t)a[4] << 8)
  259|  1.06M|            | ((uint64_t)a[3] << 16)
  260|  1.06M|            | ((uint64_t)a[2] << 24)
  261|  1.06M|            | ((uint64_t)a[1] << 32)
  262|  1.06M|            | ((uint64_t)a[0] << 40);
  263|  1.06M|}
secp256k1.c:secp256k1_fe_impl_normalize:
   43|   294k|static void secp256k1_fe_impl_normalize(secp256k1_fe *r) {
   44|   294k|    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|   294k|    uint64_t m;
   48|   294k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   49|       |
   50|       |    /* The first pass ensures the magnitude is 1, ... */
   51|   294k|    t0 += x * 0x1000003D1ULL;
   52|   294k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   53|   294k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
   54|   294k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
   55|   294k|    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|   294k|    VERIFY_CHECK(t4 >> 49 == 0);
   59|       |
   60|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
   61|   294k|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
   62|   294k|        & (t0 >= 0xFFFFEFFFFFC2FULL));
   63|       |
   64|       |    /* Apply the final reduction (for constant-time behaviour, we do it always) */
   65|   294k|    t0 += x * 0x1000003D1ULL;
   66|   294k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   67|   294k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   68|   294k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   69|   294k|    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|   294k|    VERIFY_CHECK(t4 >> 48 == x);
   73|       |
   74|       |    /* Mask off the possible multiple of 2^256 from the final reduction */
   75|   294k|    t4 &= 0x0FFFFFFFFFFFFULL;
   76|       |
   77|   294k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   78|   294k|}

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

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

secp256k1.c:secp256k1_ge_set_xy:
  132|  1.30M|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|  1.30M|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|  1.30M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|  1.30M|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  345|  1.30M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|  1.30M|    r->infinity = 0;
  137|  1.30M|    r->x = *x;
  138|  1.30M|    r->y = *y;
  139|       |
  140|  1.30M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  1.30M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|  1.30M|}
secp256k1.c:secp256k1_ge_verify:
   78|  26.3M|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|  26.3M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|  26.3M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|  26.3M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|  26.3M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|  26.3M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|  26.3M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|  26.3M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|  26.3M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|  26.3M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|  26.3M|    (void)a;
   85|  26.3M|}
secp256k1.c:secp256k1_ge_clear:
  343|   256k|static void secp256k1_ge_clear(secp256k1_ge *r) {
  344|   256k|    secp256k1_memclear_explicit(r, sizeof(secp256k1_ge));
  345|   256k|}
secp256k1.c:secp256k1_gej_verify:
   87|  30.7M|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|  30.7M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|  30.7M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|  30.7M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|  30.7M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|  30.7M|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  345|  30.7M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|  30.7M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|  30.7M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|  30.7M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|  30.7M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|  30.7M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  349|  30.7M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|  30.7M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|  30.7M|    (void)a;
   96|  30.7M|}
secp256k1.c:secp256k1_gej_add_ge:
  724|  11.9M|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|  11.9M|    secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;
  727|  11.9M|    secp256k1_fe m_alt, rr_alt;
  728|  11.9M|    int degenerate;
  729|  11.9M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  11.9M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  730|  11.9M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|  11.9M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  731|  11.9M|    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|  11.9M|    secp256k1_fe_sqr(&zz, &a->z);                       /* z = Z1^2 */
  ------------------
  |  |   94|  11.9M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  784|  11.9M|    u1 = a->x;                                          /* u1 = U1 = X1*Z2^2 (GEJ_X_M) */
  785|  11.9M|    secp256k1_fe_mul(&u2, &b->x, &zz);                  /* u2 = U2 = X2*Z1^2 (1) */
  ------------------
  |  |   93|  11.9M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  786|  11.9M|    s1 = a->y;                                          /* s1 = S1 = Y1*Z2^3 (GEJ_Y_M) */
  787|  11.9M|    secp256k1_fe_mul(&s2, &b->y, &zz);                  /* s2 = Y2*Z1^2 (1) */
  ------------------
  |  |   93|  11.9M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  788|  11.9M|    secp256k1_fe_mul(&s2, &s2, &a->z);                  /* s2 = S2 = Y2*Z1^3 (1) */
  ------------------
  |  |   93|  11.9M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  789|  11.9M|    t = u1; secp256k1_fe_add(&t, &u2);                  /* t = T = U1+U2 (GEJ_X_M+1) */
  ------------------
  |  |   92|  11.9M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  790|  11.9M|    m = s1; secp256k1_fe_add(&m, &s2);                  /* m = M = S1+S2 (GEJ_Y_M+1) */
  ------------------
  |  |   92|  11.9M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  791|  11.9M|    secp256k1_fe_sqr(&rr, &t);                          /* rr = T^2 (1) */
  ------------------
  |  |   94|  11.9M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  792|  11.9M|    secp256k1_fe_negate(&m_alt, &u2, 1);                /* Malt = -X2*Z1^2 (2) */
  ------------------
  |  |  211|  11.9M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  11.9M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  11.9M|    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: 11.9M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  11.9M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 11.9M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  11.9M|    } \
  |  |  |  |   94|  11.9M|    stmt; \
  |  |  |  |   95|  11.9M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 11.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  793|  11.9M|    secp256k1_fe_mul(&tt, &u1, &m_alt);                 /* tt = -U1*U2 (1) */
  ------------------
  |  |   93|  11.9M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  794|  11.9M|    secp256k1_fe_add(&rr, &tt);                         /* rr = R = T^2-U1*U2 (2) */
  ------------------
  |  |   92|  11.9M|#  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|  11.9M|    degenerate = secp256k1_fe_normalizes_to_zero(&m);
  ------------------
  |  |   81|  11.9M|#  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|  11.9M|    rr_alt = s1;
  804|  11.9M|    secp256k1_fe_mul_int(&rr_alt, 2);       /* rr_alt = Y1*Z2^3 - Y2*Z1^3 (GEJ_Y_M*2) */
  ------------------
  |  |  233|  11.9M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  11.9M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  11.9M|    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: 11.9M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  11.9M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 11.9M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  11.9M|    } \
  |  |  |  |   94|  11.9M|    stmt; \
  |  |  |  |   95|  11.9M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 11.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|  11.9M|    secp256k1_fe_add(&m_alt, &u1);          /* Malt = X1*Z2^2 - X2*Z1^2 (GEJ_X_M+2) */
  ------------------
  |  |   92|  11.9M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  806|       |
  807|  11.9M|    secp256k1_fe_cmov(&rr_alt, &rr, !degenerate);       /* rr_alt (GEJ_Y_M*2) */
  ------------------
  |  |   95|  11.9M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  808|  11.9M|    secp256k1_fe_cmov(&m_alt, &m, !degenerate);         /* m_alt (GEJ_X_M+2) */
  ------------------
  |  |   95|  11.9M|#  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|  11.9M|    secp256k1_fe_sqr(&n, &m_alt);                       /* n = Malt^2 (1) */
  ------------------
  |  |   94|  11.9M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  814|  11.9M|    secp256k1_fe_negate(&q, &t,
  ------------------
  |  |  211|  11.9M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  11.9M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  11.9M|    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: 11.9M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  11.9M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 11.9M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  11.9M|    } \
  |  |  |  |   94|  11.9M|    stmt; \
  |  |  |  |   95|  11.9M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 11.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|  11.9M|        SECP256K1_GEJ_X_MAGNITUDE_MAX + 1);             /* q = -T (GEJ_X_M+2) */
  816|  11.9M|    secp256k1_fe_mul(&q, &q, &n);                       /* q = Q = -T*Malt^2 (1) */
  ------------------
  |  |   93|  11.9M|#  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|  11.9M|    secp256k1_fe_sqr(&n, &n);                           /* n = Malt^4 (1) */
  ------------------
  |  |   94|  11.9M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  822|  11.9M|    secp256k1_fe_cmov(&n, &m, degenerate);              /* n = M^3 * Malt (GEJ_Y_M+1) */
  ------------------
  |  |   95|  11.9M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  823|  11.9M|    secp256k1_fe_sqr(&t, &rr_alt);                      /* t = Ralt^2 (1) */
  ------------------
  |  |   94|  11.9M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  824|  11.9M|    secp256k1_fe_mul(&r->z, &a->z, &m_alt);             /* r->z = Z3 = Malt*Z (1) */
  ------------------
  |  |   93|  11.9M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  825|  11.9M|    secp256k1_fe_add(&t, &q);                           /* t = Ralt^2 + Q (2) */
  ------------------
  |  |   92|  11.9M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  826|  11.9M|    r->x = t;                                           /* r->x = X3 = Ralt^2 + Q (2) */
  827|  11.9M|    secp256k1_fe_mul_int(&t, 2);                        /* t = 2*X3 (4) */
  ------------------
  |  |  233|  11.9M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  11.9M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  11.9M|    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: 11.9M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  11.9M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 11.9M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  11.9M|    } \
  |  |  |  |   94|  11.9M|    stmt; \
  |  |  |  |   95|  11.9M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 11.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|  11.9M|    secp256k1_fe_add(&t, &q);                           /* t = 2*X3 + Q (5) */
  ------------------
  |  |   92|  11.9M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  829|  11.9M|    secp256k1_fe_mul(&t, &t, &rr_alt);                  /* t = Ralt*(2*X3 + Q) (1) */
  ------------------
  |  |   93|  11.9M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  830|  11.9M|    secp256k1_fe_add(&t, &n);                           /* t = Ralt*(2*X3 + Q) + M^3*Malt (GEJ_Y_M+2) */
  ------------------
  |  |   92|  11.9M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  831|  11.9M|    secp256k1_fe_negate(&r->y, &t,
  ------------------
  |  |  211|  11.9M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  11.9M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  11.9M|    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: 11.9M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  11.9M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 11.9M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  11.9M|    } \
  |  |  |  |   94|  11.9M|    stmt; \
  |  |  |  |   95|  11.9M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 11.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  832|  11.9M|        SECP256K1_GEJ_Y_MAGNITUDE_MAX + 2);             /* r->y = -(Ralt*(2*X3 + Q) + M^3*Malt) (GEJ_Y_M+3) */
  833|  11.9M|    secp256k1_fe_half(&r->y);                           /* r->y = Y3 = -(Ralt*(2*X3 + Q) + M^3*Malt)/2 ((GEJ_Y_M+3)/2 + 1) */
  ------------------
  |  |  101|  11.9M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  834|       |
  835|       |    /* In case a->infinity == 1, replace r with (b->x, b->y, 1). */
  836|  11.9M|    secp256k1_fe_cmov(&r->x, &b->x, a->infinity);
  ------------------
  |  |   95|  11.9M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  837|  11.9M|    secp256k1_fe_cmov(&r->y, &b->y, a->infinity);
  ------------------
  |  |   95|  11.9M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  838|  11.9M|    secp256k1_fe_cmov(&r->z, &secp256k1_fe_one, a->infinity);
  ------------------
  |  |   95|  11.9M|#  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|  11.9M|    r->infinity = secp256k1_fe_normalizes_to_zero(&r->z);
  ------------------
  |  |   81|  11.9M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  857|       |
  858|  11.9M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  11.9M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  859|  11.9M|}
secp256k1.c:secp256k1_ge_set_gej:
  159|   256k|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|   256k|    secp256k1_fe z2, z3;
  161|   256k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   256k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|   256k|    r->infinity = a->infinity;
  164|   256k|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|   256k|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|   256k|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|   256k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|   256k|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|   256k|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|   256k|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|   256k|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|   256k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|   256k|    r->x = a->x;
  171|   256k|    r->y = a->y;
  172|       |
  173|   256k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   256k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|   256k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   256k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|   256k|}
secp256k1.c:secp256k1_gej_set_ge:
  367|   313k|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  368|   313k|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|   313k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  369|       |
  370|   313k|   r->infinity = a->infinity;
  371|   313k|   r->x = a->x;
  372|   313k|   r->y = a->y;
  373|   313k|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|   313k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  374|       |
  375|   313k|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   313k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  376|   313k|}
secp256k1.c:secp256k1_gej_rescale:
  861|   256k|static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {
  862|       |    /* Operations: 4 mul, 1 sqr */
  863|   256k|    secp256k1_fe zz;
  864|   256k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   256k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  865|   256k|    SECP256K1_FE_VERIFY(s);
  ------------------
  |  |  345|   256k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  866|   256k|    VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(s));
  867|       |
  868|   256k|    secp256k1_fe_sqr(&zz, s);
  ------------------
  |  |   94|   256k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  869|   256k|    secp256k1_fe_mul(&r->x, &r->x, &zz);                /* r->x *= s^2 */
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  870|   256k|    secp256k1_fe_mul(&r->y, &r->y, &zz);
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  871|   256k|    secp256k1_fe_mul(&r->y, &r->y, s);                  /* r->y *= s^3 */
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  872|   256k|    secp256k1_fe_mul(&r->z, &r->z, s);                  /* r->z *= s   */
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  873|       |
  874|   256k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   256k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  875|   256k|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|  18.8k|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|  18.8k|    secp256k1_fe zi2;
  101|  18.8k|    secp256k1_fe zi3;
  102|  18.8k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  18.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|  18.8k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|  18.8k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|  18.8k|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|  18.8k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|  18.8k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|  18.8k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|  18.8k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|  18.8k|    r->infinity = a->infinity;
  111|       |
  112|  18.8k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  18.8k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|  18.8k|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  289|  18.8k|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  290|  18.8k|    size_t i;
  291|  18.8k|    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|  18.8k|    if (len > 0) {
  ------------------
  |  Branch (299:9): [True: 18.8k, False: 0]
  ------------------
  300|  18.8k|        i = len - 1;
  301|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  302|  18.8k|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|  18.8k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  303|  18.8k|        zs = zr[i];
  304|       |
  305|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  306|   302k|        while (i > 0) {
  ------------------
  |  Branch (306:16): [True: 283k, False: 18.8k]
  ------------------
  307|   283k|            if (i != len - 1) {
  ------------------
  |  Branch (307:17): [True: 264k, False: 18.8k]
  ------------------
  308|   264k|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|   264k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  309|   264k|            }
  310|   283k|            i--;
  311|   283k|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  312|   283k|        }
  313|  18.8k|    }
  314|       |
  315|       |#ifdef VERIFY
  316|       |    for (i = 0; i < len; i++) {
  317|       |        SECP256K1_GE_VERIFY(&a[i]);
  318|       |    }
  319|       |#endif
  320|  18.8k|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|   283k|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|   283k|    secp256k1_fe zi2;
  118|   283k|    secp256k1_fe zi3;
  119|   283k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|   283k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|   283k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|   283k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|   283k|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|   283k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|   283k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|   283k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|   283k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|   283k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|   283k|    r->infinity = a->infinity;
  128|       |
  129|   283k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   283k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|   283k|}
secp256k1.c:secp256k1_gej_double_var:
  495|  18.8k|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  496|  18.8k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  18.8k|#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|  18.8k|    if (a->infinity) {
  ------------------
  |  Branch (508:9): [True: 0, False: 18.8k]
  ------------------
  509|      0|        secp256k1_gej_set_infinity(r);
  510|      0|        if (rzr != NULL) {
  ------------------
  |  Branch (510:13): [True: 0, False: 0]
  ------------------
  511|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  512|      0|        }
  513|      0|        return;
  514|      0|    }
  515|       |
  516|  18.8k|    if (rzr != NULL) {
  ------------------
  |  Branch (516:9): [True: 0, False: 18.8k]
  ------------------
  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|  18.8k|    secp256k1_gej_double(r, a);
  522|       |
  523|  18.8k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  18.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  524|  18.8k|}
secp256k1.c:secp256k1_gej_double:
  460|  2.37M|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|  2.37M|    secp256k1_fe l, s, t;
  463|  2.37M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  2.37M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  464|       |
  465|  2.37M|    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|  2.37M|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|  2.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  477|  2.37M|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|  2.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  478|  2.37M|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|  2.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  479|  2.37M|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|  2.37M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  2.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  2.37M|    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.37M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  2.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 2.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  2.37M|    } \
  |  |  |  |   94|  2.37M|    stmt; \
  |  |  |  |   95|  2.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 2.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  2.37M|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|  2.37M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  481|  2.37M|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|  2.37M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  2.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  2.37M|    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.37M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  2.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 2.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  2.37M|    } \
  |  |  |  |   94|  2.37M|    stmt; \
  |  |  |  |   95|  2.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 2.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.37M|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|  2.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  483|  2.37M|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|  2.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  484|  2.37M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|  2.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  485|  2.37M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|  2.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  486|  2.37M|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|  2.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  487|  2.37M|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|  2.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  488|  2.37M|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|  2.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  489|  2.37M|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|  2.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  490|  2.37M|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|  2.37M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  2.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  2.37M|    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.37M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  2.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 2.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  2.37M|    } \
  |  |  |  |   94|  2.37M|    stmt; \
  |  |  |  |   95|  2.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 2.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|       |
  492|  2.37M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  2.37M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  493|  2.37M|}
secp256k1.c:secp256k1_ge_from_storage:
  890|  11.0M|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  891|  11.0M|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|  11.0M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  892|  11.0M|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|  11.0M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  893|  11.0M|    r->infinity = 0;
  894|       |
  895|  11.0M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  11.0M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  896|  11.0M|}
secp256k1.c:secp256k1_ge_is_infinity:
  143|  18.8k|static int secp256k1_ge_is_infinity(const secp256k1_ge *a) {
  144|  18.8k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  18.8k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  145|       |
  146|  18.8k|    return a->infinity;
  147|  18.8k|}
secp256k1.c:secp256k1_ge_mul_lambda:
  917|   302k|static void secp256k1_ge_mul_lambda(secp256k1_ge *r, const secp256k1_ge *a) {
  918|   302k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|   302k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  919|       |
  920|   302k|    *r = *a;
  921|   302k|    secp256k1_fe_mul(&r->x, &r->x, &secp256k1_const_beta);
  ------------------
  |  |   93|   302k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  922|       |
  923|   302k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   302k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  924|   302k|}
secp256k1.c:secp256k1_ge_storage_cmov:
  911|   352M|static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) {
  912|   352M|    VERIFY_CHECK(flag == 0 || flag == 1);
  913|   352M|    secp256k1_fe_storage_cmov(&r->x, &a->x, flag);
  914|   352M|    secp256k1_fe_storage_cmov(&r->y, &a->y, flag);
  915|   352M|}
secp256k1.c:secp256k1_gej_clear:
  339|   256k|static void secp256k1_gej_clear(secp256k1_gej *r) {
  340|   256k|    secp256k1_memclear_explicit(r, sizeof(secp256k1_gej));
  341|   256k|}
secp256k1.c:secp256k1_ge_x_on_curve_var:
  950|   512k|static int secp256k1_ge_x_on_curve_var(const secp256k1_fe *x) {
  951|   512k|    secp256k1_fe c;
  952|   512k|    secp256k1_fe_sqr(&c, x);
  ------------------
  |  |   94|   512k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  953|   512k|    secp256k1_fe_mul(&c, &c, x);
  ------------------
  |  |   93|   512k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  954|   512k|    secp256k1_fe_add_int(&c, SECP256K1_B);
  ------------------
  |  |  102|   512k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&c, SECP256K1_B);
  ------------------
  |  |   73|   512k|#define SECP256K1_B 7
  ------------------
  955|   512k|    return secp256k1_fe_is_square_var(&c);
  ------------------
  |  |  103|   512k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  956|   512k|}
secp256k1.c:secp256k1_ge_x_frac_on_curve_var:
  958|  30.9k|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|  30.9k|     secp256k1_fe r, t;
  964|  30.9k|     VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(xd));
  965|       |
  966|  30.9k|     secp256k1_fe_mul(&r, xd, xn); /* r = xd*xn */
  ------------------
  |  |   93|  30.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  967|  30.9k|     secp256k1_fe_sqr(&t, xn); /* t = xn^2 */
  ------------------
  |  |   94|  30.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  968|  30.9k|     secp256k1_fe_mul(&r, &r, &t); /* r = xd*xn^3 */
  ------------------
  |  |   93|  30.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  969|  30.9k|     secp256k1_fe_sqr(&t, xd); /* t = xd^2 */
  ------------------
  |  |   94|  30.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  970|  30.9k|     secp256k1_fe_sqr(&t, &t); /* t = xd^4 */
  ------------------
  |  |   94|  30.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  971|  30.9k|     VERIFY_CHECK(SECP256K1_B <= 31);
  972|  30.9k|     secp256k1_fe_mul_int(&t, SECP256K1_B); /* t = 7*xd^4 */
  ------------------
  |  |  233|  30.9k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  30.9k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  30.9k|    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: 30.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  30.9k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 30.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  30.9k|    } \
  |  |  |  |   94|  30.9k|    stmt; \
  |  |  |  |   95|  30.9k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 30.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|  30.9k|     secp256k1_fe_add(&r, &t); /* r = xd*xn^3 + 7*xd^4 */
  ------------------
  |  |   92|  30.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  974|  30.9k|     return secp256k1_fe_is_square_var(&r);
  ------------------
  |  |  103|  30.9k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  975|  30.9k|}
secp256k1.c:secp256k1_gej_add_ge_var:
  590|   283k|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|   283k|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  593|   283k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   283k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  594|   283k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|   283k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  595|       |
  596|   283k|    if (a->infinity) {
  ------------------
  |  Branch (596:9): [True: 0, False: 283k]
  ------------------
  597|      0|        VERIFY_CHECK(rzr == NULL);
  598|      0|        secp256k1_gej_set_ge(r, b);
  599|      0|        return;
  600|      0|    }
  601|   283k|    if (b->infinity) {
  ------------------
  |  Branch (601:9): [True: 0, False: 283k]
  ------------------
  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|   283k|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|   283k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  610|   283k|    u1 = a->x;
  611|   283k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  612|   283k|    s1 = a->y;
  613|   283k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  614|   283k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|   283k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   283k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   283k|    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: 283k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   283k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 283k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   283k|    } \
  |  |  |  |   94|   283k|    stmt; \
  |  |  |  |   95|   283k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 283k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  615|   283k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|   283k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   283k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   283k|    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: 283k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   283k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 283k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   283k|    } \
  |  |  |  |   94|   283k|    stmt; \
  |  |  |  |   95|   283k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 283k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  616|   283k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|   283k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (616:9): [True: 0, False: 283k]
  ------------------
  617|      0|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|      0|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (617:13): [True: 0, False: 0]
  ------------------
  618|      0|            secp256k1_gej_double_var(r, a, rzr);
  619|      0|        } else {
  620|      0|            if (rzr != NULL) {
  ------------------
  |  Branch (620:17): [True: 0, False: 0]
  ------------------
  621|      0|                secp256k1_fe_set_int(rzr, 0);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  622|      0|            }
  623|      0|            secp256k1_gej_set_infinity(r);
  624|      0|        }
  625|      0|        return;
  626|      0|    }
  627|       |
  628|   283k|    r->infinity = 0;
  629|   283k|    if (rzr != NULL) {
  ------------------
  |  Branch (629:9): [True: 283k, False: 0]
  ------------------
  630|   283k|        *rzr = h;
  631|   283k|    }
  632|   283k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  633|       |
  634|   283k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|   283k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  635|   283k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|   283k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   283k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   283k|    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: 283k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   283k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 283k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   283k|    } \
  |  |  |  |   94|   283k|    stmt; \
  |  |  |  |   95|   283k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 283k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|   283k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  637|   283k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  638|       |
  639|   283k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|   283k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  640|   283k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  641|   283k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  642|   283k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  643|       |
  644|   283k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  645|   283k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  646|   283k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|   283k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|   283k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|   283k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  648|       |
  649|   283k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   283k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  650|   283k|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  345|   283k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (650:9): [True: 283k, False: 0]
  ------------------
  651|   283k|}

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

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

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

secp256k1_ellswift_create:
  431|   256k|int secp256k1_ellswift_create(const secp256k1_context *ctx, unsigned char *ell64, const unsigned char *seckey32, const unsigned char *auxrnd32) {
  432|   256k|    secp256k1_ge p;
  433|   256k|    secp256k1_fe t;
  434|   256k|    secp256k1_sha256 hash;
  435|   256k|    secp256k1_scalar seckey_scalar;
  436|   256k|    int ret;
  437|   256k|    static const unsigned char zero32[32] = {0};
  438|       |
  439|       |    /* Sanity check inputs. */
  440|   256k|    VERIFY_CHECK(ctx != NULL);
  441|   256k|    ARG_CHECK(ell64 != NULL);
  ------------------
  |  |   45|   256k|#define ARG_CHECK(cond) do { \
  |  |   46|   256k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   256k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   256k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 256k]
  |  |  ------------------
  ------------------
  442|   256k|    memset(ell64, 0, 64);
  443|   256k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|   256k|#define ARG_CHECK(cond) do { \
  |  |   46|   256k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   256k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   256k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 256k]
  |  |  ------------------
  ------------------
  444|   256k|    ARG_CHECK(seckey32 != NULL);
  ------------------
  |  |   45|   256k|#define ARG_CHECK(cond) do { \
  |  |   46|   256k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   256k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   256k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 256k]
  |  |  ------------------
  ------------------
  445|       |
  446|       |    /* Compute (affine) public key */
  447|   256k|    ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &seckey_scalar, &p, seckey32);
  448|   256k|    secp256k1_declassify(ctx, &p, sizeof(p)); /* not constant time in produced pubkey */
  449|   256k|    secp256k1_fe_normalize_var(&p.x);
  ------------------
  |  |   80|   256k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  450|   256k|    secp256k1_fe_normalize_var(&p.y);
  ------------------
  |  |   80|   256k|#  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|   256k|    secp256k1_ellswift_sha256_init_create(&hash);
  455|   256k|    secp256k1_sha256_write(secp256k1_get_hash_context(ctx), &hash, seckey32, 32);
  456|   256k|    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|   256k|    secp256k1_declassify(ctx, &hash.s, sizeof(hash.s));
  459|   256k|    if (auxrnd32) secp256k1_sha256_write(secp256k1_get_hash_context(ctx), &hash, auxrnd32, 32);
  ------------------
  |  Branch (459:9): [True: 256k, False: 0]
  ------------------
  460|       |
  461|       |    /* Compute ElligatorSwift encoding and construct output. */
  462|   256k|    secp256k1_ellswift_elligatorswift_var(ctx, ell64, &t, &p, &hash); /* puts u in ell64[0..32] */
  463|   256k|    secp256k1_fe_get_b32(ell64 + 32, &t); /* puts t in ell64[32..64] */
  ------------------
  |  |   89|   256k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
  464|       |
  465|   256k|    secp256k1_memczero(ell64, 64, !ret);
  466|   256k|    secp256k1_scalar_clear(&seckey_scalar);
  467|   256k|    secp256k1_sha256_clear(&hash);
  468|       |
  469|   256k|    return ret;
  470|   256k|}
secp256k1_ellswift_xdh:
  536|  18.8k|int secp256k1_ellswift_xdh(const secp256k1_context *ctx, unsigned char *output, const unsigned char *ell_a64, const unsigned char *ell_b64, const unsigned char *seckey32, int party, secp256k1_ellswift_xdh_hash_function hashfp, void *data) {
  537|  18.8k|    int ret = 0;
  538|  18.8k|    int overflow;
  539|  18.8k|    secp256k1_scalar s;
  540|  18.8k|    secp256k1_fe xn, xd, px, u, t;
  541|  18.8k|    unsigned char sx[32];
  542|  18.8k|    const unsigned char* theirs64;
  543|       |
  544|  18.8k|    VERIFY_CHECK(ctx != NULL);
  545|  18.8k|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  18.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  18.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  18.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
  546|  18.8k|    ARG_CHECK(ell_a64 != NULL);
  ------------------
  |  |   45|  18.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  18.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  18.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
  547|  18.8k|    ARG_CHECK(ell_b64 != NULL);
  ------------------
  |  |   45|  18.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  18.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  18.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
  548|  18.8k|    ARG_CHECK(seckey32 != NULL);
  ------------------
  |  |   45|  18.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  18.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  18.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
  549|  18.8k|    ARG_CHECK(hashfp != NULL);
  ------------------
  |  |   45|  18.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  18.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  18.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
  550|       |
  551|       |    /* Load remote public key (as fraction). */
  552|  18.8k|    theirs64 = party ? ell_a64 : ell_b64;
  ------------------
  |  Branch (552:16): [True: 18.8k, False: 46]
  ------------------
  553|  18.8k|    secp256k1_fe_set_b32_mod(&u, theirs64);
  ------------------
  |  |   87|  18.8k|#  define secp256k1_fe_set_b32_mod secp256k1_fe_impl_set_b32_mod
  ------------------
  554|  18.8k|    secp256k1_fe_set_b32_mod(&t, theirs64 + 32);
  ------------------
  |  |   87|  18.8k|#  define secp256k1_fe_set_b32_mod secp256k1_fe_impl_set_b32_mod
  ------------------
  555|  18.8k|    secp256k1_ellswift_xswiftec_frac_var(&xn, &xd, &u, &t);
  556|       |
  557|       |    /* Load private key (using one if invalid). */
  558|  18.8k|    secp256k1_scalar_set_b32(&s, seckey32, &overflow);
  559|  18.8k|    overflow |= secp256k1_scalar_is_zero(&s);
  560|  18.8k|    secp256k1_scalar_cmov(&s, &secp256k1_scalar_one, overflow);
  561|       |
  562|       |    /* Compute shared X coordinate. */
  563|  18.8k|    secp256k1_ecmult_const_xonly(&px, &xn, &xd, &s, 1);
  564|  18.8k|    secp256k1_fe_normalize(&px);
  ------------------
  |  |   78|  18.8k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  565|  18.8k|    secp256k1_fe_get_b32(sx, &px);
  ------------------
  |  |   89|  18.8k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
  566|       |
  567|       |    /* Invoke hasher. Use ctx-aware function by default */
  568|  18.8k|    if (hashfp == secp256k1_ellswift_xdh_hash_function_bip324) {
  ------------------
  |  Branch (568:9): [True: 18.8k, False: 0]
  ------------------
  569|  18.8k|        ret = ellswift_xdh_hash_function_bip324_impl(secp256k1_get_hash_context(ctx), output, sx, ell_a64, ell_b64, data);
  570|  18.8k|    } else if (hashfp == secp256k1_ellswift_xdh_hash_function_prefix) {
  ------------------
  |  Branch (570:16): [True: 0, False: 0]
  ------------------
  571|      0|        ret = ellswift_xdh_hash_function_prefix_impl(secp256k1_get_hash_context(ctx), output, sx, ell_a64, ell_b64, data);
  572|      0|    } else {
  573|      0|        ret = hashfp(output, sx, ell_a64, ell_b64, data);
  574|      0|    }
  575|       |
  576|  18.8k|    secp256k1_memclear_explicit(sx, sizeof(sx));
  577|  18.8k|    secp256k1_fe_clear(&px);
  578|  18.8k|    secp256k1_scalar_clear(&s);
  579|       |
  580|  18.8k|    return !!ret & !overflow;
  581|  18.8k|}
secp256k1.c:secp256k1_ellswift_elligatorswift_var:
  375|   256k|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|   256k|    secp256k1_ellswift_xelligatorswift_var(ctx, u32, t, &p->x, hasher);
  377|   256k|    secp256k1_fe_normalize_var(t);
  ------------------
  |  |   80|   256k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  378|   256k|    if (secp256k1_fe_is_odd(t) != secp256k1_fe_is_odd(&p->y)) {
  ------------------
  |  |   85|   256k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                  if (secp256k1_fe_is_odd(t) != secp256k1_fe_is_odd(&p->y)) {
  ------------------
  |  |   85|   256k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (378:9): [True: 127k, False: 128k]
  ------------------
  379|   127k|        secp256k1_fe_negate(t, t, 1);
  ------------------
  |  |  211|   127k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   127k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   127k|    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: 127k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   127k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 127k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   127k|    } \
  |  |  |  |   94|   127k|    stmt; \
  |  |  |  |   95|   127k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 127k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  380|   127k|        secp256k1_fe_normalize_var(t);
  ------------------
  |  |   80|   127k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  381|   127k|    }
  382|   256k|}
secp256k1.c:secp256k1_ellswift_xelligatorswift_var:
  333|   256k|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|   256k|    unsigned char branch_hash[32];
  336|       |    /* Number of 3-bit values in branch_hash left. */
  337|   256k|    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|   256k|    uint32_t cnt = 0;
  344|  1.02M|    while (1) {
  ------------------
  |  Branch (344:12): [True: 1.02M, Folded]
  ------------------
  345|  1.02M|        int branch;
  346|  1.02M|        secp256k1_fe u;
  347|       |        /* If the pool of branch values is empty, populate it. */
  348|  1.02M|        if (branches_left == 0) {
  ------------------
  |  Branch (348:13): [True: 256k, False: 767k]
  ------------------
  349|   256k|            secp256k1_ellswift_prng(secp256k1_get_hash_context(ctx), branch_hash, hasher, cnt++);
  350|   256k|            branches_left = 64;
  351|   256k|        }
  352|       |        /* Take a 3-bit branch value from the branch pool (top bit is discarded). */
  353|  1.02M|        --branches_left;
  354|  1.02M|        branch = (branch_hash[branches_left >> 1] >> ((branches_left & 1) << 2)) & 7;
  355|       |        /* Compute a new u value by hashing. */
  356|  1.02M|        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|  1.02M|        secp256k1_fe_set_b32_mod(&u, u32);
  ------------------
  |  |   87|  1.02M|#  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|  1.02M|        VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(&u));
  363|       |
  364|       |        /* Find a remainder t, and return it if found. */
  365|  1.02M|        if (EXPECT(secp256k1_ellswift_xswiftec_inv_var(t, x, &u, branch), 0)) break;
  ------------------
  |  |  146|  1.02M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 256k, False: 767k]
  |  |  ------------------
  ------------------
  366|  1.02M|    }
  367|   256k|}
secp256k1.c:secp256k1_ellswift_prng:
  310|  1.28M|static void secp256k1_ellswift_prng(const secp256k1_hash_ctx *hash_ctx, unsigned char* out32, const secp256k1_sha256 *hasher, uint32_t cnt) {
  311|  1.28M|    secp256k1_sha256 hash = *hasher;
  312|  1.28M|    unsigned char buf4[4];
  313|       |#ifdef VERIFY
  314|       |    size_t blocks = hash.bytes >> 6;
  315|       |#endif
  316|  1.28M|    buf4[0] = cnt;
  317|  1.28M|    buf4[1] = cnt >> 8;
  318|  1.28M|    buf4[2] = cnt >> 16;
  319|  1.28M|    buf4[3] = cnt >> 24;
  320|  1.28M|    secp256k1_sha256_write(hash_ctx, &hash, buf4, 4);
  321|  1.28M|    secp256k1_sha256_finalize(hash_ctx, &hash, out32);
  322|       |
  323|       |    /* Writing and finalizing together should trigger exactly one SHA256 compression. */
  324|  1.28M|    VERIFY_CHECK(((hash.bytes) >> 6) == (blocks + 1));
  325|  1.28M|}
secp256k1.c:secp256k1_ellswift_xswiftec_inv_var:
  168|  1.02M|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|  1.02M|    secp256k1_fe x = *x_in, u = *u_in, g, v, s, m, r, q;
  190|  1.02M|    int ret;
  191|       |
  192|  1.02M|    secp256k1_fe_normalize_weak(&x);
  ------------------
  |  |   79|  1.02M|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  193|  1.02M|    secp256k1_fe_normalize_weak(&u);
  ------------------
  |  |   79|  1.02M|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  194|       |
  195|  1.02M|    VERIFY_CHECK(c >= 0 && c < 8);
  196|  1.02M|    VERIFY_CHECK(secp256k1_ge_x_on_curve_var(&x));
  197|       |
  198|  1.02M|    if (!(c & 2)) {
  ------------------
  |  Branch (198:9): [True: 512k, False: 511k]
  ------------------
  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|   512k|        m = x;                                          /* m = x */
  206|   512k|        secp256k1_fe_add(&m, &u);                       /* m = u+x */
  ------------------
  |  |   92|   512k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  207|   512k|        secp256k1_fe_negate(&m, &m, 2);                 /* m = -u-x */
  ------------------
  |  |  211|   512k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   512k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   512k|    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: 512k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   512k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 512k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   512k|    } \
  |  |  |  |   94|   512k|    stmt; \
  |  |  |  |   95|   512k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 512k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|       |        /* Test if (-u-x) is a valid X coordinate. If so, fail. */
  209|   512k|        if (secp256k1_ge_x_on_curve_var(&m)) return 0;
  ------------------
  |  Branch (209:13): [True: 256k, False: 255k]
  ------------------
  210|       |
  211|       |        /* Let s = -(u^3 + 7)/(u^2 + u*x + x^2) [first part] */
  212|   255k|        secp256k1_fe_sqr(&s, &m);                       /* s = (u+x)^2 */
  ------------------
  |  |   94|   255k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  213|   255k|        secp256k1_fe_negate(&s, &s, 1);                 /* s = -(u+x)^2 */
  ------------------
  |  |  211|   255k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   255k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   255k|    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: 255k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   255k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 255k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   255k|    } \
  |  |  |  |   94|   255k|    stmt; \
  |  |  |  |   95|   255k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 255k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|   255k|        secp256k1_fe_mul(&m, &u, &x);                   /* m = u*x */
  ------------------
  |  |   93|   255k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  215|   255k|        secp256k1_fe_add(&s, &m);                       /* s = -(u^2 + u*x + x^2) */
  ------------------
  |  |   92|   255k|#  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|   255k|        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|   255k|        secp256k1_fe_sqr(&g, &u);                       /* g = u^2 */
  ------------------
  |  |   94|   255k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  236|   255k|        secp256k1_fe_mul(&g, &g, &u);                   /* g = u^3 */
  ------------------
  |  |   93|   255k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  237|   255k|        secp256k1_fe_add_int(&g, SECP256K1_B);          /* g = u^3+7 */
  ------------------
  |  |  102|   255k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                      secp256k1_fe_add_int(&g, SECP256K1_B);          /* g = u^3+7 */
  ------------------
  |  |   73|   255k|#define SECP256K1_B 7
  ------------------
  238|   255k|        secp256k1_fe_mul(&m, &s, &g);                   /* m = -(u^3 + 7)*(u^2 + u*x + x^2) */
  ------------------
  |  |   93|   255k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  239|   255k|        if (!secp256k1_fe_is_square_var(&m)) return 0;
  ------------------
  |  |  103|   255k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (239:13): [True: 127k, False: 128k]
  ------------------
  240|       |
  241|       |        /* Let s = -(u^3 + 7)/(u^2 + u*x + x^2) [second part] */
  242|   128k|        secp256k1_fe_inv_var(&s, &s);                   /* s = -1/(u^2 + u*x + x^2) [no div by 0] */
  ------------------
  |  |   99|   128k|#  define secp256k1_fe_inv_var secp256k1_fe_impl_inv_var
  ------------------
  243|   128k|        secp256k1_fe_mul(&s, &s, &g);                   /* s = -(u^3 + 7)/(u^2 + u*x + x^2) */
  ------------------
  |  |   93|   128k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  244|       |
  245|       |        /* Let v = x. */
  246|   128k|        v = x;
  247|   511k|    } 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|   511k|        secp256k1_fe_negate(&m, &u, 1);                 /* m = -u */
  ------------------
  |  |  211|   511k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   511k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   511k|    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: 511k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   511k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 511k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   511k|    } \
  |  |  |  |   94|   511k|    stmt; \
  |  |  |  |   95|   511k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 511k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|   511k|        s = m;                                          /* s = -u */
  253|   511k|        secp256k1_fe_add(&s, &x);                       /* s = x-u */
  ------------------
  |  |   92|   511k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  254|       |
  255|       |        /* If s is not square, fail. */
  256|   511k|        if (!secp256k1_fe_is_square_var(&s)) return 0;
  ------------------
  |  |  103|   511k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (256:13): [True: 255k, False: 256k]
  ------------------
  257|       |
  258|       |        /* Let r = sqrt(-s*(4*(u^3+7)+3*u^2*s)); fail if it doesn't exist. */
  259|   256k|        secp256k1_fe_sqr(&g, &u);                       /* g = u^2 */
  ------------------
  |  |   94|   256k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  260|   256k|        secp256k1_fe_mul(&q, &s, &g);                   /* q = s*u^2 */
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  261|   256k|        secp256k1_fe_mul_int(&q, 3);                    /* q = 3*s*u^2 */
  ------------------
  |  |  233|   256k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   256k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   256k|    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: 256k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   256k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 256k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   256k|    } \
  |  |  |  |   94|   256k|    stmt; \
  |  |  |  |   95|   256k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|   256k|        secp256k1_fe_mul(&g, &g, &u);                   /* g = u^3 */
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  263|   256k|        secp256k1_fe_mul_int(&g, 4);                    /* g = 4*u^3 */
  ------------------
  |  |  233|   256k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   256k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   256k|    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: 256k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   256k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 256k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   256k|    } \
  |  |  |  |   94|   256k|    stmt; \
  |  |  |  |   95|   256k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|   256k|        secp256k1_fe_add_int(&g, 4 * SECP256K1_B);      /* g = 4*(u^3+7) */
  ------------------
  |  |  102|   256k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                      secp256k1_fe_add_int(&g, 4 * SECP256K1_B);      /* g = 4*(u^3+7) */
  ------------------
  |  |   73|   256k|#define SECP256K1_B 7
  ------------------
  265|   256k|        secp256k1_fe_add(&q, &g);                       /* q = 4*(u^3+7)+3*s*u^2 */
  ------------------
  |  |   92|   256k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  266|   256k|        secp256k1_fe_mul(&q, &q, &s);                   /* q = s*(4*(u^3+7)+3*u^2*s) */
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  267|   256k|        secp256k1_fe_negate(&q, &q, 1);                 /* q = -s*(4*(u^3+7)+3*u^2*s) */
  ------------------
  |  |  211|   256k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   256k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   256k|    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: 256k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   256k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 256k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   256k|    } \
  |  |  |  |   94|   256k|    stmt; \
  |  |  |  |   95|   256k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|   256k|        if (!secp256k1_fe_is_square_var(&q)) return 0;
  ------------------
  |  |  103|   256k|#  define secp256k1_fe_is_square_var secp256k1_fe_impl_is_square_var
  ------------------
  |  Branch (268:13): [True: 127k, False: 128k]
  ------------------
  269|   128k|        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|   128k|        (void)ret;
  274|   128k|#endif
  275|       |
  276|       |        /* If (c & 1) = 1 and r = 0, fail. */
  277|   128k|        if (EXPECT((c & 1) && secp256k1_fe_normalizes_to_zero_var(&r), 0)) return 0;
  ------------------
  |  |  146|   192k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 128k]
  |  |  |  Branch (146:39): [True: 63.9k, False: 64.2k]
  |  |  |  Branch (146:39): [True: 0, False: 63.9k]
  |  |  ------------------
  ------------------
  278|       |
  279|       |        /* If s = 0, fail. */
  280|   128k|        if (EXPECT(secp256k1_fe_normalizes_to_zero_var(&s), 0)) return 0;
  ------------------
  |  |  146|   128k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 128k]
  |  |  ------------------
  ------------------
  281|       |
  282|       |        /* Let v = (r/s-u)/2. */
  283|   128k|        secp256k1_fe_inv_var(&v, &s);                   /* v = 1/s [no div by 0] */
  ------------------
  |  |   99|   128k|#  define secp256k1_fe_inv_var secp256k1_fe_impl_inv_var
  ------------------
  284|   128k|        secp256k1_fe_mul(&v, &v, &r);                   /* v = r/s */
  ------------------
  |  |   93|   128k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  285|   128k|        secp256k1_fe_add(&v, &m);                       /* v = r/s-u */
  ------------------
  |  |   92|   128k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  286|   128k|        secp256k1_fe_half(&v);                          /* v = (r/s-u)/2 */
  ------------------
  |  |  101|   128k|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  287|   128k|    }
  288|       |
  289|       |    /* Let w = sqrt(s). */
  290|   256k|    ret = secp256k1_fe_sqrt(&m, &s);                    /* m = sqrt(s) = w */
  291|   256k|    VERIFY_CHECK(ret);
  292|       |
  293|       |    /* Return logic. */
  294|   256k|    if ((c & 5) == 0 || (c & 5) == 5) {
  ------------------
  |  Branch (294:9): [True: 64.5k, False: 191k]
  |  Branch (294:25): [True: 64.0k, False: 127k]
  ------------------
  295|   128k|        secp256k1_fe_negate(&m, &m, 1);                 /* m = -w */
  ------------------
  |  |  211|   128k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   128k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   128k|    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: 128k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   128k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 128k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   128k|    } \
  |  |  |  |   94|   128k|    stmt; \
  |  |  |  |   95|   128k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 128k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|   128k|    }
  297|       |    /* Now m = {-w if c&5=0 or c&5=5; w otherwise}. */
  298|   256k|    secp256k1_fe_mul(&u, &u, c&1 ? &secp256k1_ellswift_c4 : &secp256k1_ellswift_c3);
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  |  Branch (298:30): [True: 128k, False: 128k]
  ------------------
  299|       |    /* u = {c4 if c&1=1; c3 otherwise}*u */
  300|   256k|    secp256k1_fe_add(&u, &v);                           /* u = {c4 if c&1=1; c3 otherwise}*u + v */
  ------------------
  |  |   92|   256k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  301|   256k|    secp256k1_fe_mul(t, &m, &u);
  ------------------
  |  |   93|   256k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  302|   256k|    return 1;
  303|   256k|}
secp256k1.c:secp256k1_ellswift_sha256_init_create:
  423|   256k|static void secp256k1_ellswift_sha256_init_create(secp256k1_sha256* hash) {
  424|   256k|    static const uint32_t midstate[8] = {
  425|   256k|        0xd29e1bf5ul, 0xf7025f42ul, 0x9b024773ul, 0x094cb7d5ul,
  426|   256k|        0xe59ed789ul, 0x03bc9786ul, 0x68335b35ul, 0x4e363b53ul
  427|   256k|    };
  428|   256k|    secp256k1_sha256_initialize_midstate(hash, 64, midstate);
  429|   256k|}
secp256k1.c:secp256k1_ellswift_xswiftec_frac_var:
   24|  18.8k|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|  18.8k|    secp256k1_fe u1, s, g, p, d, n, l;
   87|  18.8k|    u1 = *u;
   88|  18.8k|    if (EXPECT(secp256k1_fe_normalizes_to_zero_var(&u1), 0)) u1 = secp256k1_fe_one;
  ------------------
  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 2.73k, False: 16.1k]
  |  |  ------------------
  ------------------
   89|  18.8k|    secp256k1_fe_sqr(&s, t);
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   90|  18.8k|    if (EXPECT(secp256k1_fe_normalizes_to_zero_var(t), 0)) s = secp256k1_fe_one;
  ------------------
  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 13.9k, False: 4.90k]
  |  |  ------------------
  ------------------
   91|  18.8k|    secp256k1_fe_sqr(&l, &u1);                                   /* l = u^2 */
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   92|  18.8k|    secp256k1_fe_mul(&g, &l, &u1);                               /* g = u^3 */
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   93|  18.8k|    secp256k1_fe_add_int(&g, SECP256K1_B);                       /* g = u^3 + 7 */
  ------------------
  |  |  102|  18.8k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&g, SECP256K1_B);                       /* g = u^3 + 7 */
  ------------------
  |  |   73|  18.8k|#define SECP256K1_B 7
  ------------------
   94|  18.8k|    p = g;                                                       /* p = g */
   95|  18.8k|    secp256k1_fe_add(&p, &s);                                    /* p = g+s */
  ------------------
  |  |   92|  18.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
   96|  18.8k|    if (EXPECT(secp256k1_fe_normalizes_to_zero_var(&p), 0)) {
  ------------------
  |  |  146|  18.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 18.8k]
  |  |  ------------------
  ------------------
   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|  18.8k|    secp256k1_fe_mul(&d, &s, &l);                                /* d = s*u^2 */
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  103|  18.8k|    secp256k1_fe_mul_int(&d, 3);                                 /* d = 3*s*u^2 */
  ------------------
  |  |  233|  18.8k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  18.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  18.8k|    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: 18.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  18.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  18.8k|    } \
  |  |  |  |   94|  18.8k|    stmt; \
  |  |  |  |   95|  18.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  18.8k|    secp256k1_fe_sqr(&l, &p);                                    /* l = (g+s)^2 */
  ------------------
  |  |   94|  18.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  105|  18.8k|    secp256k1_fe_negate(&l, &l, 1);                              /* l = -(g+s)^2 */
  ------------------
  |  |  211|  18.8k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  18.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  18.8k|    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: 18.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  18.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  18.8k|    } \
  |  |  |  |   94|  18.8k|    stmt; \
  |  |  |  |   95|  18.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|  18.8k|    secp256k1_fe_mul(&n, &d, &u1);                               /* n = 3*s*u^3 */
  ------------------
  |  |   93|  18.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  107|  18.8k|    secp256k1_fe_add(&n, &l);                                    /* n = 3*s*u^3-(g+s)^2 */
  ------------------
  |  |   92|  18.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  108|  18.8k|    if (secp256k1_ge_x_frac_on_curve_var(&n, &d)) {
  ------------------
  |  Branch (108:9): [True: 6.81k, False: 12.0k]
  ------------------
  109|       |        /* Return x3 = n/d = (3*s*u^3-(g+s)^2)/(3*s*u^2) */
  110|  6.81k|        *xn = n;
  111|  6.81k|        *xd = d;
  112|  6.81k|        return;
  113|  6.81k|    }
  114|  12.0k|    *xd = p;
  115|  12.0k|    secp256k1_fe_mul(&l, &secp256k1_ellswift_c1, &s);            /* l = c1*s */
  ------------------
  |  |   93|  12.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  116|  12.0k|    secp256k1_fe_mul(&n, &secp256k1_ellswift_c2, &g);            /* n = c2*g */
  ------------------
  |  |   93|  12.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  117|  12.0k|    secp256k1_fe_add(&n, &l);                                    /* n = c1*s+c2*g */
  ------------------
  |  |   92|  12.0k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  118|  12.0k|    secp256k1_fe_mul(&n, &n, &u1);                               /* n = u*(c1*s+c2*g) */
  ------------------
  |  |   93|  12.0k|#  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|  12.0k|    if (secp256k1_ge_x_frac_on_curve_var(&n, &p)) {
  ------------------
  |  Branch (121:9): [True: 6.26k, False: 5.80k]
  ------------------
  122|       |        /* Return x2 = n/p = u*(c1*s+c2*g)/(g+s) */
  123|  6.26k|        *xn = n;
  124|  6.26k|        return;
  125|  6.26k|    }
  126|  5.80k|    secp256k1_fe_mul(&l, &p, &u1);                               /* l = u*(g+s) */
  ------------------
  |  |   93|  5.80k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|  5.80k|    secp256k1_fe_add(&n, &l);                                    /* n = u*(c1*s+c2*g)+u*(g+s) */
  ------------------
  |  |   92|  5.80k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  128|  5.80k|    secp256k1_fe_negate(xn, &n, 2);                              /* n = -u*(c1*s+c2*g)-u*(g+s) */
  ------------------
  |  |  211|  5.80k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  5.80k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  5.80k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 5.80k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  5.80k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 5.80k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  5.80k|    } \
  |  |  |  |   94|  5.80k|    stmt; \
  |  |  |  |   95|  5.80k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 5.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|       |
  130|  5.80k|    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|  5.80k|}
secp256k1.c:ellswift_xdh_hash_function_bip324_impl:
  514|  18.8k|static int ellswift_xdh_hash_function_bip324_impl(const secp256k1_hash_ctx *hash_ctx, unsigned char* output, const unsigned char *x32, const unsigned char *ell_a64, const unsigned char *ell_b64, void *data) {
  515|  18.8k|    secp256k1_sha256 sha;
  516|       |
  517|  18.8k|    (void)data;
  518|       |
  519|  18.8k|    secp256k1_ellswift_sha256_init_bip324(&sha);
  520|  18.8k|    secp256k1_sha256_write(hash_ctx, &sha, ell_a64, 64);
  521|  18.8k|    secp256k1_sha256_write(hash_ctx, &sha, ell_b64, 64);
  522|  18.8k|    secp256k1_sha256_write(hash_ctx, &sha, x32, 32);
  523|  18.8k|    secp256k1_sha256_finalize(hash_ctx, &sha, output);
  524|  18.8k|    secp256k1_sha256_clear(&sha);
  525|       |
  526|  18.8k|    return 1;
  527|  18.8k|}
secp256k1.c:secp256k1_ellswift_sha256_init_bip324:
  506|  18.8k|static void secp256k1_ellswift_sha256_init_bip324(secp256k1_sha256* hash) {
  507|  18.8k|    static const uint32_t midstate[8] = {
  508|  18.8k|        0x8c12d730ul, 0x827bd392ul, 0x9e4fb2eeul, 0x207b373eul,
  509|  18.8k|        0x2292bd7aul, 0xaa5441bcul, 0x15c3779ful, 0xcfb52549ul
  510|  18.8k|    };
  511|  18.8k|    secp256k1_sha256_initialize_midstate(hash, 64, midstate);
  512|  18.8k|}

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

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

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_seckey_verify:
  615|   256k|int secp256k1_ec_seckey_verify(const secp256k1_context* ctx, const unsigned char *seckey) {
  616|   256k|    secp256k1_scalar sec;
  617|   256k|    int ret;
  618|   256k|    VERIFY_CHECK(ctx != NULL);
  619|   256k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|   256k|#define ARG_CHECK(cond) do { \
  |  |   46|   256k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   256k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   256k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 256k]
  |  |  ------------------
  ------------------
  620|       |
  621|   256k|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  622|   256k|    secp256k1_scalar_clear(&sec);
  623|   256k|    return ret;
  624|   256k|}
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_ec_pubkey_create_helper:
  626|   256k|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|   256k|    int ret;
  628|       |
  629|   256k|    ret = secp256k1_scalar_set_b32_seckey(seckey_scalar, seckey);
  630|   256k|    secp256k1_scalar_cmov(seckey_scalar, &secp256k1_scalar_one, !ret);
  631|       |
  632|   256k|    secp256k1_ecmult_gen_ge(ecmult_gen_ctx, p, seckey_scalar);
  633|   256k|    return ret;
  634|   256k|}
secp256k1.c:secp256k1_get_hash_context:
  237|  2.06M|static SECP256K1_INLINE const secp256k1_hash_ctx* secp256k1_get_hash_context(const secp256k1_context *ctx) {
  238|  2.06M|    return &ctx->hash_ctx;
  239|  2.06M|}
secp256k1.c:secp256k1_declassify:
  254|   512k|static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, const void *p, size_t len) {
  255|   512k|    if (EXPECT(ctx->declassify, 0)) SECP256K1_CHECKMEM_DEFINE(p, len);
  ------------------
  |  |  146|   512k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 512k]
  |  |  ------------------
  ------------------
                  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|   512k|}

secp256k1.c:secp256k1_read_be32:
  428|  25.5M|SECP256K1_INLINE static uint32_t secp256k1_read_be32(const unsigned char* p) {
  429|  25.5M|    return (uint32_t)p[0] << 24 |
  430|  25.5M|           (uint32_t)p[1] << 16 |
  431|  25.5M|           (uint32_t)p[2] << 8  |
  432|  25.5M|           (uint32_t)p[3];
  433|  25.5M|}
secp256k1.c:secp256k1_read_be64:
  444|  2.12M|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  445|  2.12M|    return (uint64_t)p[0] << 56 |
  446|  2.12M|           (uint64_t)p[1] << 48 |
  447|  2.12M|           (uint64_t)p[2] << 40 |
  448|  2.12M|           (uint64_t)p[3] << 32 |
  449|  2.12M|           (uint64_t)p[4] << 24 |
  450|  2.12M|           (uint64_t)p[5] << 16 |
  451|  2.12M|           (uint64_t)p[6] << 8  |
  452|  2.12M|           (uint64_t)p[7];
  453|  2.12M|}
secp256k1.c:secp256k1_ctz64_var:
  410|   387M|static SECP256K1_INLINE int secp256k1_ctz64_var(uint64_t x) {
  411|   387M|    VERIFY_CHECK(x != 0);
  412|   387M|#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|   387M|    if (((unsigned long)UINT64_MAX) == UINT64_MAX) {
  ------------------
  |  Branch (414:9): [True: 387M, Folded]
  ------------------
  415|   387M|        return __builtin_ctzl(x);
  416|   387M|    }
  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|   387M|}
secp256k1.c:secp256k1_memczero:
  220|   256k|static SECP256K1_INLINE void secp256k1_memczero(void *s, size_t len, int flag) {
  221|   256k|    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|   256k|    volatile int vflag = flag;
  226|   256k|    unsigned char mask = -(unsigned char) vflag;
  227|   256k|    VERIFY_CHECK(flag == 0 || flag == 1);
  228|  16.6M|    while (len) {
  ------------------
  |  Branch (228:12): [True: 16.4M, False: 256k]
  ------------------
  229|  16.4M|        *p &= ~mask;
  230|  16.4M|        p++;
  231|  16.4M|        len--;
  232|  16.4M|    }
  233|   256k|}
secp256k1.c:secp256k1_rotr32:
  468|  66.1M|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|  66.1M|    const unsigned int mask = CHAR_BIT * sizeof(x) - 1;
  474|       |    /* Turned into a rot instruction by GCC and clang. */
  475|  66.1M|    return (x >> (by & mask)) | (x << ((-by) & mask));
  476|  66.1M|#endif
  477|  66.1M|}
secp256k1.c:secp256k1_write_be64:
  456|  1.10M|SECP256K1_INLINE static void secp256k1_write_be64(unsigned char* p, uint64_t x) {
  457|  1.10M|    p[7] = x;
  458|  1.10M|    p[6] = x >>  8;
  459|  1.10M|    p[5] = x >> 16;
  460|  1.10M|    p[4] = x >> 24;
  461|  1.10M|    p[3] = x >> 32;
  462|  1.10M|    p[2] = x >> 40;
  463|  1.10M|    p[1] = x >> 48;
  464|  1.10M|    p[0] = x >> 56;
  465|  1.10M|}
secp256k1.c:secp256k1_memclear_explicit:
  268|  2.38M|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|  2.38M|    secp256k1_memzero_explicit(ptr, len);
  271|       |#ifdef VERIFY
  272|       |    SECP256K1_CHECKMEM_UNDEFINE(ptr, len);
  273|       |#endif
  274|  2.38M|}
secp256k1.c:secp256k1_memzero_explicit:
  236|  2.38M|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|  2.38M|    memset(ptr, 0, len);
  253|  2.38M|    __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|  2.38M|}
secp256k1.c:secp256k1_write_be32:
  436|  12.9M|SECP256K1_INLINE static void secp256k1_write_be32(unsigned char* p, uint32_t x) {
  437|  12.9M|    p[3] = x;
  438|  12.9M|    p[2] = x >>  8;
  439|  12.9M|    p[1] = x >> 16;
  440|  12.9M|    p[0] = x >> 24;
  441|  12.9M|}

_ZN22CountingSemaphoreGrantILl9223372036854775807EE7ReleaseEv:
   30|   448k|    {
   31|   448k|        if (!fHaveGrant) {
  ------------------
  |  Branch (31:13): [True: 448k, False: 0]
  ------------------
   32|   448k|            return;
   33|   448k|        }
   34|      0|        sem->release();
   35|      0|        fHaveGrant = false;
   36|      0|    }
_ZN22CountingSemaphoreGrantILl9223372036854775807EEaSEOS0_:
   60|    938|    {
   61|    938|        Release();
   62|    938|        sem = other.sem;
   63|    938|        fHaveGrant = other.fHaveGrant;
   64|    938|        other.fHaveGrant = false;
   65|    938|        other.sem = nullptr;
   66|    938|        return *this;
   67|    938|    }
_ZN22CountingSemaphoreGrantILl9223372036854775807EEC2Ev:
   69|   447k|    CountingSemaphoreGrant() noexcept : sem(nullptr), fHaveGrant(false) {}
_ZN22CountingSemaphoreGrantILl9223372036854775807EED2Ev:
   81|   447k|    {
   82|   447k|        Release();
   83|   447k|    }

_Z11UnserializeI10DataStreamR20AddrManDeterministicQ14UnserializableIT0_T_EEvRS4_OS3_:
  776|  4.23k|{
  777|  4.23k|    a.Unserialize(is);
  778|  4.23k|}
deserialize.cpp:_ZL5UsingI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE7WrapperIT_RT0_EOSE_:
  491|   234k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
deserialize.cpp:_ZL5UsingI20CompactSizeFormatterILb0EERmE7WrapperIT_RT0_EOS5_:
  491|  9.53k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
deserialize.cpp:_ZL5UsingI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE7WrapperIT_RT0_EOS6_:
  491|   225k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
deserialize.cpp:_ZL5UsingI20CompactSizeFormatterILb1EERmE7WrapperIT_RT0_EOS5_:
  491|  9.47k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
deserialize.cpp:_ZL5UsingI19CustomUintFormatterILi2ELb1EERtE7WrapperIT_RT0_EOS5_:
  491|   234k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZNK8CAddress9SerParamsclIR8CNetAddrEEDaOT_:
 1282|  1.27M|    {                                                                                    \
 1283|  1.27M|        return ParamsWrapper{*this, t};                                                  \
 1284|  1.27M|    }
_ZN13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrEC2ERKS1_RS2_:
 1249|  1.27M|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z11UnserializeI10DataStreamR13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrEQ14UnserializableIT0_T_EEvRS8_OS7_:
  776|  1.27M|{
  777|  1.27M|    a.Unserialize(is);
  778|  1.27M|}
_ZN13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrE11UnserializeI10DataStreamEEvRT_:
 1259|  1.27M|    {
 1260|  1.27M|        ParamsStream ss{s, m_params};
 1261|  1.27M|        ::Unserialize(ss, m_object);
 1262|  1.27M|    }
_Z9SerializeI10HashWriterTk9BasicByteKSt4byteEvRT_NSt3__14spanIT0_Lm18446744073709551615EEE:
  261|    280|template <typename Stream, BasicByte B>           void Serialize(Stream& s, std::span<B> span)         { s.write(std::as_bytes(span)); }
_ZNK12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE9GetParamsIN8CNetAddr9SerParamsEEERKDav:
 1198|  1.50M|    {
 1199|  1.50M|        if constexpr (std::is_convertible_v<Params, P>) {
 1200|  1.50M|            return m_params;
 1201|       |        } else {
 1202|       |            return m_substream.template GetParams<P>();
 1203|       |        }
 1204|  1.50M|    }
addrman.cpp:_ZL5UsingI19CustomUintFormatterILi1ELb0EERN11AddrManImpl6FormatEE7WrapperIT_RT0_EOS7_:
  491|  4.23k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI19CustomUintFormatterILi1ELb0EERN11AddrManImpl6FormatEEC2ES4_:
  475|  4.23k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z6AsBaseI8CAddress8AddrInfoERT_RT0_:
  137|   235k|{
  138|   235k|    static_assert(std::is_base_of_v<Out, In>);
  139|   235k|    return x;
  140|   235k|}
addrman.cpp:_ZL5UsingI15ChronoFormatterIlLb0EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE7WrapperIT_RT0_EOSE_:
  491|   235k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15ChronoFormatterIlLb0EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEEC2ESB_:
  475|   235k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamR7WrapperI19CustomUintFormatterILi1ELb0EERN11AddrManImpl6FormatEEQ14UnserializableIT0_T_EEvRSA_OS9_:
  776|  4.23k|{
  777|  4.23k|    a.Unserialize(is);
  778|  4.23k|}
_ZN7WrapperI19CustomUintFormatterILi1ELb0EERN11AddrManImpl6FormatEE11UnserializeI10DataStreamEEvRT_:
  477|  4.23k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi1ELb0EE5UnserI10DataStreamN11AddrManImpl6FormatEEEvRT_RT0_:
  542|  4.23k|    {
  543|  4.23k|        using U = typename std::conditional_t<std::is_enum_v<I>, std::underlying_type<I>, std::common_type<I>>::type;
  544|  4.23k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  545|  4.23k|        uint64_t raw = 0;
  546|  4.23k|        if (BigEndian) {
  ------------------
  |  Branch (546:13): [Folded, False: 4.23k]
  ------------------
  547|      0|            s.read(std::as_writable_bytes(std::span{&raw, 1}).last(Bytes));
  548|      0|            v = static_cast<I>(be64toh_internal(raw));
  549|  4.23k|        } else {
  550|  4.23k|            s.read(std::as_writable_bytes(std::span{&raw, 1}).first(Bytes));
  551|  4.23k|            v = static_cast<I>(le64toh_internal(raw));
  552|  4.23k|        }
  553|  4.23k|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRhEERS4_OT_:
 1188|  1.44M|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEvRT_Rh:
  266|  1.44M|template <typename Stream> void Unserialize(Stream& s, uint8_t& a)   { a = ser_readdata8(s); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIR7uint256EERS4_OT_:
 1188|  3.20k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7uint256Q14UnserializableIT0_T_EEvRS9_OS8_:
  776|  3.20k|{
  777|  3.20k|    a.Unserialize(is);
  778|  3.20k|}
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRiEERS4_OT_:
 1188|   446k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEvRT_Ri:
  269|   680k|template <typename Stream> void Unserialize(Stream& s, int32_t& a)   { a = int32_t(ser_readdata32(s)); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIR8AddrInfoEERS4_OT_:
 1188|   235k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER8AddrInfoQ14UnserializableIT0_T_EEvRS9_OS8_:
  776|   235k|{
  777|   235k|    a.Unserialize(is);
  778|   235k|}
_ZN8AddrInfo11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  220|   235k|    {                                                                                               \
  221|   235k|        static_assert(std::is_same_v<cls&, decltype(*this)>, "Unserialize type mismatch");          \
  222|   235k|        Unser(s, *this);                                                                            \
  223|   235k|    }
_ZN8AddrInfo5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_RS_:
  172|   235k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJRS4_R8CNetAddr7WrapperI15ChronoFormatterIlLb0EERNSt3__16chrono10time_pointI9NodeClockNSE_8durationIxNSD_5ratioILl1ELl1EEEEEEEERiEEEvRT_DpOT0_:
 1086|   235k|    {
 1087|   235k|        ::UnserializeMany(s, args...);
 1088|   235k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJRS3_R8CNetAddrR7WrapperI15ChronoFormatterIlLb0EERNSt3__16chrono10time_pointI9NodeClockNSD_8durationIxNSC_5ratioILl1ELl1EEEEEEEERiEEvRT_DpOT0_:
 1054|   235k|{
 1055|   235k|    (::Unserialize(s, args), ...);
 1056|   235k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER8CNetAddrQ14UnserializableIT0_T_EEvRS9_OS8_:
  776|  1.50M|{
  777|  1.50M|    a.Unserialize(is);
  778|  1.50M|}
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsI7WrapperI20CompactSizeFormatterILb1EERmEEERS4_OT_:
 1188|  1.44M|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI20CompactSizeFormatterILb1EERmEQ14UnserializableIT0_T_EEvRSD_OSC_:
  776|  1.44M|{
  777|  1.44M|    a.Unserialize(is);
  778|  1.44M|}
_ZN7WrapperI20CompactSizeFormatterILb1EERmE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  477|  1.44M|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb1EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEmEEvRT_RT0_:
  564|  1.44M|    {
  565|  1.44M|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  566|  1.44M|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (566:13): [True: 66, False: 1.44M]
  |  Branch (566:50): [True: 0, False: 1.44M]
  ------------------
  567|      0|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  568|      0|        }
  569|  1.44M|        v = n;
  570|  1.44M|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsINSt3__14spanIhLm18446744073709551615EEEEERS4_OT_:
 1188|  1.27M|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEETk9BasicBytehEvRT_NSt3__14spanIT0_Lm18446744073709551615EEE:
  277|  1.27M|template <typename Stream, BasicByte B>           void Unserialize(Stream& s, std::span<B> span)    { s.read(std::as_writable_bytes(span)); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE6ignoreEm:
 1191|   172k|    void ignore(size_t num) { GetStream().ignore(num); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRA16_hEERS4_OT_:
 1188|  61.0k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEETk9BasicBytehLm16EEvRT_RAT1__T0_:
  274|  61.0k|template <typename Stream, BasicByte B, size_t N> void Unserialize(Stream& s, B (&a)[N])            { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI15ChronoFormatterIlLb0EERNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEQ14UnserializableIT0_T_EEvRSM_OSL_:
  776|   234k|{
  777|   234k|    a.Unserialize(is);
  778|   234k|}
_ZN7WrapperI15ChronoFormatterIlLb0EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  477|   234k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15ChronoFormatterIlLb0EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEENSt3__16chrono10time_pointI9NodeClockNS9_8durationIxNS8_5ratioILl1ELl1EEEEEEEEEvRT_RT0_:
  586|   234k|    {
  587|   234k|        U u;
  588|   234k|        s >> u;
  589|       |        // Lossy deserialization does not make sense, so force Wnarrowing
  590|   234k|        tp = Tp{typename Tp::duration{typename Tp::duration::rep{u}}};
  591|   234k|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRlEERS4_OT_:
 1188|   234k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEvRT_Rl:
  271|   234k|template <typename Stream> void Unserialize(Stream& s, int64_t& a)   { a = int64_t(ser_readdata64(s)); }
net.cpp:_ZL5UsingI20CompactSizeFormatterILb1EERmE7WrapperIT_RT0_EOS5_:
  491|  1.44M|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z11UnserializeI10DataStreamR14CMessageHeaderQ14UnserializableIT0_T_EEvRS4_OS3_:
  776|  4.60k|{
  777|  4.60k|    a.Unserialize(is);
  778|  4.60k|}
_ZN14CMessageHeader11UnserializeI10DataStreamEEvRT_:
  220|  4.60k|    {                                                                                               \
  221|  4.60k|        static_assert(std::is_same_v<cls&, decltype(*this)>, "Unserialize type mismatch");          \
  222|  4.60k|        Unser(s, *this);                                                                            \
  223|  4.60k|    }
_ZN14CMessageHeader5UnserI10DataStreamEEvRT_RS_:
  172|  4.60k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRNSt3__15arrayIhLm4EEERA12_cRjRA4_hEEEvRT_DpOT0_:
 1086|  4.60k|    {
 1087|  4.60k|        ::UnserializeMany(s, args...);
 1088|  4.60k|    }
_Z15UnserializeManyI10DataStreamJRNSt3__15arrayIhLm4EEERA12_cRjRA4_hEEvRT_DpOT0_:
 1054|  4.60k|{
 1055|  4.60k|    (::Unserialize(s, args), ...);
 1056|  4.60k|}
_Z11UnserializeI10DataStreamTk9BasicBytehLm4EEvRT_RNSt3__15arrayIT0_XT1_EEE:
  275|  4.60k|template <typename Stream, BasicByte B, size_t N> void Unserialize(Stream& s, std::array<B, N>& a)  { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI10DataStreamTk9BasicBytecLm12EEvRT_RAT1__T0_:
  274|  4.60k|template <typename Stream, BasicByte B, size_t N> void Unserialize(Stream& s, B (&a)[N])            { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI10DataStreamTk9BasicBytehLm4EEvRT_RAT1__T0_:
  274|  4.60k|template <typename Stream, BasicByte B, size_t N> void Unserialize(Stream& s, B (&a)[N])            { s.read(MakeWritableByteSpan(a)); }
_Z13SerializeManyI12VectorWriterJ14CMessageHeaderEEvRT_DpRKT0_:
 1048|  86.7k|{
 1049|  86.7k|    (::Serialize(s, args), ...);
 1050|  86.7k|}
_Z9SerializeI12VectorWriter14CMessageHeaderQ12SerializableIT0_T_EEvRS3_RKS2_:
  767|  86.7k|{
  768|  86.7k|    a.Serialize(os);
  769|  86.7k|}
_ZNK14CMessageHeader9SerializeI12VectorWriterEEvRT_:
  214|  86.7k|    {                                                                                               \
  215|  86.7k|        static_assert(std::is_same_v<const cls&, decltype(*this)>, "Serialize type mismatch");      \
  216|  86.7k|        Ser(s, *this);                                                                              \
  217|  86.7k|    }                                                                                               \
_ZN14CMessageHeader3SerI12VectorWriterEEvRT_RKS_:
  170|  86.7k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJNSt3__15arrayIhLm4EEEA12_cjA4_hEEEvRT_DpRKT0_:
 1066|  86.7k|    {
 1067|  86.7k|        ::SerializeMany(s, args...);
 1068|  86.7k|    }
_Z13SerializeManyI12VectorWriterJNSt3__15arrayIhLm4EEEA12_cjA4_hEEvRT_DpRKT0_:
 1048|  86.7k|{
 1049|  86.7k|    (::Serialize(s, args), ...);
 1050|  86.7k|}
_Z9SerializeI12VectorWriterTk9BasicBytecLm12EEvRT_RAT1__KT0_:
  258|  86.7k|template <typename Stream, BasicByte B, size_t N> void Serialize(Stream& s, const B (&a)[N])           { s.write(MakeByteSpan(a)); }
_Z9SerializeI12VectorWriterTk9BasicBytehLm4EEvRT_RAT1__KT0_:
  258|  86.7k|template <typename Stream, BasicByte B, size_t N> void Serialize(Stream& s, const B (&a)[N])           { s.write(MakeByteSpan(a)); }
_ZN7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEC2ES3_:
  475|   225k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN7WrapperI20CompactSizeFormatterILb1EERmEC2ES2_:
  475|  1.45M|    explicit Wrapper(T obj) : m_object(obj) {}
_Z6AsBaseI8CNetAddr8CServiceERT_RT0_:
  137|   234k|{
  138|   234k|    static_assert(std::is_base_of_v<Out, In>);
  139|   234k|    return x;
  140|   234k|}
_ZN7WrapperI19CustomUintFormatterILi2ELb1EERtEC2ES2_:
  475|   234k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK8CNetAddr9SerParamsclIR8CServiceEEDaOT_:
 1282|   234k|    {                                                                                    \
 1283|   234k|        return ParamsWrapper{*this, t};                                                  \
 1284|   234k|    }
_ZN13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEC2ERKS1_RS2_:
 1249|   234k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEC2ES1_RKS3_:
 1181|  1.27M|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z15ReadCompactSizeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEmRT_b:
  334|  1.45M|{
  335|  1.45M|    uint8_t chSize = ser_readdata8(is);
  336|  1.45M|    uint64_t nSizeRet = 0;
  337|  1.45M|    if (chSize < 253)
  ------------------
  |  Branch (337:9): [True: 1.44M, False: 5.23k]
  ------------------
  338|  1.44M|    {
  339|  1.44M|        nSizeRet = chSize;
  340|  1.44M|    }
  341|  5.23k|    else if (chSize == 253)
  ------------------
  |  Branch (341:14): [True: 387, False: 4.84k]
  ------------------
  342|    387|    {
  343|    387|        nSizeRet = ser_readdata16(is);
  344|    387|        if (nSizeRet < 253)
  ------------------
  |  Branch (344:13): [True: 1, False: 386]
  ------------------
  345|      1|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  346|    387|    }
  347|  4.84k|    else if (chSize == 254)
  ------------------
  |  Branch (347:14): [True: 4.59k, False: 252]
  ------------------
  348|  4.59k|    {
  349|  4.59k|        nSizeRet = ser_readdata32(is);
  350|  4.59k|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (350:13): [True: 10, False: 4.58k]
  ------------------
  351|     10|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|  4.59k|    }
  353|    252|    else
  354|    252|    {
  355|    252|        nSizeRet = ser_readdata64(is);
  356|    252|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (356:13): [True: 29, False: 223]
  ------------------
  357|     29|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|    252|    }
  359|  1.45M|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (359:9): [True: 1.44M, False: 9.51k]
  |  Branch (359:24): [True: 44, False: 1.44M]
  ------------------
  360|     44|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  361|     44|    }
  362|  1.45M|    return nSizeRet;
  363|  1.45M|}
_Z13ser_readdata8I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEhRT_:
   82|  2.90M|{
   83|  2.90M|    uint8_t obj;
   84|  2.90M|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   85|  2.90M|    return obj;
   86|  2.90M|}
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE4readENSt3__14spanISt4byteLm18446744073709551615EEE:
 1190|  5.85M|    void read(std::span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE9GetStreamEv:
 1208|  6.51M|    {
 1209|       |        if constexpr (ContainsStream<SubStream>) {
 1210|       |            return m_substream.GetStream();
 1211|  6.51M|        } else {
 1212|  6.51M|            return m_substream;
 1213|  6.51M|        }
 1214|  6.51M|    }
_Z14ser_readdata16I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEtRT_:
   88|    387|{
   89|    387|    uint16_t obj;
   90|    387|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   91|    387|    return le16toh_internal(obj);
   92|    387|}
_Z14ser_readdata32I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEjRT_:
   94|  1.15M|{
   95|  1.15M|    uint32_t obj;
   96|  1.15M|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   97|  1.15M|    return le32toh_internal(obj);
   98|  1.15M|}
_Z14ser_readdata64I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEmRT_:
  106|   234k|{
  107|   234k|    uint64_t obj;
  108|   234k|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
  109|   234k|    return le64toh_internal(obj);
  110|   234k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEERS3_Q14UnserializableIT0_T_EEvRS8_OS7_:
  776|   235k|{
  777|   235k|    a.Unserialize(is);
  778|   235k|}
_ZN8CAddress11UnserializeI12ParamsStreamIR10DataStreamNS_9SerParamsEEEEvRT_:
  220|   235k|    {                                                                                               \
  221|   235k|        static_assert(std::is_same_v<cls&, decltype(*this)>, "Unserialize type mismatch");          \
  222|   235k|        Unser(s, *this);                                                                            \
  223|   235k|    }
_ZN8CAddress5UnserI12ParamsStreamIR10DataStreamNS_9SerParamsEEEEvRT_RS_:
  172|   235k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZNK12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE9GetParamsIS3_EERKDav:
 1198|   235k|    {
 1199|   235k|        if constexpr (std::is_convertible_v<Params, P>) {
 1200|   235k|            return m_params;
 1201|       |        } else {
 1202|       |            return m_substream.template GetParams<P>();
 1203|       |        }
 1204|   235k|    }
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJRjEEEvRT_DpOT0_:
 1086|   235k|    {
 1087|   235k|        ::UnserializeMany(s, args...);
 1088|   235k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJRjEEvRT_DpOT0_:
 1054|   235k|{
 1055|   235k|    (::Unserialize(s, args), ...);
 1056|   235k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEvRT_Rj:
  270|   469k|template <typename Stream> void Unserialize(Stream& s, uint32_t& a)  { a = ser_readdata32(s); }
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNSB_8durationIxNSA_5ratioILl1ELl1EEEEEEEEEEEvRT_DpOT0_:
 1086|   234k|    {
 1087|   234k|        ::UnserializeMany(s, args...);
 1088|   234k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEEEvRT_DpOT0_:
 1054|   234k|{
 1055|   234k|    (::Unserialize(s, args), ...);
 1056|   234k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEQ14UnserializableIT0_T_EEvRSM_OSL_:
  776|   234k|{
  777|   234k|    a.Unserialize(is);
  778|   234k|}
_ZN7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  477|   234k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15ChronoFormatterIjLb1EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEENSt3__16chrono10time_pointI9NodeClockNS9_8durationIxNS8_5ratioILl1ELl1EEEEEEEEEvRT_RT0_:
  586|   234k|    {
  587|   234k|        U u;
  588|   234k|        s >> u;
  589|       |        // Lossy deserialization does not make sense, so force Wnarrowing
  590|   234k|        tp = Tp{typename Tp::duration{typename Tp::duration::rep{u}}};
  591|   234k|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRjEERS4_OT_:
 1188|   234k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_ZN7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEEC2ESB_:
  475|   234k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN17ActionUnserialize8SerWriteI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEERS4_ZNS4_16SerializationOpsIS6_S4_S_EEvRT0_RT_T1_EUlRS6_RKS4_E_EEvSC_OS9_OSD_:
 1098|  9.53k|    {
 1099|  9.53k|    }
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ7WrapperI20CompactSizeFormatterILb0EERmEEEEvRT_DpOT0_:
 1086|  9.53k|    {
 1087|  9.53k|        ::UnserializeMany(s, args...);
 1088|  9.53k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR7WrapperI20CompactSizeFormatterILb0EERmEEEvRT_DpOT0_:
 1054|  9.53k|{
 1055|  9.53k|    (::Unserialize(s, args), ...);
 1056|  9.53k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI20CompactSizeFormatterILb0EERmEQ14UnserializableIT0_T_EEvRSD_OSC_:
  776|  9.53k|{
  777|  9.53k|    a.Unserialize(is);
  778|  9.53k|}
_ZN7WrapperI20CompactSizeFormatterILb0EERmE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  477|  9.53k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb0EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEmEEvRT_RT0_:
  564|  9.53k|    {
  565|  9.53k|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  566|  9.53k|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (566:13): [True: 37, False: 9.49k]
  |  Branch (566:50): [True: 0, False: 9.49k]
  ------------------
  567|      0|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  568|      0|        }
  569|  9.53k|        v = n;
  570|  9.53k|    }
_ZN7WrapperI20CompactSizeFormatterILb0EERmEC2ES2_:
  475|  9.53k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN17ActionUnserialize7SerReadI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEERS4_ZNS4_16SerializationOpsIS6_S4_S_EEvRT0_RT_T1_EUlRS6_S7_E_EEvSC_OS9_OSD_:
 1092|  9.49k|    {
 1093|  9.49k|        fn(s, std::forward<Type>(obj));
 1094|  9.49k|    }
_ZZN8CAddress16SerializationOpsI12ParamsStreamIR10DataStreamNS_9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_ENKUlRS5_RS_E_clESC_SD_:
  149|  9.49k|#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, std::remove_const_t<Type>& obj) { code; })
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEEEEvRT_DpOT0_:
 1086|   225k|    {
 1087|   225k|        ::UnserializeMany(s, args...);
 1088|   225k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEEEvRT_DpOT0_:
 1054|   225k|{
 1055|   225k|    (::Unserialize(s, args), ...);
 1056|   225k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEQ14UnserializableIT0_T_EEvRSE_OSD_:
  776|   225k|{
  777|   225k|    a.Unserialize(is);
  778|   225k|}
_ZN7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  477|   225k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi8ELb0EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE12ServiceFlagsEEvRT_RT0_:
  542|   225k|    {
  543|   225k|        using U = typename std::conditional_t<std::is_enum_v<I>, std::underlying_type<I>, std::common_type<I>>::type;
  544|   225k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  545|   225k|        uint64_t raw = 0;
  546|   225k|        if (BigEndian) {
  ------------------
  |  Branch (546:13): [Folded, False: 225k]
  ------------------
  547|      0|            s.read(std::as_writable_bytes(std::span{&raw, 1}).last(Bytes));
  548|      0|            v = static_cast<I>(be64toh_internal(raw));
  549|   225k|        } else {
  550|   225k|            s.read(std::as_writable_bytes(std::span{&raw, 1}).first(Bytes));
  551|   225k|            v = static_cast<I>(le64toh_internal(raw));
  552|   225k|        }
  553|   225k|    }
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEEEEvRT_DpOT0_:
 1086|   234k|    {
 1087|   234k|        ::UnserializeMany(s, args...);
 1088|   234k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEEEvRT_DpOT0_:
 1054|   234k|{
 1055|   234k|    (::Unserialize(s, args), ...);
 1056|   234k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEQ14UnserializableIT0_T_EEvRSD_OSC_:
  776|   234k|{
  777|   234k|    a.Unserialize(is);
  778|   234k|}
_ZN13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
 1259|   234k|    {
 1260|   234k|        ParamsStream ss{s, m_params};
 1261|   234k|        ::Unserialize(ss, m_object);
 1262|   234k|    }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEC2ES5_RKS7_:
 1181|   234k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEER8CServiceQ14UnserializableIT0_T_EEvRSD_OSC_:
  776|   234k|{
  777|   234k|    a.Unserialize(is);
  778|   234k|}
_ZN8CService11UnserializeI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  220|   234k|    {                                                                                               \
  221|   234k|        static_assert(std::is_same_v<cls&, decltype(*this)>, "Unserialize type mismatch");          \
  222|   234k|        Unser(s, *this);                                                                            \
  223|   234k|    }
_ZN8CService5UnserI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_RS_:
  172|   234k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEJRS8_7WrapperI19CustomUintFormatterILi2ELb1EERtEEEEvRT_DpOT0_:
 1086|   234k|    {
 1087|   234k|        ::UnserializeMany(s, args...);
 1088|   234k|    }
_Z15UnserializeManyI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEJRS7_R7WrapperI19CustomUintFormatterILi2ELb1EERtEEEvRT_DpOT0_:
 1054|   234k|{
 1055|   234k|    (::Unserialize(s, args), ...);
 1056|   234k|}
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEERS7_Q14UnserializableIT0_T_EEvRSC_OSB_:
  776|   234k|{
  777|   234k|    a.Unserialize(is);
  778|   234k|}
_ZNK12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE9GetParamsIS7_EERKDav:
 1198|   234k|    {
 1199|   234k|        if constexpr (std::is_convertible_v<Params, P>) {
 1200|   234k|            return m_params;
 1201|       |        } else {
 1202|       |            return m_substream.template GetParams<P>();
 1203|       |        }
 1204|   234k|    }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsIRhEERS8_OT_:
 1188|  9.49k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEvRT_Rh:
  266|  9.49k|template <typename Stream> void Unserialize(Stream& s, uint8_t& a)   { a = ser_readdata8(s); }
_Z13ser_readdata8I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEhRT_:
   82|  18.9k|{
   83|  18.9k|    uint8_t obj;
   84|  18.9k|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   85|  18.9k|    return obj;
   86|  18.9k|}
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE4readENSt3__14spanISt4byteLm18446744073709551615EEE:
 1190|   482k|    void read(std::span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE9GetStreamEv:
 1208|   487k|    {
 1209|   487k|        if constexpr (ContainsStream<SubStream>) {
 1210|   487k|            return m_substream.GetStream();
 1211|       |        } else {
 1212|       |            return m_substream;
 1213|       |        }
 1214|   487k|    }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsI7WrapperI20CompactSizeFormatterILb1EERmEEERS8_OT_:
 1188|  9.47k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEER7WrapperI20CompactSizeFormatterILb1EERmEQ14UnserializableIT0_T_EEvRSH_OSG_:
  776|  9.47k|{
  777|  9.47k|    a.Unserialize(is);
  778|  9.47k|}
_ZN7WrapperI20CompactSizeFormatterILb1EERmE11UnserializeI12ParamsStreamIRS5_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  477|  9.47k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb1EE5UnserI12ParamsStreamIRS2_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEmEEvRT_RT0_:
  564|  9.47k|    {
  565|  9.47k|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  566|  9.47k|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (566:13): [True: 129, False: 9.34k]
  |  Branch (566:50): [True: 0, False: 9.34k]
  ------------------
  567|      0|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  568|      0|        }
  569|  9.47k|        v = n;
  570|  9.47k|    }
_Z15ReadCompactSizeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEmRT_b:
  334|  9.47k|{
  335|  9.47k|    uint8_t chSize = ser_readdata8(is);
  336|  9.47k|    uint64_t nSizeRet = 0;
  337|  9.47k|    if (chSize < 253)
  ------------------
  |  Branch (337:9): [True: 9.29k, False: 173]
  ------------------
  338|  9.29k|    {
  339|  9.29k|        nSizeRet = chSize;
  340|  9.29k|    }
  341|    173|    else if (chSize == 253)
  ------------------
  |  Branch (341:14): [True: 30, False: 143]
  ------------------
  342|     30|    {
  343|     30|        nSizeRet = ser_readdata16(is);
  344|     30|        if (nSizeRet < 253)
  ------------------
  |  Branch (344:13): [True: 3, False: 27]
  ------------------
  345|      3|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  346|     30|    }
  347|    143|    else if (chSize == 254)
  ------------------
  |  Branch (347:14): [True: 50, False: 93]
  ------------------
  348|     50|    {
  349|     50|        nSizeRet = ser_readdata32(is);
  350|     50|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (350:13): [True: 9, False: 41]
  ------------------
  351|      9|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|     50|    }
  353|     93|    else
  354|     93|    {
  355|     93|        nSizeRet = ser_readdata64(is);
  356|     93|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (356:13): [True: 11, False: 82]
  ------------------
  357|     11|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|     93|    }
  359|  9.44k|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (359:9): [True: 9.42k, False: 22]
  |  Branch (359:24): [True: 84, False: 9.34k]
  ------------------
  360|     84|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  361|     84|    }
  362|  9.36k|    return nSizeRet;
  363|  9.44k|}
_Z14ser_readdata16I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEtRT_:
   88|     30|{
   89|     30|    uint16_t obj;
   90|     30|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   91|     30|    return le16toh_internal(obj);
   92|     30|}
_Z14ser_readdata32I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEjRT_:
   94|     50|{
   95|     50|    uint32_t obj;
   96|     50|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   97|     50|    return le32toh_internal(obj);
   98|     50|}
_Z14ser_readdata64I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEmRT_:
  106|     79|{
  107|     79|    uint64_t obj;
  108|     79|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
  109|     79|    return le64toh_internal(obj);
  110|     79|}
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsINSt3__14spanIhLm18446744073709551615EEEEERS8_OT_:
 1188|  3.74k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEETk9BasicBytehEvRT_NSt3__14spanIT0_Lm18446744073709551615EEE:
  277|  3.74k|template <typename Stream, BasicByte B>           void Unserialize(Stream& s, std::span<B> span)    { s.read(std::as_writable_bytes(span)); }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE6ignoreEm:
 1191|  5.56k|    void ignore(size_t num) { GetStream().ignore(num); }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsIRA16_hEERS8_OT_:
 1188|   225k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEETk9BasicBytehLm16EEvRT_RAT1__T0_:
  274|   225k|template <typename Stream, BasicByte B, size_t N> void Unserialize(Stream& s, B (&a)[N])            { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEER7WrapperI19CustomUintFormatterILi2ELb1EERtEQ14UnserializableIT0_T_EEvRSH_OSG_:
  776|   234k|{
  777|   234k|    a.Unserialize(is);
  778|   234k|}
_ZN7WrapperI19CustomUintFormatterILi2ELb1EERtE11UnserializeI12ParamsStreamIRS5_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  477|   234k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi2ELb1EE5UnserI12ParamsStreamIRS2_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEtEEvRT_RT0_:
  542|   234k|    {
  543|   234k|        using U = typename std::conditional_t<std::is_enum_v<I>, std::underlying_type<I>, std::common_type<I>>::type;
  544|   234k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  545|   234k|        uint64_t raw = 0;
  546|   234k|        if (BigEndian) {
  ------------------
  |  Branch (546:13): [True: 234k, Folded]
  ------------------
  547|   234k|            s.read(std::as_writable_bytes(std::span{&raw, 1}).last(Bytes));
  548|   234k|            v = static_cast<I>(be64toh_internal(raw));
  549|   234k|        } else {
  550|      0|            s.read(std::as_writable_bytes(std::span{&raw, 1}).first(Bytes));
  551|      0|            v = static_cast<I>(le64toh_internal(raw));
  552|      0|        }
  553|   234k|    }
_Z6AsBaseI8CService8CAddressERT_RT0_:
  137|   234k|{
  138|   234k|    static_assert(std::is_base_of_v<Out, In>);
  139|   234k|    return x;
  140|   234k|}
_Z9SerializeI10HashWriterEvRT_m:
  256|  61.0k|template <typename Stream> void Serialize(Stream& s, uint64_t a)  { ser_writedata64(s, a); }
_Z14ser_readdata32I10DataStreamEjRT_:
   94|  4.60k|{
   95|  4.60k|    uint32_t obj;
   96|  4.60k|    s.read(std::as_writable_bytes(std::span{&obj, 1}));
   97|  4.60k|    return le32toh_internal(obj);
   98|  4.60k|}
_Z11UnserializeI10DataStreamEvRT_Rj:
  270|  4.60k|template <typename Stream> void Unserialize(Stream& s, uint32_t& a)  { a = ser_readdata32(s); }
_Z9SerializeI12VectorWriterTk9BasicBytehLm4EEvRT_RKNSt3__15arrayIT0_XT1_EEE:
  259|  86.7k|template <typename Stream, BasicByte B, size_t N> void Serialize(Stream& s, const std::array<B, N>& a) { s.write(MakeByteSpan(a)); }
_Z9SerializeI10DataStreamhNSt3__19allocatorIhEEEvRT_RKNS1_6vectorIT0_T1_EE:
  899|  1.27M|{
  900|  1.27M|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  901|  1.27M|        WriteCompactSize(os, v.size());
  902|  1.27M|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (902:13): [True: 1.27M, False: 0]
  ------------------
  903|       |    } else if constexpr (std::is_same_v<T, bool>) {
  904|       |        // A special case for std::vector<bool>, as dereferencing
  905|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  906|       |        // due to std::vector's special casing for bool arguments.
  907|       |        WriteCompactSize(os, v.size());
  908|       |        for (bool elem : v) {
  909|       |            ::Serialize(os, elem);
  910|       |        }
  911|       |    } else {
  912|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  913|       |    }
  914|  1.27M|}
_Z15ser_writedata32I12VectorWriterEvRT_j:
   67|  86.7k|{
   68|  86.7k|    obj = htole32_internal(obj);
   69|  86.7k|    s.write(std::as_bytes(std::span{&obj, 1}));
   70|  86.7k|}
_Z9SerializeI12VectorWriterEvRT_j:
  254|  86.7k|template <typename Stream> void Serialize(Stream& s, uint32_t a)  { ser_writedata32(s, a); }
_Z9SerializeI10DataStreamEvRT_h:
  250|  1.27M|template <typename Stream> void Serialize(Stream& s, uint8_t a)   { ser_writedata8(s, a); }
_Z14ser_writedata8I10DataStreamEvRT_h:
   58|  2.54M|{
   59|  2.54M|    s.write(std::as_bytes(std::span{&obj, 1}));
   60|  2.54M|}
_Z16WriteCompactSizeI10DataStreamEvRT_m:
  303|  1.27M|{
  304|  1.27M|    if (nSize < 253)
  ------------------
  |  Branch (304:9): [True: 1.27M, False: 0]
  ------------------
  305|  1.27M|    {
  306|  1.27M|        ser_writedata8(os, nSize);
  307|  1.27M|    }
  308|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (308:14): [True: 0, False: 0]
  ------------------
  309|      0|    {
  310|      0|        ser_writedata8(os, 253);
  311|      0|        ser_writedata16(os, nSize);
  312|      0|    }
  313|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (313:14): [True: 0, False: 0]
  ------------------
  314|      0|    {
  315|      0|        ser_writedata8(os, 254);
  316|      0|        ser_writedata32(os, nSize);
  317|      0|    }
  318|      0|    else
  319|      0|    {
  320|      0|        ser_writedata8(os, 255);
  321|      0|        ser_writedata64(os, nSize);
  322|      0|    }
  323|  1.27M|    return;
  324|  1.27M|}
_Z15ser_writedata64I10HashWriterEvRT_m:
   77|  61.0k|{
   78|  61.0k|    obj = htole64_internal(obj);
   79|  61.0k|    s.write(std::as_bytes(std::span{&obj, 1}));
   80|  61.0k|}
_Z16WriteCompactSizeI10HashWriterEvRT_m:
  303|   239k|{
  304|   239k|    if (nSize < 253)
  ------------------
  |  Branch (304:9): [True: 239k, False: 0]
  ------------------
  305|   239k|    {
  306|   239k|        ser_writedata8(os, nSize);
  307|   239k|    }
  308|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (308:14): [True: 0, False: 0]
  ------------------
  309|      0|    {
  310|      0|        ser_writedata8(os, 253);
  311|      0|        ser_writedata16(os, nSize);
  312|      0|    }
  313|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (313:14): [True: 0, False: 0]
  ------------------
  314|      0|    {
  315|      0|        ser_writedata8(os, 254);
  316|      0|        ser_writedata32(os, nSize);
  317|      0|    }
  318|      0|    else
  319|      0|    {
  320|      0|        ser_writedata8(os, 255);
  321|      0|        ser_writedata64(os, nSize);
  322|      0|    }
  323|   239k|    return;
  324|   239k|}
_Z14ser_writedata8I10HashWriterEvRT_h:
   58|   329k|{
   59|   329k|    s.write(std::as_bytes(std::span{&obj, 1}));
   60|   329k|}
_Z15ser_writedata32I10HashWriterEvRT_j:
   67|  90.0k|{
   68|  90.0k|    obj = htole32_internal(obj);
   69|  90.0k|    s.write(std::as_bytes(std::span{&obj, 1}));
   70|  90.0k|}
_Z9SerializeI10HashWriterhNSt3__19allocatorIhEEEvRT_RKNS1_6vectorIT0_T1_EE:
  899|   239k|{
  900|   239k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  901|   239k|        WriteCompactSize(os, v.size());
  902|   239k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (902:13): [True: 239k, False: 0]
  ------------------
  903|       |    } else if constexpr (std::is_same_v<T, bool>) {
  904|       |        // A special case for std::vector<bool>, as dereferencing
  905|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  906|       |        // due to std::vector's special casing for bool arguments.
  907|       |        WriteCompactSize(os, v.size());
  908|       |        for (bool elem : v) {
  909|       |            ::Serialize(os, elem);
  910|       |        }
  911|       |    } else {
  912|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  913|       |    }
  914|   239k|}
_Z9SerializeI10HashWriterTk9BasicByteKhLm32EEvRT_NSt3__14spanIT0_XT1_EEE:
  260|   212k|template <typename Stream, BasicByte B, size_t N> void Serialize(Stream& s, std::span<B, N> span)      { s.write(std::as_bytes(span)); }
_Z9SerializeI10HashWriterEvRT_i:
  253|  90.0k|template <typename Stream> void Serialize(Stream& s, int32_t a)   { ser_writedata32(s, uint32_t(a)); }
_Z9SerializeI10HashWriter7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  767|   212k|{
  768|   212k|    a.Serialize(os);
  769|   212k|}
_Z9SerializeI10HashWriterEvRT_h:
  250|  90.0k|template <typename Stream> void Serialize(Stream& s, uint8_t a)   { ser_writedata8(s, a); }

_Z13MakeUCharSpanINSt3__14spanIKcLm18446744073709551615EEEEDTcl13UCharSpanCasttlS1_fp_EEERKT_:
  111|  1.20k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z20MakeWritableByteSpanIRNSt3__16vectorIhNS0_9allocatorIhEEEEEDaOT_:
   90|   314k|{
   91|   314k|    return std::as_writable_bytes(std::span{std::forward<V>(v)});
   92|   314k|}
_Z20MakeWritableByteSpanIRA12_cEDaOT_:
   90|  4.60k|{
   91|  4.60k|    return std::as_writable_bytes(std::span{std::forward<V>(v)});
   92|  4.60k|}
_Z20MakeWritableByteSpanIRA4_hEDaOT_:
   90|  4.60k|{
   91|  4.60k|    return std::as_writable_bytes(std::span{std::forward<V>(v)});
   92|  4.60k|}
_Z12MakeByteSpanIA12_cEDaRKT_:
   85|  86.7k|{
   86|  86.7k|    return std::as_bytes(std::span{v});
   87|  86.7k|}
_Z12MakeByteSpanIA4_hEDaRKT_:
   85|  86.7k|{
   86|  86.7k|    return std::as_bytes(std::span{v});
   87|  86.7k|}
_Z20MakeWritableByteSpanIRA16_hEDaOT_:
   90|   286k|{
   91|   286k|    return std::as_writable_bytes(std::span{std::forward<V>(v)});
   92|   286k|}
_Z13MakeUCharSpanINSt3__16vectorIhNS0_9allocatorIhEEEEEDTcl13UCharSpanCasttlNS0_4spanEfp_EEERKT_:
  111|  86.7k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z12MakeByteSpanINSt3__15arrayIhLm4EEEEDaRKT_:
   85|  86.7k|{
   86|  86.7k|    return std::as_bytes(std::span{v});
   87|  86.7k|}
_Z13UCharSpanCastIKcLm18446744073709551615EEDaNSt3__14spanIT_XT0_EEE:
  108|  1.20k|template <typename T, size_t N> constexpr auto UCharSpanCast(std::span<T, N> s) { return std::span<std::remove_pointer_t<decltype(UCharCast(s.data()))>, N>{UCharCast(s.data()), s.size()}; }
_Z9UCharCastPKc:
   99|  1.20k|inline const unsigned char* UCharCast(const char* c) { return reinterpret_cast<const unsigned char*>(c); }
_Z20MakeWritableByteSpanIRNSt3__15arrayIhLm4EEEEDaOT_:
   90|  4.60k|{
   91|  4.60k|    return std::as_writable_bytes(std::span{std::forward<V>(v)});
   92|  4.60k|}
_Z20MakeWritableByteSpanIRNSt3__15arrayIhLm32EEEEDaOT_:
   90|  3.20k|{
   91|  3.20k|    return std::as_writable_bytes(std::span{std::forward<V>(v)});
   92|  3.20k|}
_Z12MakeByteSpanINSt3__16vectorIhNS0_9allocatorIhEEEEEDaRKT_:
   85|  78.0M|{
   86|  78.0M|    return std::as_bytes(std::span{v});
   87|  78.0M|}
_Z13UCharSpanCastIKhLm18446744073709551615EEDaNSt3__14spanIT_XT0_EEE:
  108|  86.7k|template <typename T, size_t N> constexpr auto UCharSpanCast(std::span<T, N> s) { return std::span<std::remove_pointer_t<decltype(UCharCast(s.data()))>, N>{UCharCast(s.data()), s.size()}; }
_Z9UCharCastPKh:
  100|   153M|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPSt4byte:
   98|   426k|inline unsigned char* UCharCast(std::byte* c) { return reinterpret_cast<unsigned char*>(c); }
_Z12MakeByteSpanI7uint256EDaRKT_:
   85|   562k|{
   86|   562k|    return std::as_bytes(std::span{v});
   87|   562k|}
_Z9UCharCastPKSt4byte:
  102|  2.03M|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }

_ZNK10DataStream14GetMemoryUsageEv:
  141|     72|{
  142|     72|    return sizeof(*this) + memusage::DynamicUsage(vch);
  143|     72|}

_ZN10DataStreamrsIR20AddrManDeterministicEERS_OT_:
  259|  4.23k|    {
  260|  4.23k|        ::Unserialize(*this, obj);
  261|  4.23k|        return (*this);
  262|  4.23k|    }
_ZN10DataStreamrsI13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrEEERS_OT_:
  259|  1.27M|    {
  260|  1.27M|        ::Unserialize(*this, obj);
  261|  1.27M|        return (*this);
  262|  1.27M|    }
_ZN10DataStreamrsI7WrapperI19CustomUintFormatterILi1ELb0EERN11AddrManImpl6FormatEEEERS_OT_:
  259|  4.23k|    {
  260|  4.23k|        ::Unserialize(*this, obj);
  261|  4.23k|        return (*this);
  262|  4.23k|    }
_ZN10DataStreamixEm:
  203|  5.16k|    reference operator[](size_type pos)              { return vch[pos + m_read_pos]; }
_ZN10DataStream6resizeEmSt4byte:
  200|   393k|    void resize(size_type n, value_type c = value_type{}) { vch.resize(n + m_read_pos, c); }
_ZN10DataStreamrsIR14CMessageHeaderEERS_OT_:
  259|  4.60k|    {
  260|  4.60k|        ::Unserialize(*this, obj);
  261|  4.60k|        return (*this);
  262|  4.60k|    }
_ZN12VectorWriterC2IJR14CMessageHeaderEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   52|  86.7k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   53|  86.7k|    {
   54|  86.7k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   55|  86.7k|    }
_ZN10DataStreamC2ENSt3__14spanIKhLm18446744073709551615EEE:
  183|  4.23k|    explicit DataStream(std::span<const uint8_t> sp) : DataStream{std::as_bytes(sp)} {}
_ZN10DataStreamC2ENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  184|  4.23k|    explicit DataStream(std::span<const value_type> sp) : vch(sp.data(), sp.data() + sp.size()) {}
_ZN10DataStreamlsINSt3__16vectorIhNS1_9allocatorIhEEEEEERS_RKT_:
  252|  1.27M|    {
  253|  1.27M|        ::Serialize(*this, obj);
  254|  1.27M|        return (*this);
  255|  1.27M|    }
_ZN12VectorWriterC2ERNSt3__16vectorIhNS0_9allocatorIhEEEEm:
   42|  86.7k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn) : vchData{vchDataIn}, nPos{nPosIn}
   43|  86.7k|    {
   44|  86.7k|        if(nPos > vchData.size())
  ------------------
  |  Branch (44:12): [True: 0, False: 86.7k]
  ------------------
   45|      0|            vchData.resize(nPos);
   46|  86.7k|    }
_ZN12VectorWriter5writeENSt3__14spanIKSt4byteLm18446744073709551615EEE:
   57|   347k|    {
   58|   347k|        assert(nPos <= vchData.size());
  ------------------
  |  Branch (58:9): [True: 347k, False: 0]
  ------------------
   59|   347k|        size_t nOverwrite = std::min(src.size(), vchData.size() - nPos);
   60|   347k|        if (nOverwrite) {
  ------------------
  |  Branch (60:13): [True: 0, False: 347k]
  ------------------
   61|      0|            memcpy(vchData.data() + nPos, src.data(), nOverwrite);
   62|      0|        }
   63|   347k|        if (nOverwrite < src.size()) {
  ------------------
  |  Branch (63:13): [True: 347k, False: 0]
  ------------------
   64|   347k|            vchData.insert(vchData.end(), UCharCast(src.data()) + nOverwrite, UCharCast(src.data() + src.size()));
   65|   347k|        }
   66|   347k|        nPos += src.size();
   67|   347k|    }
_ZN10DataStream5writeENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  245|  3.81M|    {
  246|       |        // Write to the end of the buffer
  247|  3.81M|        vch.insert(vch.end(), src.begin(), src.end());
  248|  3.81M|    }
_ZNK10DataStream4sizeEv:
  198|    324|    size_type size() const                           { return vch.size() - m_read_pos; }
_ZN10DataStream5clearEv:
  204|  2.06M|    void clear()                                     { vch.clear(); m_read_pos = 0; }
_ZN10DataStreamC2Ev:
  182|  2.04M|    explicit DataStream() = default;
_ZN10DataStreamlsIhEERS_RKT_:
  252|  1.27M|    {
  253|  1.27M|        ::Serialize(*this, obj);
  254|  1.27M|        return (*this);
  255|  1.27M|    }
_ZN10DataStream4readENSt3__14spanISt4byteLm18446744073709551615EEE:
  212|  6.35M|    {
  213|  6.35M|        if (dst.size() == 0) return;
  ------------------
  |  Branch (213:13): [True: 0, False: 6.35M]
  ------------------
  214|       |
  215|       |        // Read from the beginning of the buffer
  216|  6.35M|        auto next_read_pos{CheckedAdd(m_read_pos, dst.size())};
  217|  6.35M|        if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
  ------------------
  |  Branch (217:13): [True: 0, False: 6.35M]
  |  Branch (217:43): [True: 1.19k, False: 6.35M]
  ------------------
  218|  1.19k|            throw std::ios_base::failure("DataStream::read(): end of data");
  219|  1.19k|        }
  220|  6.35M|        memcpy(dst.data(), &vch[m_read_pos], dst.size());
  221|  6.35M|        if (next_read_pos.value() == vch.size()) {
  ------------------
  |  Branch (221:13): [True: 1.27M, False: 5.07M]
  ------------------
  222|       |            // If fully consumed, reset to empty state.
  223|  1.27M|            clear();
  224|  1.27M|            return;
  225|  1.27M|        }
  226|  5.07M|        m_read_pos = next_read_pos.value();
  227|  5.07M|    }
_ZN10DataStream6ignoreEm:
  230|   178k|    {
  231|       |        // Ignore from the beginning of the buffer
  232|   178k|        auto next_read_pos{CheckedAdd(m_read_pos, num_ignore)};
  233|   178k|        if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
  ------------------
  |  Branch (233:13): [True: 0, False: 178k]
  |  Branch (233:43): [True: 56, False: 178k]
  ------------------
  234|     56|            throw std::ios_base::failure("DataStream::ignore(): end of data");
  235|     56|        }
  236|   178k|        if (next_read_pos.value() == vch.size()) {
  ------------------
  |  Branch (236:13): [True: 9, False: 178k]
  ------------------
  237|       |            // If all bytes are ignored, reset to empty state.
  238|      9|            clear();
  239|      9|            return;
  240|      9|        }
  241|   178k|        m_read_pos = next_read_pos.value();
  242|   178k|    }

_ZN12PoolResourceILm152ELm8EED2Ev:
  207|      4|    {
  208|      4|        for (std::byte* chunk : m_allocated_chunks) {
  ------------------
  |  Branch (208:31): [True: 4, False: 4]
  ------------------
  209|      4|            std::destroy(chunk, chunk + m_chunk_size_bytes);
  210|      4|            ::operator delete ((void*)chunk, std::align_val_t{ELEM_ALIGN_BYTES});
  211|      4|            ASAN_UNPOISON_MEMORY_REGION(chunk, m_chunk_size_bytes);
  ------------------
  |  |  144|      4|#   define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
  ------------------
  212|      4|        }
  213|      4|    }

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

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

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

_ZN5ArenaC2EPvmm:
   40|      1|    base(base_in), end(static_cast<char*>(base_in) + size_in), alignment(alignment_in)
   41|      1|{
   42|       |    // Start with one free chunk that covers the entire arena
   43|      1|    auto it = size_to_free_chunk.emplace(size_in, base);
   44|      1|    chunks_free.emplace(base, it);
   45|      1|    chunks_free_end.emplace(static_cast<char*>(base) + size_in, it);
   46|      1|}
_ZN5ArenaD2Ev:
   48|      3|Arena::~Arena() = default;
_ZN5Arena5allocEm:
   51|   552k|{
   52|       |    // Round to next multiple of alignment
   53|   552k|    size = align_up(size, alignment);
   54|       |
   55|       |    // Don't handle zero-sized chunks
   56|   552k|    if (size == 0)
  ------------------
  |  Branch (56:9): [True: 0, False: 552k]
  ------------------
   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|   552k|    auto size_ptr_it = size_to_free_chunk.lower_bound(size);
   64|   552k|    if (size_ptr_it == size_to_free_chunk.end())
  ------------------
  |  Branch (64:9): [True: 39.1k, False: 512k]
  ------------------
   65|  39.1k|        return nullptr;
   66|       |
   67|       |    // Create the used-chunk, taking its space from the end of the free-chunk
   68|   512k|    const size_t size_remaining = size_ptr_it->first - size;
   69|   512k|    char* const free_chunk = static_cast<char*>(size_ptr_it->second);
   70|   512k|    auto allocated = chunks_used.emplace(free_chunk + size_remaining, size).first;
   71|   512k|    chunks_free_end.erase(free_chunk + size_ptr_it->first);
   72|   512k|    if (size_ptr_it->first == size) {
  ------------------
  |  Branch (72:9): [True: 257k, False: 255k]
  ------------------
   73|       |        // whole chunk is used up
   74|   257k|        chunks_free.erase(size_ptr_it->second);
   75|   257k|    } else {
   76|       |        // still some memory left in the chunk
   77|   255k|        auto it_remaining = size_to_free_chunk.emplace(size_remaining, size_ptr_it->second);
   78|   255k|        chunks_free[size_ptr_it->second] = it_remaining;
   79|   255k|        chunks_free_end.emplace(free_chunk + size_remaining, it_remaining);
   80|   255k|    }
   81|   512k|    size_to_free_chunk.erase(size_ptr_it);
   82|       |
   83|   512k|    return allocated->first;
   84|   552k|}
_ZN5Arena4freeEPv:
   87|   512k|{
   88|       |    // Freeing the nullptr pointer is OK.
   89|   512k|    if (ptr == nullptr) {
  ------------------
  |  Branch (89:9): [True: 0, False: 512k]
  ------------------
   90|      0|        return;
   91|      0|    }
   92|       |
   93|       |    // Remove chunk from used map
   94|   512k|    auto i = chunks_used.find(ptr);
   95|   512k|    if (i == chunks_used.end()) {
  ------------------
  |  Branch (95:9): [True: 0, False: 512k]
  ------------------
   96|      0|        throw std::runtime_error("Arena: invalid or double free");
   97|      0|    }
   98|   512k|    auto freed = std::make_pair(static_cast<char*>(i->first), i->second);
   99|   512k|    chunks_used.erase(i);
  100|       |
  101|       |    // coalesce freed with previous chunk
  102|   512k|    auto prev = chunks_free_end.find(freed.first);
  103|   512k|    if (prev != chunks_free_end.end()) {
  ------------------
  |  Branch (103:9): [True: 8.49k, False: 504k]
  ------------------
  104|  8.49k|        freed.first -= prev->second->first;
  105|  8.49k|        freed.second += prev->second->first;
  106|  8.49k|        size_to_free_chunk.erase(prev->second);
  107|  8.49k|        chunks_free_end.erase(prev);
  108|  8.49k|    }
  109|       |
  110|       |    // coalesce freed with chunk after freed
  111|   512k|    auto next = chunks_free.find(freed.first + freed.second);
  112|   512k|    if (next != chunks_free.end()) {
  ------------------
  |  Branch (112:9): [True: 247k, False: 265k]
  ------------------
  113|   247k|        freed.second += next->second->first;
  114|   247k|        size_to_free_chunk.erase(next->second);
  115|   247k|        chunks_free.erase(next);
  116|   247k|    }
  117|       |
  118|       |    // Add/set space with coalesced free chunk
  119|   512k|    auto it = size_to_free_chunk.emplace(freed.second, freed.first);
  120|   512k|    chunks_free[freed.first] = it;
  121|   512k|    chunks_free_end[freed.first + freed.second] = it;
  122|   512k|}
_ZN24PosixLockedPageAllocator14AllocateLockedEmPb:
  236|      1|{
  237|      1|    void *addr;
  238|      1|    len = align_up(len, page_size);
  239|      1|    addr = mmap(nullptr, len, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
  240|      1|    if (addr == MAP_FAILED) {
  ------------------
  |  Branch (240:9): [True: 0, False: 1]
  ------------------
  241|      0|        return nullptr;
  242|      0|    }
  243|      1|    if (addr) {
  ------------------
  |  Branch (243:9): [True: 1, False: 0]
  ------------------
  244|      1|        *lockingSuccess = mlock(addr, len) == 0;
  245|      1|#if defined(MADV_DONTDUMP) // Linux
  246|      1|        madvise(addr, len, MADV_DONTDUMP);
  247|       |#elif defined(MADV_NOCORE) // FreeBSD
  248|       |        madvise(addr, len, MADV_NOCORE);
  249|       |#endif
  250|      1|    }
  251|      1|    return addr;
  252|      1|}
_ZN24PosixLockedPageAllocator10FreeLockedEPvm:
  254|      3|{
  255|      3|    len = align_up(len, page_size);
  256|      3|    memory_cleanse(addr, len);
  257|      3|    munlock(addr, len);
  258|      3|    munmap(addr, len);
  259|      3|}
_ZN10LockedPoolD2Ev:
  283|      2|LockedPool::~LockedPool() = default;
_ZN10LockedPool5allocEm:
  286|   512k|{
  287|   512k|    std::lock_guard<std::mutex> lock(mutex);
  288|       |
  289|       |    // Don't handle impossible sizes
  290|   512k|    if (size == 0 || size > ARENA_SIZE)
  ------------------
  |  Branch (290:9): [True: 0, False: 512k]
  |  Branch (290:22): [True: 0, False: 512k]
  ------------------
  291|      0|        return nullptr;
  292|       |
  293|       |    // Try allocating from each current arena
  294|   552k|    for (auto &arena: arenas) {
  ------------------
  |  Branch (294:21): [True: 552k, False: 1]
  ------------------
  295|   552k|        void *addr = arena.alloc(size);
  296|   552k|        if (addr) {
  ------------------
  |  Branch (296:13): [True: 512k, False: 39.1k]
  ------------------
  297|   512k|            return addr;
  298|   512k|        }
  299|   552k|    }
  300|       |    // If that fails, create a new one
  301|      1|    if (new_arena(ARENA_SIZE, ARENA_ALIGN)) {
  ------------------
  |  Branch (301:9): [True: 1, False: 0]
  ------------------
  302|      1|        return arenas.back().alloc(size);
  303|      1|    }
  304|      0|    return nullptr;
  305|      1|}
_ZN10LockedPool4freeEPv:
  308|   512k|{
  309|   512k|    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|   552k|    for (auto &arena: arenas) {
  ------------------
  |  Branch (312:21): [True: 552k, False: 0]
  ------------------
  313|   552k|        if (arena.addressInArena(ptr)) {
  ------------------
  |  Branch (313:13): [True: 512k, False: 39.1k]
  ------------------
  314|   512k|            arena.free(ptr);
  315|   512k|            return;
  316|   512k|        }
  317|   552k|    }
  318|      0|    throw std::runtime_error("LockedPool: invalid address not pointing to any arena");
  319|   512k|}
_ZN10LockedPool9new_arenaEmm:
  337|      1|{
  338|      1|    bool locked;
  339|       |    // If this is the first arena, handle this specially: Cap the upper size
  340|       |    // by the process limit. This makes sure that the first arena will at least
  341|       |    // be locked. An exception to this is if the process limit is 0:
  342|       |    // in this case no memory can be locked at all so we'll skip past this logic.
  343|      1|    if (arenas.empty()) {
  ------------------
  |  Branch (343:9): [True: 0, False: 1]
  ------------------
  344|      0|        size_t limit = allocator->GetLimit();
  345|      0|        if (limit > 0) {
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            size = std::min(size, limit);
  347|      0|        }
  348|      0|    }
  349|      1|    void *addr = allocator->AllocateLocked(size, &locked);
  350|      1|    if (!addr) {
  ------------------
  |  Branch (350:9): [True: 0, False: 1]
  ------------------
  351|      0|        return false;
  352|      0|    }
  353|      1|    if (locked) {
  ------------------
  |  Branch (353:9): [True: 1, False: 0]
  ------------------
  354|      1|        cumulative_bytes_locked += size;
  355|      1|    } else if (lf_cb) { // Call the locking-failed callback if locking failed
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|        if (!lf_cb()) { // If the callback returns false, free the memory and fail, otherwise consider the user warned and proceed.
  ------------------
  |  Branch (356:13): [True: 0, False: 0]
  ------------------
  357|      0|            allocator->FreeLocked(addr, size);
  358|      0|            return false;
  359|      0|        }
  360|      0|    }
  361|      1|    arenas.emplace_back(allocator.get(), addr, size, align);
  362|      1|    return true;
  363|      1|}
_ZN10LockedPool15LockedPageArenaC2EP19LockedPageAllocatorPvmm:
  366|      1|    Arena(base_in, size_in, align_in), base(base_in), size(size_in), allocator(allocator_in)
  367|      1|{
  368|      1|}
_ZN10LockedPool15LockedPageArenaD2Ev:
  370|      3|{
  371|      3|    allocator->FreeLocked(base, size);
  372|      3|}
_ZN17LockedPoolManager8InstanceEv:
  405|  1.02M|{
  406|  1.02M|    static std::once_flag init_flag;
  407|  1.02M|    std::call_once(init_flag, LockedPoolManager::CreateInstance);
  408|  1.02M|    return *LockedPoolManager::_instance;
  409|  1.02M|}
lockedpool.cpp:_ZL8align_upmm:
   32|   552k|{
   33|   552k|    return (x + align - 1) & ~(align - 1);
   34|   552k|}

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

_ZZN20AddrManDeterministicC1ERK15NetGroupManagerR18FuzzedDataProvideriENKUlvE_clEv:
  299|  12.9k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|  12.9k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  12.9k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  12.9k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  12.9k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_ZZN10CScheduler4stopEvENKUlvE_clEv:
  299|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_ZZNK11V1Transport23ReceivedMessageCompleteEvENKUlvE_clEv:
  299|    963|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|    963|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    963|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    963|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    963|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net.cpp:_ZZN8CConnman22SocketHandlerConnectedERKNSt3__16vectorIP5CNodeNS0_9allocatorIS3_EEEERKNS0_13unordered_mapINS0_10shared_ptrIK4SockEENSB_6EventsENSB_17HashSharedPtrSockENSB_18EqualSharedPtrSockENS4_INS0_4pairIKSD_SE_EEEEEEENK3$_0clEv:
  299|  4.17k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|  4.17k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.17k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.17k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.17k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net.cpp:_ZZN8CConnman9StopNodesEvENK3$_0clEv:
  299|  9.89k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net.cpp:_ZZN8CConnman9StopNodesEvENK3$_1clEv:
  299|  9.89k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_Z22AssertLockHeldInternalI14AnnotatedMixinINSt3__15mutexEEEvPKcS5_iPT_:
   71|   154M|inline void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) EXCLUSIVE_LOCKS_REQUIRED(cs) {}
_Z17MaybeCheckNotHeldI11GlobalMutexERT_S2_:
  264|  25.8k|inline MutexType& MaybeCheckNotHeld(MutexType& m) LOCKS_EXCLUDED(m) LOCK_RETURNED(m) { return m; }
_ZN10UniqueLockI11GlobalMutexEC2ERS0_PKcS4_ib:
  181|  25.8k|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  182|  25.8k|    {
  183|  25.8k|        if (fTry)
  ------------------
  |  Branch (183:13): [True: 0, False: 25.8k]
  ------------------
  184|      0|            TryEnter(pszName, pszFile, nLine);
  185|  25.8k|        else
  186|  25.8k|            Enter(pszName, pszFile, nLine);
  187|  25.8k|    }
_ZN10UniqueLockI11GlobalMutexE5EnterEPKcS3_i:
  159|  25.8k|    {
  160|  25.8k|        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|  25.8k|        Base::lock();
  167|  25.8k|#endif
  168|  25.8k|    }
_ZN10UniqueLockI11GlobalMutexED2Ev:
  201|  25.8k|    {
  202|  25.8k|        if (Base::owns_lock())
  ------------------
  |  Branch (202:13): [True: 25.8k, False: 0]
  ------------------
  203|  25.8k|            LeaveCritical();
  204|  25.8k|    }
_ZN14AnnotatedMixinINSt3__115recursive_mutexEED2Ev:
   96|      4|    ~AnnotatedMixin() {
   97|      4|        DeleteLock((void*)this);
   98|      4|    }
_Z23AssertLockNotHeldInlinePKcS0_iP14AnnotatedMixinINSt3__15mutexEE:
  146|  5.05M|inline void AssertLockNotHeldInline(const char* name, const char* file, int line, Mutex* cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) { AssertLockNotHeldInternal(name, file, line, cs); }
_Z25AssertLockNotHeldInternalI14AnnotatedMixinINSt3__15mutexEEEvPKcS5_iPT_:
   73|  5.05M|void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) LOCKS_EXCLUDED(cs) {}
_ZZN11CCheckQueueI12CScriptCheckNSt3__14pairI13ScriptError_tNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEED1EvENKUlvE_clEv:
  299|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_Z17MaybeCheckNotHeldI14AnnotatedMixinINSt3__115recursive_mutexEEERT_S5_:
  264|      2|inline MutexType& MaybeCheckNotHeld(MutexType& m) LOCKS_EXCLUDED(m) LOCK_RETURNED(m) { return m; }
_Z13EnterCriticalINSt3__115recursive_mutexEEvPKcS3_iPT_b:
   67|      2|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEE5EnterEPKcS6_i:
  159|      2|    {
  160|      2|        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|      2|        Base::lock();
  167|      2|#endif
  168|      2|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEEC2ERS3_PKcS7_ib:
  181|      2|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  182|      2|    {
  183|      2|        if (fTry)
  ------------------
  |  Branch (183:13): [True: 0, False: 2]
  ------------------
  184|      0|            TryEnter(pszName, pszFile, nLine);
  185|      2|        else
  186|      2|            Enter(pszName, pszFile, nLine);
  187|      2|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEED2Ev:
  201|      2|    {
  202|      2|        if (Base::owns_lock())
  ------------------
  |  Branch (202:13): [True: 2, False: 0]
  ------------------
  203|      2|            LeaveCritical();
  204|      2|    }
_ZN14AnnotatedMixinINSt3__15mutexEED2Ev:
   96|  3.71M|    ~AnnotatedMixin() {
   97|  3.71M|        DeleteLock((void*)this);
   98|  3.71M|    }
_Z10DeleteLockPv:
   74|  3.71M|inline void DeleteLock(void* cs) {}
_Z17MaybeCheckNotHeldR14AnnotatedMixinINSt3__15mutexEE:
  258|  13.2M|inline Mutex& MaybeCheckNotHeld(Mutex& cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) LOCK_RETURNED(cs) { return cs; }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEEC2ERS3_PKcS7_ib:
  181|  13.1M|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  182|  13.1M|    {
  183|  13.1M|        if (fTry)
  ------------------
  |  Branch (183:13): [True: 0, False: 13.1M]
  ------------------
  184|      0|            TryEnter(pszName, pszFile, nLine);
  185|  13.1M|        else
  186|  13.1M|            Enter(pszName, pszFile, nLine);
  187|  13.1M|    }
_Z13EnterCriticalINSt3__15mutexEEvPKcS3_iPT_b:
   67|  13.2M|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_Z13LeaveCriticalv:
   68|  13.2M|inline void LeaveCritical() {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEE5EnterEPKcS6_i:
  159|  13.1M|    {
  160|  13.1M|        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|  13.1M|        Base::lock();
  167|  13.1M|#endif
  168|  13.1M|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEED2Ev:
  201|  13.1M|    {
  202|  13.1M|        if (Base::owns_lock())
  ------------------
  |  Branch (202:13): [True: 13.1M, False: 0]
  ------------------
  203|  13.1M|            LeaveCritical();
  204|  13.1M|    }

_ZN18FuzzedDataProvider16PickValueInArrayI19ConnectionDirectionEET_St16initializer_listIKS2_E:
  316|  14.1k|T FuzzedDataProvider::PickValueInArray(std::initializer_list<const T> list) {
  317|  14.1k|  if (!list.size())
  ------------------
  |  Branch (317:7): [True: 0, False: 14.1k]
  ------------------
  318|      0|    abort();
  319|       |
  320|  14.1k|  return *(list.begin() + ConsumeIntegralInRange<size_t>(0, list.size() - 1));
  321|  14.1k|}
_ZN18FuzzedDataProvider16PickValueInArrayI14ConnectionTypeLm7EEET_RAT0__KS2_:
  304|   116k|T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
  305|   116k|  static_assert(size > 0, "The array must be non empty.");
  306|   116k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  307|   116k|}
_ZN18FuzzedDataProvider16PickValueInArrayI18NetPermissionFlagsLm10EEET_RAT0__KS2_:
  304|   439k|T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
  305|   439k|  static_assert(size > 0, "The array must be non empty.");
  306|   439k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  307|   439k|}
_ZN18FuzzedDataProvider15ConsumeIntegralItEET_v:
  195|  1.19M|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  1.19M|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  1.19M|                                std::numeric_limits<T>::max());
  198|  1.19M|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeItEET_S1_S1_:
  205|  1.20M|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  1.20M|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  1.20M|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  1.20M|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 1.20M]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  1.20M|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  1.20M|  uint64_t result = 0;
  215|  1.20M|  size_t offset = 0;
  216|       |
  217|  3.58M|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 2.39M, False: 1.19M]
  |  Branch (217:43): [True: 2.39M, False: 0]
  ------------------
  218|  2.39M|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 2.38M, False: 10.1k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  2.38M|    --remaining_bytes_;
  226|  2.38M|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  2.38M|    offset += CHAR_BIT;
  228|  2.38M|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  1.20M|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 1.20M, False: 0]
  ------------------
  232|  1.20M|    result = result % (range + 1);
  233|       |
  234|  1.20M|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  1.20M|}
_ZN18FuzzedDataProvider15ConsumeIntegralImEET_v:
  195|   314k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|   314k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|   314k|                                std::numeric_limits<T>::max());
  198|   314k|}
_ZN18FuzzedDataProvider15ConsumeIntegralIjEET_v:
  195|   993k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|   993k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|   993k|                                std::numeric_limits<T>::max());
  198|   993k|}
_ZN18FuzzedDataProviderC2EPKhm:
   37|  9.89k|      : data_ptr_(data), remaining_bytes_(size) {}
_ZN18FuzzedDataProvider11ConsumeBoolEv:
  289|  5.66M|inline bool FuzzedDataProvider::ConsumeBool() {
  290|  5.66M|  return 1 & ConsumeIntegral<uint8_t>();
  291|  5.66M|}
_ZN18FuzzedDataProvider15ConsumeIntegralIhEET_v:
  195|  5.76M|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  5.76M|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  5.76M|                                std::numeric_limits<T>::max());
  198|  5.76M|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIhEET_S1_S1_:
  205|  5.76M|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  5.76M|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  5.76M|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  5.76M|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 5.76M]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  5.76M|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  5.76M|  uint64_t result = 0;
  215|  5.76M|  size_t offset = 0;
  216|       |
  217|  11.4M|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 5.76M, False: 5.69M]
  |  Branch (217:43): [True: 5.76M, False: 0]
  ------------------
  218|  5.76M|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 5.69M, False: 70.0k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  5.69M|    --remaining_bytes_;
  226|  5.69M|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  5.69M|    offset += CHAR_BIT;
  228|  5.69M|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  5.76M|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 5.76M, False: 0]
  ------------------
  232|  5.76M|    result = result % (range + 1);
  233|       |
  234|  5.76M|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  5.76M|}
_ZN18FuzzedDataProvider20ConsumeBytesAsStringEm:
  137|  72.9k|inline std::string FuzzedDataProvider::ConsumeBytesAsString(size_t num_bytes) {
  138|  72.9k|  static_assert(sizeof(std::string::value_type) == sizeof(uint8_t),
  139|  72.9k|                "ConsumeBytesAsString cannot convert the data to a string.");
  140|       |
  141|  72.9k|  num_bytes = std::min(num_bytes, remaining_bytes_);
  142|  72.9k|  std::string result(
  143|  72.9k|      reinterpret_cast<const std::string::value_type *>(data_ptr_), num_bytes);
  144|  72.9k|  Advance(num_bytes);
  145|  72.9k|  return result;
  146|  72.9k|}
_ZN18FuzzedDataProvider16PickValueInArrayI12ServiceFlagsLm7EEET_RAT0__KS2_:
  304|   811k|T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
  305|   811k|  static_assert(size > 0, "The array must be non empty.");
  306|   811k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  307|   811k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm18EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|  1.04k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|  1.04k|  static_assert(size > 0, "The array must be non empty.");
  312|  1.04k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|  1.04k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm10EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|  1.34k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|  1.34k|  static_assert(size > 0, "The array must be non empty.");
  312|  1.34k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|  1.34k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm8EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|  2.59k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|  2.59k|  static_assert(size > 0, "The array must be non empty.");
  312|  2.59k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|  2.59k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm4EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|  14.0k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|  14.0k|  static_assert(size > 0, "The array must be non empty.");
  312|  14.0k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|  14.0k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm3EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|  6.43k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|  6.43k|  static_assert(size > 0, "The array must be non empty.");
  312|  6.43k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|  6.43k|}
_ZN18FuzzedDataProvider12ConsumeBytesISt4byteEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEm:
  109|  2.55k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
  110|  2.55k|  num_bytes = std::min(num_bytes, remaining_bytes_);
  111|  2.55k|  return ConsumeBytes<T>(num_bytes, num_bytes);
  112|  2.55k|}
_ZN18FuzzedDataProvider12ConsumeBytesISt4byteEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEmm:
  352|  2.55k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
  353|  2.55k|  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.55k|  std::vector<T> result(size);
  362|  2.55k|  if (size == 0) {
  ------------------
  |  Branch (362:7): [True: 692, False: 1.86k]
  ------------------
  363|    692|    if (num_bytes != 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 692]
  ------------------
  364|      0|      abort();
  365|    692|    return result;
  366|    692|  }
  367|       |
  368|  1.86k|  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|  1.86k|  result.shrink_to_fit();
  374|  1.86k|  return result;
  375|  2.55k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm2EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|   364k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|   364k|  static_assert(size > 0, "The array must be non empty.");
  312|   364k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|   364k|}
_ZN18FuzzedDataProvider25ConsumeRandomLengthStringEm:
  153|   422k|FuzzedDataProvider::ConsumeRandomLengthString(size_t max_length) {
  154|       |  // Reads bytes from the start of |data_ptr_|. Maps "\\" to "\", and maps "\"
  155|       |  // followed by anything else to the end of the string. As a result of this
  156|       |  // logic, a fuzzer can insert characters into the string, and the string
  157|       |  // will be lengthened to include those new characters, resulting in a more
  158|       |  // stable fuzzer than picking the length of a string independently from
  159|       |  // picking its contents.
  160|   422k|  std::string result;
  161|       |
  162|       |  // Reserve the anticipated capacity to prevent several reallocations.
  163|   422k|  result.reserve(std::min(max_length, remaining_bytes_));
  164|  53.5M|  for (size_t i = 0; i < max_length && remaining_bytes_ != 0; ++i) {
  ------------------
  |  Branch (164:22): [True: 53.5M, False: 67.3k]
  |  Branch (164:40): [True: 53.4M, False: 10.4k]
  ------------------
  165|  53.4M|    char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
  166|  53.4M|    Advance(1);
  167|  53.4M|    if (next == '\\' && remaining_bytes_ != 0) {
  ------------------
  |  Branch (167:9): [True: 367k, False: 53.1M]
  |  Branch (167:25): [True: 367k, False: 27]
  ------------------
  168|   367k|      next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
  169|   367k|      Advance(1);
  170|   367k|      if (next != '\\')
  ------------------
  |  Branch (170:11): [True: 344k, False: 22.4k]
  ------------------
  171|   344k|        break;
  172|   367k|    }
  173|  53.1M|    result += next;
  174|  53.1M|  }
  175|       |
  176|   422k|  result.shrink_to_fit();
  177|   422k|  return result;
  178|   422k|}
_ZN18FuzzedDataProvider25ConsumeRandomLengthStringEv:
  181|   152k|inline std::string FuzzedDataProvider::ConsumeRandomLengthString() {
  182|   152k|  return ConsumeRandomLengthString(remaining_bytes_);
  183|   152k|}
_ZN18FuzzedDataProvider14CopyAndAdvanceEPvm:
  338|  1.27M|                                               size_t num_bytes) {
  339|  1.27M|  std::memcpy(destination, data_ptr_, num_bytes);
  340|  1.27M|  Advance(num_bytes);
  341|  1.27M|}
_ZN18FuzzedDataProvider7AdvanceEm:
  343|  55.2M|inline void FuzzedDataProvider::Advance(size_t num_bytes) {
  344|  55.2M|  if (num_bytes > remaining_bytes_)
  ------------------
  |  Branch (344:7): [True: 0, False: 55.2M]
  ------------------
  345|      0|    abort();
  346|       |
  347|  55.2M|  data_ptr_ += num_bytes;
  348|  55.2M|  remaining_bytes_ -= num_bytes;
  349|  55.2M|}
_ZN18FuzzedDataProvider23ConvertUnsignedToSignedIchEET_T0_:
  378|  53.8M|TS FuzzedDataProvider::ConvertUnsignedToSigned(TU value) {
  379|  53.8M|  static_assert(sizeof(TS) == sizeof(TU), "Incompatible data types.");
  380|  53.8M|  static_assert(!std::numeric_limits<TU>::is_signed,
  381|  53.8M|                "Source type must be unsigned.");
  382|       |
  383|       |  if constexpr (std::numeric_limits<TS>::is_modulo)
  384|       |    return static_cast<TS>(value);
  385|       |
  386|       |  // Avoid using implementation-defined unsigned to signed conversions.
  387|       |  // To learn more, see https://stackoverflow.com/questions/13150449.
  388|  53.8M|  constexpr auto TS_max = static_cast<TU>(std::numeric_limits<TS>::max());
  389|  53.8M|  if (value <= TS_max) {
  ------------------
  |  Branch (389:7): [True: 46.8M, False: 7.03M]
  ------------------
  390|  46.8M|    return static_cast<TS>(value);
  391|  46.8M|  } else {
  392|  7.03M|    constexpr auto TS_min = std::numeric_limits<TS>::min();
  393|  7.03M|    return TS_min + static_cast<TS>(value - TS_min);
  394|  7.03M|  }
  395|  53.8M|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeImEET_S1_S1_:
  205|  5.20M|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  5.20M|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  5.20M|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  5.20M|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 5.20M]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  5.20M|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  5.20M|  uint64_t result = 0;
  215|  5.20M|  size_t offset = 0;
  216|       |
  217|  12.3M|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 12.0M, False: 283k]
  |  Branch (217:43): [True: 7.19M, False: 4.87M]
  ------------------
  218|  7.19M|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 7.14M, False: 50.4k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  7.14M|    --remaining_bytes_;
  226|  7.14M|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  7.14M|    offset += CHAR_BIT;
  228|  7.14M|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  5.20M|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 4.89M, False: 314k]
  ------------------
  232|  4.89M|    result = result % (range + 1);
  233|       |
  234|  5.20M|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  5.20M|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIjEET_S1_S1_:
  205|  1.44M|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  1.44M|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  1.44M|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  1.44M|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 1.44M]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  1.44M|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  1.44M|  uint64_t result = 0;
  215|  1.44M|  size_t offset = 0;
  216|       |
  217|  5.80M|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 4.82M, False: 979k]
  |  Branch (217:43): [True: 4.38M, False: 441k]
  ------------------
  218|  4.38M|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 4.36M, False: 19.4k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  4.36M|    --remaining_bytes_;
  226|  4.36M|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  4.36M|    offset += CHAR_BIT;
  228|  4.36M|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  1.44M|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 1.44M, False: 0]
  ------------------
  232|  1.44M|    result = result % (range + 1);
  233|       |
  234|  1.44M|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  1.44M|}
_ZN18FuzzedDataProvider15ConsumeIntegralIlEET_v:
  195|  11.8k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  11.8k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  11.8k|                                std::numeric_limits<T>::max());
  198|  11.8k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIlEET_S1_S1_:
  205|  76.0k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  76.0k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  76.0k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  76.0k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 76.0k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  76.0k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  76.0k|  uint64_t result = 0;
  215|  76.0k|  size_t offset = 0;
  216|       |
  217|   613k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 546k, False: 66.2k]
  |  Branch (217:43): [True: 540k, False: 6.22k]
  ------------------
  218|   540k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 537k, False: 3.50k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|   537k|    --remaining_bytes_;
  226|   537k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|   537k|    offset += CHAR_BIT;
  228|   537k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  76.0k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 64.1k, False: 11.8k]
  ------------------
  232|  64.1k|    result = result % (range + 1);
  233|       |
  234|  76.0k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  76.0k|}
_ZN18FuzzedDataProvider12ConsumeBytesIhEENSt3__16vectorIT_NS1_9allocatorIS3_EEEEm:
  109|  1.28M|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
  110|  1.28M|  num_bytes = std::min(num_bytes, remaining_bytes_);
  111|  1.28M|  return ConsumeBytes<T>(num_bytes, num_bytes);
  112|  1.28M|}
_ZN18FuzzedDataProvider12ConsumeBytesIhEENSt3__16vectorIT_NS1_9allocatorIS3_EEEEmm:
  352|  1.28M|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
  353|  1.28M|  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|  1.28M|  std::vector<T> result(size);
  362|  1.28M|  if (size == 0) {
  ------------------
  |  Branch (362:7): [True: 10.7k, False: 1.27M]
  ------------------
  363|  10.7k|    if (num_bytes != 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 10.7k]
  ------------------
  364|      0|      abort();
  365|  10.7k|    return result;
  366|  10.7k|  }
  367|       |
  368|  1.27M|  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|  1.27M|  result.shrink_to_fit();
  374|  1.27M|  return result;
  375|  1.28M|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIiEET_S1_S1_:
  205|  9.89k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  9.89k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  9.89k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  9.89k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 9.89k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  9.89k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  9.89k|  uint64_t result = 0;
  215|  9.89k|  size_t offset = 0;
  216|       |
  217|  23.5k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 23.5k, False: 0]
  |  Branch (217:43): [True: 16.7k, False: 6.84k]
  ------------------
  218|  16.7k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 13.6k, False: 3.05k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  13.6k|    --remaining_bytes_;
  226|  13.6k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  13.6k|    offset += CHAR_BIT;
  228|  13.6k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  9.89k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 9.89k, False: 0]
  ------------------
  232|  9.89k|    result = result % (range + 1);
  233|       |
  234|  9.89k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  9.89k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIKmEET_S2_S2_:
  205|  18.5k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  18.5k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  18.5k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  18.5k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 18.5k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  18.5k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  18.5k|  uint64_t result = 0;
  215|  18.5k|  size_t offset = 0;
  216|       |
  217|  34.5k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 34.5k, False: 0]
  |  Branch (217:43): [True: 16.0k, False: 18.5k]
  ------------------
  218|  16.0k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 16.0k, False: 5]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  16.0k|    --remaining_bytes_;
  226|  16.0k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  16.0k|    offset += CHAR_BIT;
  228|  16.0k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  18.5k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 18.5k, False: 0]
  ------------------
  232|  18.5k|    result = result % (range + 1);
  233|       |
  234|  18.5k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  18.5k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIxEET_S1_S1_:
  205|  13.1k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  13.1k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  13.1k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  13.1k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 13.1k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  13.1k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  13.1k|  uint64_t result = 0;
  215|  13.1k|  size_t offset = 0;
  216|       |
  217|  65.7k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 65.7k, False: 0]
  |  Branch (217:43): [True: 52.6k, False: 13.1k]
  ------------------
  218|  52.6k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 52.6k, False: 42]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  52.6k|    --remaining_bytes_;
  226|  52.6k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  52.6k|    offset += CHAR_BIT;
  228|  52.6k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  13.1k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 13.1k, False: 0]
  ------------------
  232|  13.1k|    result = result % (range + 1);
  233|       |
  234|  13.1k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  13.1k|}

_Z19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   41|  9.89k|{
   42|  9.89k|    SeedRandomStateForTest(SeedRand::ZEROS);
   43|  9.89k|    FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
   44|  9.89k|    FakeNodeClock clock{ConsumeTime(fuzzed_data_provider)};
   45|  9.89k|    FakeSteadyClock steady_clock;
   46|  9.89k|    auto netgroupman{ConsumeNetGroupManager(fuzzed_data_provider)};
   47|  9.89k|    auto addr_man_ptr{std::make_unique<AddrManDeterministic>(netgroupman, fuzzed_data_provider, GetCheckRatio())};
   48|  9.89k|    if (fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (48:9): [True: 4.23k, False: 5.65k]
  ------------------
   49|  4.23k|        const std::vector<uint8_t> serialized_data{ConsumeRandomLengthByteVector(fuzzed_data_provider)};
   50|  4.23k|        DataStream ds{serialized_data};
   51|  4.23k|        try {
   52|  4.23k|            ds >> *addr_man_ptr;
   53|  4.23k|        } catch (const std::ios_base::failure&) {
   54|  3.08k|            addr_man_ptr = std::make_unique<AddrManDeterministic>(netgroupman, fuzzed_data_provider, GetCheckRatio());
   55|  3.08k|        }
   56|  4.23k|    }
   57|  9.89k|    AddrManDeterministic& addr_man{*addr_man_ptr};
   58|  9.89k|    auto net_events{ConsumeNetEvents(fuzzed_data_provider)};
   59|       |
   60|       |    // Mock CreateSock() to create FuzzedSock.
   61|  9.89k|    auto CreateSockOrig = CreateSock;
   62|  9.89k|    CreateSock = [&fuzzed_data_provider, &steady_clock](int, int, int) {
   63|  9.89k|        return std::make_unique<FuzzedSock>(fuzzed_data_provider, steady_clock);
   64|  9.89k|    };
   65|       |
   66|       |    // Mock g_dns_lookup() to return a fuzzed address.
   67|  9.89k|    auto g_dns_lookup_orig = g_dns_lookup;
   68|  9.89k|    g_dns_lookup = [&fuzzed_data_provider](const std::string&, bool) {
   69|  9.89k|        return std::vector<CNetAddr>{ConsumeNetAddr(fuzzed_data_provider)};
   70|  9.89k|    };
   71|       |
   72|  9.89k|    ConnmanTestMsg connman{fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
   73|  9.89k|                     fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
   74|  9.89k|                     addr_man,
   75|  9.89k|                     netgroupman,
   76|  9.89k|                     Params(),
   77|  9.89k|                     fuzzed_data_provider.ConsumeBool(),
   78|  9.89k|                     ConsumeThreadInterrupt(fuzzed_data_provider)};
   79|       |
   80|  9.89k|    const uint64_t max_outbound_limit{fuzzed_data_provider.ConsumeIntegral<uint64_t>()};
   81|  9.89k|    CConnman::Options options;
   82|  9.89k|    options.m_msgproc = &net_events;
   83|  9.89k|    options.nMaxOutboundLimit = max_outbound_limit;
   84|       |
   85|  9.89k|    const auto local_services{ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS)};
   86|  9.89k|    options.m_local_services = local_services;
   87|       |
   88|  9.89k|    const auto use_addrman_outgoing{fuzzed_data_provider.ConsumeBool()};
   89|  9.89k|    options.m_use_addrman_outgoing = use_addrman_outgoing;
   90|  9.89k|    options.m_max_automatic_connections = fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 1000);
   91|       |
   92|  9.89k|    auto consume_whitelist = [&]() {
   93|  9.89k|        std::vector<NetWhitelistPermissions> result(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 3));
   94|  9.89k|        for (auto& entry : result) {
   95|  9.89k|            entry.m_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
   96|  9.89k|            entry.m_subnet = ConsumeSubNet(fuzzed_data_provider);
   97|  9.89k|        }
   98|  9.89k|        return result;
   99|  9.89k|    };
  100|  9.89k|    options.vWhitelistedRangeIncoming = consume_whitelist();
  101|  9.89k|    options.vWhitelistedRangeOutgoing = consume_whitelist();
  102|       |
  103|  9.89k|    connman.Init(options);
  104|       |
  105|  9.89k|    const uint64_t total_bytes_recv_initial{connman.GetTotalBytesRecv()};
  106|  9.89k|    const uint64_t total_bytes_sent_initial{connman.GetTotalBytesSent()};
  107|       |
  108|  9.89k|    CNetAddr random_netaddr;
  109|  9.89k|    CAddress random_address;
  110|  9.89k|    CNode random_node = ConsumeNode(fuzzed_data_provider, steady_clock);
  111|  9.89k|    CSubNet random_subnet;
  112|  9.89k|    std::string random_string;
  113|  9.89k|    std::vector<NodeId> node_ids;
  114|  9.89k|    std::vector<std::string> node_addr_names;
  115|       |
  116|  47.8k|    LIMITED_WHILE (fuzzed_data_provider.ConsumeBool(), 100) {
  ------------------
  |  |   23|  57.7k|    for (unsigned _count{limit}; (condition) && _count; --_count)
  |  |  ------------------
  |  |  |  Branch (23:34): [True: 48.0k, False: 9.68k]
  |  |  |  Branch (23:49): [True: 47.8k, False: 212]
  |  |  ------------------
  ------------------
  117|  47.8k|        CNode& p2p_node{*ConsumeNodeAsUniquePtr(fuzzed_data_provider, steady_clock).release()};
  118|       |        // Simulate post-handshake state.
  119|  47.8k|        p2p_node.fSuccessfullyConnected = true;
  120|  47.8k|        connman.AddTestNode(p2p_node);
  121|  47.8k|        node_ids.push_back(p2p_node.GetId());
  122|  47.8k|        node_addr_names.push_back(p2p_node.m_addr_name);
  123|  47.8k|    }
  124|       |
  125|  1.59M|    LIMITED_WHILE (fuzzed_data_provider.ConsumeBool(), 10000) {
  ------------------
  |  |   23|  1.60M|    for (unsigned _count{limit}; (condition) && _count; --_count)
  |  |  ------------------
  |  |  |  Branch (23:34): [True: 1.59M, False: 9.87k]
  |  |  |  Branch (23:49): [True: 1.59M, False: 16]
  |  |  ------------------
  ------------------
  126|  1.59M|        CallOneOf(
  127|  1.59M|            fuzzed_data_provider,
  128|  1.59M|            [&] {
  129|  1.59M|                random_netaddr = ConsumeNetAddr(fuzzed_data_provider);
  130|  1.59M|            },
  131|  1.59M|            [&] {
  132|  1.59M|                random_address = ConsumeAddress(fuzzed_data_provider);
  133|  1.59M|            },
  134|  1.59M|            [&] {
  135|  1.59M|                random_subnet = ConsumeSubNet(fuzzed_data_provider);
  136|  1.59M|            },
  137|  1.59M|            [&] {
  138|  1.59M|                random_string = fuzzed_data_provider.ConsumeRandomLengthString(64);
  139|  1.59M|            },
  140|  1.59M|            [&] {
  141|  1.59M|                const std::string& node_str = (!node_addr_names.empty() && fuzzed_data_provider.ConsumeBool())
  142|  1.59M|                    ? PickValue(fuzzed_data_provider, node_addr_names)
  143|  1.59M|                    : random_string;
  144|  1.59M|                const auto added_node_info{connman.GetAddedNodeInfo(/*include_connected=*/true)};
  145|  1.59M|                const auto add_node{connman.AddNode({node_str, /*use_v2transport=*/fuzzed_data_provider.ConsumeBool()})};
  146|  1.59M|                if (add_node) {
  147|  1.59M|                    assert(!connman.AddNode({node_str, /*use_v2transport=*/fuzzed_data_provider.ConsumeBool()}));
  148|  1.59M|                    assert(added_node_info.size() < connman.GetAddedNodeInfo(/*include_connected=*/true).size());
  149|  1.59M|                    const auto remove{fuzzed_data_provider.ConsumeBool()};
  150|  1.59M|                    if (remove) {
  151|  1.59M|                        assert(connman.RemoveAddedNode(node_str));
  152|  1.59M|                        assert(added_node_info.size() == connman.GetAddedNodeInfo(/*include_connected=*/true).size());
  153|  1.59M|                    }
  154|  1.59M|                }
  155|  1.59M|            },
  156|  1.59M|            [&] {
  157|  1.59M|                (void)connman.RemoveAddedNode(random_string);
  158|  1.59M|            },
  159|  1.59M|            [&] {
  160|  1.59M|                connman.CheckIncomingNonce(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
  161|  1.59M|            },
  162|  1.59M|            [&] {
  163|  1.59M|                connman.DisconnectNode(fuzzed_data_provider.ConsumeIntegral<NodeId>());
  164|  1.59M|            },
  165|  1.59M|            [&] {
  166|  1.59M|                connman.DisconnectNode(random_netaddr);
  167|  1.59M|            },
  168|  1.59M|            [&] {
  169|  1.59M|                connman.DisconnectNode(random_string);
  170|  1.59M|            },
  171|  1.59M|            [&] {
  172|  1.59M|                connman.DisconnectNode(random_subnet);
  173|  1.59M|            },
  174|  1.59M|            [&] {
  175|  1.59M|                NodeId id = node_ids.empty() || fuzzed_data_provider.ConsumeBool()
  176|  1.59M|                    ? fuzzed_data_provider.ConsumeIntegral<NodeId>()
  177|  1.59M|                    : PickValue(fuzzed_data_provider, node_ids);
  178|  1.59M|                (void)connman.ForNode(id, [&](CNode* pnode) {
  179|  1.59M|                    (void)pnode->GetId();
  180|  1.59M|                    (void)pnode->IsInboundConn();
  181|  1.59M|                    (void)pnode->IsFullOutboundConn();
  182|  1.59M|                    return true;
  183|  1.59M|                });
  184|  1.59M|            },
  185|  1.59M|            [&] {
  186|  1.59M|                auto max_addresses = fuzzed_data_provider.ConsumeIntegral<size_t>();
  187|  1.59M|                auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
  188|  1.59M|                auto filtered = fuzzed_data_provider.ConsumeBool();
  189|  1.59M|                (void)connman.GetAddressesUnsafe(max_addresses, max_pct, /*network=*/std::nullopt, filtered);
  190|  1.59M|            },
  191|  1.59M|            [&] {
  192|  1.59M|                auto max_addresses = fuzzed_data_provider.ConsumeIntegral<size_t>();
  193|  1.59M|                auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
  194|  1.59M|                (void)connman.GetAddresses(/*requestor=*/random_node, max_addresses, max_pct);
  195|  1.59M|            },
  196|  1.59M|            [&] {
  197|  1.59M|                (void)connman.GetDeterministicRandomizer(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
  198|  1.59M|            },
  199|  1.59M|            [&] {
  200|  1.59M|                (void)connman.GetNodeCount(fuzzed_data_provider.PickValueInArray({ConnectionDirection::None, ConnectionDirection::In, ConnectionDirection::Out, ConnectionDirection::Both}));
  201|  1.59M|            },
  202|  1.59M|            [&] {
  203|  1.59M|                (void)connman.OutboundTargetReached(fuzzed_data_provider.ConsumeBool());
  204|  1.59M|            },
  205|  1.59M|            [&] {
  206|  1.59M|                CSerializedNetMsg serialized_net_msg;
  207|  1.59M|                serialized_net_msg.m_type = fuzzed_data_provider.ConsumeRandomLengthString(CMessageHeader::MESSAGE_TYPE_SIZE);
  208|  1.59M|                serialized_net_msg.data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
  209|  1.59M|                connman.PushMessage(&random_node, std::move(serialized_net_msg));
  210|  1.59M|            },
  211|  1.59M|            [&] {
  212|  1.59M|                const auto set_active{fuzzed_data_provider.ConsumeBool()};
  213|  1.59M|                connman.SetNetworkActive(set_active);
  214|  1.59M|                assert(connman.GetNetworkActive() == set_active);
  215|  1.59M|            },
  216|  1.59M|            [&] {
  217|  1.59M|                connman.SetTryNewOutboundPeer(fuzzed_data_provider.ConsumeBool());
  218|  1.59M|            },
  219|  1.59M|            [&] {
  220|  1.59M|                const auto services{ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS)};
  221|  1.59M|                const auto before{connman.GetLocalServices()};
  222|  1.59M|                if (fuzzed_data_provider.ConsumeBool()) {
  223|  1.59M|                    connman.AddLocalServices(services);
  224|  1.59M|                    assert((connman.GetLocalServices() & services) == services);
  225|       |                    // Restore by clearing only the bits that weren't already set.
  226|  1.59M|                    connman.RemoveLocalServices(ServiceFlags(services & ~before));
  227|  1.59M|                } else {
  228|  1.59M|                    connman.RemoveLocalServices(services);
  229|  1.59M|                    assert((connman.GetLocalServices() & services) == 0);
  230|       |                    // Restore by re-adding only the bits that were previously set.
  231|  1.59M|                    connman.AddLocalServices(ServiceFlags(services & before));
  232|  1.59M|                }
  233|  1.59M|                assert(connman.GetLocalServices() == before);
  234|  1.59M|            },
  235|  1.59M|            [&] {
  236|  1.59M|                ConnectionType conn_type{
  237|  1.59M|                    fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES)};
  238|  1.59M|                if (conn_type == ConnectionType::INBOUND) { // INBOUND is not allowed
  239|  1.59M|                    conn_type = ConnectionType::OUTBOUND_FULL_RELAY;
  240|  1.59M|                }
  241|       |
  242|  1.59M|                std::optional<Proxy> proxy_override;
  243|  1.59M|                if (conn_type == ConnectionType::PRIVATE_BROADCAST || fuzzed_data_provider.ConsumeBool()) {
  244|  1.59M|                    proxy_override.emplace(ConsumeService(fuzzed_data_provider));
  245|  1.59M|                }
  246|       |
  247|  1.59M|                connman.OpenNetworkConnection(
  248|  1.59M|                    /*addrConnect=*/random_address,
  249|  1.59M|                    /*fCountFailure=*/fuzzed_data_provider.ConsumeBool(),
  250|  1.59M|                    /*grant_outbound=*/{},
  251|  1.59M|                    /*pszDest=*/fuzzed_data_provider.ConsumeBool() ? nullptr : random_string.c_str(),
  252|  1.59M|                    /*conn_type=*/conn_type,
  253|  1.59M|                    /*use_v2transport=*/fuzzed_data_provider.ConsumeBool(),
  254|  1.59M|                    /*proxy_override=*/proxy_override);
  255|  1.59M|            },
  256|  1.59M|            [&] {
  257|  1.59M|                connman.SetNetworkActive(fuzzed_data_provider.ConsumeBool());
  258|  1.59M|                const auto peer = ConsumeAddress(fuzzed_data_provider);
  259|  1.59M|                connman.CreateNodeFromAcceptedSocketPublic(
  260|  1.59M|                    /*sock=*/CreateSock(AF_INET, SOCK_STREAM, IPPROTO_TCP),
  261|  1.59M|                    /*permissions=*/ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS),
  262|  1.59M|                    /*addr_bind=*/ConsumeAddress(fuzzed_data_provider),
  263|  1.59M|                    /*addr_peer=*/peer);
  264|  1.59M|            },
  265|  1.59M|            [&] {
  266|  1.59M|                CConnman::Options options;
  267|       |
  268|  1.59M|                options.vBinds = ConsumeServiceVector(fuzzed_data_provider);
  269|       |
  270|  1.59M|                options.vWhiteBinds = std::vector<NetWhitebindPermissions>{
  271|  1.59M|                    fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 5)};
  272|  1.59M|                for (auto& wb : options.vWhiteBinds) {
  273|  1.59M|                    wb.m_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
  274|  1.59M|                    wb.m_service = ConsumeService(fuzzed_data_provider);
  275|  1.59M|                }
  276|       |
  277|  1.59M|                options.onion_binds = ConsumeServiceVector(fuzzed_data_provider);
  278|       |
  279|  1.59M|                options.bind_on_any = options.vBinds.empty() && options.vWhiteBinds.empty() &&
  280|  1.59M|                                      options.onion_binds.empty();
  281|       |
  282|  1.59M|                connman.InitBindsPublic(options);
  283|  1.59M|            },
  284|  1.59M|            [&] {
  285|  1.59M|                connman.SocketHandlerPublic();
  286|  1.59M|            });
  287|  1.59M|    }
  288|  9.89k|    connman.ForEachNode([](CNode* pnode) {
  289|  9.89k|        (void)pnode->GetId();
  290|  9.89k|        (void)pnode->IsInboundConn();
  291|  9.89k|        (void)pnode->IsFullOutboundConn();
  292|  9.89k|        (void)pnode->ConnectionTypeAsString();
  293|  9.89k|    });
  294|  9.89k|    (void)connman.GetAddedNodeInfo(/*include_connected=*/false);
  295|  9.89k|    (void)connman.GetExtraFullOutboundCount();
  296|  9.89k|    assert(connman.GetLocalServices() == local_services);
  ------------------
  |  Branch (296:5): [True: 9.89k, False: 0]
  ------------------
  297|  9.89k|    assert(connman.GetMaxOutboundTarget() == max_outbound_limit);
  ------------------
  |  Branch (297:5): [True: 9.89k, False: 0]
  ------------------
  298|  9.89k|    const auto time_left_in_cycle{connman.GetMaxOutboundTimeLeftInCycle()};
  299|  9.89k|    std::vector<CNodeStats> stats;
  300|  9.89k|    connman.GetNodeStats(stats);
  301|  9.89k|    const auto bytes_left{connman.GetOutboundTargetBytesLeft()};
  302|  9.89k|    assert(bytes_left <= max_outbound_limit);
  ------------------
  |  Branch (302:5): [True: 9.89k, False: 0]
  ------------------
  303|  9.89k|    if (max_outbound_limit == 0) {
  ------------------
  |  Branch (303:9): [True: 3.21k, False: 6.68k]
  ------------------
  304|  3.21k|        assert(bytes_left == 0);
  ------------------
  |  Branch (304:9): [True: 3.21k, False: 0]
  ------------------
  305|  3.21k|        assert(time_left_in_cycle == std::chrono::seconds{0});
  ------------------
  |  Branch (305:9): [True: 3.21k, False: 0]
  ------------------
  306|  3.21k|        assert(!connman.OutboundTargetReached(/*historicalBlockServingLimit=*/false));
  ------------------
  |  Branch (306:9): [True: 3.21k, False: 0]
  ------------------
  307|  3.21k|        assert(!connman.OutboundTargetReached(/*historicalBlockServingLimit=*/true));
  ------------------
  |  Branch (307:9): [True: 3.21k, False: 0]
  ------------------
  308|  3.21k|    }
  309|  9.89k|    assert(connman.GetTotalBytesRecv() >= total_bytes_recv_initial);
  ------------------
  |  Branch (309:5): [True: 9.89k, False: 0]
  ------------------
  310|  9.89k|    assert(connman.GetTotalBytesSent() >= total_bytes_sent_initial);
  ------------------
  |  Branch (310:5): [True: 9.89k, False: 0]
  ------------------
  311|  9.89k|    (void)connman.GetTryNewOutboundPeer();
  312|  9.89k|    assert(connman.GetUseAddrmanOutgoing() == use_addrman_outgoing);
  ------------------
  |  Branch (312:5): [True: 9.89k, False: 0]
  ------------------
  313|  9.89k|    (void)connman.ASMapHealthCheck();
  314|       |
  315|  9.89k|    connman.ClearTestNodes();
  316|  9.89k|    g_dns_lookup = g_dns_lookup_orig;
  317|  9.89k|    CreateSock = CreateSockOrig;
  318|  9.89k|}
connman.cpp:_ZN12_GLOBAL__N_113GetCheckRatioEv:
   28|  12.9k|{
   29|  12.9k|    return std::clamp<int32_t>(g_setup->m_node.args->GetIntArg("-checkaddrman", 0), 0, 1000000);
   30|  12.9k|}
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_4clEv:
   92|  19.7k|    auto consume_whitelist = [&]() {
   93|  19.7k|        std::vector<NetWhitelistPermissions> result(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 3));
   94|  19.7k|        for (auto& entry : result) {
  ------------------
  |  Branch (94:26): [True: 12.9k, False: 19.7k]
  ------------------
   95|  12.9k|            entry.m_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
   96|  12.9k|            entry.m_subnet = ConsumeSubNet(fuzzed_data_provider);
   97|  12.9k|        }
   98|  19.7k|        return result;
   99|  19.7k|    };
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_0clEiii:
   62|   387k|    CreateSock = [&fuzzed_data_provider, &steady_clock](int, int, int) {
   63|   387k|        return std::make_unique<FuzzedSock>(fuzzed_data_provider, steady_clock);
   64|   387k|    };
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_1clERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEb:
   68|  28.3k|    g_dns_lookup = [&fuzzed_data_provider](const std::string&, bool) {
   69|  28.3k|        return std::vector<CNetAddr>{ConsumeNetAddr(fuzzed_data_provider)};
   70|  28.3k|    };
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_5clEv:
  128|  14.2k|            [&] {
  129|  14.2k|                random_netaddr = ConsumeNetAddr(fuzzed_data_provider);
  130|  14.2k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_6clEv:
  131|  50.7k|            [&] {
  132|  50.7k|                random_address = ConsumeAddress(fuzzed_data_provider);
  133|  50.7k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_7clEv:
  134|  89.6k|            [&] {
  135|  89.6k|                random_subnet = ConsumeSubNet(fuzzed_data_provider);
  136|  89.6k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_8clEv:
  137|  32.9k|            [&] {
  138|  32.9k|                random_string = fuzzed_data_provider.ConsumeRandomLengthString(64);
  139|  32.9k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_9clEv:
  140|  31.5k|            [&] {
  141|  31.5k|                const std::string& node_str = (!node_addr_names.empty() && fuzzed_data_provider.ConsumeBool())
  ------------------
  |  Branch (141:48): [True: 18.0k, False: 13.4k]
  |  Branch (141:76): [True: 17.6k, False: 440]
  ------------------
  142|  31.5k|                    ? PickValue(fuzzed_data_provider, node_addr_names)
  143|  31.5k|                    : random_string;
  144|  31.5k|                const auto added_node_info{connman.GetAddedNodeInfo(/*include_connected=*/true)};
  145|  31.5k|                const auto add_node{connman.AddNode({node_str, /*use_v2transport=*/fuzzed_data_provider.ConsumeBool()})};
  146|  31.5k|                if (add_node) {
  ------------------
  |  Branch (146:21): [True: 25.8k, False: 5.62k]
  ------------------
  147|  25.8k|                    assert(!connman.AddNode({node_str, /*use_v2transport=*/fuzzed_data_provider.ConsumeBool()}));
  ------------------
  |  Branch (147:21): [True: 25.8k, False: 0]
  ------------------
  148|  25.8k|                    assert(added_node_info.size() < connman.GetAddedNodeInfo(/*include_connected=*/true).size());
  ------------------
  |  Branch (148:21): [True: 25.8k, False: 0]
  ------------------
  149|  25.8k|                    const auto remove{fuzzed_data_provider.ConsumeBool()};
  150|  25.8k|                    if (remove) {
  ------------------
  |  Branch (150:25): [True: 24.5k, False: 1.34k]
  ------------------
  151|  24.5k|                        assert(connman.RemoveAddedNode(node_str));
  ------------------
  |  Branch (151:25): [True: 24.5k, False: 0]
  ------------------
  152|  24.5k|                        assert(added_node_info.size() == connman.GetAddedNodeInfo(/*include_connected=*/true).size());
  ------------------
  |  Branch (152:25): [True: 24.5k, False: 0]
  ------------------
  153|  24.5k|                    }
  154|  25.8k|                }
  155|  31.5k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_10clEv:
  156|   100k|            [&] {
  157|   100k|                (void)connman.RemoveAddedNode(random_string);
  158|   100k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_11clEv:
  159|  4.59k|            [&] {
  160|  4.59k|                connman.CheckIncomingNonce(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
  161|  4.59k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_12clEv:
  162|  6.81k|            [&] {
  163|  6.81k|                connman.DisconnectNode(fuzzed_data_provider.ConsumeIntegral<NodeId>());
  164|  6.81k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_13clEv:
  165|  15.3k|            [&] {
  166|  15.3k|                connman.DisconnectNode(random_netaddr);
  167|  15.3k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_14clEv:
  168|  89.8k|            [&] {
  169|  89.8k|                connman.DisconnectNode(random_string);
  170|  89.8k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_15clEv:
  171|  46.7k|            [&] {
  172|  46.7k|                connman.DisconnectNode(random_subnet);
  173|  46.7k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_2clEv:
  174|  5.89k|            [&] {
  175|  5.89k|                NodeId id = node_ids.empty() || fuzzed_data_provider.ConsumeBool()
  ------------------
  |  Branch (175:29): [True: 2.65k, False: 3.24k]
  |  Branch (175:49): [True: 2.33k, False: 906]
  ------------------
  176|  5.89k|                    ? fuzzed_data_provider.ConsumeIntegral<NodeId>()
  177|  5.89k|                    : PickValue(fuzzed_data_provider, node_ids);
  178|  5.89k|                (void)connman.ForNode(id, [&](CNode* pnode) {
  179|  5.89k|                    (void)pnode->GetId();
  180|  5.89k|                    (void)pnode->IsInboundConn();
  181|  5.89k|                    (void)pnode->IsFullOutboundConn();
  182|  5.89k|                    return true;
  183|  5.89k|                });
  184|  5.89k|            },
connman.cpp:_ZZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_2clEvENKUlP5CNodeE_clES5_:
  178|  1.91k|                (void)connman.ForNode(id, [&](CNode* pnode) {
  179|  1.91k|                    (void)pnode->GetId();
  180|  1.91k|                    (void)pnode->IsInboundConn();
  181|  1.91k|                    (void)pnode->IsFullOutboundConn();
  182|  1.91k|                    return true;
  183|  1.91k|                });
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_16clEv:
  185|  26.9k|            [&] {
  186|  26.9k|                auto max_addresses = fuzzed_data_provider.ConsumeIntegral<size_t>();
  187|  26.9k|                auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
  188|  26.9k|                auto filtered = fuzzed_data_provider.ConsumeBool();
  189|  26.9k|                (void)connman.GetAddressesUnsafe(max_addresses, max_pct, /*network=*/std::nullopt, filtered);
  190|  26.9k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_17clEv:
  191|  8.02k|            [&] {
  192|  8.02k|                auto max_addresses = fuzzed_data_provider.ConsumeIntegral<size_t>();
  193|  8.02k|                auto max_pct = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 100);
  194|  8.02k|                (void)connman.GetAddresses(/*requestor=*/random_node, max_addresses, max_pct);
  195|  8.02k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_18clEv:
  196|  3.63k|            [&] {
  197|  3.63k|                (void)connman.GetDeterministicRandomizer(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
  198|  3.63k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_19clEv:
  199|  14.1k|            [&] {
  200|  14.1k|                (void)connman.GetNodeCount(fuzzed_data_provider.PickValueInArray({ConnectionDirection::None, ConnectionDirection::In, ConnectionDirection::Out, ConnectionDirection::Both}));
  201|  14.1k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_20clEv:
  202|   202k|            [&] {
  203|   202k|                (void)connman.OutboundTargetReached(fuzzed_data_provider.ConsumeBool());
  204|   202k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_21clEv:
  205|   138k|            [&] {
  206|   138k|                CSerializedNetMsg serialized_net_msg;
  207|   138k|                serialized_net_msg.m_type = fuzzed_data_provider.ConsumeRandomLengthString(CMessageHeader::MESSAGE_TYPE_SIZE);
  208|   138k|                serialized_net_msg.data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
  209|   138k|                connman.PushMessage(&random_node, std::move(serialized_net_msg));
  210|   138k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_22clEv:
  211|  12.8k|            [&] {
  212|  12.8k|                const auto set_active{fuzzed_data_provider.ConsumeBool()};
  213|  12.8k|                connman.SetNetworkActive(set_active);
  214|       |                assert(connman.GetNetworkActive() == set_active);
  ------------------
  |  Branch (214:17): [True: 12.8k, False: 0]
  ------------------
  215|  12.8k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_23clEv:
  216|   217k|            [&] {
  217|   217k|                connman.SetTryNewOutboundPeer(fuzzed_data_provider.ConsumeBool());
  218|   217k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_24clEv:
  219|  1.99k|            [&] {
  220|  1.99k|                const auto services{ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS)};
  221|  1.99k|                const auto before{connman.GetLocalServices()};
  222|  1.99k|                if (fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (222:21): [True: 1.09k, False: 897]
  ------------------
  223|  1.09k|                    connman.AddLocalServices(services);
  224|  1.09k|                    assert((connman.GetLocalServices() & services) == services);
  ------------------
  |  Branch (224:21): [True: 1.09k, False: 0]
  ------------------
  225|       |                    // Restore by clearing only the bits that weren't already set.
  226|  1.09k|                    connman.RemoveLocalServices(ServiceFlags(services & ~before));
  227|  1.09k|                } else {
  228|    897|                    connman.RemoveLocalServices(services);
  229|    897|                    assert((connman.GetLocalServices() & services) == 0);
  ------------------
  |  Branch (229:21): [True: 897, False: 0]
  ------------------
  230|       |                    // Restore by re-adding only the bits that were previously set.
  231|    897|                    connman.AddLocalServices(ServiceFlags(services & before));
  232|    897|                }
  233|  1.99k|                assert(connman.GetLocalServices() == before);
  ------------------
  |  Branch (233:17): [True: 1.99k, False: 0]
  ------------------
  234|  1.99k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_25clEv:
  235|  58.2k|            [&] {
  236|  58.2k|                ConnectionType conn_type{
  237|  58.2k|                    fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES)};
  238|  58.2k|                if (conn_type == ConnectionType::INBOUND) { // INBOUND is not allowed
  ------------------
  |  Branch (238:21): [True: 30.3k, False: 27.9k]
  ------------------
  239|  30.3k|                    conn_type = ConnectionType::OUTBOUND_FULL_RELAY;
  240|  30.3k|                }
  241|       |
  242|  58.2k|                std::optional<Proxy> proxy_override;
  243|  58.2k|                if (conn_type == ConnectionType::PRIVATE_BROADCAST || fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (243:21): [True: 1.56k, False: 56.7k]
  |  Branch (243:71): [True: 49.4k, False: 7.29k]
  ------------------
  244|  50.9k|                    proxy_override.emplace(ConsumeService(fuzzed_data_provider));
  245|  50.9k|                }
  246|       |
  247|  58.2k|                connman.OpenNetworkConnection(
  248|  58.2k|                    /*addrConnect=*/random_address,
  249|  58.2k|                    /*fCountFailure=*/fuzzed_data_provider.ConsumeBool(),
  250|  58.2k|                    /*grant_outbound=*/{},
  251|  58.2k|                    /*pszDest=*/fuzzed_data_provider.ConsumeBool() ? nullptr : random_string.c_str(),
  ------------------
  |  Branch (251:33): [True: 49.6k, False: 8.63k]
  ------------------
  252|  58.2k|                    /*conn_type=*/conn_type,
  253|  58.2k|                    /*use_v2transport=*/fuzzed_data_provider.ConsumeBool(),
  254|  58.2k|                    /*proxy_override=*/proxy_override);
  255|  58.2k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_26clEv:
  256|   350k|            [&] {
  257|   350k|                connman.SetNetworkActive(fuzzed_data_provider.ConsumeBool());
  258|   350k|                const auto peer = ConsumeAddress(fuzzed_data_provider);
  259|   350k|                connman.CreateNodeFromAcceptedSocketPublic(
  260|   350k|                    /*sock=*/CreateSock(AF_INET, SOCK_STREAM, IPPROTO_TCP),
  261|   350k|                    /*permissions=*/ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS),
  262|   350k|                    /*addr_bind=*/ConsumeAddress(fuzzed_data_provider),
  263|   350k|                    /*addr_peer=*/peer);
  264|   350k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_27clEv:
  265|  42.5k|            [&] {
  266|  42.5k|                CConnman::Options options;
  267|       |
  268|  42.5k|                options.vBinds = ConsumeServiceVector(fuzzed_data_provider);
  269|       |
  270|  42.5k|                options.vWhiteBinds = std::vector<NetWhitebindPermissions>{
  271|  42.5k|                    fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 5)};
  272|   143k|                for (auto& wb : options.vWhiteBinds) {
  ------------------
  |  Branch (272:31): [True: 143k, False: 42.5k]
  ------------------
  273|   143k|                    wb.m_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
  274|   143k|                    wb.m_service = ConsumeService(fuzzed_data_provider);
  275|   143k|                }
  276|       |
  277|  42.5k|                options.onion_binds = ConsumeServiceVector(fuzzed_data_provider);
  278|       |
  279|  42.5k|                options.bind_on_any = options.vBinds.empty() && options.vWhiteBinds.empty() &&
  ------------------
  |  Branch (279:39): [True: 7.69k, False: 34.8k]
  |  Branch (279:65): [True: 6.68k, False: 1.01k]
  ------------------
  280|  6.68k|                                      options.onion_binds.empty();
  ------------------
  |  Branch (280:39): [True: 6.67k, False: 9]
  ------------------
  281|       |
  282|  42.5k|                connman.InitBindsPublic(options);
  283|  42.5k|            },
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK4$_28clEv:
  284|  28.6k|            [&] {
  285|  28.6k|                connman.SocketHandlerPublic();
  286|  28.6k|            });
connman.cpp:_ZZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_3clEP5CNode:
  288|  41.8k|    connman.ForEachNode([](CNode* pnode) {
  289|  41.8k|        (void)pnode->GetId();
  290|  41.8k|        (void)pnode->IsInboundConn();
  291|  41.8k|        (void)pnode->IsFullOutboundConn();
  292|  41.8k|        (void)pnode->ConnectionTypeAsString();
  293|  41.8k|    });

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

_Z11ConsumeTimeR18FuzzedDataProviderRKNSt3__18optionalIlEES5_:
   35|  13.1k|{
   36|       |    // Avoid t=0 (1970-01-01T00:00:00Z) since SetMockTime(0) disables mocktime.
   37|  13.1k|    static const int64_t time_min{ParseISO8601DateTime("2000-01-01T00:00:01Z").value()};
   38|  13.1k|    static const int64_t time_max{ParseISO8601DateTime("2100-12-31T23:59:59Z").value()};
   39|  13.1k|    return NodeSeconds{ConsumeDuration<std::chrono::seconds>(fuzzed_data_provider, min.value_or(time_min) * 1s, max.value_or(time_max) * 1s)};
   40|  13.1k|}

connman.cpp:_Z9CallOneOfIJZ19connman_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEE3$_5Z19connman_fuzz_targetS3_E3$_6Z19connman_fuzz_targetS3_E3$_7Z19connman_fuzz_targetS3_E3$_8Z19connman_fuzz_targetS3_E3$_9Z19connman_fuzz_targetS3_E4$_10Z19connman_fuzz_targetS3_E4$_11Z19connman_fuzz_targetS3_E4$_12Z19connman_fuzz_targetS3_E4$_13Z19connman_fuzz_targetS3_E4$_14Z19connman_fuzz_targetS3_E4$_15Z19connman_fuzz_targetS3_E3$_2Z19connman_fuzz_targetS3_E4$_16Z19connman_fuzz_targetS3_E4$_17Z19connman_fuzz_targetS3_E4$_18Z19connman_fuzz_targetS3_E4$_19Z19connman_fuzz_targetS3_E4$_20Z19connman_fuzz_targetS3_E4$_21Z19connman_fuzz_targetS3_E4$_22Z19connman_fuzz_targetS3_E4$_23Z19connman_fuzz_targetS3_E4$_24Z19connman_fuzz_targetS3_E4$_25Z19connman_fuzz_targetS3_E4$_26Z19connman_fuzz_targetS3_E4$_27Z19connman_fuzz_targetS3_E4$_28EEmR18FuzzedDataProviderDpT_:
   38|  1.59M|{
   39|  1.59M|    constexpr size_t call_size{sizeof...(callables)};
   40|  1.59M|    static_assert(call_size >= 1);
   41|  1.59M|    const size_t call_index{fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, call_size - 1)};
   42|       |
   43|  1.59M|    size_t i{0};
   44|  39.8M|    ((i++ == call_index ? callables() : void()), ...);
  ------------------
  |  Branch (44:7): [True: 14.2k, False: 1.58M]
  |  Branch (44:7): [True: 50.7k, False: 1.54M]
  |  Branch (44:7): [True: 89.6k, False: 1.50M]
  |  Branch (44:7): [True: 32.9k, False: 1.56M]
  |  Branch (44:7): [True: 31.5k, False: 1.56M]
  |  Branch (44:7): [True: 100k, False: 1.49M]
  |  Branch (44:7): [True: 4.59k, False: 1.59M]
  |  Branch (44:7): [True: 6.81k, False: 1.58M]
  |  Branch (44:7): [True: 15.3k, False: 1.57M]
  |  Branch (44:7): [True: 89.8k, False: 1.50M]
  |  Branch (44:7): [True: 46.7k, False: 1.54M]
  |  Branch (44:7): [True: 5.89k, False: 1.58M]
  |  Branch (44:7): [True: 26.9k, False: 1.56M]
  |  Branch (44:7): [True: 8.02k, False: 1.58M]
  |  Branch (44:7): [True: 3.63k, False: 1.59M]
  |  Branch (44:7): [True: 14.1k, False: 1.58M]
  |  Branch (44:7): [True: 202k, False: 1.39M]
  |  Branch (44:7): [True: 138k, False: 1.45M]
  |  Branch (44:7): [True: 12.8k, False: 1.58M]
  |  Branch (44:7): [True: 217k, False: 1.37M]
  |  Branch (44:7): [True: 1.99k, False: 1.59M]
  |  Branch (44:7): [True: 58.2k, False: 1.53M]
  |  Branch (44:7): [True: 350k, False: 1.24M]
  |  Branch (44:7): [True: 42.5k, False: 1.55M]
  |  Branch (44:7): [True: 28.6k, False: 1.56M]
  ------------------
   45|  1.59M|    return call_size;
   46|  1.59M|}
_Z9PickValueINSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEERDaR18FuzzedDataProviderRT_:
   58|  17.6k|{
   59|  17.6k|    return *PickIterator(fuzzed_data_provider, col);
   60|  17.6k|}
_Z12PickIteratorINSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEEDaR18FuzzedDataProviderRT_:
   50|  17.6k|{
   51|  17.6k|    const auto sz{col.size()};
   52|  17.6k|    assert(sz >= 1);
  ------------------
  |  Branch (52:5): [True: 17.6k, False: 0]
  ------------------
   53|  17.6k|    return std::next(col.begin(), fuzzed_data_provider.ConsumeIntegralInRange<decltype(sz)>(0, sz - 1));
   54|  17.6k|}
_Z9PickValueINSt3__16vectorIlNS0_9allocatorIlEEEEERDaR18FuzzedDataProviderRT_:
   58|    906|{
   59|    906|    return *PickIterator(fuzzed_data_provider, col);
   60|    906|}
_Z12PickIteratorINSt3__16vectorIlNS0_9allocatorIlEEEEEDaR18FuzzedDataProviderRT_:
   50|    906|{
   51|    906|    const auto sz{col.size()};
   52|    906|    assert(sz >= 1);
  ------------------
  |  Branch (52:5): [True: 906, False: 0]
  ------------------
   53|    906|    return std::next(col.begin(), fuzzed_data_provider.ConsumeIntegralInRange<decltype(sz)>(0, sz - 1));
   54|    906|}
_Z29ConsumeRandomLengthByteVectorISt4byteENSt3__16vectorIT_NS1_9allocatorIS3_EEEER18FuzzedDataProviderRKNS1_8optionalImEE:
   64|  9.89k|{
   65|  9.89k|    static_assert(sizeof(B) == 1);
   66|  9.89k|    const std::string s = max_length ?
  ------------------
  |  Branch (66:27): [True: 0, False: 9.89k]
  ------------------
   67|      0|                              fuzzed_data_provider.ConsumeRandomLengthString(*max_length) :
   68|  9.89k|                              fuzzed_data_provider.ConsumeRandomLengthString();
   69|  9.89k|    std::vector<B> ret(s.size());
   70|  9.89k|    std::copy(s.begin(), s.end(), reinterpret_cast<char*>(ret.data()));
   71|  9.89k|    return ret;
   72|  9.89k|}
_Z15ConsumeWeakEnumI18NetPermissionFlagsLm10EET_R18FuzzedDataProviderRAT0__KS1_:
  148|   564k|{
  149|   564k|    return fuzzed_data_provider.ConsumeBool() ?
  ------------------
  |  Branch (149:12): [True: 439k, False: 125k]
  ------------------
  150|   439k|               fuzzed_data_provider.PickValueInArray<WeakEnumType>(all_types) :
  151|   564k|               WeakEnumType(fuzzed_data_provider.ConsumeIntegral<std::underlying_type_t<WeakEnumType>>());
  152|   564k|}
_Z15ConsumeWeakEnumI12ServiceFlagsLm7EET_R18FuzzedDataProviderRAT0__KS1_:
  148|   879k|{
  149|   879k|    return fuzzed_data_provider.ConsumeBool() ?
  ------------------
  |  Branch (149:12): [True: 811k, False: 68.3k]
  ------------------
  150|   811k|               fuzzed_data_provider.PickValueInArray<WeakEnumType>(all_types) :
  151|   879k|               WeakEnumType(fuzzed_data_provider.ConsumeIntegral<std::underlying_type_t<WeakEnumType>>());
  152|   879k|}
_Z14SetFuzzedErrNoIiLm18EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  261|  1.04k|{
  262|       |    errno = fuzzed_data_provider.PickValueInArray(errnos);
  263|  1.04k|}
_Z14SetFuzzedErrNoIiLm10EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  261|  1.34k|{
  262|       |    errno = fuzzed_data_provider.PickValueInArray(errnos);
  263|  1.34k|}
_Z14SetFuzzedErrNoIiLm8EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  261|  2.59k|{
  262|       |    errno = fuzzed_data_provider.PickValueInArray(errnos);
  263|  2.59k|}
_Z14SetFuzzedErrNoIiLm4EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  261|  14.0k|{
  262|       |    errno = fuzzed_data_provider.PickValueInArray(errnos);
  263|  14.0k|}
_Z14SetFuzzedErrNoIiLm3EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  261|  6.43k|{
  262|       |    errno = fuzzed_data_provider.PickValueInArray(errnos);
  263|  6.43k|}
_Z14SetFuzzedErrNoIiLm2EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  261|   364k|{
  262|       |    errno = fuzzed_data_provider.PickValueInArray(errnos);
  263|   364k|}
_Z14ConsumeUInt256R18FuzzedDataProvider:
  196|  12.9k|{
  197|  12.9k|    const std::vector<uint8_t> v256 = fuzzed_data_provider.ConsumeBytes<uint8_t>(256 / 8);
  198|  12.9k|    if (v256.size() != 256 / 8) {
  ------------------
  |  Branch (198:9): [True: 1.94k, False: 11.0k]
  ------------------
  199|  1.94k|        return {};
  200|  1.94k|    }
  201|  11.0k|    return uint256{v256};
  202|  12.9k|}
_Z29ConsumeRandomLengthByteVectorIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEER18FuzzedDataProviderRKNS0_8optionalImEE:
   64|   183k|{
   65|   183k|    static_assert(sizeof(B) == 1);
   66|   183k|    const std::string s = max_length ?
  ------------------
  |  Branch (66:27): [True: 41.5k, False: 142k]
  ------------------
   67|  41.5k|                              fuzzed_data_provider.ConsumeRandomLengthString(*max_length) :
   68|   183k|                              fuzzed_data_provider.ConsumeRandomLengthString();
   69|   183k|    std::vector<B> ret(s.size());
   70|   183k|    std::copy(s.begin(), s.end(), reinterpret_cast<char*>(ret.data()));
   71|   183k|    return ret;
   72|   183k|}
_Z15ConsumeDurationINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEEET_R18FuzzedDataProviderNS0_11common_typeIJS6_EE4typeESB_:
  169|  13.1k|{
  170|  13.1k|    return Dur{fuzzed_data_provider.ConsumeIntegralInRange(min.count(), max.count())};
  171|  13.1k|}
_Z28ConsumeFixedLengthByteVectorIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEER18FuzzedDataProviderm:
  281|    124|{
  282|    124|    static_assert(sizeof(B) == 1);
  283|    124|    auto random_bytes = fuzzed_data_provider.ConsumeBytes<B>(length);
  284|    124|    random_bytes.resize(length);
  285|    124|    return random_bytes;
  286|    124|}

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

_Z14ConsumeNetAddrR18FuzzedDataProviderP17FastRandomContext:
   30|  1.34M|{
   31|  1.34M|    struct NetAux {
   32|  1.34M|        Network net;
   33|  1.34M|        CNetAddr::BIP155Network bip155;
   34|  1.34M|        size_t len;
   35|  1.34M|    };
   36|       |
   37|  1.34M|    static constexpr std::array<NetAux, 6> nets{
   38|  1.34M|        NetAux{.net = Network::NET_IPV4, .bip155 = CNetAddr::BIP155Network::IPV4, .len = ADDR_IPV4_SIZE},
   39|  1.34M|        NetAux{.net = Network::NET_IPV6, .bip155 = CNetAddr::BIP155Network::IPV6, .len = ADDR_IPV6_SIZE},
   40|  1.34M|        NetAux{.net = Network::NET_ONION, .bip155 = CNetAddr::BIP155Network::TORV3, .len = ADDR_TORV3_SIZE},
   41|  1.34M|        NetAux{.net = Network::NET_I2P, .bip155 = CNetAddr::BIP155Network::I2P, .len = ADDR_I2P_SIZE},
   42|  1.34M|        NetAux{.net = Network::NET_CJDNS, .bip155 = CNetAddr::BIP155Network::CJDNS, .len = ADDR_CJDNS_SIZE},
   43|  1.34M|        NetAux{.net = Network::NET_INTERNAL, .bip155 = CNetAddr::BIP155Network{0}, .len = 0},
   44|  1.34M|    };
   45|       |
   46|  1.34M|    const size_t nets_index{rand == nullptr
  ------------------
  |  Branch (46:29): [True: 1.34M, False: 0]
  ------------------
   47|  1.34M|        ? fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, nets.size() - 1)
   48|  1.34M|        : static_cast<size_t>(rand->randrange(nets.size()))};
   49|       |
   50|  1.34M|    const auto& aux = nets[nets_index];
   51|       |
   52|  1.34M|    CNetAddr addr;
   53|       |
   54|  1.34M|    if (aux.net == Network::NET_INTERNAL) {
  ------------------
  |  Branch (54:9): [True: 72.9k, False: 1.27M]
  ------------------
   55|  72.9k|        if (rand == nullptr) {
  ------------------
  |  Branch (55:13): [True: 72.9k, False: 0]
  ------------------
   56|  72.9k|            addr.SetInternal(fuzzed_data_provider.ConsumeBytesAsString(32));
   57|  72.9k|        } else {
   58|      0|            const auto v = rand->randbytes(32);
   59|      0|            addr.SetInternal(std::string{v.begin(), v.end()});
   60|      0|        }
   61|  72.9k|        return addr;
   62|  72.9k|    }
   63|       |
   64|  1.27M|    DataStream s;
   65|       |
   66|  1.27M|    s << static_cast<uint8_t>(aux.bip155);
   67|       |
   68|  1.27M|    std::vector<uint8_t> addr_bytes;
   69|  1.27M|    if (rand == nullptr) {
  ------------------
  |  Branch (69:9): [True: 1.27M, False: 0]
  ------------------
   70|  1.27M|        addr_bytes = fuzzed_data_provider.ConsumeBytes<uint8_t>(aux.len);
   71|  1.27M|        addr_bytes.resize(aux.len);
   72|  1.27M|    } else {
   73|      0|        addr_bytes = rand->randbytes(aux.len);
   74|      0|    }
   75|  1.27M|    if (aux.net == NET_IPV6 && addr_bytes[0] == CJDNS_PREFIX) { // Avoid generating IPv6 addresses that look like CJDNS.
  ------------------
  |  Branch (75:9): [True: 797k, False: 473k]
  |  Branch (75:32): [True: 1.01k, False: 796k]
  ------------------
   76|  1.01k|        addr_bytes[0] = 0x55; // Just an arbitrary number, anything != CJDNS_PREFIX would do.
   77|  1.01k|    }
   78|  1.27M|    if (aux.net == NET_CJDNS) { // Avoid generating CJDNS addresses that don't start with CJDNS_PREFIX because those are !IsValid().
  ------------------
  |  Branch (78:9): [True: 15.5k, False: 1.25M]
  ------------------
   79|  15.5k|        addr_bytes[0] = CJDNS_PREFIX;
   80|  15.5k|    }
   81|  1.27M|    s << addr_bytes;
   82|       |
   83|  1.27M|    s >> CAddress::V2_NETWORK(addr);
   84|       |
   85|  1.27M|    return addr;
   86|  1.34M|}
_Z14ConsumeAddressR18FuzzedDataProvider:
   89|   867k|{
   90|   867k|    return {ConsumeService(fuzzed_data_provider), ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS), NodeSeconds{std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<uint32_t>()}}};
   91|   867k|}
_ZN10FuzzedSockC2ER18FuzzedDataProviderR15FakeSteadyClock:
  115|   447k|    : Sock{fuzzed_data_provider.ConsumeIntegralInRange<SOCKET>(INVALID_SOCKET - 1, INVALID_SOCKET)},
  ------------------
  |  |   67|   447k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
                  : Sock{fuzzed_data_provider.ConsumeIntegralInRange<SOCKET>(INVALID_SOCKET - 1, INVALID_SOCKET)},
  ------------------
  |  |   67|   447k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  116|   447k|      m_fuzzed_data_provider{fuzzed_data_provider},
  117|   447k|      m_selectable{fuzzed_data_provider.ConsumeBool()},
  118|   447k|      m_clock{clock}
  119|   447k|{
  120|   447k|}
_ZN10FuzzedSockD2Ev:
  123|   447k|{
  124|       |    // Sock::~Sock() will be called after FuzzedSock::~FuzzedSock() and it will call
  125|       |    // close(m_socket) if m_socket is not INVALID_SOCKET.
  126|       |    // Avoid closing an arbitrary file descriptor (m_socket is just a random very high number which
  127|       |    // theoretically may concide with a real opened file descriptor).
  128|   447k|    m_socket = INVALID_SOCKET;
  ------------------
  |  |   67|   447k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  129|   447k|}
_ZNK10FuzzedSock4SendEPKvmi:
  138|   153k|{
  139|   153k|    constexpr std::array send_errnos{
  140|   153k|        EACCES,
  141|   153k|        EAGAIN,
  142|   153k|        EALREADY,
  143|   153k|        EBADF,
  144|   153k|        ECONNRESET,
  145|   153k|        EDESTADDRREQ,
  146|   153k|        EFAULT,
  147|   153k|        EINTR,
  148|   153k|        EINVAL,
  149|   153k|        EISCONN,
  150|   153k|        EMSGSIZE,
  151|   153k|        ENOBUFS,
  152|   153k|        ENOMEM,
  153|   153k|        ENOTCONN,
  154|   153k|        ENOTSOCK,
  155|   153k|        EOPNOTSUPP,
  156|   153k|        EPIPE,
  157|   153k|        EWOULDBLOCK,
  158|   153k|    };
  159|   153k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (159:9): [True: 147k, False: 6.46k]
  ------------------
  160|   147k|        return len;
  161|   147k|    }
  162|  6.46k|    const ssize_t r = m_fuzzed_data_provider.ConsumeIntegralInRange<ssize_t>(-1, len);
  163|  6.46k|    if (r == -1) {
  ------------------
  |  Branch (163:9): [True: 1.04k, False: 5.41k]
  ------------------
  164|  1.04k|        SetFuzzedErrNo(m_fuzzed_data_provider, send_errnos);
  165|  1.04k|    }
  166|  6.46k|    return r;
  167|   153k|}
_ZNK10FuzzedSock4RecvEPvmi:
  170|  43.3k|{
  171|       |    // Have a permanent error at recv_errnos[0] because when the fuzzed data is exhausted
  172|       |    // SetFuzzedErrNo() will always return the first element and we want to avoid Recv()
  173|       |    // returning -1 and setting errno to EAGAIN repeatedly.
  174|  43.3k|    constexpr std::array recv_errnos{
  175|  43.3k|        ECONNREFUSED,
  176|  43.3k|        EAGAIN,
  177|  43.3k|        EBADF,
  178|  43.3k|        EFAULT,
  179|  43.3k|        EINTR,
  180|  43.3k|        EINVAL,
  181|  43.3k|        ENOMEM,
  182|  43.3k|        ENOTCONN,
  183|  43.3k|        ENOTSOCK,
  184|  43.3k|        EWOULDBLOCK,
  185|  43.3k|    };
  186|  43.3k|    assert(buf != nullptr || len == 0);
  ------------------
  |  Branch (186:5): [True: 43.3k, False: 0]
  |  Branch (186:5): [True: 0, False: 0]
  |  Branch (186:5): [True: 43.3k, False: 0]
  ------------------
  187|       |
  188|       |    // Do the latency before any of the "return" statements.
  189|  43.3k|    if (m_fuzzed_data_provider.ConsumeBool() && std::getenv("FUZZED_SOCKET_FAKE_LATENCY") != nullptr) {
  ------------------
  |  Branch (189:9): [True: 2.48k, False: 40.8k]
  |  Branch (189:49): [True: 0, False: 2.48k]
  ------------------
  190|      0|        std::this_thread::sleep_for(std::chrono::milliseconds{2});
  191|      0|    }
  192|       |
  193|  43.3k|    if (len == 0 || m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (193:9): [True: 0, False: 43.3k]
  |  Branch (193:21): [True: 2.49k, False: 40.8k]
  ------------------
  194|  2.49k|        const ssize_t r = m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;
  ------------------
  |  Branch (194:27): [True: 1.15k, False: 1.34k]
  ------------------
  195|  2.49k|        if (r == -1) {
  ------------------
  |  Branch (195:13): [True: 1.34k, False: 1.15k]
  ------------------
  196|  1.34k|            SetFuzzedErrNo(m_fuzzed_data_provider, recv_errnos);
  197|  1.34k|        }
  198|  2.49k|        return r;
  199|  2.49k|    }
  200|       |
  201|  40.8k|    size_t copied_so_far{0};
  202|       |
  203|  40.8k|    if (!m_peek_data.empty()) {
  ------------------
  |  Branch (203:9): [True: 2.76k, False: 38.1k]
  ------------------
  204|       |        // `MSG_PEEK` was used in the preceding `Recv()` call, copy the first bytes from `m_peek_data`.
  205|  2.76k|        const size_t copy_len{std::min(len, m_peek_data.size())};
  206|  2.76k|        std::memcpy(buf, m_peek_data.data(), copy_len);
  207|  2.76k|        copied_so_far += copy_len;
  208|  2.76k|        if ((flags & MSG_PEEK) == 0) {
  ------------------
  |  Branch (208:13): [True: 2.75k, False: 15]
  ------------------
  209|  2.75k|            m_peek_data.erase(m_peek_data.begin(), m_peek_data.begin() + copy_len);
  210|  2.75k|        }
  211|  2.76k|    }
  212|       |
  213|  40.8k|    if (copied_so_far == len) {
  ------------------
  |  Branch (213:9): [True: 1.24k, False: 39.6k]
  ------------------
  214|  1.24k|        return copied_so_far;
  215|  1.24k|    }
  216|       |
  217|  39.6k|    auto new_data = ConsumeRandomLengthByteVector(m_fuzzed_data_provider, len - copied_so_far);
  218|  39.6k|    if (new_data.empty()) return copied_so_far;
  ------------------
  |  Branch (218:9): [True: 11.5k, False: 28.0k]
  ------------------
  219|       |
  220|  28.0k|    std::memcpy(reinterpret_cast<uint8_t*>(buf) + copied_so_far, new_data.data(), new_data.size());
  221|  28.0k|    copied_so_far += new_data.size();
  222|       |
  223|  28.0k|    if ((flags & MSG_PEEK) != 0) {
  ------------------
  |  Branch (223:9): [True: 2.82k, False: 25.2k]
  ------------------
  224|  2.82k|        m_peek_data.insert(m_peek_data.end(), new_data.begin(), new_data.end());
  225|  2.82k|    }
  226|       |
  227|  28.0k|    if (copied_so_far == len || m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (227:9): [True: 1.05k, False: 27.0k]
  |  Branch (227:33): [True: 1.24k, False: 25.7k]
  ------------------
  228|  2.30k|        return copied_so_far;
  229|  2.30k|    }
  230|       |
  231|       |    // Pad to len bytes.
  232|  25.7k|    std::memset(reinterpret_cast<uint8_t*>(buf) + copied_so_far, 0x0, len - copied_so_far);
  233|       |
  234|  25.7k|    return len;
  235|  28.0k|}
_ZNK10FuzzedSock7ConnectEPK8sockaddrj:
  238|  6.73k|{
  239|       |    // Have a permanent error at connect_errnos[0] because when the fuzzed data is exhausted
  240|       |    // SetFuzzedErrNo() will always return the first element and we want to avoid Connect()
  241|       |    // returning -1 and setting errno to EAGAIN repeatedly.
  242|  6.73k|    constexpr std::array connect_errnos{
  243|  6.73k|        ECONNREFUSED,
  244|  6.73k|        EAGAIN,
  245|  6.73k|        ECONNRESET,
  246|  6.73k|        EHOSTUNREACH,
  247|  6.73k|        EINPROGRESS,
  248|  6.73k|        EINTR,
  249|  6.73k|        ENETUNREACH,
  250|  6.73k|        ETIMEDOUT,
  251|  6.73k|    };
  252|  6.73k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (252:9): [True: 2.59k, False: 4.14k]
  ------------------
  253|  2.59k|        SetFuzzedErrNo(m_fuzzed_data_provider, connect_errnos);
  254|  2.59k|        return -1;
  255|  2.59k|    }
  256|  4.14k|    return 0;
  257|  6.73k|}
_ZNK10FuzzedSock4BindEPK8sockaddrj:
  260|  27.6k|{
  261|       |    // Have a permanent error at bind_errnos[0] because when the fuzzed data is exhausted
  262|       |    // SetFuzzedErrNo() will always set the global errno to bind_errnos[0]. We want to
  263|       |    // avoid this method returning -1 and setting errno to a temporary error (like EAGAIN)
  264|       |    // repeatedly because proper code should retry on temporary errors, leading to an
  265|       |    // infinite loop.
  266|  27.6k|    constexpr std::array bind_errnos{
  267|  27.6k|        EACCES,
  268|  27.6k|        EADDRINUSE,
  269|  27.6k|        EADDRNOTAVAIL,
  270|  27.6k|        EAGAIN,
  271|  27.6k|    };
  272|  27.6k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (272:9): [True: 14.0k, False: 13.5k]
  ------------------
  273|  14.0k|        SetFuzzedErrNo(m_fuzzed_data_provider, bind_errnos);
  274|  14.0k|        return -1;
  275|  14.0k|    }
  276|  13.5k|    return 0;
  277|  27.6k|}
_ZNK10FuzzedSock6ListenEi:
  280|  13.5k|{
  281|       |    // Have a permanent error at listen_errnos[0] because when the fuzzed data is exhausted
  282|       |    // SetFuzzedErrNo() will always set the global errno to listen_errnos[0]. We want to
  283|       |    // avoid this method returning -1 and setting errno to a temporary error (like EAGAIN)
  284|       |    // repeatedly because proper code should retry on temporary errors, leading to an
  285|       |    // infinite loop.
  286|  13.5k|    constexpr std::array listen_errnos{
  287|  13.5k|        EADDRINUSE,
  288|  13.5k|        EINVAL,
  289|  13.5k|        EOPNOTSUPP,
  290|  13.5k|    };
  291|  13.5k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (291:9): [True: 4.65k, False: 8.91k]
  ------------------
  292|  4.65k|        SetFuzzedErrNo(m_fuzzed_data_provider, listen_errnos);
  293|  4.65k|        return -1;
  294|  4.65k|    }
  295|  8.91k|    return 0;
  296|  13.5k|}
_ZNK10FuzzedSock6AcceptEP8sockaddrPj:
  299|  2.75k|{
  300|  2.75k|    constexpr std::array accept_errnos{
  301|  2.75k|        ECONNABORTED,
  302|  2.75k|        EINTR,
  303|  2.75k|        ENOMEM,
  304|  2.75k|    };
  305|  2.75k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (305:9): [True: 202, False: 2.55k]
  ------------------
  306|    202|        SetFuzzedErrNo(m_fuzzed_data_provider, accept_errnos);
  307|    202|        return std::unique_ptr<FuzzedSock>();
  308|    202|    }
  309|  2.55k|    if (addr != nullptr) {
  ------------------
  |  Branch (309:9): [True: 2.55k, False: 0]
  ------------------
  310|       |        // Set a fuzzed address in the output argument addr.
  311|  2.55k|        memset(addr, 0x00, *addr_len);
  312|  2.55k|        if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (312:13): [True: 458, False: 2.09k]
  ------------------
  313|       |            // IPv4
  314|    458|            const socklen_t write_len = static_cast<socklen_t>(sizeof(sockaddr_in));
  315|    458|            if (*addr_len >= write_len) {
  ------------------
  |  Branch (315:17): [True: 458, False: 0]
  ------------------
  316|    458|                *addr_len = write_len;
  317|    458|                auto addr4 = reinterpret_cast<sockaddr_in*>(addr);
  318|    458|                addr4->sin_family = AF_INET;
  319|    458|                const auto sin_addr_bytes{m_fuzzed_data_provider.ConsumeBytes<std::byte>(sizeof(addr4->sin_addr))};
  320|    458|                std::ranges::copy(sin_addr_bytes, reinterpret_cast<std::byte*>(&addr4->sin_addr));
  321|    458|                addr4->sin_port = m_fuzzed_data_provider.ConsumeIntegralInRange<uint16_t>(1, 65535);
  322|    458|            }
  323|  2.09k|        } else {
  324|       |            // IPv6
  325|  2.09k|            const socklen_t write_len = static_cast<socklen_t>(sizeof(sockaddr_in6));
  326|  2.09k|            if (*addr_len >= write_len) {
  ------------------
  |  Branch (326:17): [True: 2.09k, False: 0]
  ------------------
  327|  2.09k|                *addr_len = write_len;
  328|  2.09k|                auto addr6 = reinterpret_cast<sockaddr_in6*>(addr);
  329|       |                addr6->sin6_family = AF_INET6;
  330|  2.09k|                const auto sin_addr_bytes{m_fuzzed_data_provider.ConsumeBytes<std::byte>(sizeof(addr6->sin6_addr))};
  331|  2.09k|                std::ranges::copy(sin_addr_bytes, reinterpret_cast<std::byte*>(&addr6->sin6_addr));
  332|  2.09k|                addr6->sin6_port = m_fuzzed_data_provider.ConsumeIntegralInRange<uint16_t>(1, 65535);
  333|  2.09k|            }
  334|  2.09k|        }
  335|  2.55k|    }
  336|  2.55k|    return std::make_unique<FuzzedSock>(m_fuzzed_data_provider, m_clock);
  337|  2.75k|}
_ZNK10FuzzedSock10GetSockOptEiiPvPj:
  340|    384|{
  341|    384|    constexpr std::array getsockopt_errnos{
  342|    384|        ENOMEM,
  343|    384|        ENOBUFS,
  344|    384|    };
  345|    384|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (345:9): [True: 260, False: 124]
  ------------------
  346|    260|        SetFuzzedErrNo(m_fuzzed_data_provider, getsockopt_errnos);
  347|    260|        return -1;
  348|    260|    }
  349|    124|    if (opt_val == nullptr) {
  ------------------
  |  Branch (349:9): [True: 0, False: 124]
  ------------------
  350|      0|        return 0;
  351|      0|    }
  352|    124|    std::memcpy(opt_val,
  353|    124|                ConsumeFixedLengthByteVector(m_fuzzed_data_provider, *opt_len).data(),
  354|    124|                *opt_len);
  355|    124|    return 0;
  356|    124|}
_ZNK10FuzzedSock10SetSockOptEiiPKvj:
  359|   388k|{
  360|   388k|    constexpr std::array setsockopt_errnos{
  361|   388k|        ENOMEM,
  362|   388k|        ENOBUFS,
  363|   388k|    };
  364|   388k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (364:9): [True: 363k, False: 25.0k]
  ------------------
  365|   363k|        SetFuzzedErrNo(m_fuzzed_data_provider, setsockopt_errnos);
  366|   363k|        return -1;
  367|   363k|    }
  368|  25.0k|    return 0;
  369|   388k|}
_ZNK10FuzzedSock11GetSockNameEP8sockaddrPj:
  372|  3.49k|{
  373|  3.49k|    constexpr std::array getsockname_errnos{
  374|  3.49k|        ECONNRESET,
  375|  3.49k|        ENOBUFS,
  376|  3.49k|    };
  377|  3.49k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (377:9): [True: 1.54k, False: 1.94k]
  ------------------
  378|  1.54k|        SetFuzzedErrNo(m_fuzzed_data_provider, getsockname_errnos);
  379|  1.54k|        return -1;
  380|  1.54k|    }
  381|  3.49k|    assert(name_len);
  ------------------
  |  Branch (381:5): [True: 1.94k, False: 0]
  ------------------
  382|  1.94k|    const auto bytes{ConsumeRandomLengthByteVector(m_fuzzed_data_provider, *name_len)};
  383|  1.94k|    if (bytes.size() < (int)sizeof(sockaddr)) return -1;
  ------------------
  |  Branch (383:9): [True: 1.30k, False: 645]
  ------------------
  384|    645|    std::memcpy(name, bytes.data(), bytes.size());
  385|    645|    *name_len = bytes.size();
  386|    645|    return 0;
  387|  1.94k|}
_ZNK10FuzzedSock12IsSelectableEv:
  403|   350k|{
  404|   350k|    return m_selectable;
  405|   350k|}
_ZNK10FuzzedSock4WaitENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEEhPh:
  408|  7.93k|{
  409|  7.93k|    constexpr std::array wait_errnos{
  410|  7.93k|        EBADF,
  411|  7.93k|        EINTR,
  412|  7.93k|        EINVAL,
  413|  7.93k|    };
  414|  7.93k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (414:9): [True: 1.57k, False: 6.35k]
  ------------------
  415|  1.57k|        SetFuzzedErrNo(m_fuzzed_data_provider, wait_errnos);
  416|  1.57k|        return false;
  417|  1.57k|    }
  418|  6.35k|    if (occurred != nullptr) {
  ------------------
  |  Branch (418:9): [True: 622, False: 5.73k]
  ------------------
  419|       |        // We simulate the requested event as occurred when ConsumeBool()
  420|       |        // returns false. This avoids simulating endless waiting if the
  421|       |        // FuzzedDataProvider runs out of data.
  422|    622|        *occurred = m_fuzzed_data_provider.ConsumeBool() ? 0 : requested;
  ------------------
  |  Branch (422:21): [True: 238, False: 384]
  ------------------
  423|    622|    }
  424|  6.35k|    m_clock += timeout;
  425|  6.35k|    return true;
  426|  7.93k|}
_ZNK10FuzzedSock8WaitManyENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEERNS0_13unordered_mapINS0_10shared_ptrIK4SockEENS8_6EventsENS8_17HashSharedPtrSockENS8_18EqualSharedPtrSockENS0_9allocatorINS0_4pairIKSA_SB_EEEEEE:
  429|  25.4k|{
  430|  36.6k|    for (auto& [sock, events] : events_per_sock) {
  ------------------
  |  Branch (430:31): [True: 36.6k, False: 25.4k]
  ------------------
  431|  36.6k|        (void)sock;
  432|       |        // We simulate the requested event as occurred when ConsumeBool()
  433|       |        // returns false. This avoids simulating endless waiting if the
  434|       |        // FuzzedDataProvider runs out of data.
  435|  36.6k|        events.occurred = m_fuzzed_data_provider.ConsumeBool() ? 0 : events.requested;
  ------------------
  |  Branch (435:27): [True: 32.6k, False: 3.96k]
  ------------------
  436|  36.6k|    }
  437|  25.4k|    m_clock += timeout;
  438|  25.4k|    return true;
  439|  25.4k|}

_Z22ConsumeNetGroupManagerR18FuzzedDataProvider:
  237|  9.89k|{
  238|  9.89k|    std::vector<std::byte> asmap{ConsumeRandomLengthByteVector<std::byte>(fuzzed_data_provider)};
  239|  9.89k|    if (!CheckStandardAsmap(asmap)) {
  ------------------
  |  Branch (239:9): [True: 9.27k, False: 616]
  ------------------
  240|  9.27k|        return NetGroupManager::NoAsmap();
  241|  9.27k|    }
  242|    616|    return NetGroupManager::WithLoadedAsmap(std::move(asmap));
  243|  9.89k|}
_Z16ConsumeNetEventsR18FuzzedDataProvider:
  227|  9.89k|{
  228|  9.89k|    return FuzzedNetEvents{fdp};
  229|  9.89k|}
_ZN15FuzzedNetEventsC2ER18FuzzedDataProvider:
  147|  9.89k|    FuzzedNetEvents(FuzzedDataProvider& fdp) : m_fdp(fdp) {}
_ZN15FuzzedNetEvents14InitializeNodeERK5CNode12ServiceFlags:
  149|   331k|    virtual void InitializeNode(const CNode&, ServiceFlags) override {}
_Z13ConsumeSubNetR18FuzzedDataProvider:
  246|   102k|{
  247|   102k|    return {ConsumeNetAddr(fuzzed_data_provider), fuzzed_data_provider.ConsumeIntegral<uint8_t>()};
  248|   102k|}
_ZN20AddrManDeterministicC2ERK15NetGroupManagerR18FuzzedDataProvideri:
   46|  12.9k|        : AddrMan(netgroupman, /*deterministic=*/true, check_ratio)
   47|  12.9k|    {
   48|  12.9k|        WITH_LOCK(m_impl->cs, m_impl->insecure_rand.Reseed(ConsumeUInt256(fuzzed_data_provider)));
  ------------------
  |  |  299|  12.9k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
   49|  12.9k|    }
_Z20ConsumeServiceVectorR18FuzzedDataProviderm:
  257|  85.0k|{
  258|  85.0k|    std::vector<CService> ret;
  259|  85.0k|    const size_t size = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, max_vector_size);
  260|  85.0k|    ret.reserve(size);
  261|   221k|    for (size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (261:24): [True: 136k, False: 85.0k]
  ------------------
  262|   136k|        ret.emplace_back(ConsumeService(fuzzed_data_provider));
  263|   136k|    }
  264|  85.0k|    return ret;
  265|  85.0k|}
_Z11ConsumeNodeILb0EEDaR18FuzzedDataProviderR15FakeSteadyClockRKNSt3__18optionalIlEE:
  271|  9.89k|{
  272|  9.89k|    const NodeId node_id = node_id_in.value_or(fuzzed_data_provider.ConsumeIntegralInRange<NodeId>(0, std::numeric_limits<NodeId>::max()));
  273|  9.89k|    const auto sock = std::make_shared<FuzzedSock>(fuzzed_data_provider, clock);
  274|  9.89k|    const CAddress address = ConsumeAddress(fuzzed_data_provider);
  275|  9.89k|    const uint64_t keyed_net_group = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  276|  9.89k|    const uint64_t local_host_nonce = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  277|  9.89k|    const CAddress addr_bind = ConsumeAddress(fuzzed_data_provider);
  278|  9.89k|    const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
  279|  9.89k|    const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES);
  280|  9.89k|    const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
  ------------------
  |  Branch (280:30): [True: 5.13k, False: 4.75k]
  ------------------
  281|  9.89k|    const uint64_t network_id = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  282|       |
  283|  9.89k|    NetPermissionFlags permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
  284|       |    if constexpr (ReturnUniquePtr) {
  285|       |        return std::make_unique<CNode>(node_id,
  286|       |                                       sock,
  287|       |                                       address,
  288|       |                                       keyed_net_group,
  289|       |                                       local_host_nonce,
  290|       |                                       addr_bind,
  291|       |                                       addr_name,
  292|       |                                       conn_type,
  293|       |                                       inbound_onion,
  294|       |                                       network_id,
  295|       |                                       CNodeOptions{ .permission_flags = permission_flags });
  296|  9.89k|    } else {
  297|  9.89k|        return CNode{node_id,
  298|  9.89k|                     sock,
  299|  9.89k|                     address,
  300|  9.89k|                     keyed_net_group,
  301|  9.89k|                     local_host_nonce,
  302|  9.89k|                     addr_bind,
  303|  9.89k|                     addr_name,
  304|  9.89k|                     conn_type,
  305|  9.89k|                     inbound_onion,
  306|  9.89k|                     network_id,
  307|  9.89k|                     CNodeOptions{ .permission_flags = permission_flags }};
  308|  9.89k|    }
  309|  9.89k|}
_Z22ConsumeNodeAsUniquePtrR18FuzzedDataProviderR15FakeSteadyClockRKNSt3__18optionalIlEE:
  310|  47.8k|inline std::unique_ptr<CNode> ConsumeNodeAsUniquePtr(FuzzedDataProvider& fdp, FakeSteadyClock& clock, const std::optional<NodeId>& node_id_in = std::nullopt) { return ConsumeNode<true>(fdp, clock, node_id_in); }
_Z11ConsumeNodeILb1EEDaR18FuzzedDataProviderR15FakeSteadyClockRKNSt3__18optionalIlEE:
  271|  47.8k|{
  272|  47.8k|    const NodeId node_id = node_id_in.value_or(fuzzed_data_provider.ConsumeIntegralInRange<NodeId>(0, std::numeric_limits<NodeId>::max()));
  273|  47.8k|    const auto sock = std::make_shared<FuzzedSock>(fuzzed_data_provider, clock);
  274|  47.8k|    const CAddress address = ConsumeAddress(fuzzed_data_provider);
  275|  47.8k|    const uint64_t keyed_net_group = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  276|  47.8k|    const uint64_t local_host_nonce = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  277|  47.8k|    const CAddress addr_bind = ConsumeAddress(fuzzed_data_provider);
  278|  47.8k|    const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
  279|  47.8k|    const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES);
  280|  47.8k|    const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
  ------------------
  |  Branch (280:30): [True: 21.8k, False: 26.0k]
  ------------------
  281|  47.8k|    const uint64_t network_id = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  282|       |
  283|  47.8k|    NetPermissionFlags permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
  284|  47.8k|    if constexpr (ReturnUniquePtr) {
  285|  47.8k|        return std::make_unique<CNode>(node_id,
  286|  47.8k|                                       sock,
  287|  47.8k|                                       address,
  288|  47.8k|                                       keyed_net_group,
  289|  47.8k|                                       local_host_nonce,
  290|  47.8k|                                       addr_bind,
  291|  47.8k|                                       addr_name,
  292|  47.8k|                                       conn_type,
  293|  47.8k|                                       inbound_onion,
  294|  47.8k|                                       network_id,
  295|  47.8k|                                       CNodeOptions{ .permission_flags = permission_flags });
  296|       |    } else {
  297|       |        return CNode{node_id,
  298|       |                     sock,
  299|       |                     address,
  300|       |                     keyed_net_group,
  301|       |                     local_host_nonce,
  302|       |                     addr_bind,
  303|       |                     addr_name,
  304|       |                     conn_type,
  305|       |                     inbound_onion,
  306|       |                     network_id,
  307|       |                     CNodeOptions{ .permission_flags = permission_flags }};
  308|       |    }
  309|  47.8k|}
_Z14ConsumeServiceR18FuzzedDataProvider:
  251|  1.19M|{
  252|  1.19M|    return {ConsumeNetAddr(fuzzed_data_provider), fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
  253|  1.19M|}

_ZN21FuzzedThreadInterruptC2ER18FuzzedDataProvider:
    9|  9.89k|    : m_fuzzed_data_provider{fuzzed_data_provider}
   10|  9.89k|{
   11|  9.89k|}
_ZNK21FuzzedThreadInterrupt11interruptedEv:
   14|   138k|{
   15|   138k|    return m_fuzzed_data_provider.ConsumeBool();
   16|   138k|}
_ZN21FuzzedThreadInterrupt9sleep_forENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000000000EEEEE:
   19|  3.28k|{
   20|  3.28k|    SetMockTime(ConsumeTime(m_fuzzed_data_provider)); // Time could go backwards.
   21|  3.28k|    return m_fuzzed_data_provider.ConsumeBool();
   22|  3.28k|}

_Z22ConsumeThreadInterruptR18FuzzedDataProvider:
   29|  9.89k|{
   30|  9.89k|    return std::make_shared<FuzzedThreadInterrupt>(fuzzed_data_provider);
   31|  9.89k|}

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

_ZN14ConnmanTestMsg14ClearTestNodesEv:
   71|  9.89k|    {
   72|  9.89k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  9.89k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.89k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.89k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.89k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|   379k|        for (CNode* node : m_nodes) {
  ------------------
  |  Branch (73:26): [True: 379k, False: 9.89k]
  ------------------
   74|   379k|            delete node;
   75|   379k|        }
   76|  9.89k|        m_nodes.clear();
   77|  9.89k|    }
_ZN14ConnmanTestMsg34CreateNodeFromAcceptedSocketPublicENSt3__110unique_ptrI4SockNS0_14default_deleteIS2_EEEE18NetPermissionFlagsRK8CAddressS9_:
   83|   350k|    {
   84|   350k|        CreateNodeFromAcceptedSocket(std::move(sock), permissions, addr_bind, addr_peer);
   85|   350k|    }
_ZN14ConnmanTestMsg15InitBindsPublicERKN8CConnman7OptionsE:
   88|  42.5k|    {
   89|  42.5k|        return InitBinds(options);
   90|  42.5k|    }
_ZN14ConnmanTestMsg19SocketHandlerPublicEv:
   93|  28.6k|    {
   94|  28.6k|        SocketHandler();
   95|  28.6k|    }
_ZN14ConnmanTestMsg11AddTestNodeER5CNode:
   63|  47.8k|    {
   64|  47.8k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  268|  47.8k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  47.8k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  47.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  47.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|  47.8k|        m_nodes.push_back(&node);
   66|       |
   67|  47.8k|        if (node.IsManualOrFullOutboundConn()) ++m_network_conn_counts[node.addr.GetNetwork()];
  ------------------
  |  Branch (67:13): [True: 9.46k, False: 38.3k]
  ------------------
   68|  47.8k|    }

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

_ZN17BasicTestingSetupD2Ev:
  252|      2|{
  253|      2|    m_node.ecc_context.reset();
  254|      2|    m_node.kernel.reset();
  255|      2|    if (!EnableFuzzDeterminism()) {
  ------------------
  |  Branch (255:9): [True: 0, False: 2]
  ------------------
  256|      0|        SetMockTime(0s); // Reset mocktime for following tests
  257|      0|    }
  258|      2|    LogInstance().DisconnectTestLogger();
  259|      2|    if (m_has_custom_datadir) {
  ------------------
  |  Branch (259:9): [True: 0, False: 2]
  ------------------
  260|       |        // Only remove the lock file, preserve the data directory.
  261|      0|        UnlockDirectory(m_path_lock, ".lock");
  262|      0|        fs::remove(m_path_lock / ".lock");
  263|      2|    } else {
  264|      2|        fs::remove_all(m_path_root);
  265|      2|    }
  266|       |    // Clear all arguments except for -datadir, which GUI tests currently rely
  267|       |    // on to be set even after the testing setup is destroyed.
  268|      2|    gArgs.ClearArgs();
  269|      2|    gArgs.ForceSetArg("-datadir", fs::PathToString(m_path_root));
  270|      2|}
_ZN17ChainTestingSetupD2Ev:
  336|      2|{
  337|      2|    if (m_node.scheduler) m_node.scheduler->stop();
  ------------------
  |  Branch (337:9): [True: 2, False: 0]
  ------------------
  338|      2|    if (m_node.validation_signals) m_node.validation_signals->FlushBackgroundCallbacks();
  ------------------
  |  Branch (338:9): [True: 2, False: 0]
  ------------------
  339|      2|    m_node.connman.reset();
  340|      2|    m_node.banman.reset();
  341|      2|    m_node.addrman.reset();
  342|      2|    m_node.netgroupman.reset();
  343|      2|    m_node.args = nullptr;
  344|      2|    m_node.mempool.reset();
  345|      2|    Assert(!m_node.fee_estimator_man); // Each test must create a local object, if they wish to use the fee_estimator_man
  ------------------
  |  |  116|      2|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
  346|      2|    m_node.chainman.reset();
  347|      2|    m_node.validation_signals.reset();
  348|      2|    m_node.scheduler.reset();
  349|      2|}

_ZN15FakeSteadyClockC2Ev:
   34|  9.89k|    explicit FakeSteadyClock() { (*this) += 0s; }
_ZN8LimitOneI15FakeSteadyClockEC2Ev:
   16|  9.89k|    LimitOne() { Assert(g_T_available) = false; }
  ------------------
  |  |  116|  9.89k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
_ZN8LimitOneI15FakeSteadyClockED2Ev:
   17|  9.89k|    ~LimitOne() { g_T_available = true; }
_ZN15FakeSteadyClockD2Ev:
   37|  9.89k|    ~FakeSteadyClock() { MockableSteadyClock::ClearMockTime(); }
_ZN13FakeNodeClockC2ENSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1EEEEEEE:
   59|  9.89k|    explicit FakeNodeClock(NodeSeconds init_time) { set(init_time); }
_ZN15FakeSteadyClockpLENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEE:
   44|  41.6k|    {
   45|  41.6k|        Assert(d >= 0s); // Steady time can only increase monotonically.
  ------------------
  |  |  116|  41.6k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
   46|  41.6k|        t += d;
   47|  41.6k|        MockableSteadyClock::SetMockTime(t);
   48|  41.6k|    }
_ZN8LimitOneI13FakeNodeClockEC2Ev:
   16|  9.89k|    LimitOne() { Assert(g_T_available) = false; }
  ------------------
  |  |  116|  9.89k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
_ZN13FakeNodeClock3setENSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEE:
   72|  9.89k|    void set(std::chrono::seconds t) { set(NodeSeconds{t}); }
_ZN8LimitOneI13FakeNodeClockED2Ev:
   17|  9.89k|    ~LimitOne() { g_T_available = true; }
_ZN13FakeNodeClockD2Ev:
   65|  9.89k|    ~FakeNodeClock() { set(0s); }
_ZN13FakeNodeClock3setENSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1EEEEEEE:
   71|  19.7k|    void set(NodeSeconds t) { SetMockTime(m_t = t); }

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

_ZN12CCoinsViewDBD2Ev:
   64|      2|{
   65|      2|    if (m_compaction.valid()) {
  ------------------
  |  Branch (65:9): [True: 0, False: 2]
  ------------------
   66|      0|        if (m_compaction.wait_for(std::chrono::seconds{0}) != std::future_status::ready) {
  ------------------
  |  Branch (66:13): [True: 0, False: 0]
  ------------------
   67|      0|            LogInfo("Waiting for background chainstate compaction of %s", fs::PathToString(m_db_params.path));
  ------------------
  |  |  125|      0|#define LogInfo(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
   68|      0|        }
   69|      0|        m_compaction.wait();
   70|      0|    }
   71|      2|}

txgraph.cpp:_ZN12_GLOBAL__N_111TxGraphImplD2Ev:
 1602|      2|{
 1603|       |    // If Refs outlive the TxGraphImpl they refer to, unlink them, so that their destructor does not
 1604|       |    // try to reach into a non-existing TxGraphImpl anymore.
 1605|      2|    for (auto& entry : m_entries) {
  ------------------
  |  Branch (1605:22): [True: 0, False: 2]
  ------------------
 1606|      0|        if (entry.m_ref != nullptr) {
  ------------------
  |  Branch (1606:13): [True: 0, False: 0]
  ------------------
 1607|      0|            GetRefGraph(*entry.m_ref) = nullptr;
 1608|      0|        }
 1609|      0|    }
 1610|      2|}

_ZN7TxGraphD2Ev:
   70|      2|    virtual ~TxGraph() = default;

_ZN16TxRequestTrackerD2Ev:
  714|      2|TxRequestTracker::~TxRequestTracker() = default;

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

_ZN7uint256C2Eh:
  202|  12.9k|    constexpr explicit uint256(uint8_t v) : base_blob<256>(v) {}
_ZN9base_blobILj256EEC2Eh:
   40|  12.9k|    constexpr explicit base_blob(uint8_t v) : m_data{v} {}
_ZN9base_blobILj256EE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  119|  3.20k|    {
  120|  3.20k|        s.read(MakeWritableByteSpan(m_data));
  121|  3.20k|    }
_ZN9base_blobILj256EE7SetNullEv:
   58|   406k|    {
   59|   406k|        std::fill(m_data.begin(), m_data.end(), 0);
   60|   406k|    }
_ZNK9base_blobILj256EEeqERKS0_:
   62|     26|    constexpr bool operator==(const base_blob&) const = default;
_ZNK9base_blobILj256EE6IsNullEv:
   51|  1.49k|    {
   52|  1.49k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   53|  1.49k|            return val == 0;
   54|  1.49k|        });
   55|  1.49k|    }
_ZZNK9base_blobILj256EE6IsNullEvENKUlhE_clEh:
   52|  13.3k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   53|  13.3k|            return val == 0;
   54|  13.3k|        });
_ZN7uint256C2ENSt3__14spanIKhLm18446744073709551615EEE:
  203|  11.0k|    constexpr explicit uint256(std::span<const unsigned char> vch) : base_blob<256>(vch) {}
_ZN9base_blobILj256EEC2ENSt3__14spanIKhLm18446744073709551615EEE:
   43|  11.0k|    {
   44|  11.0k|        assert(vch.size() == WIDTH);
  ------------------
  |  Branch (44:9): [True: 11.0k, False: 0]
  ------------------
   45|  11.0k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   46|  11.0k|    }
_ZN9base_blobILj256EE4dataEv:
   99|   629k|    constexpr unsigned char* data() { return m_data.data(); }
_ZNK9base_blobILj256EE9SerializeI10HashWriterEEvRT_:
  113|   212k|    {
  114|   212k|        s << std::span(m_data);
  115|   212k|    }
_ZN7uint256C2Ev:
  200|  1.23M|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   37|  1.23M|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EE5beginEv:
  101|   936k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE4dataEv:
   98|   562k|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  107|  1.19M|    static constexpr unsigned int size() { return WIDTH; }

_ZN8UniValueC2Ev:
   31|  26.3k|    UniValue() { typ = VNULL; }
_ZN8UniValueC2IRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_TnNS1_9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbSB_Esr3stdE11is_signed_vISB_Esr3stdE13is_unsigned_vISB_Esr3stdE18is_constructible_vIS7_SB_EEbE4typeELb1EEEOT_:
   40|      2|    {
   41|       |        if constexpr (std::is_floating_point_v<T>) {
   42|       |            setFloat(val);
   43|       |        } else if constexpr (std::is_same_v<bool, T>) {
   44|       |            setBool(val);
   45|       |        } else if constexpr (std::is_signed_v<T>) {
   46|       |            setInt(int64_t{val});
   47|       |        } else if constexpr (std::is_unsigned_v<T>) {
   48|       |            setInt(uint64_t{val});
   49|      2|        } else {
   50|      2|            setStr(std::string{std::forward<Ref>(val)});
   51|      2|        }
   52|      2|    }
_ZNK8UniValue6isNullEv:
   81|  26.3k|    bool isNull() const { return (typ == VNULL); }

_ZN8UniValue5clearEv:
   18|      2|{
   19|      2|    typ = VNULL;
   20|      2|    val.clear();
   21|      2|    keys.clear();
   22|      2|    values.clear();
   23|      2|}
_ZN8UniValue6setStrENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   85|      2|{
   86|      2|    clear();
   87|      2|    typ = VSTR;
   88|      2|    val = std::move(str);
   89|      2|}

_Z9InterpretNSt3__14spanIKSt4byteLm18446744073709551615EEES3_:
  181|  39.4k|{
  182|  39.4k|    size_t pos{0};
  183|  39.4k|    const size_t endpos{asmap.size() * 8};
  184|  39.4k|    uint8_t ip_bit{0};
  185|  39.4k|    const uint8_t ip_bits_end = ip.size() * 8;
  186|  39.4k|    uint32_t default_asn = 0;
  187|   103k|    while (pos < endpos) {
  ------------------
  |  Branch (187:12): [True: 103k, False: 0]
  ------------------
  188|   103k|        Instruction opcode = DecodeType(pos, asmap);
  189|   103k|        if (opcode == Instruction::RETURN) {
  ------------------
  |  Branch (189:13): [True: 16.4k, False: 86.6k]
  ------------------
  190|       |            // Found leaf node - return the ASN
  191|  16.4k|            uint32_t asn = DecodeASN(pos, asmap);
  192|  16.4k|            if (asn == INVALID) break; // ASN straddles EOF
  ------------------
  |  Branch (192:17): [True: 0, False: 16.4k]
  ------------------
  193|  16.4k|            return asn;
  194|  86.6k|        } else if (opcode == Instruction::JUMP) {
  ------------------
  |  Branch (194:20): [True: 26.1k, False: 60.5k]
  ------------------
  195|       |            // Binary branch: if IP bit is 1, jump forward; else continue
  196|  26.1k|            uint32_t jump = DecodeJump(pos, asmap);
  197|  26.1k|            if (jump == INVALID) break; // Jump offset straddles EOF
  ------------------
  |  Branch (197:17): [True: 0, False: 26.1k]
  ------------------
  198|  26.1k|            if (ip_bit == ip_bits_end) break; // No input bits left
  ------------------
  |  Branch (198:17): [True: 0, False: 26.1k]
  ------------------
  199|  26.1k|            if (int64_t{jump} >= static_cast<int64_t>(endpos - pos)) break; // Jumping past EOF
  ------------------
  |  Branch (199:17): [True: 0, False: 26.1k]
  ------------------
  200|  26.1k|            if (ConsumeBitBE(ip_bit, ip)) {  // Check next IP bit (big-endian)
  ------------------
  |  Branch (200:17): [True: 16.4k, False: 9.70k]
  ------------------
  201|  16.4k|                pos += jump;  // Bit = 1: skip to right subtree
  202|  16.4k|            }
  203|       |            // Bit = 0: fall through to left subtree
  204|  60.5k|        } else if (opcode == Instruction::MATCH) {
  ------------------
  |  Branch (204:20): [True: 34.6k, False: 25.9k]
  ------------------
  205|       |            // Compare multiple IP bits against a pattern
  206|       |            // The match value encodes both length and pattern:
  207|       |            // - highest set bit position determines length (bit_width - 1)
  208|       |            // - lower bits contain the pattern to compare
  209|  34.6k|            uint32_t match = DecodeMatch(pos, asmap);
  210|  34.6k|            if (match == INVALID) break; // Match bits straddle EOF
  ------------------
  |  Branch (210:17): [True: 0, False: 34.6k]
  ------------------
  211|  34.6k|            int matchlen = std::bit_width(match) - 1;  // An n-bit value matches n-1 input bits
  212|  34.6k|            if ((ip_bits_end - ip_bit) < matchlen) break; // Not enough input bits
  ------------------
  |  Branch (212:17): [True: 0, False: 34.6k]
  ------------------
  213|  67.8k|            for (int bit = 0; bit < matchlen; bit++) {
  ------------------
  |  Branch (213:31): [True: 56.3k, False: 11.5k]
  ------------------
  214|  56.3k|                if (ConsumeBitBE(ip_bit, ip) != ((match >> (matchlen - 1 - bit)) & 1)) {
  ------------------
  |  Branch (214:21): [True: 23.0k, False: 33.2k]
  ------------------
  215|  23.0k|                    return default_asn;  // Pattern mismatch - use default
  216|  23.0k|                }
  217|  56.3k|            }
  218|       |            // Pattern matched - continue execution
  219|  34.6k|        } else if (opcode == Instruction::DEFAULT) {
  ------------------
  |  Branch (219:20): [True: 25.9k, False: 0]
  ------------------
  220|       |            // Update the default ASN for subsequent MATCH failures
  221|  25.9k|            default_asn = DecodeASN(pos, asmap);
  222|  25.9k|            if (default_asn == INVALID) break; // ASN straddles EOF
  ------------------
  |  Branch (222:17): [True: 0, False: 25.9k]
  ------------------
  223|  25.9k|        } else {
  224|      0|            break; // Instruction straddles EOF
  225|      0|        }
  226|   103k|    }
  227|       |    // Reached EOF without RETURN, or aborted (see any of the breaks above)
  228|       |    // - should have been caught by SanityCheckAsmap below
  229|  39.4k|    assert(false);
  ------------------
  |  Branch (229:5): [Folded, False: 0]
  ------------------
  230|      0|    return 0; // 0 is not a valid ASN
  231|      0|}
_Z16SanityCheckAsmapNSt3__14spanIKSt4byteLm18446744073709551615EEEi:
  238|  9.89k|{
  239|  9.89k|    size_t pos{0};
  240|  9.89k|    const size_t endpos{asmap.size() * 8};
  241|  9.89k|    std::vector<std::pair<uint32_t, int>> jumps; // All future positions we may jump to (bit offset in asmap -> bits to consume left)
  242|  9.89k|    jumps.reserve(bits);
  243|  9.89k|    Instruction prevopcode = Instruction::JUMP;
  244|  9.89k|    bool had_incomplete_match = false;  // Track <8 bit matches for efficiency check
  245|       |
  246|  19.4k|    while (pos != endpos) {
  ------------------
  |  Branch (246:12): [True: 14.8k, False: 4.62k]
  ------------------
  247|       |        // There was a jump into the middle of the previous instruction
  248|  14.8k|        if (!jumps.empty() && pos >= jumps.back().first) return false;
  ------------------
  |  Branch (248:13): [True: 4.00k, False: 10.8k]
  |  Branch (248:31): [True: 16, False: 3.98k]
  ------------------
  249|       |
  250|  14.8k|        Instruction opcode = DecodeType(pos, asmap);
  251|  14.8k|        if (opcode == Instruction::RETURN) {
  ------------------
  |  Branch (251:13): [True: 5.65k, False: 9.16k]
  ------------------
  252|       |            // There should not be any RETURN immediately after a DEFAULT (could be combined into just RETURN)
  253|  5.65k|            if (prevopcode == Instruction::DEFAULT) return false;
  ------------------
  |  Branch (253:17): [True: 229, False: 5.42k]
  ------------------
  254|  5.42k|            uint32_t asn = DecodeASN(pos, asmap);
  255|  5.42k|            if (asn == INVALID) return false; // ASN straddles EOF
  ------------------
  |  Branch (255:17): [True: 845, False: 4.58k]
  ------------------
  256|  4.58k|            if (jumps.empty()) {
  ------------------
  |  Branch (256:17): [True: 1.99k, False: 2.58k]
  ------------------
  257|       |                // Nothing to execute anymore
  258|  1.99k|                if (endpos - pos > 7) return false; // Excessive padding
  ------------------
  |  Branch (258:21): [True: 1.26k, False: 735]
  ------------------
  259|  2.70k|                while (pos != endpos) {
  ------------------
  |  Branch (259:24): [True: 2.09k, False: 616]
  ------------------
  260|  2.09k|                    if (ConsumeBitLE(pos, asmap)) return false; // Nonzero padding bit
  ------------------
  |  Branch (260:25): [True: 119, False: 1.97k]
  ------------------
  261|  2.09k|                }
  262|    616|                return true; // Sanely reached EOF
  263|  2.58k|            } else {
  264|       |                // Continue by pretending we jumped to the next instruction
  265|  2.58k|                if (pos != jumps.back().first) return false; // Unreachable code
  ------------------
  |  Branch (265:21): [True: 197, False: 2.38k]
  ------------------
  266|  2.38k|                bits = jumps.back().second; // Restore the number of bits we would have had left after this jump
  267|  2.38k|                jumps.pop_back();
  268|  2.38k|                prevopcode = Instruction::JUMP;
  269|  2.38k|            }
  270|  9.16k|        } else if (opcode == Instruction::JUMP) {
  ------------------
  |  Branch (270:20): [True: 3.95k, False: 5.21k]
  ------------------
  271|  3.95k|            uint32_t jump = DecodeJump(pos, asmap);
  272|  3.95k|            if (jump == INVALID) return false; // Jump offset straddles EOF
  ------------------
  |  Branch (272:17): [True: 45, False: 3.90k]
  ------------------
  273|  3.90k|            if (int64_t{jump} > static_cast<int64_t>(endpos - pos)) return false; // Jump out of range
  ------------------
  |  Branch (273:17): [True: 764, False: 3.14k]
  ------------------
  274|  3.14k|            if (bits == 0) return false; // Consuming bits past the end of the input
  ------------------
  |  Branch (274:17): [True: 2, False: 3.14k]
  ------------------
  275|  3.14k|            --bits;
  276|  3.14k|            uint32_t jump_offset = pos + jump;
  277|  3.14k|            if (!jumps.empty() && jump_offset >= jumps.back().first) return false; // Intersecting jumps
  ------------------
  |  Branch (277:17): [True: 891, False: 2.24k]
  |  Branch (277:35): [True: 199, False: 692]
  ------------------
  278|  2.94k|            jumps.emplace_back(jump_offset, bits);  // Queue jump target for validation
  279|  2.94k|            prevopcode = Instruction::JUMP;
  280|  5.21k|        } else if (opcode == Instruction::MATCH) {
  ------------------
  |  Branch (280:20): [True: 2.44k, False: 2.76k]
  ------------------
  281|  2.44k|            uint32_t match = DecodeMatch(pos, asmap);
  282|  2.44k|            if (match == INVALID) return false; // Match bits straddle EOF
  ------------------
  |  Branch (282:17): [True: 92, False: 2.34k]
  ------------------
  283|  2.34k|            int matchlen = std::bit_width(match) - 1;
  284|  2.34k|            if (prevopcode != Instruction::MATCH) had_incomplete_match = false;
  ------------------
  |  Branch (284:17): [True: 1.97k, False: 374]
  ------------------
  285|       |            // Within a sequence of matches only at most one should be incomplete
  286|  2.34k|            if (matchlen < 8 && had_incomplete_match) return false;
  ------------------
  |  Branch (286:17): [True: 2.03k, False: 310]
  |  Branch (286:33): [True: 39, False: 2.00k]
  ------------------
  287|  2.31k|            had_incomplete_match = (matchlen < 8);
  288|  2.31k|            if (bits < matchlen) return false; // Consuming bits past the end of the input
  ------------------
  |  Branch (288:17): [True: 5, False: 2.30k]
  ------------------
  289|  2.30k|            bits -= matchlen;
  290|  2.30k|            prevopcode = Instruction::MATCH;
  291|  2.76k|        } else if (opcode == Instruction::DEFAULT) {
  ------------------
  |  Branch (291:20): [True: 2.74k, False: 22]
  ------------------
  292|       |            // There should not be two successive DEFAULTs (they could be combined into one)
  293|  2.74k|            if (prevopcode == Instruction::DEFAULT) return false;
  ------------------
  |  Branch (293:17): [True: 439, False: 2.30k]
  ------------------
  294|  2.30k|            uint32_t asn = DecodeASN(pos, asmap);
  295|  2.30k|            if (asn == INVALID) return false; // ASN straddles EOF
  ------------------
  |  Branch (295:17): [True: 380, False: 1.92k]
  ------------------
  296|  1.92k|            prevopcode = Instruction::DEFAULT;
  297|  1.92k|        } else {
  298|     22|            return false; // Instruction straddles EOF
  299|     22|        }
  300|  14.8k|    }
  301|  4.62k|    return false; // Reached EOF without RETURN instruction
  302|  9.89k|}
_Z18CheckStandardAsmapNSt3__14spanIKSt4byteLm18446744073709551615EEE:
  309|  9.89k|{
  310|  9.89k|    if (!SanityCheckAsmap(data, 128)) {
  ------------------
  |  Branch (310:9): [True: 9.27k, False: 616]
  ------------------
  311|  9.27k|        LogWarning("Sanity check of asmap data failed\n");
  ------------------
  |  |  126|  9.27k|#define LogWarning(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Warning, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|  9.27k|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  312|  9.27k|        return false;
  313|  9.27k|    }
  314|    616|    return true;
  315|  9.89k|}
_Z12AsmapVersionNSt3__14spanIKSt4byteLm18446744073709551615EEE:
  347|  1.40k|{
  348|  1.40k|    if (data.empty()) return {};
  ------------------
  |  Branch (348:9): [True: 1.12k, False: 280]
  ------------------
  349|       |
  350|    280|    HashWriter asmap_hasher;
  351|    280|    asmap_hasher << data;
  352|    280|    return asmap_hasher.GetHash();
  353|  1.40k|}
asmap.cpp:_ZN12_GLOBAL__N_110DecodeTypeERmNSt3__14spanIKSt4byteLm18446744073709551615EEE:
  142|   117k|{
  143|   117k|    return Instruction(DecodeBits(bitpos, data, 0, TYPE_BIT_SIZES));
  144|   117k|}
asmap.cpp:_ZN12_GLOBAL__N_110DecodeBitsERmNSt3__14spanIKSt4byteLm18446744073709551615EEEhNS2_IKhLm18446744073709551615EEE:
   86|   235k|{
   87|   235k|    uint32_t val = minval;  // Start with minimum encodable value
   88|   235k|    bool bit;
   89|   644k|    for (auto bit_sizes_it = bit_sizes.begin(); bit_sizes_it != bit_sizes.end(); ++bit_sizes_it) {
  ------------------
  |  Branch (89:49): [True: 644k, False: 0]
  ------------------
   90|       |        // Read continuation bit to determine if we're in this class
   91|   644k|        if (bit_sizes_it + 1 != bit_sizes.end()) {  // Unless we're in the last class
  ------------------
  |  Branch (91:13): [True: 573k, False: 71.3k]
  ------------------
   92|   573k|            if (bitpos >= data.size() * 8) break;
  ------------------
  |  Branch (92:17): [True: 144, False: 572k]
  ------------------
   93|   572k|            bit = ConsumeBitLE(bitpos, data);
   94|   572k|        } else {
   95|  71.3k|            bit = 0;  // Last class has no continuation bit
   96|  71.3k|        }
   97|   644k|        if (bit) {
  ------------------
  |  Branch (97:13): [True: 409k, False: 235k]
  ------------------
   98|       |            // If the value will not fit in this class, subtract its range from val,
   99|       |            // emit a "1" bit and continue with the next class
  100|   409k|            val += (1 << *bit_sizes_it);  // Add size of this class
  101|   409k|        } else {
  102|       |            // Decode the position within this class in big endian
  103|  1.47M|            for (int b = 0; b < *bit_sizes_it; b++) {
  ------------------
  |  Branch (103:29): [True: 1.23M, False: 233k]
  ------------------
  104|  1.23M|                if (bitpos >= data.size() * 8) return INVALID; // Reached EOF in mantissa
  ------------------
  |  Branch (104:21): [True: 1.24k, False: 1.23M]
  ------------------
  105|  1.23M|                bit = ConsumeBitLE(bitpos, data);
  106|  1.23M|                val += bit << (*bit_sizes_it - 1 - b); // Big-endian within the class
  107|  1.23M|            }
  108|   233k|            return val;
  109|   235k|        }
  110|   644k|    }
  111|    144|    return INVALID; // Reached EOF in exponent
  112|   235k|}
asmap.cpp:_ZN12_GLOBAL__N_19DecodeASNERmNSt3__14spanIKSt4byteLm18446744073709551615EEE:
  151|  50.0k|{
  152|  50.0k|    return DecodeBits(bitpos, data, 1, ASN_BIT_SIZES);
  153|  50.0k|}
asmap.cpp:_ZN12_GLOBAL__N_110DecodeJumpERmNSt3__14spanIKSt4byteLm18446744073709551615EEE:
  167|  30.1k|{
  168|  30.1k|    return DecodeBits(bitpos, data, 17, JUMP_BIT_SIZES);
  169|  30.1k|}
asmap.cpp:_ZN12_GLOBAL__N_112ConsumeBitBEERhNSt3__14spanIKSt4byteLm18446744073709551615EEE:
   64|  82.4k|{
   65|  82.4k|    const bool bit = (std::to_integer<uint8_t>(bytes[bitpos / 8]) >> (7 - (bitpos % 8))) & 1;
   66|  82.4k|    ++bitpos;
   67|  82.4k|    return bit;
   68|  82.4k|}
asmap.cpp:_ZN12_GLOBAL__N_111DecodeMatchERmNSt3__14spanIKSt4byteLm18446744073709551615EEE:
  159|  37.0k|{
  160|  37.0k|    return DecodeBits(bitpos, data, 2, MATCH_BIT_SIZES);
  161|  37.0k|}
asmap.cpp:_ZN12_GLOBAL__N_112ConsumeBitLEERmNSt3__14spanIKSt4byteLm18446744073709551615EEE:
   53|  1.81M|{
   54|  1.81M|    const bool bit = (std::to_integer<uint8_t>(bytes[bitpos / 8]) >> (bitpos % 8)) & 1;
   55|  1.81M|    ++bitpos;
   56|  1.81M|    return bit;
   57|  1.81M|}

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

_Z17ChainTypeToString9ChainType:
   13|  53.0k|{
   14|  53.0k|    switch (chain) {
  ------------------
  |  Branch (14:13): [True: 53.0k, False: 0]
  ------------------
   15|  53.0k|    case ChainType::MAIN:
  ------------------
  |  Branch (15:5): [True: 53.0k, False: 0]
  ------------------
   16|  53.0k|        return "main";
   17|      0|    case ChainType::TESTNET:
  ------------------
  |  Branch (17:5): [True: 0, False: 53.0k]
  ------------------
   18|      0|        return "test";
   19|      0|    case ChainType::TESTNET4:
  ------------------
  |  Branch (19:5): [True: 0, False: 53.0k]
  ------------------
   20|      0|        return "testnet4";
   21|      0|    case ChainType::SIGNET:
  ------------------
  |  Branch (21:5): [True: 0, False: 53.0k]
  ------------------
   22|      0|        return "signet";
   23|      0|    case ChainType::REGTEST:
  ------------------
  |  Branch (23:5): [True: 0, False: 53.0k]
  ------------------
   24|      0|        return "regtest";
   25|  53.0k|    }
   26|  53.0k|    assert(false);
  ------------------
  |  Branch (26:5): [Folded, False: 0]
  ------------------
   27|      0|}

_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_RKNS0_15source_locationENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   90|  9.89k|{
   91|  9.89k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 9.89k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  9.89k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 9.89k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  9.89k|    }
   96|  9.89k|    return std::forward<T>(val);
   97|  9.89k|}
_Z22inline_assertion_checkILb1ERNSt3__16atomicIbEEEOT0_S5_RKNS0_15source_locationENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   90|  9.89k|{
   91|  9.89k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 9.89k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  9.89k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 9.89k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  9.89k|    }
   96|  9.89k|    return std::forward<T>(val);
   97|  9.89k|}
_Z21EnableFuzzDeterminismv:
   39|  9.89k|{
   40|  9.89k|    if constexpr (G_FUZZING_BUILD) {
   41|  9.89k|        return true;
   42|       |    } else if constexpr (!G_ABORT_ON_FAILED_ASSUME) {
   43|       |        // Running fuzz tests is always disabled if Assume() doesn't abort
   44|       |        // (ie, non-fuzz non-debug builds), as otherwise tests which
   45|       |        // should fail due to a failing Assume may still pass. As such,
   46|       |        // we also statically disable fuzz determinism in that case.
   47|       |        return false;
   48|       |    } else {
   49|       |        return g_enable_dynamic_fuzz_determinism;
   50|       |    }
   51|  9.89k|}
_Z22inline_assertion_checkILb1ERbEOT0_S2_RKNSt3__115source_locationENS3_17basic_string_viewIcNS3_11char_traitsIcEEEE:
   90|  19.7k|{
   91|  19.7k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 19.7k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  19.7k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 19.7k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  19.7k|    }
   96|  19.7k|    return std::forward<T>(val);
   97|  19.7k|}
_Z22inline_assertion_checkILb1ERKNSt3__110unique_ptrI14LevelDBContextNS0_14default_deleteIS2_EEEEEOT0_S9_RKNS0_15source_locationENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   90|     40|{
   91|     40|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 40, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|     40|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 40]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|     40|    }
   96|     40|    return std::forward<T>(val);
   97|     40|}
_Z22inline_assertion_checkILb0ERbEOT0_S2_RKNSt3__115source_locationENS3_17basic_string_viewIcNS3_11char_traitsIcEEEE:
   90|     84|{
   91|     84|    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|     84|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 84]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|     84|    }
   96|     84|    return std::forward<T>(val);
   97|     84|}
_Z22inline_assertion_checkILb1EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|   126k|{
   91|   126k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 126k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|   126k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 126k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|   126k|    }
   96|   126k|    return std::forward<T>(val);
   97|   126k|}
_Z22inline_assertion_checkILb0EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|   234M|{
   91|   234M|    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|   234M|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 234M]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|   234M|    }
   96|   234M|    return std::forward<T>(val);
   97|   234M|}

setup_common.cpp:_ZN2fsL12PathToStringERKNS_4pathE:
  163|      2|{
  164|       |    // Implementation note: On Windows, the std::filesystem::path(string)
  165|       |    // constructor and std::filesystem::path::string() method are not safe to
  166|       |    // use here, because these methods encode the path using C++'s narrow
  167|       |    // multibyte encoding, which on Windows corresponds to the current "code
  168|       |    // page", which is unpredictable and typically not able to represent all
  169|       |    // valid paths. So fs::path::utf8string() and
  170|       |    // fs::u8path() functions are used instead on Windows. On
  171|       |    // POSIX, u8string/utf8string/u8path functions are not safe to use because paths are
  172|       |    // not always valid UTF-8, so plain string methods which do not transform
  173|       |    // the path there are used.
  174|       |#ifdef WIN32
  175|       |    return path.utf8string();
  176|       |#else
  177|      2|    static_assert(std::is_same_v<path::string_type, std::string>, "PathToString not implemented on this platform");
  178|      2|    return path.std::filesystem::path::string();
  179|      2|#endif
  180|      2|}

_ZN4util3log22LogPrintFormatInternalIJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEtEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|    635|{
  102|    635|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|    635|}
_ZN4util3log23LogPrintFormatInternal_IJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEtEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|    635|{
   85|    635|    std::string log_msg;
   86|    635|    try {
   87|    635|        log_msg = tfm::format(fmt, args...);
   88|    635|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|    635|    util::log::Log(util::log::Entry{
   92|    635|        .category = flag,
   93|    635|        .level = level,
   94|    635|        .should_ratelimit = should_ratelimit,
   95|    635|        .source_loc = std::move(source_loc),
   96|    635|        .message = std::move(log_msg)});
   97|    635|}
_ZN4util3log22LogPrintFormatInternalIJA17_cbEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|   373k|{
  102|   373k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|   373k|}
_ZN4util3log23LogPrintFormatInternal_IJA17_cbEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|   373k|{
   85|   373k|    std::string log_msg;
   86|   373k|    try {
   87|   373k|        log_msg = tfm::format(fmt, args...);
   88|   373k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|   373k|    util::log::Log(util::log::Entry{
   92|   373k|        .category = flag,
   93|   373k|        .level = level,
   94|   373k|        .should_ratelimit = should_ratelimit,
   95|   373k|        .source_loc = std::move(source_loc),
   96|   373k|        .message = std::move(log_msg)});
   97|   373k|}
_ZN4util3log22LogPrintFormatInternalIJmmiEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|  9.89k|{
  102|  9.89k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|  9.89k|}
_ZN4util3log23LogPrintFormatInternal_IJmmiEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|  9.89k|{
   85|  9.89k|    std::string log_msg;
   86|  9.89k|    try {
   87|  9.89k|        log_msg = tfm::format(fmt, args...);
   88|  9.89k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|  9.89k|    util::log::Log(util::log::Entry{
   92|  9.89k|        .category = flag,
   93|  9.89k|        .level = level,
   94|  9.89k|        .should_ratelimit = should_ratelimit,
   95|  9.89k|        .source_loc = std::move(source_loc),
   96|  9.89k|        .message = std::move(log_msg)});
   97|  9.89k|}
_ZN4util3log22LogPrintFormatInternalIJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|  9.89k|{
  102|  9.89k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|  9.89k|}
_ZN4util3log23LogPrintFormatInternal_IJPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|  9.89k|{
   85|  9.89k|    std::string log_msg;
   86|  9.89k|    try {
   87|  9.89k|        log_msg = tfm::format(fmt, args...);
   88|  9.89k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|  9.89k|    util::log::Log(util::log::Entry{
   92|  9.89k|        .category = flag,
   93|  9.89k|        .level = level,
   94|  9.89k|        .should_ratelimit = should_ratelimit,
   95|  9.89k|        .source_loc = std::move(source_loc),
   96|  9.89k|        .message = std::move(log_msg)});
   97|  9.89k|}
_ZN4util3log22LogPrintFormatInternalIJNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|      2|{
  102|      2|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|      2|}
_ZN4util3log23LogPrintFormatInternal_IJNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|      2|{
   85|      2|    std::string log_msg;
   86|      2|    try {
   87|      2|        log_msg = tfm::format(fmt, args...);
   88|      2|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|      2|    util::log::Log(util::log::Entry{
   92|      2|        .category = flag,
   93|      2|        .level = level,
   94|      2|        .should_ratelimit = should_ratelimit,
   95|      2|        .source_loc = std::move(source_loc),
   96|      2|        .message = std::move(log_msg)});
   97|      2|}
_ZN4util3log22LogPrintFormatInternalIJPKcEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|  1.40k|{
  102|  1.40k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|  1.40k|}
_ZN4util3log23LogPrintFormatInternal_IJPKcEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|  1.40k|{
   85|  1.40k|    std::string log_msg;
   86|  1.40k|    try {
   87|  1.40k|        log_msg = tfm::format(fmt, args...);
   88|  1.40k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|  1.40k|    util::log::Log(util::log::Entry{
   92|  1.40k|        .category = flag,
   93|  1.40k|        .level = level,
   94|  1.40k|        .should_ratelimit = should_ratelimit,
   95|  1.40k|        .source_loc = std::move(source_loc),
   96|  1.40k|        .message = std::move(log_msg)});
   97|  1.40k|}
_ZN4util3log22LogPrintFormatInternalIJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES8_EEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|  1.44k|{
  102|  1.44k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|  1.44k|}
_ZN4util3log23LogPrintFormatInternal_IJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES8_EEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|  1.44k|{
   85|  1.44k|    std::string log_msg;
   86|  1.44k|    try {
   87|  1.44k|        log_msg = tfm::format(fmt, args...);
   88|  1.44k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|  1.44k|    util::log::Log(util::log::Entry{
   92|  1.44k|        .category = flag,
   93|  1.44k|        .level = level,
   94|  1.44k|        .should_ratelimit = should_ratelimit,
   95|  1.44k|        .source_loc = std::move(source_loc),
   96|  1.44k|        .message = std::move(log_msg)});
   97|  1.44k|}
_ZN14SourceLocationC2EPKcNSt3__115source_locationE:
   31|   497k|        : m_func{func}, m_loc{loc} {}
_ZN4util3log22LogPrintFormatInternalIJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|  88.6k|{
  102|  88.6k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|  88.6k|}
_ZN4util3log23LogPrintFormatInternal_IJNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|  88.6k|{
   85|  88.6k|    std::string log_msg;
   86|  88.6k|    try {
   87|  88.6k|        log_msg = tfm::format(fmt, args...);
   88|  88.6k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|  88.6k|    util::log::Log(util::log::Entry{
   92|  88.6k|        .category = flag,
   93|  88.6k|        .level = level,
   94|  88.6k|        .should_ratelimit = should_ratelimit,
   95|  88.6k|        .source_loc = std::move(source_loc),
   96|  88.6k|        .message = std::move(log_msg)});
   97|  88.6k|}
_ZN4util3log22LogPrintFormatInternalIJEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelENS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
  101|  12.1k|{
  102|  12.1k|    return LogPrintFormatInternal_(std::move(source_loc), flag, level, /*should_ratelimit=*/true, fmt, args...);
  103|  12.1k|}
_ZN4util3log23LogPrintFormatInternal_IJEEEvO14SourceLocationN5BCLog8LogFlagsENS0_5LevelEbNS_21ConstevalFormatStringIXsZT_EEEDpRKT_:
   84|  12.1k|{
   85|  12.1k|    std::string log_msg;
   86|  12.1k|    try {
   87|  12.1k|        log_msg = tfm::format(fmt, args...);
   88|  12.1k|    } catch (tinyformat::format_error& fmterr) {
   89|      0|        log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
   90|      0|    }
   91|  12.1k|    util::log::Log(util::log::Entry{
   92|  12.1k|        .category = flag,
   93|  12.1k|        .level = level,
   94|  12.1k|        .should_ratelimit = should_ratelimit,
   95|  12.1k|        .source_loc = std::move(source_loc),
   96|  12.1k|        .message = std::move(log_msg)});
   97|  12.1k|}

_Z13SaturatingAddITkNSt3__18integralEiET_S1_S1_:
   45|  2.61k|{
   46|  2.61k|    if constexpr (std::numeric_limits<T>::is_signed) {
   47|  2.61k|        if (i > 0 && j > std::numeric_limits<T>::max() - i) {
  ------------------
  |  Branch (47:13): [True: 2.61k, False: 0]
  |  Branch (47:22): [True: 0, False: 2.61k]
  ------------------
   48|      0|            return std::numeric_limits<T>::max();
   49|      0|        }
   50|  2.61k|        if (i < 0 && j < std::numeric_limits<T>::min() - i) {
  ------------------
  |  Branch (50:13): [True: 0, False: 2.61k]
  |  Branch (50:22): [True: 0, False: 0]
  ------------------
   51|      0|            return std::numeric_limits<T>::min();
   52|      0|        }
   53|       |    } else {
   54|       |        if (std::numeric_limits<T>::max() - i < j) {
   55|       |            return std::numeric_limits<T>::max();
   56|       |        }
   57|       |    }
   58|  2.61k|    return i + j;
   59|  2.61k|}
_Z7CeilDivITkNSt3__117unsigned_integralEmTkNS0_17unsigned_integralEjEDaT_T0_:
   71|  42.2k|{
   72|  42.2k|    assert(divisor > 0);
  ------------------
  |  Branch (72:5): [True: 42.2k, False: 0]
  ------------------
   73|  42.2k|    return dividend / divisor + (dividend % divisor != 0);
   74|  42.2k|}
_Z10CheckedAddImENSt3__18optionalIT_EES2_S2_:
   28|  6.53M|{
   29|  6.53M|    if (AdditionOverflow(i, j)) {
  ------------------
  |  Branch (29:9): [True: 0, False: 6.53M]
  ------------------
   30|      0|        return std::nullopt;
   31|      0|    }
   32|  6.53M|    return i + j;
   33|  6.53M|}
_Z16AdditionOverflowITkNSt3__18integralEmEbT_S1_:
   18|  6.53M|{
   19|       |    if constexpr (std::numeric_limits<T>::is_signed) {
   20|       |        return (i > 0 && j > std::numeric_limits<T>::max() - i) ||
   21|       |               (i < 0 && j < std::numeric_limits<T>::min() - i);
   22|       |    }
   23|  6.53M|    return std::numeric_limits<T>::max() - i < j;
   24|  6.53M|}

_ZN4SockC2Ej:
   29|   447k|Sock::Sock(SOCKET s) : m_socket(s) {}
_ZN4SockD2Ev:
   37|   447k|Sock::~Sock() { Close(); }
_ZNK4Sock12SendCompleteENSt3__14spanIKhLm18446744073709551615EEENS0_6chrono8durationIxNS0_5ratioILl1ELl1000EEEEER16CThreadInterrupt:
  252|  3.24k|{
  253|  3.24k|    const auto deadline = GetTime<std::chrono::milliseconds>() + timeout;
  254|  3.24k|    size_t sent{0};
  255|       |
  256|  6.83k|    for (;;) {
  257|  6.83k|        const ssize_t ret{Send(data.data() + sent, data.size() - sent, MSG_NOSIGNAL)};
  258|       |
  259|  6.83k|        if (ret > 0) {
  ------------------
  |  Branch (259:13): [True: 2.85k, False: 3.97k]
  ------------------
  260|  2.85k|            sent += static_cast<size_t>(ret);
  261|  2.85k|            if (sent == data.size()) {
  ------------------
  |  Branch (261:17): [True: 1.60k, False: 1.25k]
  ------------------
  262|  1.60k|                break;
  263|  1.60k|            }
  264|  3.97k|        } else {
  265|  3.97k|            const int err{WSAGetLastError()};
  ------------------
  |  |   59|  3.97k|#define WSAGetLastError()   errno
  ------------------
  266|  3.97k|            if (IOErrorIsPermanent(err)) {
  ------------------
  |  Branch (266:17): [True: 934, False: 3.04k]
  ------------------
  267|    934|                throw std::runtime_error(strprintf("send(): %s", NetworkErrorString(err)));
  ------------------
  |  | 1172|    934|#define strprintf tfm::format
  ------------------
  268|    934|            }
  269|  3.97k|        }
  270|       |
  271|  4.29k|        const auto now = GetTime<std::chrono::milliseconds>();
  272|       |
  273|  4.29k|        if (now >= deadline) {
  ------------------
  |  Branch (273:13): [True: 0, False: 4.29k]
  ------------------
  274|      0|            throw std::runtime_error(strprintf(
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  275|      0|                "Send timeout (sent only %u of %u bytes before that)", sent, data.size()));
  276|      0|        }
  277|       |
  278|  4.29k|        if (interrupt) {
  ------------------
  |  Branch (278:13): [True: 708, False: 3.58k]
  ------------------
  279|    708|            throw std::runtime_error(strprintf(
  ------------------
  |  | 1172|    708|#define strprintf tfm::format
  ------------------
  280|    708|                "Send interrupted (sent only %u of %u bytes before that)", sent, data.size()));
  281|    708|        }
  282|       |
  283|       |        // Wait for a short while (or the socket to become ready for sending) before retrying
  284|       |        // if nothing was sent.
  285|  3.58k|        const auto wait_time = std::min(deadline - now, std::chrono::milliseconds{MAX_WAIT_FOR_IO});
  286|  3.58k|        (void)Wait(wait_time, SendEvent);
  287|  3.58k|    }
  288|  3.24k|}
_ZNK4Sock12SendCompleteENSt3__14spanIKcLm18446744073709551615EEENS0_6chrono8durationIxNS0_5ratioILl1ELl1000EEEEER16CThreadInterrupt:
  293|  1.20k|{
  294|  1.20k|    SendComplete(MakeUCharSpan(data), timeout, interrupt);
  295|  1.20k|}
_ZNK4Sock19RecvUntilTerminatorEhNSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEER16CThreadInterruptm:
  301|    965|{
  302|    965|    const auto deadline = GetTime<std::chrono::milliseconds>() + timeout;
  303|    965|    std::string data;
  304|    965|    bool terminator_found{false};
  305|       |
  306|       |    // We must not consume any bytes past the terminator from the socket.
  307|       |    // One option is to read one byte at a time and check if we have read a terminator.
  308|       |    // However that is very slow. Instead, we peek at what is in the socket and only read
  309|       |    // as many bytes as possible without crossing the terminator.
  310|       |    // Reading 64 MiB of random data with 262526 terminator chars takes 37 seconds to read
  311|       |    // one byte at a time VS 0.71 seconds with the "peek" solution below. Reading one byte
  312|       |    // at a time is about 50 times slower.
  313|       |
  314|  3.41k|    for (;;) {
  315|  3.41k|        if (data.size() >= max_data) {
  ------------------
  |  Branch (315:13): [True: 2, False: 3.41k]
  ------------------
  316|      2|            throw std::runtime_error(
  317|      2|                strprintf("Received too many bytes without a terminator (%u)", data.size()));
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
  318|      2|        }
  319|       |
  320|  3.41k|        char buf[512];
  321|       |
  322|  3.41k|        const ssize_t peek_ret{Recv(buf, std::min(sizeof(buf), max_data - data.size()), MSG_PEEK)};
  323|       |
  324|  3.41k|        switch (peek_ret) {
  325|    353|        case -1: {
  ------------------
  |  Branch (325:9): [True: 353, False: 3.06k]
  ------------------
  326|    353|            const int err{WSAGetLastError()};
  ------------------
  |  |   59|    353|#define WSAGetLastError()   errno
  ------------------
  327|    353|            if (IOErrorIsPermanent(err)) {
  ------------------
  |  Branch (327:17): [True: 100, False: 253]
  ------------------
  328|    100|                throw std::runtime_error(strprintf("recv(): %s", NetworkErrorString(err)));
  ------------------
  |  | 1172|    100|#define strprintf tfm::format
  ------------------
  329|    100|            }
  330|    253|            break;
  331|    353|        }
  332|    253|        case 0:
  ------------------
  |  Branch (332:9): [True: 233, False: 3.18k]
  ------------------
  333|    233|            throw std::runtime_error("Connection unexpectedly closed by peer");
  334|  2.82k|        default:
  ------------------
  |  Branch (334:9): [True: 2.82k, False: 586]
  ------------------
  335|  2.82k|            auto end = buf + peek_ret;
  336|  2.82k|            auto terminator_pos = std::find(buf, end, terminator);
  337|  2.82k|            terminator_found = terminator_pos != end;
  338|       |
  339|  2.82k|            const size_t try_len{terminator_found ? terminator_pos - buf + 1 :
  ------------------
  |  Branch (339:34): [True: 432, False: 2.39k]
  ------------------
  340|  2.82k|                                                    static_cast<size_t>(peek_ret)};
  341|       |
  342|  2.82k|            const ssize_t read_ret{Recv(buf, try_len, 0)};
  343|       |
  344|  2.82k|            if (read_ret < 0 || static_cast<size_t>(read_ret) != try_len) {
  ------------------
  |  Branch (344:17): [True: 9, False: 2.81k]
  |  Branch (344:33): [True: 177, False: 2.64k]
  ------------------
  345|    186|                throw std::runtime_error(
  346|    186|                    strprintf("recv() returned %u bytes on attempt to read %u bytes but previous "
  ------------------
  |  | 1172|    186|#define strprintf tfm::format
  ------------------
  347|    186|                              "peek claimed %u bytes are available",
  348|    186|                              read_ret, try_len, peek_ret));
  349|    186|            }
  350|       |
  351|       |            // Don't include the terminator in the output.
  352|  2.64k|            const size_t append_len{terminator_found ? try_len - 1 : try_len};
  ------------------
  |  Branch (352:37): [True: 399, False: 2.24k]
  ------------------
  353|       |
  354|  2.64k|            data.append(buf, buf + append_len);
  355|       |
  356|  2.64k|            if (terminator_found) {
  ------------------
  |  Branch (356:17): [True: 399, False: 2.24k]
  ------------------
  357|    399|                return data;
  358|    399|            }
  359|  3.41k|        }
  360|       |
  361|  2.49k|        const auto now = GetTime<std::chrono::milliseconds>();
  362|       |
  363|  2.49k|        if (now >= deadline) {
  ------------------
  |  Branch (363:13): [True: 0, False: 2.49k]
  ------------------
  364|      0|            throw std::runtime_error(strprintf(
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  365|      0|                "Receive timeout (received %u bytes without terminator before that)", data.size()));
  366|      0|        }
  367|       |
  368|  2.49k|        if (interrupt) {
  ------------------
  |  Branch (368:13): [True: 45, False: 2.45k]
  ------------------
  369|     45|            throw std::runtime_error(strprintf(
  ------------------
  |  | 1172|     45|#define strprintf tfm::format
  ------------------
  370|     45|                "Receive interrupted (received %u bytes without terminator before that)",
  371|     45|                data.size()));
  372|     45|        }
  373|       |
  374|       |        // Wait for a short while (or the socket to become ready for reading) before retrying.
  375|  2.45k|        const auto wait_time = std::min(deadline - now, std::chrono::milliseconds{MAX_WAIT_FOR_IO});
  376|  2.45k|        (void)Wait(wait_time, RecvEvent);
  377|  2.45k|    }
  378|    965|}
_ZN4Sock5CloseEv:
  406|   447k|{
  407|   447k|    if (m_socket == INVALID_SOCKET) {
  ------------------
  |  |   67|   447k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  |  Branch (407:9): [True: 447k, False: 0]
  ------------------
  408|   447k|        return;
  409|   447k|    }
  410|       |#ifdef WIN32
  411|       |    int ret = closesocket(m_socket);
  412|       |#else
  413|      0|    int ret = close(m_socket);
  414|      0|#endif
  415|      0|    if (ret) {
  ------------------
  |  Branch (415:9): [True: 0, False: 0]
  ------------------
  416|      0|        LogWarning("Error closing socket %d: %s", m_socket, NetworkErrorString(WSAGetLastError()));
  ------------------
  |  |  126|      0|#define LogWarning(...) detail_LogWithSrcLoc(BCLog::LogFlags::ALL, util::log::Level::Warning, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  119|      0|#define detail_LogWithSrcLoc(category, level, ...) util::log::LogPrintFormatInternal(SourceLocation{__func__}, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  417|      0|    }
  418|      0|    m_socket = INVALID_SOCKET;
  ------------------
  |  |   67|      0|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  419|      0|}
_Z18NetworkErrorStringi:
  427|  42.3k|{
  428|       |#if defined(WIN32)
  429|       |    return Win32ErrorString(err);
  430|       |#else
  431|       |    // On BSD sockets implementations, NetworkErrorString is the same as SysErrorString.
  432|  42.3k|    return SysErrorString(err);
  433|  42.3k|#endif
  434|  42.3k|}

_Z18IOErrorIsPermanenti:
   27|  4.33k|{
   28|  4.33k|    return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
  ------------------
  |  |   62|  8.66k|#define WSAEAGAIN           EAGAIN
  ------------------
                  return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
  ------------------
  |  |   64|  8.20k|#define WSAEINTR            EINTR
  ------------------
                  return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
  ------------------
  |  |   61|  5.80k|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
                  return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
  ------------------
  |  |   65|  1.47k|#define WSAEINPROGRESS      EINPROGRESS
  ------------------
  |  Branch (28:12): [True: 3.87k, False: 458]
  |  Branch (28:32): [True: 1.47k, False: 2.40k]
  |  Branch (28:51): [True: 1.47k, False: 0]
  |  Branch (28:76): [True: 1.03k, False: 436]
  ------------------
   29|  4.33k|}
_ZN4Sock6EventsC2Eh:
  182|  1.67M|        explicit Events(Event req) : requested{req} {}
_ZNK4Sock17HashSharedPtrSockclERKNSt3__110shared_ptrIKS_EE:
  189|  3.39M|        {
  190|  3.39M|            return s ? s->m_socket : std::numeric_limits<SOCKET>::max();
  ------------------
  |  Branch (190:20): [True: 3.39M, False: 0]
  ------------------
  191|  3.39M|        }
_ZNK4Sock18EqualSharedPtrSockclERKNSt3__110shared_ptrIKS_EES6_:
  197|  1.68M|        {
  198|  1.68M|            if (lhs && rhs) {
  ------------------
  |  Branch (198:17): [True: 1.68M, False: 0]
  |  Branch (198:24): [True: 1.68M, False: 0]
  ------------------
  199|  1.68M|                return lhs->m_socket == rhs->m_socket;
  200|  1.68M|            }
  201|      0|            if (!lhs && !rhs) {
  ------------------
  |  Branch (201:17): [True: 0, False: 0]
  |  Branch (201:25): [True: 0, False: 0]
  ------------------
  202|      0|                return true;
  203|      0|            }
  204|      0|            return false;
  205|      0|        }

_ZN8StdMutex12CheckNotHeldERS_:
   37|   497k|    static inline StdMutex& CheckNotHeld(StdMutex& cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) LOCK_RETURNED(cs) { return cs; }
_ZN8StdMutex5GuardC2ERS_:
   33|   497k|        explicit Guard(StdMutex& cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex>(cs) {}

_Z13SplitHostPortNSt3__117basic_string_viewIcNS_11char_traitsIcEEEERtRNS_12basic_stringIcS2_NS_9allocatorIcEEEE:
   72|  38.6k|{
   73|  38.6k|    bool valid = false;
   74|  38.6k|    size_t colon = in.find_last_of(':');
   75|       |    // if a : is found, and it either follows a [...], or no other : is in the string, treat it as port separator
   76|  38.6k|    bool fHaveColon = colon != in.npos;
   77|  38.6k|    bool fBracketed = fHaveColon && (in[0] == '[' && in[colon - 1] == ']'); // if there is a colon, and in[0]=='[', colon is not 0, so in[colon-1] is safe
  ------------------
  |  Branch (77:23): [True: 17.0k, False: 21.6k]
  |  Branch (77:38): [True: 1.49k, False: 15.5k]
  |  Branch (77:54): [True: 1.16k, False: 339]
  ------------------
   78|  38.6k|    bool fMultiColon{fHaveColon && colon != 0 && (in.find_last_of(':', colon - 1) != in.npos)};
  ------------------
  |  Branch (78:22): [True: 17.0k, False: 21.6k]
  |  Branch (78:36): [True: 16.6k, False: 469]
  |  Branch (78:50): [True: 1.61k, False: 15.0k]
  ------------------
   79|  38.6k|    if (fHaveColon && (colon == 0 || fBracketed || !fMultiColon)) {
  ------------------
  |  Branch (79:9): [True: 17.0k, False: 21.6k]
  |  Branch (79:24): [True: 469, False: 16.6k]
  |  Branch (79:38): [True: 1.16k, False: 15.4k]
  |  Branch (79:52): [True: 15.0k, False: 456]
  ------------------
   80|  16.6k|        if (const auto n{ToIntegral<uint16_t>(in.substr(colon + 1))}) {
  ------------------
  |  Branch (80:24): [True: 11.2k, False: 5.36k]
  ------------------
   81|  11.2k|            in = in.substr(0, colon);
   82|  11.2k|            portOut = *n;
   83|  11.2k|            valid = (portOut != 0);
   84|  11.2k|        }
   85|  22.0k|    } else {
   86|  22.0k|        valid = true;
   87|  22.0k|    }
   88|  38.6k|    if (in.size() > 0 && in[0] == '[' && in[in.size() - 1] == ']') {
  ------------------
  |  Branch (88:9): [True: 38.3k, False: 339]
  |  Branch (88:26): [True: 2.55k, False: 35.8k]
  |  Branch (88:42): [True: 832, False: 1.72k]
  ------------------
   89|    832|        hostOut = in.substr(1, in.size() - 2);
   90|  37.8k|    } else {
   91|  37.8k|        hostOut = in;
   92|  37.8k|    }
   93|       |
   94|  38.6k|    return valid;
   95|  38.6k|}
_Z12EncodeBase32NSt3__14spanIKhLm18446744073709551615EEEb:
  144|  42.2k|{
  145|  42.2k|    static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567";
  146|       |
  147|  42.2k|    std::string str;
  148|  42.2k|    str.reserve(CeilDiv(input.size(), 5u) * 8);
  149|  42.2k|    ConvertBits<8, 5, true>([&](int v) { str += pbase32[v]; }, input.begin(), input.end());
  150|  42.2k|    if (pad) {
  ------------------
  |  Branch (150:9): [True: 33.3k, False: 8.92k]
  ------------------
  151|  33.3k|        while (str.size() % 8) {
  ------------------
  |  Branch (151:16): [True: 0, False: 33.3k]
  ------------------
  152|      0|            str += '=';
  153|      0|        }
  154|  33.3k|    }
  155|  42.2k|    return str;
  156|  42.2k|}
_Z12DecodeBase32NSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  164|  13.8k|{
  165|  13.8k|    static const int8_t decode32_table[256]{
  166|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  167|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  168|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1,
  169|  13.8k|        -1, -1, -1, -1, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
  170|  13.8k|        15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1,  0,  1,  2,
  171|  13.8k|         3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  172|  13.8k|        23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  173|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  174|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  175|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  176|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  177|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  178|  13.8k|        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
  179|  13.8k|    };
  180|       |
  181|  13.8k|    if (str.size() % 8 != 0) return {};
  ------------------
  |  Branch (181:9): [True: 585, False: 13.2k]
  ------------------
  182|       |    /* 1, 3, 4, or 6 padding '=' suffix characters are permitted. */
  183|  13.2k|    if (str.size() >= 1 && str.back() == '=') str.remove_suffix(1);
  ------------------
  |  Branch (183:9): [True: 13.0k, False: 208]
  |  Branch (183:28): [True: 7.31k, False: 5.69k]
  ------------------
  184|  13.2k|    if (str.size() >= 2 && str.substr(str.size() - 2) == "==") str.remove_suffix(2);
  ------------------
  |  Branch (184:9): [True: 13.0k, False: 208]
  |  Branch (184:28): [True: 7.11k, False: 5.89k]
  ------------------
  185|  13.2k|    if (str.size() >= 1 && str.back() == '=') str.remove_suffix(1);
  ------------------
  |  Branch (185:9): [True: 13.0k, False: 208]
  |  Branch (185:28): [True: 7.28k, False: 5.72k]
  ------------------
  186|  13.2k|    if (str.size() >= 2 && str.substr(str.size() - 2) == "==") str.remove_suffix(2);
  ------------------
  |  Branch (186:9): [True: 13.0k, False: 208]
  |  Branch (186:28): [True: 286, False: 12.7k]
  ------------------
  187|       |
  188|  13.2k|    std::vector<unsigned char> ret;
  189|  13.2k|    ret.reserve((str.size() * 5) / 8);
  190|  13.2k|    bool valid = ConvertBits<5, 8, false>(
  191|  13.2k|        [&](unsigned char c) { ret.push_back(c); },
  192|  13.2k|        str.begin(), str.end(),
  193|  13.2k|        [](char c) { return decode32_table[uint8_t(c)]; }
  194|  13.2k|    );
  195|       |
  196|  13.2k|    if (!valid) return {};
  ------------------
  |  Branch (196:9): [True: 838, False: 12.3k]
  ------------------
  197|       |
  198|  12.3k|    return ret;
  199|  13.2k|}
_Z7ToLowerNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  363|  7.56k|{
  364|  7.56k|    std::string r;
  365|  7.56k|    r.reserve(str.size());
  366|  60.5k|    for (auto ch : str) r += ToLower(ch);
  ------------------
  |  Branch (366:18): [True: 60.5k, False: 7.56k]
  ------------------
  367|  7.56k|    return r;
  368|  7.56k|}
strencodings.cpp:_ZZ12EncodeBase32NSt3__14spanIKhLm18446744073709551615EEEbENK3$_0clEi:
  149|  1.23M|    ConvertBits<8, 5, true>([&](int v) { str += pbase32[v]; }, input.begin(), input.end());
strencodings.cpp:_ZZ12DecodeBase32NSt3__117basic_string_viewIcNS_11char_traitsIcEEEEENK3$_1clEc:
  193|   682k|        [](char c) { return decode32_table[uint8_t(c)]; }
strencodings.cpp:_ZZ12DecodeBase32NSt3__117basic_string_viewIcNS_11char_traitsIcEEEEENK3$_0clEh:
  191|   422k|        [&](unsigned char c) { ret.push_back(c); },

_Z7ToLowerc:
  256|  60.5k|{
  257|  60.5k|    return (c >= 'A' && c <= 'Z' ? (c - 'A') + 'a' : c);
  ------------------
  |  Branch (257:13): [True: 23.7k, False: 36.8k]
  |  Branch (257:25): [True: 255, False: 23.4k]
  ------------------
  258|  60.5k|}
strencodings.cpp:_Z11ConvertBitsILi8ELi5ELb1EZ12EncodeBase32NSt3__14spanIKhLm18446744073709551615EEEbE3$_0NS0_11__wrap_iterIPS2_EENS0_8identityEEbT2_T3_SA_T4_:
  221|  42.2k|{
  222|  42.2k|    size_t acc = 0;
  223|  42.2k|    size_t bits = 0;
  224|  42.2k|    constexpr size_t maxv = (1 << tobits) - 1;
  225|  42.2k|    constexpr size_t max_acc = (1 << (frombits + tobits - 1)) - 1;
  226|   808k|    while (it != end) {
  ------------------
  |  Branch (226:12): [True: 765k, False: 42.2k]
  ------------------
  227|   765k|        int v = infn(*it);
  228|   765k|        if (v < 0) return false;
  ------------------
  |  Branch (228:13): [True: 0, False: 765k]
  ------------------
  229|   765k|        acc = ((acc << frombits) | v) & max_acc;
  230|   765k|        bits += frombits;
  231|  1.98M|        while (bits >= tobits) {
  ------------------
  |  Branch (231:16): [True: 1.22M, False: 765k]
  ------------------
  232|  1.22M|            bits -= tobits;
  233|  1.22M|            outfn((acc >> bits) & maxv);
  234|  1.22M|        }
  235|   765k|        ++it;
  236|   765k|    }
  237|  42.2k|    if (pad) {
  ------------------
  |  Branch (237:9): [True: 42.2k, Folded]
  ------------------
  238|  42.2k|        if (bits) outfn((acc << (tobits - bits)) & maxv);
  ------------------
  |  Branch (238:13): [True: 8.92k, False: 33.3k]
  ------------------
  239|  42.2k|    } else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {
  ------------------
  |  Branch (239:16): [True: 0, False: 0]
  |  Branch (239:36): [True: 0, False: 0]
  ------------------
  240|      0|        return false;
  241|      0|    }
  242|  42.2k|    return true;
  243|  42.2k|}
strencodings.cpp:_Z11ConvertBitsILi5ELi8ELb0EZ12DecodeBase32NSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEE3$_0PKcZ12DecodeBase32S4_E3$_1EbT2_T3_SA_T4_:
  221|  13.2k|{
  222|  13.2k|    size_t acc = 0;
  223|  13.2k|    size_t bits = 0;
  224|  13.2k|    constexpr size_t maxv = (1 << tobits) - 1;
  225|  13.2k|    constexpr size_t max_acc = (1 << (frombits + tobits - 1)) - 1;
  226|   695k|    while (it != end) {
  ------------------
  |  Branch (226:12): [True: 682k, False: 12.8k]
  ------------------
  227|   682k|        int v = infn(*it);
  228|   682k|        if (v < 0) return false;
  ------------------
  |  Branch (228:13): [True: 344, False: 682k]
  ------------------
  229|   682k|        acc = ((acc << frombits) | v) & max_acc;
  230|   682k|        bits += frombits;
  231|  1.10M|        while (bits >= tobits) {
  ------------------
  |  Branch (231:16): [True: 422k, False: 682k]
  ------------------
  232|   422k|            bits -= tobits;
  233|   422k|            outfn((acc >> bits) & maxv);
  234|   422k|        }
  235|   682k|        ++it;
  236|   682k|    }
  237|  12.8k|    if (pad) {
  ------------------
  |  Branch (237:9): [Folded, False: 12.8k]
  ------------------
  238|      0|        if (bits) outfn((acc << (tobits - bits)) & maxv);
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|  12.8k|    } else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {
  ------------------
  |  Branch (239:16): [True: 207, False: 12.6k]
  |  Branch (239:36): [True: 287, False: 12.3k]
  ------------------
  240|    494|        return false;
  241|    494|    }
  242|  12.3k|    return true;
  243|  12.8k|}
_Z10ToIntegralIhENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEEm:
  181|     10|{
  182|     10|    static_assert(std::is_integral_v<T>);
  183|     10|    T result;
  184|     10|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result, base);
  185|     10|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (185:9): [True: 0, False: 10]
  |  Branch (185:57): [True: 0, False: 10]
  ------------------
  186|      0|        return std::nullopt;
  187|      0|    }
  188|     10|    return result;
  189|     10|}
_Z10ToIntegralItENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEEm:
  181|  16.6k|{
  182|  16.6k|    static_assert(std::is_integral_v<T>);
  183|  16.6k|    T result;
  184|  16.6k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result, base);
  185|  16.6k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (185:9): [True: 2.54k, False: 14.0k]
  |  Branch (185:57): [True: 2.82k, False: 11.2k]
  ------------------
  186|  5.36k|        return std::nullopt;
  187|  5.36k|    }
  188|  11.2k|    return result;
  189|  16.6k|}

_ZN4util9HasPrefixINSt3__14spanIKhLm18446744073709551615EEELm12EEEbRKT_RKNS1_5arrayIhXT0_EEE:
  263|   294k|{
  264|   294k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 294k, False: 0]
  ------------------
  265|   294k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 2.01k, False: 292k]
  ------------------
  266|   294k|}
_ZN4util9HasPrefixINSt3__14spanIKhLm18446744073709551615EEELm6EEEbRKT_RKNS1_5arrayIhXT0_EEE:
  263|   585k|{
  264|   585k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 585k, False: 0]
  ------------------
  265|   585k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 1.08k, False: 584k]
  ------------------
  266|   585k|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm2EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  263|  38.4M|{
  264|  38.4M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 38.4M, False: 0]
  ------------------
  265|  38.4M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 2.49k, False: 38.4M]
  ------------------
  266|  38.4M|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm3EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  263|   149M|{
  264|   149M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 149M, False: 0]
  ------------------
  265|   149M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 22.2k, False: 149M]
  ------------------
  266|   149M|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm4EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  263|   107M|{
  264|   107M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 107M, False: 0]
  ------------------
  265|   107M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 8.84k, False: 107M]
  ------------------
  266|   107M|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm8EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  263|  67.7M|{
  264|  67.7M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 67.7M, False: 0]
  ------------------
  265|  67.7M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 3.38k, False: 67.7M]
  ------------------
  266|  67.7M|}
_ZN4util11ContainsNULENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  238|   435k|{
  239|  11.2M|    for (auto c : str) {
  ------------------
  |  Branch (239:17): [True: 11.2M, False: 250k]
  ------------------
  240|  11.2M|        if (c == 0) return true;
  ------------------
  |  Branch (240:13): [True: 184k, False: 11.1M]
  ------------------
  241|  11.2M|    }
  242|   250k|    return false;
  243|   435k|}
_ZN4util5SplitINSt3__14spanIKcLm18446744073709551615EEEEENS1_6vectorIT_NS1_9allocatorIS6_EEEERKS4_cb:
  148|    399|{
  149|    399|    return Split<T>(sp, std::string_view{&sep, 1}, include_sep);
  150|    399|}
_ZN4util5SplitINSt3__14spanIKcLm18446744073709551615EEEEENS1_6vectorIT_NS1_9allocatorIS6_EEEERKS4_NS1_17basic_string_viewIcNS1_11char_traitsIcEEEEb:
  120|    399|{
  121|    399|    std::vector<T> ret;
  122|    399|    auto it = sp.begin();
  123|    399|    auto start = it;
  124|   716k|    while (it != sp.end()) {
  ------------------
  |  Branch (124:12): [True: 715k, False: 399]
  ------------------
  125|   715k|        if (separators.find(*it) != std::string::npos) {
  ------------------
  |  Branch (125:13): [True: 25.9k, False: 689k]
  ------------------
  126|  25.9k|            if (include_sep) {
  ------------------
  |  Branch (126:17): [True: 0, False: 25.9k]
  ------------------
  127|      0|                ret.emplace_back(start, it + 1);
  128|  25.9k|            } else {
  129|  25.9k|                ret.emplace_back(start, it);
  130|  25.9k|            }
  131|  25.9k|            start = it + 1;
  132|  25.9k|        }
  133|   715k|        ++it;
  134|   715k|    }
  135|    399|    ret.emplace_back(start, it);
  136|    399|    return ret;
  137|    399|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm6EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  263|  1.59M|{
  264|  1.59M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 1.59M, False: 0]
  ------------------
  265|  1.59M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 1.08k, False: 1.59M]
  ------------------
  266|  1.59M|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm12EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  263|  68.5M|{
  264|  68.5M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (264:12): [True: 68.5M, False: 0]
  ------------------
  265|  68.5M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (265:12): [True: 10.0k, False: 68.5M]
  ------------------
  266|  68.5M|}

_Z14SysErrorStringi:
   19|  42.3k|{
   20|  42.3k|    char buf[1024];
   21|       |    /* Too bad there are three incompatible implementations of the
   22|       |     * thread-safe strerror. */
   23|  42.3k|    const char *s = nullptr;
   24|       |#ifdef WIN32
   25|       |    if (strerror_s(buf, sizeof(buf), err) == 0) s = buf;
   26|       |#else
   27|  42.3k|#ifdef STRERROR_R_CHAR_P /* GNU variant can return a pointer outside the passed buffer */
   28|  42.3k|    s = strerror_r(err, buf, sizeof(buf));
   29|       |#else /* POSIX variant always returns message in buffer */
   30|       |    if (strerror_r(err, buf, sizeof(buf)) == 0) s = buf;
   31|       |#endif
   32|  42.3k|#endif
   33|  42.3k|    if (s != nullptr) {
  ------------------
  |  Branch (33:9): [True: 42.3k, False: 0]
  ------------------
   34|  42.3k|        return strprintf("%s (%d)", s, err);
  ------------------
  |  | 1172|  42.3k|#define strprintf tfm::format
  ------------------
   35|  42.3k|    } else {
   36|      0|        return strprintf("Unknown error (%d)", err);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
   37|      0|    }
   38|  42.3k|}

_ZN4util19ImmediateTaskRunner5flushEv:
   46|      2|    void flush() override {}
_ZN4util19TaskRunnerInterfaceD2Ev:
   22|      2|    virtual ~TaskRunnerInterface() = default;

_ZN16CThreadInterruptC2Ev:
   10|  9.89k|CThreadInterrupt::CThreadInterrupt() : flag(false) {}
_ZNK16CThreadInterrupt11interruptedEv:
   13|    617|{
   14|    617|    return flag.load(std::memory_order_acquire);
   15|    617|}
_ZNK16CThreadInterruptcvbEv:
   18|  6.90k|{
   19|  6.90k|    return interrupted();
   20|  6.90k|}
_ZN16CThreadInterruptclEv:
   28|  19.7k|{
   29|  19.7k|    {
   30|  19.7k|        LOCK(mut);
  ------------------
  |  |  268|  19.7k|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  19.7k|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  19.7k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  19.7k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   31|  19.7k|        flag.store(true, std::memory_order_release);
   32|  19.7k|    }
   33|  19.7k|    cond.notify_all();
   34|  19.7k|}

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

_ZN4util21ThreadGetInternalNameEv:
   56|   497k|std::string util::ThreadGetInternalName() { return g_thread_name; }

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

_ZN9NodeClock3nowEv:
   39|   776k|{
   40|   776k|    const auto mocktime{g_mock_time.load(std::memory_order_relaxed)};
   41|   776k|    if (!mocktime.count()) {
  ------------------
  |  Branch (41:9): [True: 1, False: 776k]
  ------------------
   42|      1|        g_used_system_time = true;
   43|      1|    }
   44|   776k|    const auto ret{
   45|   776k|        mocktime.count() ?
  ------------------
  |  Branch (45:9): [True: 776k, False: 1]
  ------------------
   46|   776k|            mocktime :
   47|   776k|            std::chrono::system_clock::now().time_since_epoch()};
   48|   776k|    assert(ret > 0s);
  ------------------
  |  Branch (48:5): [True: 776k, False: 0]
  ------------------
   49|   776k|    return time_point{ret};
   50|   776k|};
_Z11SetMockTimeNSt3__16chrono10time_pointI9NodeClockNS0_8durationIxNS_5ratioILl1ELl1EEEEEEE:
   52|  23.0k|void SetMockTime(std::chrono::time_point<NodeClock, std::chrono::seconds> mock) { SetMockTime(mock.time_since_epoch()); }
_Z11SetMockTimeNSt3__16chrono8durationIxNS_5ratioILl1ELl1EEEEE:
   54|  32.9k|{
   55|  32.9k|    Assert(mock_time_in >= 0s);
  ------------------
  |  |  116|  32.9k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
   56|  32.9k|    g_mock_time.store(mock_time_in, std::memory_order_relaxed);
   57|  32.9k|}
_Z11GetMockTimev:
   60|   497k|{
   61|   497k|    return g_mock_time.load(std::memory_order_relaxed);
   62|   497k|}
_ZN19MockableSteadyClock11SetMockTimeENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEE:
   78|  41.6k|{
   79|  41.6k|    Assert(mock_time_in >= 0s);
  ------------------
  |  |  116|  41.6k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
   80|  41.6k|    g_mock_steady_time.store(mock_time_in, std::memory_order_relaxed);
   81|  41.6k|}
_ZN19MockableSteadyClock13ClearMockTimeEv:
   84|  19.7k|{
   85|  19.7k|    g_mock_steady_time.store(0ms, std::memory_order_relaxed);
   86|  19.7k|}
_Z7GetTimev:
   88|      2|int64_t GetTime() { return GetTime<std::chrono::seconds>().count(); }
_Z20ParseISO8601DateTimeNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  108|      2|{
  109|      2|    constexpr auto FMT_SIZE{std::string_view{"2000-01-01T01:01:01Z"}.size()};
  110|      2|    if (str.size() != FMT_SIZE || str[4] != '-' || str[7] != '-' || str[10] != 'T' || str[13] != ':' || str[16] != ':' || str[19] != 'Z') {
  ------------------
  |  Branch (110:9): [True: 0, False: 2]
  |  Branch (110:35): [True: 0, False: 2]
  |  Branch (110:52): [True: 0, False: 2]
  |  Branch (110:69): [True: 0, False: 2]
  |  Branch (110:87): [True: 0, False: 2]
  |  Branch (110:105): [True: 0, False: 2]
  |  Branch (110:123): [True: 0, False: 2]
  ------------------
  111|      0|        return {};
  112|      0|    }
  113|      2|    const auto year{ToIntegral<uint16_t>(str.substr(0, 4))};
  114|      2|    const auto month{ToIntegral<uint8_t>(str.substr(5, 2))};
  115|      2|    const auto day{ToIntegral<uint8_t>(str.substr(8, 2))};
  116|      2|    const auto hour{ToIntegral<uint8_t>(str.substr(11, 2))};
  117|      2|    const auto min{ToIntegral<uint8_t>(str.substr(14, 2))};
  118|      2|    const auto sec{ToIntegral<uint8_t>(str.substr(17, 2))};
  119|      2|    if (!year || !month || !day || !hour || !min || !sec) {
  ------------------
  |  Branch (119:9): [True: 0, False: 2]
  |  Branch (119:18): [True: 0, False: 2]
  |  Branch (119:28): [True: 0, False: 2]
  |  Branch (119:36): [True: 0, False: 2]
  |  Branch (119:45): [True: 0, False: 2]
  |  Branch (119:53): [True: 0, False: 2]
  ------------------
  120|      0|        return {};
  121|      0|    }
  122|      2|    const std::chrono::year_month_day ymd{std::chrono::year{*year}, std::chrono::month{*month}, std::chrono::day{*day}};
  123|      2|    if (!ymd.ok()) {
  ------------------
  |  Branch (123:9): [True: 0, False: 2]
  ------------------
  124|      0|        return {};
  125|      0|    }
  126|      2|    const auto time{std::chrono::hours{*hour} + std::chrono::minutes{*min} + std::chrono::seconds{*sec}};
  127|      2|    const auto tp{std::chrono::sys_days{ymd} + time};
  128|      2|    return int64_t{TicksSinceEpoch<std::chrono::seconds>(tp)};
  129|      2|}

_Z5TicksINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEES5_EDaT0_:
   83|  7.73k|{
   84|  7.73k|    return std::chrono::duration_cast<Dur1>(d).count();
   85|  7.73k|}
_Z15TicksSinceEpochINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEENS1_10time_pointI9NodeClockS5_EEEDaT0_:
   94|  7.73k|{
   95|  7.73k|    return Ticks<Duration>(t.time_since_epoch());
   96|  7.73k|}
_Z3NowINSt3__16chrono10time_pointINS1_12steady_clockENS1_8durationIxNS0_5ratioILl1ELl1000EEEEEEEET_v:
  128|    635|{
  129|    635|    return std::chrono::time_point_cast<typename T::duration>(T::clock::now());
  130|    635|}
_Z7GetTimeINSt3__16chrono8durationIxNS0_5ratioILl1ELl1000EEEEEET_v:
  134|  11.0k|{
  135|  11.0k|    return Now<std::chrono::time_point<NodeClock, T>>().time_since_epoch();
  136|  11.0k|}
_Z3NowINSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1000EEEEEEEET_v:
  128|  11.0k|{
  129|  11.0k|    return std::chrono::time_point_cast<typename T::duration>(T::clock::now());
  130|  11.0k|}
_Z15TicksSinceEpochINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEENS1_10time_pointINS1_12system_clockES5_EEEDaT0_:
   94|      2|{
   95|      2|    return Ticks<Duration>(t.time_since_epoch());
   96|      2|}
_Z7GetTimeINSt3__16chrono8durationIxNS0_5ratioILl1ELl1000000EEEEEET_v:
  134|  8.02k|{
  135|  8.02k|    return Now<std::chrono::time_point<NodeClock, T>>().time_since_epoch();
  136|  8.02k|}
_Z3NowINSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1000000EEEEEEEET_v:
  128|  8.02k|{
  129|  8.02k|    return std::chrono::time_point_cast<typename T::duration>(T::clock::now());
  130|  8.02k|}
_Z5TicksINSt3__16chrono8durationIdNS0_5ratioILl1ELl1000EEEEENS2_IxNS3_ILl1ELl1000000000EEEEEEDaT0_:
   83|  1.37k|{
   84|  1.37k|    return std::chrono::duration_cast<Dur1>(d).count();
   85|  1.37k|}
_Z7GetTimeINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEEET_v:
  134|   115k|{
  135|   115k|    return Now<std::chrono::time_point<NodeClock, T>>().time_since_epoch();
  136|   115k|}
_Z3NowINSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1EEEEEEEET_v:
  128|   169k|{
  129|   169k|    return std::chrono::time_point_cast<typename T::duration>(T::clock::now());
  130|   169k|}

_ZN12TokenPipeEndD2Ev:
   37|      4|{
   38|      4|    Close();
   39|      4|}
_ZN12TokenPipeEnd5CloseEv:
   80|      4|{
   81|      4|    if (m_fd != -1) close(m_fd);
  ------------------
  |  Branch (81:9): [True: 4, False: 0]
  ------------------
   82|      4|    m_fd = -1;
   83|      4|}

_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEA13_cEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_:
   88|  1.97k|{
   89|  1.97k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|  1.97k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|  1.97k|            return arg.original;
   92|  1.97k|        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|  1.97k|            return arg.original;
   94|  1.97k|        } else {
   95|  1.97k|            return arg;
   96|  1.97k|        }
   97|  1.97k|    }};
   98|  1.97k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|  1.97k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|  1.97k|            return arg.translated;
  101|  1.97k|        } else {
  102|  1.97k|            return arg;
  103|  1.97k|        }
  104|  1.97k|    }};
  105|  1.97k|    return bilingual_str{tfm::format(fmt.original, original_arg(args)...),
  106|  1.97k|                         tfm::format(RuntimeFormat{std::string{fmt.lit}}, translated_arg(args)...)};
  107|  1.97k|}
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEA13_cEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E_clIS7_EERKDaSJ_:
   89|  1.97k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|       |            return arg.original;
   92|       |        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|       |            return arg.original;
   94|  1.97k|        } else {
   95|  1.97k|            return arg;
   96|  1.97k|        }
   97|  1.97k|    }};
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEA13_cEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E_clIS8_EERKDaSJ_:
   89|  1.97k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|       |            return arg.original;
   92|       |        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|       |            return arg.original;
   94|  1.97k|        } else {
   95|  1.97k|            return arg;
   96|  1.97k|        }
   97|  1.97k|    }};
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEA13_cEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E0_clIS7_EERKDaSJ_:
   98|  1.97k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|       |            return arg.translated;
  101|  1.97k|        } else {
  102|  1.97k|            return arg;
  103|  1.97k|        }
  104|  1.97k|    }};
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEA13_cEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E0_clIS8_EERKDaSJ_:
   98|  1.97k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|       |            return arg.translated;
  101|  1.97k|        } else {
  102|  1.97k|            return arg;
  103|  1.97k|        }
  104|  1.97k|    }};
_ZNK4util17TranslatedLiteralcvNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEv:
   60|  18.7k|    operator std::string() const { return translate_fn && *translate_fn ? (*translate_fn)(original) : original; }
  ------------------
  |  Branch (60:43): [True: 18.7k, False: 0]
  |  Branch (60:59): [True: 0, False: 18.7k]
  ------------------
_Z12UntranslatedNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
   82|  49.5k|inline bilingual_str Untranslated(std::string original) { return {original, original}; }
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_:
   88|  4.65k|{
   89|  4.65k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|  4.65k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|  4.65k|            return arg.original;
   92|  4.65k|        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|  4.65k|            return arg.original;
   94|  4.65k|        } else {
   95|  4.65k|            return arg;
   96|  4.65k|        }
   97|  4.65k|    }};
   98|  4.65k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|  4.65k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|  4.65k|            return arg.translated;
  101|  4.65k|        } else {
  102|  4.65k|            return arg;
  103|  4.65k|        }
  104|  4.65k|    }};
  105|  4.65k|    return bilingual_str{tfm::format(fmt.original, original_arg(args)...),
  106|  4.65k|                         tfm::format(RuntimeFormat{std::string{fmt.lit}}, translated_arg(args)...)};
  107|  4.65k|}
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E_clIS7_EERKDaSI_:
   89|  4.65k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|       |            return arg.original;
   92|       |        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|       |            return arg.original;
   94|  4.65k|        } else {
   95|  4.65k|            return arg;
   96|  4.65k|        }
   97|  4.65k|    }};
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E0_clIS7_EERKDaSI_:
   98|  4.65k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|       |            return arg.translated;
  101|  4.65k|        } else {
  102|  4.65k|            return arg;
  103|  4.65k|        }
  104|  4.65k|    }};
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_:
   88|  12.0k|{
   89|  12.0k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|  12.0k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|  12.0k|            return arg.original;
   92|  12.0k|        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|  12.0k|            return arg.original;
   94|  12.0k|        } else {
   95|  12.0k|            return arg;
   96|  12.0k|        }
   97|  12.0k|    }};
   98|  12.0k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|  12.0k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|  12.0k|            return arg.translated;
  101|  12.0k|        } else {
  102|  12.0k|            return arg;
  103|  12.0k|        }
  104|  12.0k|    }};
  105|  12.0k|    return bilingual_str{tfm::format(fmt.original, original_arg(args)...),
  106|  12.0k|                         tfm::format(RuntimeFormat{std::string{fmt.lit}}, translated_arg(args)...)};
  107|  12.0k|}
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E_clIS7_EERKDaSI_:
   89|  24.1k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|       |            return arg.original;
   92|       |        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|       |            return arg.original;
   94|  24.1k|        } else {
   95|  24.1k|            return arg;
   96|  24.1k|        }
   97|  24.1k|    }};
_ZZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E0_clIS7_EERKDaSI_:
   98|  24.1k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|       |        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|       |            return arg.translated;
  101|  24.1k|        } else {
  102|  24.1k|            return arg;
  103|  24.1k|        }
  104|  24.1k|    }};

_Z11ClearShrinkINSt3__16vectorIhNS0_9allocatorIhEEEEEvRT_:
   57|  78.2k|{
   58|       |    // There are various ways to clear a vector and release its memory:
   59|       |    //
   60|       |    // 1. V{}.swap(v)
   61|       |    // 2. v = V{}
   62|       |    // 3. v = {}; v.shrink_to_fit();
   63|       |    // 4. v.clear(); v.shrink_to_fit();
   64|       |    //
   65|       |    // (2) does not appear to release memory in glibc debug mode, even if v.shrink_to_fit()
   66|       |    // follows. (3) and (4) rely on std::vector::shrink_to_fit, which is only a non-binding
   67|       |    // request. Therefore, we use method (1).
   68|       |
   69|  78.2k|    V{}.swap(v);
   70|  78.2k|}

_ZN17ChainstateManagerD2Ev:
 6163|      2|{
 6164|      2|    LOCK(::cs_main);
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6165|       |
 6166|      2|    m_versionbitscache.Clear();
 6167|      2|}

_ZN17ValidationSignalsD2Ev:
  100|      2|ValidationSignals::~ValidationSignals() = default;
_ZN17ValidationSignals24FlushBackgroundCallbacksEv:
  103|      2|{
  104|      2|    m_internals->m_task_runner->flush();
  105|      2|}

_ZN16VersionBitsCache5ClearEv:
  288|      2|{
  289|      2|    LOCK(m_mutex);
  ------------------
  |  |  268|      2|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|      4|    for (unsigned int d = 0; d < Consensus::MAX_VERSION_BITS_DEPLOYMENTS; d++) {
  ------------------
  |  Branch (290:30): [True: 2, False: 2]
  ------------------
  291|      2|        m_caches[d].clear();
  292|      2|    }
  293|      2|}

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

