_ZNK8AddrInfo14GetTriedBucketERK7uint256RK15NetGroupManager:
   49|     20|{
   50|     20|    uint64_t hash1 = (HashWriter{} << nKey << GetKey()).GetCheapHash();
   51|     20|    uint64_t hash2 = (HashWriter{} << nKey << netgroupman.GetGroup(*this) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash();
   52|     20|    return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
   53|     20|}
_ZNK8AddrInfo12GetNewBucketERK7uint256RK8CNetAddrRK15NetGroupManager:
   56|  46.7k|{
   57|  46.7k|    std::vector<unsigned char> vchSourceGroupKey = netgroupman.GetGroup(src);
   58|  46.7k|    uint64_t hash1 = (HashWriter{} << nKey << netgroupman.GetGroup(*this) << vchSourceGroupKey).GetCheapHash();
   59|  46.7k|    uint64_t hash2 = (HashWriter{} << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetCheapHash();
   60|  46.7k|    return hash2 % ADDRMAN_NEW_BUCKET_COUNT;
   61|  46.7k|}
_ZNK8AddrInfo17GetBucketPositionERK7uint256bi:
   64|  48.0k|{
   65|  48.0k|    uint64_t hash1 = (HashWriter{} << nKey << (fNew ? uint8_t{'N'} : uint8_t{'K'}) << bucket << GetKey()).GetCheapHash();
  ------------------
  |  Branch (65:48): [True: 48.0k, False: 20]
  ------------------
   66|  48.0k|    return hash1 % ADDRMAN_BUCKET_SIZE;
   67|  48.0k|}
_ZNK8AddrInfo10IsTerribleENSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1EEEEEEE:
   70|   458k|{
   71|   458k|    if (now - m_last_try <= 1min) { // never remove things tried in the last minute
  ------------------
  |  Branch (71:9): [True: 300, False: 458k]
  ------------------
   72|    300|        return false;
   73|    300|    }
   74|       |
   75|   458k|    if (nTime > now + 10min) { // came in a flying DeLorean
  ------------------
  |  Branch (75:9): [True: 249k, False: 208k]
  ------------------
   76|   249k|        return true;
   77|   249k|    }
   78|       |
   79|   208k|    if (now - nTime > ADDRMAN_HORIZON) { // not seen in recent history
  ------------------
  |  Branch (79:9): [True: 189k, False: 19.6k]
  ------------------
   80|   189k|        return true;
   81|   189k|    }
   82|       |
   83|  19.6k|    if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
  ------------------
  |  Branch (83:9): [True: 19.5k, False: 27]
  |  Branch (83:71): [True: 0, False: 19.5k]
  ------------------
   84|      0|        return true;
   85|      0|    }
   86|       |
   87|  19.6k|    if (now - m_last_success > ADDRMAN_MIN_FAIL && nAttempts >= ADDRMAN_MAX_FAILURES) { // N successive failures in the last week
  ------------------
  |  Branch (87:9): [True: 19.6k, False: 0]
  |  Branch (87:9): [True: 0, False: 19.6k]
  |  Branch (87:52): [True: 0, False: 19.6k]
  ------------------
   88|      0|        return true;
   89|      0|    }
   90|       |
   91|  19.6k|    return false;
   92|  19.6k|}
_ZN11AddrManImplD2Ev:
  128|      2|{
  129|      2|    nKey.SetNull();
  130|      2|}
_ZN11AddrManImpl4FindERK8CServicePl:
  402|  78.8k|{
  403|  78.8k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  78.8k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  404|       |
  405|  78.8k|    const auto it = mapAddr.find(addr);
  406|  78.8k|    if (it == mapAddr.end())
  ------------------
  |  Branch (406:9): [True: 48.0k, False: 30.8k]
  ------------------
  407|  48.0k|        return nullptr;
  408|  30.8k|    if (pnId)
  ------------------
  |  Branch (408:9): [True: 30.8k, False: 68]
  ------------------
  409|  30.8k|        *pnId = (*it).second;
  410|  30.8k|    const auto it2 = mapInfo.find((*it).second);
  411|  30.8k|    if (it2 != mapInfo.end())
  ------------------
  |  Branch (411:9): [True: 30.8k, False: 0]
  ------------------
  412|  30.8k|        return &(*it2).second;
  413|      0|    return nullptr;
  414|  30.8k|}
_ZN11AddrManImpl6CreateERK8CAddressRK8CNetAddrPl:
  417|  38.6k|{
  418|  38.6k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  38.6k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  419|       |
  420|  38.6k|    nid_type nId = nIdCount++;
  421|  38.6k|    mapInfo[nId] = AddrInfo(addr, addrSource);
  422|  38.6k|    mapAddr[addr] = nId;
  423|  38.6k|    mapInfo[nId].nRandomPos = vRandom.size();
  424|  38.6k|    vRandom.push_back(nId);
  425|  38.6k|    nNew++;
  426|  38.6k|    m_network_counts[addr.GetNetwork()].n_new++;
  427|  38.6k|    if (pnId)
  ------------------
  |  Branch (427:9): [True: 38.6k, False: 0]
  ------------------
  428|  38.6k|        *pnId = nId;
  429|  38.6k|    return &mapInfo[nId];
  430|  38.6k|}
_ZNK11AddrManImpl10SwapRandomEjj:
  433|   456k|{
  434|   456k|    AssertLockHeld(cs);
  ------------------
  |  |  142|   456k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  435|       |
  436|   456k|    if (nRndPos1 == nRndPos2)
  ------------------
  |  Branch (436:9): [True: 7.95k, False: 448k]
  ------------------
  437|  7.95k|        return;
  438|       |
  439|   448k|    assert(nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size());
  440|       |
  441|   448k|    nid_type nId1 = vRandom[nRndPos1];
  442|   448k|    nid_type nId2 = vRandom[nRndPos2];
  443|       |
  444|   448k|    const auto it_1{mapInfo.find(nId1)};
  445|   448k|    const auto it_2{mapInfo.find(nId2)};
  446|   448k|    assert(it_1 != mapInfo.end());
  447|   448k|    assert(it_2 != mapInfo.end());
  448|       |
  449|   448k|    it_1->second.nRandomPos = nRndPos2;
  450|   448k|    it_2->second.nRandomPos = nRndPos1;
  451|       |
  452|   448k|    vRandom[nRndPos1] = nId2;
  453|   448k|    vRandom[nRndPos2] = nId1;
  454|   448k|}
_ZN11AddrManImpl6DeleteEl:
  457|  21.0k|{
  458|  21.0k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  21.0k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  459|       |
  460|  21.0k|    assert(mapInfo.count(nId) != 0);
  461|  21.0k|    AddrInfo& info = mapInfo[nId];
  462|  21.0k|    assert(!info.fInTried);
  463|  21.0k|    assert(info.nRefCount == 0);
  464|       |
  465|  21.0k|    SwapRandom(info.nRandomPos, vRandom.size() - 1);
  466|  21.0k|    m_network_counts[info.GetNetwork()].n_new--;
  467|  21.0k|    vRandom.pop_back();
  468|  21.0k|    mapAddr.erase(info);
  469|  21.0k|    mapInfo.erase(nId);
  470|  21.0k|    nNew--;
  471|  21.0k|}
_ZN11AddrManImpl8ClearNewEii:
  474|  34.5k|{
  475|  34.5k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  34.5k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  476|       |
  477|       |    // if there is an entry in the specified bucket, delete it.
  478|  34.5k|    if (vvNew[nUBucket][nUBucketPos] != -1) {
  ------------------
  |  Branch (478:9): [True: 15.8k, False: 18.6k]
  ------------------
  479|  15.8k|        nid_type nIdDelete = vvNew[nUBucket][nUBucketPos];
  480|  15.8k|        AddrInfo& infoDelete = mapInfo[nIdDelete];
  481|  15.8k|        assert(infoDelete.nRefCount > 0);
  482|  15.8k|        infoDelete.nRefCount--;
  483|  15.8k|        vvNew[nUBucket][nUBucketPos] = -1;
  484|  15.8k|        LogDebug(BCLog::ADDRMAN, "Removed %s from new[%i][%i]\n", infoDelete.ToStringAddrPort(), nUBucket, nUBucketPos);
  ------------------
  |  |  280|  15.8k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  15.8k|    do {                                                  \
  |  |  |  |  274|  15.8k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 15.8k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  15.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  485|  15.8k|        if (infoDelete.nRefCount == 0) {
  ------------------
  |  Branch (485:13): [True: 14.5k, False: 1.34k]
  ------------------
  486|  14.5k|            Delete(nIdDelete);
  487|  14.5k|        }
  488|  15.8k|    }
  489|  34.5k|}
_ZN11AddrManImpl9MakeTriedER8AddrInfol:
  492|     10|{
  493|     10|    AssertLockHeld(cs);
  ------------------
  |  |  142|     10|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  494|       |
  495|       |    // remove the entry from all new buckets
  496|     10|    const int start_bucket{info.GetNewBucket(nKey, m_netgroupman)};
  497|  1.34k|    for (int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; ++n) {
  ------------------
  |  Branch (497:21): [True: 1.34k, False: 0]
  ------------------
  498|  1.34k|        const int bucket{(start_bucket + n) % ADDRMAN_NEW_BUCKET_COUNT};
  499|  1.34k|        const int pos{info.GetBucketPosition(nKey, true, bucket)};
  500|  1.34k|        if (vvNew[bucket][pos] == nId) {
  ------------------
  |  Branch (500:13): [True: 16, False: 1.32k]
  ------------------
  501|     16|            vvNew[bucket][pos] = -1;
  502|     16|            info.nRefCount--;
  503|     16|            if (info.nRefCount == 0) break;
  ------------------
  |  Branch (503:17): [True: 10, False: 6]
  ------------------
  504|     16|        }
  505|  1.34k|    }
  506|     10|    nNew--;
  507|     10|    m_network_counts[info.GetNetwork()].n_new--;
  508|       |
  509|     10|    assert(info.nRefCount == 0);
  510|       |
  511|       |    // which tried bucket to move the entry to
  512|     10|    int nKBucket = info.GetTriedBucket(nKey, m_netgroupman);
  513|     10|    int nKBucketPos = info.GetBucketPosition(nKey, false, nKBucket);
  514|       |
  515|       |    // first make space to add it (the existing tried entry there is moved to new, deleting whatever is there).
  516|     10|    if (vvTried[nKBucket][nKBucketPos] != -1) {
  ------------------
  |  Branch (516:9): [True: 0, False: 10]
  ------------------
  517|       |        // find an item to evict
  518|      0|        nid_type nIdEvict = vvTried[nKBucket][nKBucketPos];
  519|      0|        assert(mapInfo.count(nIdEvict) == 1);
  520|      0|        AddrInfo& infoOld = mapInfo[nIdEvict];
  521|       |
  522|       |        // Remove the to-be-evicted item from the tried set.
  523|      0|        infoOld.fInTried = false;
  524|      0|        vvTried[nKBucket][nKBucketPos] = -1;
  525|      0|        nTried--;
  526|      0|        m_network_counts[infoOld.GetNetwork()].n_tried--;
  527|       |
  528|       |        // find which new bucket it belongs to
  529|      0|        int nUBucket = infoOld.GetNewBucket(nKey, m_netgroupman);
  530|      0|        int nUBucketPos = infoOld.GetBucketPosition(nKey, true, nUBucket);
  531|      0|        ClearNew(nUBucket, nUBucketPos);
  532|      0|        assert(vvNew[nUBucket][nUBucketPos] == -1);
  533|       |
  534|       |        // Enter it into the new set again.
  535|      0|        infoOld.nRefCount = 1;
  536|      0|        vvNew[nUBucket][nUBucketPos] = nIdEvict;
  537|      0|        nNew++;
  538|      0|        m_network_counts[infoOld.GetNetwork()].n_new++;
  539|      0|        LogDebug(BCLog::ADDRMAN, "Moved %s from tried[%i][%i] to new[%i][%i] to make space\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  540|      0|                 infoOld.ToStringAddrPort(), nKBucket, nKBucketPos, nUBucket, nUBucketPos);
  541|      0|    }
  542|     10|    assert(vvTried[nKBucket][nKBucketPos] == -1);
  543|       |
  544|     10|    vvTried[nKBucket][nKBucketPos] = nId;
  545|     10|    nTried++;
  546|     10|    info.fInTried = true;
  547|     10|    m_network_counts[info.GetNetwork()].n_tried++;
  548|     10|}
_ZN11AddrManImpl9AddSingleERK8CAddressRK8CNetAddrNSt3__16chrono8durationIxNS6_5ratioILl1ELl1EEEEE:
  551|  72.6k|{
  552|  72.6k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  72.6k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  553|       |
  554|  72.6k|    if (!addr.IsRoutable())
  ------------------
  |  Branch (554:9): [True: 3.18k, False: 69.4k]
  ------------------
  555|  3.18k|        return false;
  556|       |
  557|  69.4k|    nid_type nId;
  558|  69.4k|    AddrInfo* pinfo = Find(addr, &nId);
  559|       |
  560|       |    // Do not set a penalty for a source's self-announcement
  561|  69.4k|    if (addr == source) {
  ------------------
  |  Branch (561:9): [True: 251, False: 69.1k]
  ------------------
  562|    251|        time_penalty = 0s;
  563|    251|    }
  564|       |
  565|  69.4k|    if (pinfo) {
  ------------------
  |  Branch (565:9): [True: 30.7k, False: 38.6k]
  ------------------
  566|       |        // periodically update nTime
  567|  30.7k|        const bool currently_online{NodeClock::now() - addr.nTime < 24h};
  568|  30.7k|        const auto update_interval{currently_online ? 1h : 24h};
  ------------------
  |  Branch (568:36): [True: 739, False: 30.0k]
  ------------------
  569|  30.7k|        if (pinfo->nTime < addr.nTime - update_interval - time_penalty) {
  ------------------
  |  Branch (569:13): [True: 3.06k, False: 27.7k]
  ------------------
  570|  3.06k|            pinfo->nTime = std::max(NodeSeconds{0s}, addr.nTime - time_penalty);
  571|  3.06k|        }
  572|       |
  573|       |        // add services
  574|  30.7k|        pinfo->nServices = ServiceFlags(pinfo->nServices | addr.nServices);
  575|       |
  576|       |        // do not update if no new information is present
  577|  30.7k|        if (addr.nTime <= pinfo->nTime) {
  ------------------
  |  Branch (577:13): [True: 13.0k, False: 17.7k]
  ------------------
  578|  13.0k|            return false;
  579|  13.0k|        }
  580|       |
  581|       |        // do not update if the entry was already in the "tried" table
  582|  17.7k|        if (pinfo->fInTried)
  ------------------
  |  Branch (582:13): [True: 238, False: 17.5k]
  ------------------
  583|    238|            return false;
  584|       |
  585|       |        // do not update if the max reference count is reached
  586|  17.5k|        if (pinfo->nRefCount == ADDRMAN_NEW_BUCKETS_PER_ADDRESS)
  ------------------
  |  Branch (586:13): [True: 0, False: 17.5k]
  ------------------
  587|      0|            return false;
  588|       |
  589|       |        // stochastic test: previous nRefCount == N: 2^N times harder to increase it
  590|  17.5k|        if (pinfo->nRefCount > 0) {
  ------------------
  |  Branch (590:13): [True: 17.5k, False: 0]
  ------------------
  591|  17.5k|            const int nFactor{1 << pinfo->nRefCount};
  592|  17.5k|            if (insecure_rand.randrange(nFactor) != 0) return false;
  ------------------
  |  Branch (592:17): [True: 9.47k, False: 8.03k]
  ------------------
  593|  17.5k|        }
  594|  38.6k|    } else {
  595|  38.6k|        pinfo = Create(addr, source, &nId);
  596|  38.6k|        pinfo->nTime = std::max(NodeSeconds{0s}, pinfo->nTime - time_penalty);
  597|  38.6k|    }
  598|       |
  599|  46.6k|    int nUBucket = pinfo->GetNewBucket(nKey, source, m_netgroupman);
  600|  46.6k|    int nUBucketPos = pinfo->GetBucketPosition(nKey, true, nUBucket);
  601|  46.6k|    bool fInsert = vvNew[nUBucket][nUBucketPos] == -1;
  602|  46.6k|    if (vvNew[nUBucket][nUBucketPos] != nId) {
  ------------------
  |  Branch (602:9): [True: 41.7k, False: 4.96k]
  ------------------
  603|  41.7k|        if (!fInsert) {
  ------------------
  |  Branch (603:13): [True: 23.0k, False: 18.6k]
  ------------------
  604|  23.0k|            AddrInfo& infoExisting = mapInfo[vvNew[nUBucket][nUBucketPos]];
  605|  23.0k|            if (infoExisting.IsTerrible() || (infoExisting.nRefCount > 1 && pinfo->nRefCount == 0)) {
  ------------------
  |  Branch (605:17): [True: 15.5k, False: 7.46k]
  |  Branch (605:47): [True: 371, False: 7.09k]
  |  Branch (605:77): [True: 284, False: 87]
  ------------------
  606|       |                // Overwrite the existing new table entry.
  607|  15.8k|                fInsert = true;
  608|  15.8k|            }
  609|  23.0k|        }
  610|  41.7k|        if (fInsert) {
  ------------------
  |  Branch (610:13): [True: 34.5k, False: 7.18k]
  ------------------
  611|  34.5k|            ClearNew(nUBucket, nUBucketPos);
  612|  34.5k|            pinfo->nRefCount++;
  613|  34.5k|            vvNew[nUBucket][nUBucketPos] = nId;
  614|  34.5k|            const auto mapped_as{m_netgroupman.GetMappedAS(addr)};
  615|  34.5k|            LogDebug(BCLog::ADDRMAN, "Added %s%s to new[%i][%i]\n",
  ------------------
  |  |  280|  34.5k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  34.5k|    do {                                                  \
  |  |  |  |  274|  34.5k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 34.5k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  34.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  616|  34.5k|                     addr.ToStringAddrPort(), (mapped_as ? strprintf(" mapped to AS%i", mapped_as) : ""), nUBucket, nUBucketPos);
  617|  34.5k|        } else {
  618|  7.18k|            if (pinfo->nRefCount == 0) {
  ------------------
  |  Branch (618:17): [True: 6.52k, False: 659]
  ------------------
  619|  6.52k|                Delete(nId);
  620|  6.52k|            }
  621|  7.18k|        }
  622|  41.7k|    }
  623|  46.6k|    return fInsert;
  624|  69.4k|}
_ZN11AddrManImpl5Good_ERK8CServicebNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
  627|  3.19k|{
  628|  3.19k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  3.19k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  629|       |
  630|  3.19k|    nid_type nId;
  631|       |
  632|  3.19k|    m_last_good = time;
  633|       |
  634|  3.19k|    AddrInfo* pinfo = Find(addr, &nId);
  635|       |
  636|       |    // if not found, bail out
  637|  3.19k|    if (!pinfo) return false;
  ------------------
  |  Branch (637:9): [True: 3.15k, False: 35]
  ------------------
  638|       |
  639|     35|    AddrInfo& info = *pinfo;
  640|       |
  641|       |    // update info
  642|     35|    info.m_last_success = time;
  643|     35|    info.m_last_try = time;
  644|     35|    info.nAttempts = 0;
  645|       |    // nTime is not updated here, to avoid leaking information about
  646|       |    // currently-connected peers.
  647|       |
  648|       |    // if it is already in the tried set, don't do anything else
  649|     35|    if (info.fInTried) return false;
  ------------------
  |  Branch (649:9): [True: 25, False: 10]
  ------------------
  650|       |
  651|       |    // if it is not in new, something bad happened
  652|     10|    if (!Assume(info.nRefCount > 0)) return false;
  ------------------
  |  |   97|     10|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (652:9): [True: 0, False: 10]
  ------------------
  653|       |
  654|       |
  655|       |    // which tried bucket to move the entry to
  656|     10|    int tried_bucket = info.GetTriedBucket(nKey, m_netgroupman);
  657|     10|    int tried_bucket_pos = info.GetBucketPosition(nKey, false, tried_bucket);
  658|       |
  659|       |    // Will moving this address into tried evict another entry?
  660|     10|    if (test_before_evict && (vvTried[tried_bucket][tried_bucket_pos] != -1)) {
  ------------------
  |  Branch (660:9): [True: 10, False: 0]
  |  Branch (660:30): [True: 0, False: 10]
  ------------------
  661|      0|        if (m_tried_collisions.size() < ADDRMAN_SET_TRIED_COLLISION_SIZE) {
  ------------------
  |  Branch (661:13): [True: 0, False: 0]
  ------------------
  662|      0|            m_tried_collisions.insert(nId);
  663|      0|        }
  664|       |        // Output the entry we'd be colliding with, for debugging purposes
  665|      0|        auto colliding_entry = mapInfo.find(vvTried[tried_bucket][tried_bucket_pos]);
  666|      0|        LogDebug(BCLog::ADDRMAN, "Collision with %s while attempting to move %s to tried table. Collisions=%d\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  667|      0|                 colliding_entry != mapInfo.end() ? colliding_entry->second.ToStringAddrPort() : "",
  668|      0|                 addr.ToStringAddrPort(),
  669|      0|                 m_tried_collisions.size());
  670|      0|        return false;
  671|     10|    } else {
  672|       |        // move nId to the tried tables
  673|     10|        MakeTried(info, nId);
  674|     10|        const auto mapped_as{m_netgroupman.GetMappedAS(addr)};
  675|     10|        LogDebug(BCLog::ADDRMAN, "Moved %s%s to tried[%i][%i]\n",
  ------------------
  |  |  280|     10|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     10|    do {                                                  \
  |  |  |  |  274|     10|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  676|     10|                 addr.ToStringAddrPort(), (mapped_as ? strprintf(" mapped to AS%i", mapped_as) : ""), tried_bucket, tried_bucket_pos);
  677|     10|        return true;
  678|     10|    }
  679|     10|}
_ZN11AddrManImpl4Add_ERKNSt3__16vectorI8CAddressNS0_9allocatorIS2_EEEERK8CNetAddrNS0_6chrono8durationIxNS0_5ratioILl1ELl1EEEEE:
  682|    958|{
  683|    958|    int added{0};
  684|  73.5k|    for (std::vector<CAddress>::const_iterator it = vAddr.begin(); it != vAddr.end(); it++) {
  ------------------
  |  Branch (684:68): [True: 72.6k, False: 958]
  ------------------
  685|  72.6k|        added += AddSingle(*it, source, time_penalty) ? 1 : 0;
  ------------------
  |  Branch (685:18): [True: 34.5k, False: 38.0k]
  ------------------
  686|  72.6k|    }
  687|    958|    if (added > 0) {
  ------------------
  |  Branch (687:9): [True: 813, False: 145]
  ------------------
  688|    813|        LogDebug(BCLog::ADDRMAN, "Added %i addresses (of %i) from %s: %i tried, %i new\n", added, vAddr.size(), source.ToStringAddr(), nTried, nNew);
  ------------------
  |  |  280|    813|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    813|    do {                                                  \
  |  |  |  |  274|    813|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 813]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    813|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  689|    813|    }
  690|    958|    return added > 0;
  691|    958|}
_ZNK11AddrManImpl8GetAddr_EmmNSt3__18optionalI7NetworkEEb:
  813|    323|{
  814|    323|    AssertLockHeld(cs);
  ------------------
  |  |  142|    323|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  815|    323|    Assume(max_pct <= 100);
  ------------------
  |  |   97|    323|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  816|       |
  817|    323|    size_t nNodes = vRandom.size();
  818|    323|    if (max_pct != 0) {
  ------------------
  |  Branch (818:9): [True: 323, False: 0]
  ------------------
  819|    323|        max_pct = std::min(max_pct, size_t{100});
  820|    323|        nNodes = max_pct * nNodes / 100;
  821|    323|    }
  822|    323|    if (max_addresses != 0) {
  ------------------
  |  Branch (822:9): [True: 323, False: 0]
  ------------------
  823|    323|        nNodes = std::min(nNodes, max_addresses);
  824|    323|    }
  825|       |
  826|       |    // gather a list of random nodes, skipping those of low quality
  827|    323|    const auto now{Now<NodeSeconds>()};
  828|    323|    std::vector<CAddress> addresses;
  829|    323|    addresses.reserve(nNodes);
  830|   435k|    for (unsigned int n = 0; n < vRandom.size(); n++) {
  ------------------
  |  Branch (830:30): [True: 435k, False: 316]
  ------------------
  831|   435k|        if (addresses.size() >= nNodes)
  ------------------
  |  Branch (831:13): [True: 7, False: 435k]
  ------------------
  832|      7|            break;
  833|       |
  834|   435k|        int nRndPos = insecure_rand.randrange(vRandom.size() - n) + n;
  835|   435k|        SwapRandom(n, nRndPos);
  836|   435k|        const auto it{mapInfo.find(vRandom[n])};
  837|   435k|        assert(it != mapInfo.end());
  838|       |
  839|   435k|        const AddrInfo& ai{it->second};
  840|       |
  841|       |        // Filter by network (optional)
  842|   435k|        if (network != std::nullopt && ai.GetNetClass() != network) continue;
  ------------------
  |  Branch (842:13): [True: 0, False: 435k]
  |  Branch (842:13): [True: 0, False: 435k]
  |  Branch (842:40): [True: 0, False: 0]
  ------------------
  843|       |
  844|       |        // Filter for quality
  845|   435k|        if (ai.IsTerrible(now) && filtered) continue;
  ------------------
  |  Branch (845:13): [True: 422k, False: 12.4k]
  |  Branch (845:35): [True: 422k, False: 0]
  ------------------
  846|       |
  847|  12.4k|        addresses.push_back(ai);
  848|  12.4k|    }
  849|    323|    LogDebug(BCLog::ADDRMAN, "GetAddr returned %d random addresses\n", addresses.size());
  ------------------
  |  |  280|    323|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    323|    do {                                                  \
  |  |  |  |  274|    323|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 323]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    323|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  850|    323|    return addresses;
  851|    323|}
_ZN11AddrManImpl10Connected_ERK8CServiceNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
  878|  3.02k|{
  879|  3.02k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  3.02k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  880|       |
  881|  3.02k|    AddrInfo* pinfo = Find(addr);
  882|       |
  883|       |    // if not found, bail out
  884|  3.02k|    if (!pinfo)
  ------------------
  |  Branch (884:9): [True: 2.98k, False: 33]
  ------------------
  885|  2.98k|        return;
  886|       |
  887|     33|    AddrInfo& info = *pinfo;
  888|       |
  889|       |    // update info
  890|     33|    const auto update_interval{20min};
  891|     33|    if (time - info.nTime > update_interval) {
  ------------------
  |  Branch (891:9): [True: 8, False: 25]
  ------------------
  892|      8|        info.nTime = time;
  893|      8|    }
  894|     33|}
_ZN11AddrManImpl12SetServices_ERK8CService12ServiceFlags:
  897|  3.24k|{
  898|  3.24k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  3.24k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  899|       |
  900|  3.24k|    AddrInfo* pinfo = Find(addr);
  901|       |
  902|       |    // if not found, bail out
  903|  3.24k|    if (!pinfo)
  ------------------
  |  Branch (903:9): [True: 3.20k, False: 35]
  ------------------
  904|  3.20k|        return;
  905|       |
  906|     35|    AddrInfo& info = *pinfo;
  907|       |
  908|       |    // update info
  909|     35|    info.nServices = nServices;
  910|     35|}
_ZNK11AddrManImpl5CheckEv:
 1049|  21.4k|{
 1050|  21.4k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  21.4k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1051|       |
 1052|       |    // Run consistency checks 1 in m_consistency_check_ratio times if enabled
 1053|  21.4k|    if (m_consistency_check_ratio == 0) return;
  ------------------
  |  Branch (1053:9): [True: 21.4k, False: 0]
  ------------------
 1054|      0|    if (insecure_rand.randrange(m_consistency_check_ratio) >= 1) return;
  ------------------
  |  Branch (1054:9): [True: 0, False: 0]
  ------------------
 1055|       |
 1056|      0|    const int err{CheckAddrman()};
 1057|      0|    if (err) {
  ------------------
  |  Branch (1057:9): [True: 0, False: 0]
  ------------------
 1058|      0|        LogPrintf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err);
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1059|      0|        assert(false);
 1060|      0|    }
 1061|      0|}
_ZN11AddrManImpl3AddERKNSt3__16vectorI8CAddressNS0_9allocatorIS2_EEEERK8CNetAddrNS0_6chrono8durationIxNS0_5ratioILl1ELl1EEEEE:
 1178|    958|{
 1179|    958|    LOCK(cs);
  ------------------
  |  |  257|    958|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    958|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    958|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    958|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1180|    958|    Check();
 1181|    958|    auto ret = Add_(vAddr, source, time_penalty);
 1182|    958|    Check();
 1183|    958|    return ret;
 1184|    958|}
_ZN11AddrManImpl4GoodERK8CServiceNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
 1187|  3.19k|{
 1188|  3.19k|    LOCK(cs);
  ------------------
  |  |  257|  3.19k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.19k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.19k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.19k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1189|  3.19k|    Check();
 1190|  3.19k|    auto ret = Good_(addr, /*test_before_evict=*/true, time);
 1191|  3.19k|    Check();
 1192|  3.19k|    return ret;
 1193|  3.19k|}
_ZNK11AddrManImpl7GetAddrEmmNSt3__18optionalI7NetworkEEb:
 1230|    323|{
 1231|    323|    LOCK(cs);
  ------------------
  |  |  257|    323|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    323|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    323|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    323|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1232|    323|    Check();
 1233|    323|    auto addresses = GetAddr_(max_addresses, max_pct, network, filtered);
 1234|    323|    Check();
 1235|    323|    return addresses;
 1236|    323|}
_ZN11AddrManImpl9ConnectedERK8CServiceNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
 1248|  3.02k|{
 1249|  3.02k|    LOCK(cs);
  ------------------
  |  |  257|  3.02k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.02k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.02k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.02k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1250|  3.02k|    Check();
 1251|  3.02k|    Connected_(addr, time);
 1252|  3.02k|    Check();
 1253|  3.02k|}
_ZN11AddrManImpl11SetServicesERK8CService12ServiceFlags:
 1256|  3.24k|{
 1257|  3.24k|    LOCK(cs);
  ------------------
  |  |  257|  3.24k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.24k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.24k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.24k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1258|  3.24k|    Check();
 1259|  3.24k|    SetServices_(addr, nServices);
 1260|  3.24k|    Check();
 1261|  3.24k|}
_ZN7AddrManD2Ev:
 1275|      2|AddrMan::~AddrMan() = default;
_ZN7AddrMan3AddERKNSt3__16vectorI8CAddressNS0_9allocatorIS2_EEEERK8CNetAddrNS0_6chrono8durationIxNS0_5ratioILl1ELl1EEEEE:
 1303|    958|{
 1304|    958|    return m_impl->Add(vAddr, source, time_penalty);
 1305|    958|}
_ZN7AddrMan4GoodERK8CServiceNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
 1308|  3.19k|{
 1309|  3.19k|    return m_impl->Good(addr, time);
 1310|  3.19k|}
_ZNK7AddrMan7GetAddrEmmNSt3__18optionalI7NetworkEEb:
 1333|    323|{
 1334|    323|    return m_impl->GetAddr(max_addresses, max_pct, network, filtered);
 1335|    323|}
_ZN7AddrMan9ConnectedERK8CServiceNSt3__16chrono10time_pointI9NodeClockNS4_8durationIxNS3_5ratioILl1ELl1EEEEEEE:
 1343|  3.02k|{
 1344|  3.02k|    m_impl->Connected(addr, time);
 1345|  3.02k|}
_ZN7AddrMan11SetServicesERK8CService12ServiceFlags:
 1348|  3.24k|{
 1349|  3.24k|    m_impl->SetServices(addr, nServices);
 1350|  3.24k|}

_ZN8AddrInfoC2ERK8CAddressRK8CNetAddr:
   77|  38.6k|    AddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource)
   78|  38.6k|    {
   79|  38.6k|    }
_ZN8AddrInfoC2Ev:
   81|  38.6k|    AddrInfo() : CAddress(), source()
   82|  38.6k|    {
   83|  38.6k|    }
_ZNK8AddrInfo12GetNewBucketERK7uint256RK15NetGroupManager:
   93|     10|    {
   94|     10|        return GetNewBucket(nKey, source, netgroupman);
   95|     10|    }

_ZN9base_uintILj256EElSEj:
   15|  2.90k|{
   16|  2.90k|    base_uint<BITS> a(*this);
   17|  26.1k|    for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (17:21): [True: 23.2k, False: 2.90k]
  ------------------
   18|  23.2k|        pn[i] = 0;
   19|  2.90k|    int k = shift / 32;
   20|  2.90k|    shift = shift % 32;
   21|  26.1k|    for (int i = 0; i < WIDTH; i++) {
  ------------------
  |  Branch (21:21): [True: 23.2k, False: 2.90k]
  ------------------
   22|  23.2k|        if (i + k + 1 < WIDTH && shift != 0)
  ------------------
  |  Branch (22:13): [True: 9.94k, False: 13.3k]
  |  Branch (22:34): [True: 9.86k, False: 85]
  ------------------
   23|  9.86k|            pn[i + k + 1] |= (a.pn[i] >> (32 - shift));
   24|  23.2k|        if (i + k < WIDTH)
  ------------------
  |  Branch (24:13): [True: 12.8k, False: 10.4k]
  ------------------
   25|  12.8k|            pn[i + k] |= (a.pn[i] << shift);
   26|  23.2k|    }
   27|  2.90k|    return *this;
   28|  2.90k|}
_ZN9base_uintILj256EErSEj:
   32|  17.9k|{
   33|  17.9k|    base_uint<BITS> a(*this);
   34|   161k|    for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (34:21): [True: 143k, False: 17.9k]
  ------------------
   35|   143k|        pn[i] = 0;
   36|  17.9k|    int k = shift / 32;
   37|  17.9k|    shift = shift % 32;
   38|   161k|    for (int i = 0; i < WIDTH; i++) {
  ------------------
  |  Branch (38:21): [True: 143k, False: 17.9k]
  ------------------
   39|   143k|        if (i - k - 1 >= 0 && shift != 0)
  ------------------
  |  Branch (39:13): [True: 122k, False: 21.3k]
  |  Branch (39:31): [True: 122k, False: 0]
  ------------------
   40|   122k|            pn[i - k - 1] |= (a.pn[i] << (32 - shift));
   41|   143k|        if (i - k >= 0)
  ------------------
  |  Branch (41:13): [True: 140k, False: 3.43k]
  ------------------
   42|   140k|            pn[i - k] |= (a.pn[i] >> shift);
   43|   143k|    }
   44|  17.9k|    return *this;
   45|  17.9k|}
_ZN9base_uintILj256EEmLERKS0_:
   61|    616|{
   62|    616|    base_uint<BITS> a;
   63|  5.54k|    for (int j = 0; j < WIDTH; j++) {
  ------------------
  |  Branch (63:21): [True: 4.92k, False: 616]
  ------------------
   64|  4.92k|        uint64_t carry = 0;
   65|  27.1k|        for (int i = 0; i + j < WIDTH; i++) {
  ------------------
  |  Branch (65:25): [True: 22.1k, False: 4.92k]
  ------------------
   66|  22.1k|            uint64_t n = carry + a.pn[i + j] + (uint64_t)pn[j] * b.pn[i];
   67|  22.1k|            a.pn[i + j] = n & 0xffffffff;
   68|  22.1k|            carry = n >> 32;
   69|  22.1k|        }
   70|  4.92k|    }
   71|    616|    *this = a;
   72|    616|    return *this;
   73|    616|}
_ZN9base_uintILj256EEdVERKS0_:
   77|  1.45k|{
   78|  1.45k|    base_uint<BITS> div = b;     // make a copy, so we can shift.
   79|  1.45k|    base_uint<BITS> num = *this; // make a copy, so we can subtract.
   80|  1.45k|    *this = 0;                   // the quotient.
   81|  1.45k|    int num_bits = num.bits();
   82|  1.45k|    int div_bits = div.bits();
   83|  1.45k|    if (div_bits == 0)
  ------------------
  |  Branch (83:9): [True: 0, False: 1.45k]
  ------------------
   84|      0|        throw uint_error("Division by zero");
   85|  1.45k|    if (div_bits > num_bits) // the result is certainly 0.
  ------------------
  |  Branch (85:9): [True: 13, False: 1.44k]
  ------------------
   86|     13|        return *this;
   87|  1.44k|    int shift = num_bits - div_bits;
   88|  1.44k|    div <<= shift; // shift so that div and num align.
   89|  18.8k|    while (shift >= 0) {
  ------------------
  |  Branch (89:12): [True: 17.4k, False: 1.44k]
  ------------------
   90|  17.4k|        if (num >= div) {
  ------------------
  |  Branch (90:13): [True: 8.89k, False: 8.55k]
  ------------------
   91|  8.89k|            num -= div;
   92|  8.89k|            pn[shift / 32] |= (1U << (shift & 31)); // set a bit of the result.
   93|  8.89k|        }
   94|  17.4k|        div >>= 1; // shift back.
   95|  17.4k|        shift--;
   96|  17.4k|    }
   97|       |    // num now contains the remainder of the division.
   98|  1.44k|    return *this;
   99|  1.45k|}
_ZNK9base_uintILj256EE9CompareToERKS0_:
  103|  1.89M|{
  104|  15.0M|    for (int i = WIDTH - 1; i >= 0; i--) {
  ------------------
  |  Branch (104:29): [True: 15.0M, False: 30.6k]
  ------------------
  105|  15.0M|        if (pn[i] < b.pn[i])
  ------------------
  |  Branch (105:13): [True: 1.04M, False: 14.0M]
  ------------------
  106|  1.04M|            return -1;
  107|  14.0M|        if (pn[i] > b.pn[i])
  ------------------
  |  Branch (107:13): [True: 820k, False: 13.1M]
  ------------------
  108|   820k|            return 1;
  109|  14.0M|    }
  110|  30.6k|    return 0;
  111|  1.89M|}
_ZNK9base_uintILj256EE7EqualToEm:
  115|  1.45k|{
  116|  1.85k|    for (int i = WIDTH - 1; i >= 2; i--) {
  ------------------
  |  Branch (116:29): [True: 1.80k, False: 47]
  ------------------
  117|  1.80k|        if (pn[i])
  ------------------
  |  Branch (117:13): [True: 1.40k, False: 394]
  ------------------
  118|  1.40k|            return false;
  119|  1.80k|    }
  120|     47|    if (pn[1] != (b >> 32))
  ------------------
  |  Branch (120:9): [True: 18, False: 29]
  ------------------
  121|     18|        return false;
  122|     29|    if (pn[0] != (b & 0xfffffffful))
  ------------------
  |  Branch (122:9): [True: 27, False: 2]
  ------------------
  123|     27|        return false;
  124|      2|    return true;
  125|     29|}
_ZNK9base_uintILj256EE4bitsEv:
  157|  3.39k|{
  158|  3.80k|    for (int pos = WIDTH - 1; pos >= 0; pos--) {
  ------------------
  |  Branch (158:31): [True: 3.80k, False: 0]
  ------------------
  159|  3.80k|        if (pn[pos]) {
  ------------------
  |  Branch (159:13): [True: 3.39k, False: 409]
  ------------------
  160|  6.91k|            for (int nbits = 31; nbits > 0; nbits--) {
  ------------------
  |  Branch (160:34): [True: 6.91k, False: 2]
  ------------------
  161|  6.91k|                if (pn[pos] & 1U << nbits)
  ------------------
  |  Branch (161:21): [True: 3.39k, False: 3.51k]
  ------------------
  162|  3.39k|                    return 32 * pos + nbits + 1;
  163|  6.91k|            }
  164|      2|            return 32 * pos + 1;
  165|  3.39k|        }
  166|  3.80k|    }
  167|      0|    return 0;
  168|  3.39k|}
_ZN13arith_uint25610SetCompactEjPbS0_:
  176|  1.49k|{
  177|  1.49k|    int nSize = nCompact >> 24;
  178|  1.49k|    uint32_t nWord = nCompact & 0x007fffff;
  179|  1.49k|    if (nSize <= 3) {
  ------------------
  |  Branch (179:9): [True: 28, False: 1.46k]
  ------------------
  180|     28|        nWord >>= 8 * (3 - nSize);
  181|     28|        *this = nWord;
  182|  1.46k|    } else {
  183|  1.46k|        *this = nWord;
  184|  1.46k|        *this <<= 8 * (nSize - 3);
  185|  1.46k|    }
  186|  1.49k|    if (pfNegative)
  ------------------
  |  Branch (186:9): [True: 1.49k, False: 0]
  ------------------
  187|  1.49k|        *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0;
  ------------------
  |  Branch (187:23): [True: 1.49k, False: 2]
  |  Branch (187:37): [True: 28, False: 1.46k]
  ------------------
  188|  1.49k|    if (pfOverflow)
  ------------------
  |  Branch (188:9): [True: 1.49k, False: 0]
  ------------------
  189|  1.49k|        *pfOverflow = nWord != 0 && ((nSize > 34) ||
  ------------------
  |  Branch (189:23): [True: 1.49k, False: 2]
  |  Branch (189:38): [True: 18, False: 1.47k]
  ------------------
  190|  1.49k|                                     (nWord > 0xff && nSize > 33) ||
  ------------------
  |  Branch (190:39): [True: 1.44k, False: 29]
  |  Branch (190:55): [True: 4, False: 1.44k]
  ------------------
  191|  1.49k|                                     (nWord > 0xffff && nSize > 32));
  ------------------
  |  Branch (191:39): [True: 1.40k, False: 66]
  |  Branch (191:57): [True: 1, False: 1.40k]
  ------------------
  192|  1.49k|    return *this;
  193|  1.49k|}
_ZNK13arith_uint25610GetCompactEb:
  196|    490|{
  197|    490|    int nSize = (bits() + 7) / 8;
  198|    490|    uint32_t nCompact = 0;
  199|    490|    if (nSize <= 3) {
  ------------------
  |  Branch (199:9): [True: 0, False: 490]
  ------------------
  200|      0|        nCompact = GetLow64() << 8 * (3 - nSize);
  201|    490|    } else {
  202|    490|        arith_uint256 bn = *this >> 8 * (nSize - 3);
  203|    490|        nCompact = bn.GetLow64();
  204|    490|    }
  205|       |    // The 0x00800000 bit denotes the sign.
  206|       |    // Thus, if it is already set, divide the mantissa by 256 and increase the exponent.
  207|    490|    if (nCompact & 0x00800000) {
  ------------------
  |  Branch (207:9): [True: 0, False: 490]
  ------------------
  208|      0|        nCompact >>= 8;
  209|      0|        nSize++;
  210|      0|    }
  211|    490|    assert((nCompact & ~0x007fffffU) == 0);
  212|    490|    assert(nSize < 256);
  213|    490|    nCompact |= nSize << 24;
  214|    490|    nCompact |= (fNegative && (nCompact & 0x007fffff) ? 0x00800000 : 0);
  ------------------
  |  Branch (214:18): [True: 0, False: 490]
  |  Branch (214:31): [True: 0, False: 0]
  ------------------
  215|    490|    return nCompact;
  216|    490|}
_Z14UintToArith256RK7uint256:
  226|    490|{
  227|    490|    arith_uint256 b;
  228|  4.41k|    for(int x=0; x<b.WIDTH; ++x)
  ------------------
  |  Branch (228:18): [True: 3.92k, False: 490]
  ------------------
  229|  3.92k|        b.pn[x] = ReadLE32(a.begin() + x*4);
  230|    490|    return b;
  231|    490|}

_ZN13arith_uint256C2ERK9base_uintILj256EE:
  249|  3.71k|    arith_uint256(const base_uint<256>& b) : base_uint<256>(b) {}
_ZN13arith_uint256C2Em:
  250|  2.76k|    arith_uint256(uint64_t b) : base_uint<256>(b) {}
_ZleRK9base_uintILj256EES2_:
  219|    191|    friend inline bool operator<=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) <= 0; }
_ZmiRK9base_uintILj256EES2_:
  205|    616|    friend inline base_uint operator-(const base_uint& a, const base_uint& b) { return base_uint(a) -= b; }
_ZN9base_uintILj256EEmIERKS0_:
  141|  9.51k|    {
  142|  9.51k|        *this += -b;
  143|  9.51k|        return *this;
  144|  9.51k|    }
_ZNK9base_uintILj256EEngEv:
   71|  9.51k|    {
   72|  9.51k|        base_uint ret;
   73|  85.5k|        for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (73:25): [True: 76.0k, False: 9.51k]
  ------------------
   74|  76.0k|            ret.pn[i] = ~pn[i];
   75|  9.51k|        ++ret;
   76|  9.51k|        return ret;
   77|  9.51k|    }
_ZN9base_uintILj256EEppEv:
  167|  9.51k|    {
  168|       |        // prefix operator
  169|  9.51k|        int i = 0;
  170|  29.9k|        while (i < WIDTH && ++pn[i] == 0)
  ------------------
  |  Branch (170:16): [True: 29.9k, False: 0]
  |  Branch (170:29): [True: 20.4k, False: 9.51k]
  ------------------
  171|  20.4k|            i++;
  172|  9.51k|        return *this;
  173|  9.51k|    }
_ZN9base_uintILj256EEpLERKS0_:
  129|  13.9k|    {
  130|  13.9k|        uint64_t carry = 0;
  131|   125k|        for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (131:25): [True: 111k, False: 13.9k]
  ------------------
  132|   111k|        {
  133|   111k|            uint64_t n = carry + pn[i] + b.pn[i];
  134|   111k|            pn[i] = n & 0xffffffff;
  135|   111k|            carry = n >> 32;
  136|   111k|        }
  137|  13.9k|        return *this;
  138|  13.9k|    }
_ZNK9base_uintILj256EEcoEv:
   63|  1.45k|    {
   64|  1.45k|        base_uint ret;
   65|  13.0k|        for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (65:25): [True: 11.6k, False: 1.45k]
  ------------------
   66|  11.6k|            ret.pn[i] = ~pn[i];
   67|  1.45k|        return ret;
   68|  1.45k|    }
_ZplRK9base_uintILj256EES2_:
  204|  3.78k|    friend inline base_uint operator+(const base_uint& a, const base_uint& b) { return base_uint(a) += b; }
_ZdvRK9base_uintILj256EES2_:
  207|  1.45k|    friend inline base_uint operator/(const base_uint& a, const base_uint& b) { return base_uint(a) /= b; }
_ZmlRK9base_uintILj256EES2_:
  206|    616|    friend inline base_uint operator*(const base_uint& a, const base_uint& b) { return base_uint(a) *= b; }
_ZN9base_uintILj256EEaSERKS0_:
   46|  2.98k|    {
   47|  2.98k|        if (this != &b) {
  ------------------
  |  Branch (47:13): [True: 2.98k, False: 0]
  ------------------
   48|  26.8k|            for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (48:29): [True: 23.8k, False: 2.98k]
  ------------------
   49|  23.8k|                pn[i] = b.pn[i];
   50|  2.98k|        }
   51|  2.98k|        return *this;
   52|  2.98k|    }
_ZgeRK9base_uintILj256EES2_:
  218|   287k|    friend inline bool operator>=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) >= 0; }
_ZN13arith_uint256C2Ev:
  248|  3.08k|    arith_uint256() = default;
_ZN9base_uintILj256EEC2Ev:
   34|  14.6k|    {
   35|   131k|        for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (35:25): [True: 117k, False: 14.6k]
  ------------------
   36|   117k|            pn[i] = 0;
   37|  14.6k|    }
_ZN9base_uintILj256EEC2ERKS0_:
   40|  42.2k|    {
   41|   380k|        for (int i = 0; i < WIDTH; i++)
  ------------------
  |  Branch (41:25): [True: 338k, False: 42.2k]
  ------------------
   42|   338k|            pn[i] = b.pn[i];
   43|  42.2k|    }
_ZNK9base_uintILj256EE8GetLow64Ev:
  239|    490|    {
  240|    490|        static_assert(WIDTH >= 2, "Assertion WIDTH >= 2 failed (WIDTH = BITS / 32). BITS is a template parameter.");
  241|    490|        return pn[0] | (uint64_t)pn[1] << 32;
  242|    490|    }
_ZN9base_uintILj256EEC2Em:
   55|  6.99k|    {
   56|  6.99k|        pn[0] = (unsigned int)b;
   57|  6.99k|        pn[1] = (unsigned int)(b >> 32);
   58|  48.9k|        for (int i = 2; i < WIDTH; i++)
  ------------------
  |  Branch (58:25): [True: 41.9k, False: 6.99k]
  ------------------
   59|  41.9k|            pn[i] = 0;
   60|  6.99k|    }
_ZltRK9base_uintILj256EES2_:
  217|  1.04M|    friend inline bool operator<(const base_uint& a, const base_uint& b) { return a.CompareTo(b) < 0; }
_ZgtRK9base_uintILj256EES2_:
  216|   563k|    friend inline bool operator>(const base_uint& a, const base_uint& b) { return a.CompareTo(b) > 0; }
_ZeqRK9base_uintILj256EEm:
  220|  1.45k|    friend inline bool operator==(const base_uint& a, uint64_t b) { return a.EqualTo(b); }
_ZN9base_uintILj256EEaSEm:
   82|  1.45k|    {
   83|  1.45k|        pn[0] = (unsigned int)b;
   84|  1.45k|        pn[1] = (unsigned int)(b >> 32);
   85|  10.1k|        for (int i = 2; i < WIDTH; i++)
  ------------------
  |  Branch (85:25): [True: 8.72k, False: 1.45k]
  ------------------
   86|  8.72k|            pn[i] = 0;
   87|  1.45k|        return *this;
   88|  1.45k|    }
_ZrsRK9base_uintILj256EEi:
  211|    490|    friend inline base_uint operator>>(const base_uint& a, int shift) { return base_uint(a) >>= shift; }

_ZN6BanManD2Ev:
   25|      2|{
   26|      2|    DumpBanlist();
   27|      2|}
_ZN6BanMan11DumpBanlistEv:
   49|      2|{
   50|      2|    static Mutex dump_mutex;
   51|      2|    LOCK(dump_mutex);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define 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);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define 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);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define 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\n", banmap.size(),
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   69|      0|             Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
   70|      0|}
_ZN6BanMan13IsDiscouragedERK8CNetAddr:
   84|  72.6k|{
   85|  72.6k|    LOCK(m_banned_mutex);
  ------------------
  |  |  257|  72.6k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  72.6k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  72.6k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  72.6k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   86|  72.6k|    return m_discouraged.contains(net_addr.GetAddrBytes());
   87|  72.6k|}
_ZN6BanMan8IsBannedERK8CNetAddr:
   90|  72.6k|{
   91|  72.6k|    auto current_time = GetTime();
   92|  72.6k|    LOCK(m_banned_mutex);
  ------------------
  |  |  257|  72.6k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  72.6k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  72.6k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  72.6k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|  72.6k|    for (const auto& it : m_banned) {
  ------------------
  |  Branch (93:25): [True: 0, False: 72.6k]
  ------------------
   94|      0|        CSubNet sub_net = it.first;
   95|      0|        CBanEntry ban_entry = it.second;
   96|       |
   97|      0|        if (current_time < ban_entry.nBanUntil && sub_net.Match(net_addr)) {
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  |  Branch (97:51): [True: 0, False: 0]
  ------------------
   98|      0|            return true;
   99|      0|        }
  100|      0|    }
  101|  72.6k|    return false;
  102|  72.6k|}
_ZN6BanMan10DiscourageERK8CNetAddr:
  125|    225|{
  126|    225|    LOCK(m_banned_mutex);
  ------------------
  |  |  257|    225|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    225|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    225|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    225|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|    225|    m_discouraged.insert(net_addr.GetAddrBytes());
  128|    225|}
_ZN6BanMan11SweepBannedEv:
  183|      2|{
  184|      2|    AssertLockHeld(m_banned_mutex);
  ------------------
  |  |  142|      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());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|}

_ZN25CBlockHeaderAndShortTxIDsC2ERK6CBlockm:
   21|     10|        nonce(nonce),
   22|     10|        shorttxids(block.vtx.size() - 1), prefilledtxn(1), header(block) {
   23|     10|    FillShortTxIDSelector();
   24|       |    //TODO: Use our mempool prior to block acceptance to predictively fill more than just the coinbase
   25|     10|    prefilledtxn[0] = {0, block.vtx[0]};
   26|     10|    for (size_t i = 1; i < block.vtx.size(); i++) {
  ------------------
  |  Branch (26:24): [True: 0, False: 10]
  ------------------
   27|      0|        const CTransaction& tx = *block.vtx[i];
   28|      0|        shorttxids[i - 1] = GetShortID(tx.GetWitnessHash());
   29|      0|    }
   30|     10|}
_ZNK25CBlockHeaderAndShortTxIDs21FillShortTxIDSelectorEv:
   32|    334|void CBlockHeaderAndShortTxIDs::FillShortTxIDSelector() const {
   33|    334|    DataStream stream{};
   34|    334|    stream << header << nonce;
   35|    334|    CSHA256 hasher;
   36|    334|    hasher.Write((unsigned char*)&(*stream.begin()), stream.end() - stream.begin());
   37|    334|    uint256 shorttxidhash;
   38|    334|    hasher.Finalize(shorttxidhash.begin());
   39|    334|    shorttxidk0 = shorttxidhash.GetUint64(0);
   40|    334|    shorttxidk1 = shorttxidhash.GetUint64(1);
   41|    334|}
_ZNK25CBlockHeaderAndShortTxIDs10GetShortIDERK22transaction_identifierILb1EE:
   43|  7.10k|uint64_t CBlockHeaderAndShortTxIDs::GetShortID(const Wtxid& wtxid) const {
   44|  7.10k|    static_assert(SHORTTXIDS_LENGTH == 6, "shorttxids calculation assumes 6-byte shorttxids");
   45|  7.10k|    return SipHashUint256(shorttxidk0, shorttxidk1, wtxid) & 0xffffffffffffL;
   46|  7.10k|}
_ZN24PartiallyDownloadedBlock8InitDataERK25CBlockHeaderAndShortTxIDsRKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEE:
   50|    141|ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<CTransactionRef>& extra_txn) {
   51|    141|    if (cmpctblock.header.IsNull() || (cmpctblock.shorttxids.empty() && cmpctblock.prefilledtxn.empty()))
  ------------------
  |  Branch (51:9): [True: 0, False: 141]
  |  Branch (51:40): [True: 1, False: 140]
  |  Branch (51:73): [True: 1, False: 0]
  ------------------
   52|      1|        return READ_STATUS_INVALID;
   53|    140|    if (cmpctblock.shorttxids.size() + cmpctblock.prefilledtxn.size() > MAX_BLOCK_WEIGHT / MIN_SERIALIZABLE_TRANSACTION_WEIGHT)
  ------------------
  |  Branch (53:9): [True: 0, False: 140]
  ------------------
   54|      0|        return READ_STATUS_INVALID;
   55|       |
   56|    140|    if (!header.IsNull() || !txn_available.empty()) return READ_STATUS_INVALID;
  ------------------
  |  Branch (56:9): [True: 0, False: 140]
  |  Branch (56:29): [True: 0, False: 140]
  ------------------
   57|       |
   58|    140|    header = cmpctblock.header;
   59|    140|    txn_available.resize(cmpctblock.BlockTxCount());
   60|       |
   61|    140|    int32_t lastprefilledindex = -1;
   62|    144|    for (size_t i = 0; i < cmpctblock.prefilledtxn.size(); i++) {
  ------------------
  |  Branch (62:24): [True: 6, False: 138]
  ------------------
   63|      6|        if (cmpctblock.prefilledtxn[i].tx->IsNull())
  ------------------
  |  Branch (63:13): [True: 1, False: 5]
  ------------------
   64|      1|            return READ_STATUS_INVALID;
   65|       |
   66|      5|        lastprefilledindex += cmpctblock.prefilledtxn[i].index + 1; //index is a uint16_t, so can't overflow here
   67|      5|        if (lastprefilledindex > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (67:13): [True: 0, False: 5]
  ------------------
   68|      0|            return READ_STATUS_INVALID;
   69|      5|        if ((uint32_t)lastprefilledindex > cmpctblock.shorttxids.size() + i) {
  ------------------
  |  Branch (69:13): [True: 1, False: 4]
  ------------------
   70|       |            // If we are inserting a tx at an index greater than our full list of shorttxids
   71|       |            // plus the number of prefilled txn we've inserted, then we have txn for which we
   72|       |            // have neither a prefilled txn or a shorttxid!
   73|      1|            return READ_STATUS_INVALID;
   74|      1|        }
   75|      4|        txn_available[lastprefilledindex] = cmpctblock.prefilledtxn[i].tx;
   76|      4|    }
   77|    138|    prefilled_count = cmpctblock.prefilledtxn.size();
   78|       |
   79|       |    // Calculate map of txids -> positions and check mempool to see what we have (or don't)
   80|       |    // Because well-formed cmpctblock messages will have a (relatively) uniform distribution
   81|       |    // of short IDs, any highly-uneven distribution of elements can be safely treated as a
   82|       |    // READ_STATUS_FAILED.
   83|    138|    std::unordered_map<uint64_t, uint16_t> shorttxids(cmpctblock.shorttxids.size());
   84|    138|    uint16_t index_offset = 0;
   85|  3.84k|    for (size_t i = 0; i < cmpctblock.shorttxids.size(); i++) {
  ------------------
  |  Branch (85:24): [True: 3.70k, False: 136]
  ------------------
   86|  3.70k|        while (txn_available[i + index_offset])
  ------------------
  |  Branch (86:16): [True: 1, False: 3.70k]
  ------------------
   87|      1|            index_offset++;
   88|  3.70k|        shorttxids[cmpctblock.shorttxids[i]] = i + index_offset;
   89|       |        // To determine the chance that the number of entries in a bucket exceeds N,
   90|       |        // we use the fact that the number of elements in a single bucket is
   91|       |        // binomially distributed (with n = the number of shorttxids S, and p =
   92|       |        // 1 / the number of buckets), that in the worst case the number of buckets is
   93|       |        // equal to S (due to std::unordered_map having a default load factor of 1.0),
   94|       |        // and that the chance for any bucket to exceed N elements is at most
   95|       |        // buckets * (the chance that any given bucket is above N elements).
   96|       |        // Thus: P(max_elements_per_bucket > N) <= S * (1 - cdf(binomial(n=S,p=1/S), N)).
   97|       |        // If we assume blocks of up to 16000, allowing 12 elements per bucket should
   98|       |        // only fail once per ~1 million block transfers (per peer and connection).
   99|  3.70k|        if (shorttxids.bucket_size(shorttxids.bucket(cmpctblock.shorttxids[i])) > 12)
  ------------------
  |  Branch (99:13): [True: 2, False: 3.70k]
  ------------------
  100|      2|            return READ_STATUS_FAILED;
  101|  3.70k|    }
  102|       |    // TODO: in the shortid-collision case, we should instead request both transactions
  103|       |    // which collided. Falling back to full-block-request here is overkill.
  104|    136|    if (shorttxids.size() != cmpctblock.shorttxids.size())
  ------------------
  |  Branch (104:9): [True: 65, False: 71]
  ------------------
  105|     65|        return READ_STATUS_FAILED; // Short ID collision
  106|       |
  107|     71|    std::vector<bool> have_txn(txn_available.size());
  108|     71|    {
  109|     71|    LOCK(pool->cs);
  ------------------
  |  |  257|     71|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     71|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     71|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     71|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|     71|    for (const auto& tx : pool->txns_randomized) {
  ------------------
  |  Branch (110:25): [True: 0, False: 71]
  ------------------
  111|      0|        uint64_t shortid = cmpctblock.GetShortID(tx->GetWitnessHash());
  112|      0|        std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid);
  113|      0|        if (idit != shorttxids.end()) {
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            if (!have_txn[idit->second]) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|                txn_available[idit->second] = tx;
  116|      0|                have_txn[idit->second]  = true;
  117|      0|                mempool_count++;
  118|      0|            } else {
  119|       |                // If we find two mempool txn that match the short id, just request it.
  120|       |                // This should be rare enough that the extra bandwidth doesn't matter,
  121|       |                // but eating a round-trip due to FillBlock failure would be annoying
  122|      0|                if (txn_available[idit->second]) {
  ------------------
  |  Branch (122:21): [True: 0, False: 0]
  ------------------
  123|      0|                    txn_available[idit->second].reset();
  124|      0|                    mempool_count--;
  125|      0|                }
  126|      0|            }
  127|      0|        }
  128|       |        // Though ideally we'd continue scanning for the two-txn-match-shortid case,
  129|       |        // the performance win of an early exit here is too good to pass up and worth
  130|       |        // the extra risk.
  131|      0|        if (mempool_count == shorttxids.size())
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  ------------------
  132|      0|            break;
  133|      0|    }
  134|     71|    }
  135|       |
  136|  7.17k|    for (size_t i = 0; i < extra_txn.size(); i++) {
  ------------------
  |  Branch (136:24): [True: 7.10k, False: 71]
  ------------------
  137|  7.10k|        if (extra_txn[i] == nullptr) {
  ------------------
  |  Branch (137:13): [True: 0, False: 7.10k]
  ------------------
  138|      0|            continue;
  139|      0|        }
  140|  7.10k|        uint64_t shortid = cmpctblock.GetShortID(extra_txn[i]->GetWitnessHash());
  141|  7.10k|        std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid);
  142|  7.10k|        if (idit != shorttxids.end()) {
  ------------------
  |  Branch (142:13): [True: 0, False: 7.10k]
  ------------------
  143|      0|            if (!have_txn[idit->second]) {
  ------------------
  |  Branch (143:17): [True: 0, False: 0]
  ------------------
  144|      0|                txn_available[idit->second] = extra_txn[i];
  145|      0|                have_txn[idit->second]  = true;
  146|      0|                mempool_count++;
  147|      0|                extra_count++;
  148|      0|            } else {
  149|       |                // If we find two mempool/extra txn that match the short id, just
  150|       |                // request it.
  151|       |                // This should be rare enough that the extra bandwidth doesn't matter,
  152|       |                // but eating a round-trip due to FillBlock failure would be annoying
  153|       |                // Note that we don't want duplication between extra_txn and mempool to
  154|       |                // trigger this case, so we compare witness hashes first
  155|      0|                if (txn_available[idit->second] &&
  ------------------
  |  Branch (155:21): [True: 0, False: 0]
  ------------------
  156|      0|                        txn_available[idit->second]->GetWitnessHash() != extra_txn[i]->GetWitnessHash()) {
  ------------------
  |  Branch (156:25): [True: 0, False: 0]
  ------------------
  157|      0|                    txn_available[idit->second].reset();
  158|      0|                    mempool_count--;
  159|      0|                    extra_count--;
  160|      0|                }
  161|      0|            }
  162|      0|        }
  163|       |        // Though ideally we'd continue scanning for the two-txn-match-shortid case,
  164|       |        // the performance win of an early exit here is too good to pass up and worth
  165|       |        // the extra risk.
  166|  7.10k|        if (mempool_count == shorttxids.size())
  ------------------
  |  Branch (166:13): [True: 0, False: 7.10k]
  ------------------
  167|      0|            break;
  168|  7.10k|    }
  169|       |
  170|     71|    LogDebug(BCLog::CMPCTBLOCK, "Initialized PartiallyDownloadedBlock for block %s using a cmpctblock of size %lu\n", cmpctblock.header.GetHash().ToString(), GetSerializeSize(cmpctblock));
  ------------------
  |  |  280|     71|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     71|    do {                                                  \
  |  |  |  |  274|     71|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 71]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     71|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|       |
  172|     71|    return READ_STATUS_OK;
  173|    136|}
_ZNK24PartiallyDownloadedBlock13IsTxAvailableEm:
  176|    941|{
  177|    941|    if (header.IsNull()) return false;
  ------------------
  |  Branch (177:9): [True: 0, False: 941]
  ------------------
  178|       |
  179|    941|    assert(index < txn_available.size());
  180|    941|    return txn_available[index] != nullptr;
  181|    941|}

_ZN25CBlockHeaderAndShortTxIDsC2Ev:
  112|    411|    CBlockHeaderAndShortTxIDs() = default;
_ZN17BlockTransactionsC2Ev:
   62|     98|    BlockTransactions() = default;
_ZN25CBlockHeaderAndShortTxIDs16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
  124|    411|    {
  125|    411|        READWRITE(obj.header, obj.nonce, Using<VectorFormatter<CustomUintFormatter<SHORTTXIDS_LENGTH>>>(obj.shorttxids), obj.prefilledtxn);
  ------------------
  |  |  156|    411|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  126|    411|        if (ser_action.ForRead()) {
  ------------------
  |  Branch (126:13): [Folded - Ignored]
  ------------------
  127|    325|            if (obj.BlockTxCount() > std::numeric_limits<uint16_t>::max()) {
  ------------------
  |  Branch (127:17): [True: 1, False: 324]
  ------------------
  128|      1|                throw std::ios_base::failure("indexes overflowed 16 bits");
  129|      1|            }
  130|    324|            obj.FillShortTxIDSelector();
  131|    324|        }
  132|    411|    }
_ZN20PrefilledTransaction16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   79|  12.4k|    SERIALIZE_METHODS(PrefilledTransaction, obj) { READWRITE(COMPACTSIZE(obj.index), TX_WITH_WITNESS(Using<TransactionCompression>(obj.tx))); }
  ------------------
  |  |  156|  12.4k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZNK25CBlockHeaderAndShortTxIDs12BlockTxCountEv:
  121|  1.47k|    size_t BlockTxCount() const { return shorttxids.size() + prefilledtxn.size(); }
_ZN17BlockTransactions16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   67|     98|    {
   68|     98|        READWRITE(obj.blockhash, TX_WITH_WITNESS(Using<VectorFormatter<TransactionCompression>>(obj.txn)));
  ------------------
  |  |  156|     98|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   69|     98|    }
_ZN24BlockTransactionsRequest16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   51|    139|    {
   52|    139|        READWRITE(obj.blockhash, Using<VectorFormatter<DifferenceFormatter>>(obj.indexes));
  ------------------
  |  |  156|    139|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   53|    139|    }
_ZN19DifferenceFormatter5UnserI10DataStreamtEEvRT_RT0_:
   36|  3.02k|    {
   37|  3.02k|        uint64_t n = ReadCompactSize(s);
   38|  3.02k|        m_shift += n;
   39|  3.02k|        if (m_shift < n || m_shift >= std::numeric_limits<uint64_t>::max() || m_shift < std::numeric_limits<I>::min() || m_shift > std::numeric_limits<I>::max()) throw std::ios_base::failure("differential value overflow");
  ------------------
  |  Branch (39:13): [True: 52, False: 2.97k]
  |  Branch (39:28): [True: 0, False: 2.97k]
  |  Branch (39:79): [True: 0, False: 2.97k]
  |  Branch (39:122): [True: 25, False: 2.94k]
  ------------------
   40|  3.00k|        v = I(m_shift++);
   41|  3.00k|    }
_ZN17BlockTransactionsC2ERK24BlockTransactionsRequest:
   64|     15|        blockhash(req.blockhash), txn(req.indexes.size()) {}
_ZN24PartiallyDownloadedBlockC2EP10CTxMemPool:
  147|    141|    explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}
_ZN25CBlockHeaderAndShortTxIDs16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
  124|     10|    {
  125|     10|        READWRITE(obj.header, obj.nonce, Using<VectorFormatter<CustomUintFormatter<SHORTTXIDS_LENGTH>>>(obj.shorttxids), obj.prefilledtxn);
  ------------------
  |  |  156|     10|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  126|     10|        if (ser_action.ForRead()) {
  ------------------
  |  Branch (126:13): [Folded - Ignored]
  ------------------
  127|      0|            if (obj.BlockTxCount() > std::numeric_limits<uint16_t>::max()) {
  ------------------
  |  Branch (127:17): [True: 0, False: 0]
  ------------------
  128|      0|                throw std::ios_base::failure("indexes overflowed 16 bits");
  129|      0|            }
  130|      0|            obj.FillShortTxIDSelector();
  131|      0|        }
  132|     10|    }
_ZN20PrefilledTransaction16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   79|     10|    SERIALIZE_METHODS(PrefilledTransaction, obj) { READWRITE(COMPACTSIZE(obj.index), TX_WITH_WITNESS(Using<TransactionCompression>(obj.tx))); }
  ------------------
  |  |  156|     10|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN17BlockTransactions16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   67|      2|    {
   68|      2|        READWRITE(obj.blockhash, TX_WITH_WITNESS(Using<VectorFormatter<TransactionCompression>>(obj.txn)));
  ------------------
  |  |  156|      2|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   69|      2|    }
_ZN24BlockTransactionsRequest16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   51|     71|    {
   52|     71|        READWRITE(obj.blockhash, Using<VectorFormatter<DifferenceFormatter>>(obj.indexes));
  ------------------
  |  |  156|     71|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   53|     71|    }
_ZN19DifferenceFormatter3SerI12VectorWritertEEvRT_T0_:
   29|    939|    {
   30|    939|        if (v < m_shift || v >= std::numeric_limits<uint64_t>::max()) throw std::ios_base::failure("differential value overflow");
  ------------------
  |  Branch (30:13): [True: 0, False: 939]
  |  Branch (30:28): [True: 0, False: 939]
  ------------------
   31|    939|        WriteCompactSize(s, v - m_shift);
   32|    939|        m_shift = uint64_t(v) + 1;
   33|    939|    }

_ZN6CChain6SetTipER11CBlockIndex:
   22|    731|{
   23|    731|    CBlockIndex* pindex = &block;
   24|    731|    vChain.resize(pindex->nHeight + 1);
   25|   148k|    while (pindex && vChain[pindex->nHeight] != pindex) {
  ------------------
  |  Branch (25:12): [True: 147k, False: 731]
  |  Branch (25:22): [True: 147k, False: 0]
  ------------------
   26|   147k|        vChain[pindex->nHeight] = pindex;
   27|   147k|        pindex = pindex->pprev;
   28|   147k|    }
   29|    731|}
_Z14LocatorEntriesPK11CBlockIndex:
   32|  4.05k|{
   33|  4.05k|    int step = 1;
   34|  4.05k|    std::vector<uint256> have;
   35|  4.05k|    if (index == nullptr) return have;
  ------------------
  |  Branch (35:9): [True: 0, False: 4.05k]
  ------------------
   36|       |
   37|  4.05k|    have.reserve(32);
   38|  76.9k|    while (index) {
  ------------------
  |  Branch (38:12): [True: 76.9k, False: 0]
  ------------------
   39|  76.9k|        have.emplace_back(index->GetBlockHash());
   40|  76.9k|        if (index->nHeight == 0) break;
  ------------------
  |  Branch (40:13): [True: 4.05k, False: 72.9k]
  ------------------
   41|       |        // Exponentially larger steps back, plus the genesis block.
   42|  72.9k|        int height = std::max(index->nHeight - step, 0);
   43|       |        // Use skiplist.
   44|  72.9k|        index = index->GetAncestor(height);
   45|  72.9k|        if (have.size() > 10) step *= 2;
  ------------------
  |  Branch (45:13): [True: 32.4k, False: 40.5k]
  ------------------
   46|  72.9k|    }
   47|  4.05k|    return have;
   48|  4.05k|}
_Z10GetLocatorPK11CBlockIndex:
   51|  4.05k|{
   52|  4.05k|    return CBlockLocator{LocatorEntries(index)};
   53|  4.05k|}
_ZNK11CBlockIndex11GetAncestorEi:
   94|  73.3k|{
   95|  73.3k|    if (height > nHeight || height < 0) {
  ------------------
  |  Branch (95:9): [True: 11, False: 73.3k]
  |  Branch (95:29): [True: 0, False: 73.3k]
  ------------------
   96|     11|        return nullptr;
   97|     11|    }
   98|       |
   99|  73.3k|    const CBlockIndex* pindexWalk = this;
  100|  73.3k|    int heightWalk = nHeight;
  101|   221k|    while (heightWalk > height) {
  ------------------
  |  Branch (101:12): [True: 148k, False: 73.3k]
  ------------------
  102|   148k|        int heightSkip = GetSkipHeight(heightWalk);
  103|   148k|        int heightSkipPrev = GetSkipHeight(heightWalk - 1);
  104|   148k|        if (pindexWalk->pskip != nullptr &&
  ------------------
  |  Branch (104:13): [True: 148k, False: 20]
  ------------------
  105|   148k|            (heightSkip == height ||
  ------------------
  |  Branch (105:14): [True: 5.75k, False: 142k]
  ------------------
  106|   148k|             (heightSkip > height && !(heightSkipPrev < heightSkip - 2 &&
  ------------------
  |  Branch (106:15): [True: 48.6k, False: 93.6k]
  |  Branch (106:40): [True: 7.86k, False: 40.8k]
  ------------------
  107|  51.7k|                                       heightSkipPrev >= height)))) {
  ------------------
  |  Branch (107:40): [True: 2.69k, False: 5.17k]
  ------------------
  108|       |            // Only follow pskip if pprev->pskip isn't better than pskip->pprev.
  109|  51.7k|            pindexWalk = pindexWalk->pskip;
  110|  51.7k|            heightWalk = heightSkip;
  111|  96.3k|        } else {
  112|  96.3k|            assert(pindexWalk->pprev);
  113|  96.3k|            pindexWalk = pindexWalk->pprev;
  114|  96.3k|            heightWalk--;
  115|  96.3k|        }
  116|   148k|    }
  117|  73.3k|    return pindexWalk;
  118|  73.3k|}
_ZN11CBlockIndex11GetAncestorEi:
  121|    379|{
  122|    379|    return const_cast<CBlockIndex*>(static_cast<const CBlockIndex*>(this)->GetAncestor(height));
  123|    379|}
_ZN11CBlockIndex9BuildSkipEv:
  126|    258|{
  127|    258|    if (pprev)
  ------------------
  |  Branch (127:9): [True: 258, False: 0]
  ------------------
  128|    258|        pskip = pprev->GetAncestor(GetSkipHeight(nHeight));
  129|    258|}
_Z13GetBlockProofRK11CBlockIndex:
  132|  1.49k|{
  133|  1.49k|    arith_uint256 bnTarget;
  134|  1.49k|    bool fNegative;
  135|  1.49k|    bool fOverflow;
  136|  1.49k|    bnTarget.SetCompact(block.nBits, &fNegative, &fOverflow);
  137|  1.49k|    if (fNegative || fOverflow || bnTarget == 0)
  ------------------
  |  Branch (137:9): [True: 28, False: 1.46k]
  |  Branch (137:22): [True: 10, False: 1.45k]
  |  Branch (137:35): [True: 2, False: 1.45k]
  ------------------
  138|     40|        return 0;
  139|       |    // We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256
  140|       |    // as it's too large for an arith_uint256. However, as 2**256 is at least as large
  141|       |    // as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1,
  142|       |    // or ~bnTarget / (bnTarget+1) + 1.
  143|  1.45k|    return (~bnTarget / (bnTarget + 1)) + 1;
  144|  1.49k|}
_Z18LastCommonAncestorPK11CBlockIndexS1_:
  165|     21|const CBlockIndex* LastCommonAncestor(const CBlockIndex* pa, const CBlockIndex* pb) {
  166|     21|    if (pa->nHeight > pb->nHeight) {
  ------------------
  |  Branch (166:9): [True: 0, False: 21]
  ------------------
  167|      0|        pa = pa->GetAncestor(pb->nHeight);
  168|     21|    } else if (pb->nHeight > pa->nHeight) {
  ------------------
  |  Branch (168:16): [True: 16, False: 5]
  ------------------
  169|     16|        pb = pb->GetAncestor(pa->nHeight);
  170|     16|    }
  171|       |
  172|     27|    while (pa != pb && pa && pb) {
  ------------------
  |  Branch (172:12): [True: 6, False: 21]
  |  Branch (172:24): [True: 6, False: 0]
  |  Branch (172:30): [True: 6, False: 0]
  ------------------
  173|      6|        pa = pa->pprev;
  174|      6|        pb = pb->pprev;
  175|      6|    }
  176|       |
  177|       |    // Eventually all chain branches meet at the genesis block.
  178|     21|    assert(pa == pb);
  179|     21|    return pa;
  180|     21|}
chain.cpp:_ZL13GetSkipHeighti:
   83|   296k|int static inline GetSkipHeight(int height) {
   84|   296k|    if (height < 2)
  ------------------
  |  Branch (84:9): [True: 7.68k, False: 288k]
  ------------------
   85|  7.68k|        return 0;
   86|       |
   87|       |    // Determine which height to jump back to. Any number strictly lower than height is acceptable,
   88|       |    // but the following expression seems to perform well in simulations (max 110 steps to go back
   89|       |    // up to 2**18 blocks).
   90|   288k|    return (height & 1) ? InvertLowestOne(InvertLowestOne(height - 1)) + 1 : InvertLowestOne(height);
  ------------------
  |  Branch (90:12): [True: 144k, False: 144k]
  ------------------
   91|   296k|}
chain.cpp:_ZL15InvertLowestOnei:
   80|   433k|int static inline InvertLowestOne(int n) { return n & (n - 1); }

_ZN11CBlockIndexC2ERK12CBlockHeader:
  200|    878|        : nVersion{block.nVersion},
  201|    878|          hashMerkleRoot{block.hashMerkleRoot},
  202|    878|          nTime{block.nTime},
  203|    878|          nBits{block.nBits},
  204|    878|          nNonce{block.nNonce}
  205|    878|    {
  206|    878|    }
_ZNK11CBlockIndex11GetBlockPosEv:
  209|  1.59k|    {
  210|  1.59k|        AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.59k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  211|  1.59k|        FlatFilePos ret;
  212|  1.59k|        if (nStatus & BLOCK_HAVE_DATA) {
  ------------------
  |  Branch (212:13): [True: 1.59k, False: 0]
  ------------------
  213|  1.59k|            ret.nFile = nFile;
  214|  1.59k|            ret.nPos = nDataPos;
  215|  1.59k|        }
  216|  1.59k|        return ret;
  217|  1.59k|    }
_ZNK11CBlockIndex14GetBlockHeaderEv:
  231|  4.90k|    {
  232|  4.90k|        CBlockHeader block;
  233|  4.90k|        block.nVersion = nVersion;
  234|  4.90k|        if (pprev)
  ------------------
  |  Branch (234:13): [True: 4.90k, False: 1]
  ------------------
  235|  4.90k|            block.hashPrevBlock = pprev->GetBlockHash();
  236|  4.90k|        block.hashMerkleRoot = hashMerkleRoot;
  237|  4.90k|        block.nTime = nTime;
  238|  4.90k|        block.nBits = nBits;
  239|  4.90k|        block.nNonce = nNonce;
  240|  4.90k|        return block;
  241|  4.90k|    }
_ZNK11CBlockIndex12GetBlockHashEv:
  244|  97.2k|    {
  245|  97.2k|        assert(phashBlock != nullptr);
  246|  97.2k|        return *phashBlock;
  247|  97.2k|    }
_ZNK11CBlockIndex15HaveNumChainTxsEv:
  259|   814k|    bool HaveNumChainTxs() const { return m_chain_tx_count != 0; }
_ZNK11CBlockIndex4TimeEv:
  262|   517k|    {
  263|   517k|        return NodeSeconds{std::chrono::seconds{nTime}};
  264|   517k|    }
_ZNK11CBlockIndex12GetBlockTimeEv:
  267|  13.1k|    {
  268|  13.1k|        return (int64_t)nTime;
  269|  13.1k|    }
_ZNK11CBlockIndex17GetMedianTimePastEv:
  279|  1.21k|    {
  280|  1.21k|        int64_t pmedian[nMedianTimeSpan];
  281|  1.21k|        int64_t* pbegin = &pmedian[nMedianTimeSpan];
  282|  1.21k|        int64_t* pend = &pmedian[nMedianTimeSpan];
  283|       |
  284|  1.21k|        const CBlockIndex* pindex = this;
  285|  13.8k|        for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
  ------------------
  |  Branch (285:25): [True: 12.7k, False: 1.13k]
  |  Branch (285:48): [True: 12.6k, False: 75]
  ------------------
  286|  12.6k|            *(--pbegin) = pindex->GetBlockTime();
  287|       |
  288|  1.21k|        std::sort(pbegin, pend);
  289|  1.21k|        return pbegin[(pend - pbegin) / 2];
  290|  1.21k|    }
_ZNK11CBlockIndex7IsValidE11BlockStatus:
  297|  3.36k|    {
  298|  3.36k|        AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  3.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  299|  3.36k|        assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed.
  300|  3.36k|        if (nStatus & BLOCK_FAILED_MASK)
  ------------------
  |  Branch (300:13): [True: 0, False: 3.36k]
  ------------------
  301|      0|            return false;
  302|  3.36k|        return ((nStatus & BLOCK_VALID_MASK) >= nUpTo);
  303|  3.36k|    }
_ZN11CBlockIndex13RaiseValidityE11BlockStatus:
  308|    258|    {
  309|    258|        AssertLockHeld(::cs_main);
  ------------------
  |  |  142|    258|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  310|    258|        assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed.
  311|    258|        if (nStatus & BLOCK_FAILED_MASK) return false;
  ------------------
  |  Branch (311:13): [True: 0, False: 258]
  ------------------
  312|       |
  313|    258|        if ((nStatus & BLOCK_VALID_MASK) < nUpTo) {
  ------------------
  |  Branch (313:13): [True: 258, False: 0]
  ------------------
  314|    258|            nStatus = (nStatus & ~BLOCK_VALID_MASK) | nUpTo;
  315|    258|            return true;
  316|    258|        }
  317|      0|        return false;
  318|    258|    }
_ZNK6CChain7GenesisEv:
  428|  1.51k|    {
  429|  1.51k|        return vChain.size() > 0 ? vChain[0] : nullptr;
  ------------------
  |  Branch (429:16): [True: 1.51k, False: 0]
  ------------------
  430|  1.51k|    }
_ZNK6CChain3TipEv:
  434|  2.07M|    {
  435|  2.07M|        return vChain.size() > 0 ? vChain[vChain.size() - 1] : nullptr;
  ------------------
  |  Branch (435:16): [True: 2.07M, False: 0]
  ------------------
  436|  2.07M|    }
_ZNK6CChainixEi:
  440|   712k|    {
  441|   712k|        if (nHeight < 0 || nHeight >= (int)vChain.size())
  ------------------
  |  Branch (441:13): [True: 0, False: 712k]
  |  Branch (441:28): [True: 798, False: 711k]
  ------------------
  442|    798|            return nullptr;
  443|   711k|        return vChain[nHeight];
  444|   712k|    }
_ZNK6CChain8ContainsEPK11CBlockIndex:
  448|   550k|    {
  449|   550k|        return (*this)[pindex->nHeight] == pindex;
  450|   550k|    }
_ZNK6CChain4NextEPK11CBlockIndex:
  454|  9.35k|    {
  455|  9.35k|        if (Contains(pindex))
  ------------------
  |  Branch (455:13): [True: 9.35k, False: 0]
  ------------------
  456|  9.35k|            return (*this)[pindex->nHeight + 1];
  457|      0|        else
  458|      0|            return nullptr;
  459|  9.35k|    }
_ZNK6CChain6HeightEv:
  463|  3.84k|    {
  464|  3.84k|        return int(vChain.size()) - 1;
  465|  3.84k|    }
_ZN11CBlockIndexC2Ev:
  327|    218|    CBlockIndex() = default;
_ZN6CChainC2Ev:
  422|    731|    CChain() = default;

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

_ZN11CCheckQueueI12CScriptCheckNSt3__14pairI13ScriptError_tNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEE4LoopEb:
   73|      0|    {
   74|      0|        std::condition_variable& cond = fMaster ? m_master_cv : m_worker_cv;
  ------------------
  |  Branch (74:41): [True: 0, False: 0]
  ------------------
   75|      0|        std::vector<T> vChecks;
   76|      0|        vChecks.reserve(nBatchSize);
   77|      0|        unsigned int nNow = 0;
   78|      0|        std::optional<R> local_result;
   79|      0|        bool do_work;
   80|      0|        do {
   81|      0|            {
   82|      0|                WAIT_LOCK(m_mutex, lock);
  ------------------
  |  |  262|      0|#define WAIT_LOCK(cs, name) UniqueLock name(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  ------------------
   83|       |                // first do the clean-up of the previous loop run (allowing us to do it in the same critsect)
   84|      0|                if (nNow) {
  ------------------
  |  Branch (84:21): [True: 0, False: 0]
  ------------------
   85|      0|                    if (local_result.has_value() && !m_result.has_value()) {
  ------------------
  |  Branch (85:25): [True: 0, False: 0]
  |  Branch (85:53): [True: 0, False: 0]
  ------------------
   86|      0|                        std::swap(local_result, m_result);
   87|      0|                    }
   88|      0|                    nTodo -= nNow;
   89|      0|                    if (nTodo == 0 && !fMaster) {
  ------------------
  |  Branch (89:25): [True: 0, False: 0]
  |  Branch (89:39): [True: 0, False: 0]
  ------------------
   90|       |                        // We processed the last element; inform the master it can exit and return the result
   91|      0|                        m_master_cv.notify_one();
   92|      0|                    }
   93|      0|                } else {
   94|       |                    // first iteration
   95|      0|                    nTotal++;
   96|      0|                }
   97|       |                // logically, the do loop starts here
   98|      4|                while (queue.empty() && !m_request_stop) {
  ------------------
  |  Branch (98:24): [True: 4, False: 18.4E]
  |  Branch (98:41): [True: 0, False: 4]
  ------------------
   99|      0|                    if (fMaster && nTodo == 0) {
  ------------------
  |  Branch (99:25): [True: 0, False: 0]
  |  Branch (99:36): [True: 0, False: 0]
  ------------------
  100|      0|                        nTotal--;
  101|      0|                        std::optional<R> to_return = std::move(m_result);
  102|       |                        // reset the status for new work later
  103|      0|                        m_result = std::nullopt;
  104|       |                        // return the current status
  105|      0|                        return to_return;
  106|      0|                    }
  107|      0|                    nIdle++;
  108|      0|                    cond.wait(lock); // wait
  109|      0|                    nIdle--;
  110|      0|                }
  111|      4|                if (m_request_stop) {
  ------------------
  |  Branch (111:21): [True: 4, False: 18.4E]
  ------------------
  112|       |                    // return value does not matter, because m_request_stop is only set in the destructor.
  113|      4|                    return std::nullopt;
  114|      4|                }
  115|       |
  116|       |                // Decide how many work units to process now.
  117|       |                // * Do not try to do everything at once, but aim for increasingly smaller batches so
  118|       |                //   all workers finish approximately simultaneously.
  119|       |                // * Try to account for idle jobs which will instantly start helping.
  120|       |                // * Don't do batches smaller than 1 (duh), or larger than nBatchSize.
  121|  18.4E|                nNow = std::max(1U, std::min(nBatchSize, (unsigned int)queue.size() / (nTotal + nIdle + 1)));
  122|  18.4E|                auto start_it = queue.end() - nNow;
  123|  18.4E|                vChecks.assign(std::make_move_iterator(start_it), std::make_move_iterator(queue.end()));
  124|  18.4E|                queue.erase(start_it, queue.end());
  125|       |                // Check whether we need to do work at all
  126|  18.4E|                do_work = !m_result.has_value();
  127|  18.4E|            }
  128|       |            // execute work
  129|  18.4E|            if (do_work) {
  ------------------
  |  Branch (129:17): [True: 0, False: 18.4E]
  ------------------
  130|      0|                for (T& check : vChecks) {
  ------------------
  |  Branch (130:31): [True: 0, False: 0]
  ------------------
  131|      0|                    local_result = check();
  132|      0|                    if (local_result.has_value()) break;
  ------------------
  |  Branch (132:25): [True: 0, False: 0]
  ------------------
  133|      0|                }
  134|      0|            }
  135|  18.4E|            vChecks.clear();
  136|  18.4E|        } while (true);
  ------------------
  |  Branch (136:18): [Folded - Ignored]
  ------------------
  137|      0|    }
_ZN11CCheckQueueI12CScriptCheckNSt3__14pairI13ScriptError_tNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEED2Ev:
  192|      2|    {
  193|      2|        WITH_LOCK(m_mutex, m_request_stop = true);
  ------------------
  |  |  301|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  194|      2|        m_worker_cv.notify_all();
  195|      4|        for (std::thread& t : m_worker_threads) {
  ------------------
  |  Branch (195:29): [True: 4, False: 2]
  ------------------
  196|      4|            t.join();
  197|      4|        }
  198|      2|    }

_ZN16CCoinsViewBackedC2EP10CCoinsView:
   27|  4.08k|CCoinsViewBacked::CCoinsViewBacked(CCoinsView *viewIn) : base(viewIn) { }
_ZNK16CCoinsViewBacked7GetCoinERK9COutPoint:
   28|    552|std::optional<Coin> CCoinsViewBacked::GetCoin(const COutPoint& outpoint) const { return base->GetCoin(outpoint); }
_ZNK16CCoinsViewBacked12GetBestBlockEv:
   30|    109|uint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); }
_ZN16CCoinsViewBacked10SetBackendER10CCoinsView:
   32|    770|void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }
_ZN15CCoinsViewCacheC2EP10CCoinsViewb:
   38|  2.72k|    CCoinsViewBacked(baseIn), m_deterministic(deterministic),
   39|  2.72k|    cacheCoins(0, SaltedOutpointHasher(/*deterministic=*/deterministic), CCoinsMap::key_equal{}, &m_cache_coins_memory_resource)
   40|  2.72k|{
   41|  2.72k|    m_sentinel.second.SelfRef(m_sentinel);
   42|  2.72k|}
_ZNK15CCoinsViewCache18DynamicMemoryUsageEv:
   44|  2.72k|size_t CCoinsViewCache::DynamicMemoryUsage() const {
   45|  2.72k|    return memusage::DynamicUsage(cacheCoins) + cachedCoinsUsage;
   46|  2.72k|}
_ZNK15CCoinsViewCache9FetchCoinERK9COutPoint:
   48|  1.78k|CCoinsMap::iterator CCoinsViewCache::FetchCoin(const COutPoint &outpoint) const {
   49|  1.78k|    const auto [ret, inserted] = cacheCoins.try_emplace(outpoint);
   50|  1.78k|    if (inserted) {
  ------------------
  |  Branch (50:9): [True: 1.28k, False: 496]
  ------------------
   51|  1.28k|        if (auto coin{base->GetCoin(outpoint)}) {
  ------------------
  |  Branch (51:18): [True: 180, False: 1.10k]
  ------------------
   52|    180|            ret->second.coin = std::move(*coin);
   53|    180|            cachedCoinsUsage += ret->second.coin.DynamicMemoryUsage();
   54|    180|            if (ret->second.coin.IsSpent()) { // TODO GetCoin cannot return spent coins
  ------------------
  |  Branch (54:17): [True: 0, False: 180]
  ------------------
   55|       |                // The parent only has an empty entry for this outpoint; we can consider our version as fresh.
   56|      0|                CCoinsCacheEntry::SetFresh(*ret, m_sentinel);
   57|      0|            }
   58|  1.10k|        } else {
   59|  1.10k|            cacheCoins.erase(ret);
   60|  1.10k|            return cacheCoins.end();
   61|  1.10k|        }
   62|  1.28k|    }
   63|    676|    return ret;
   64|  1.78k|}
_ZNK15CCoinsViewCache7GetCoinERK9COutPoint:
   67|    841|{
   68|    841|    if (auto it{FetchCoin(outpoint)}; it != cacheCoins.end() && !it->second.coin.IsSpent()) return it->second.coin;
  ------------------
  |  Branch (68:39): [True: 289, False: 552]
  |  Branch (68:39): [True: 289, False: 552]
  |  Branch (68:65): [True: 289, False: 0]
  ------------------
   69|    552|    return std::nullopt;
   70|    841|}
_ZNK15CCoinsViewCache10AccessCoinERK9COutPoint:
  154|    115|const Coin& CCoinsViewCache::AccessCoin(const COutPoint &outpoint) const {
  155|    115|    CCoinsMap::const_iterator it = FetchCoin(outpoint);
  156|    115|    if (it == cacheCoins.end()) {
  ------------------
  |  Branch (156:9): [True: 0, False: 115]
  ------------------
  157|      0|        return coinEmpty;
  158|    115|    } else {
  159|    115|        return it->second.coin;
  160|    115|    }
  161|    115|}
_ZNK15CCoinsViewCache8HaveCoinERK9COutPoint:
  163|    824|bool CCoinsViewCache::HaveCoin(const COutPoint &outpoint) const {
  164|    824|    CCoinsMap::const_iterator it = FetchCoin(outpoint);
  165|    824|    return (it != cacheCoins.end() && !it->second.coin.IsSpent());
  ------------------
  |  Branch (165:13): [True: 272, False: 552]
  |  Branch (165:39): [True: 272, False: 0]
  ------------------
  166|    824|}
_ZNK15CCoinsViewCache15HaveCoinInCacheERK9COutPoint:
  168|  1.56k|bool CCoinsViewCache::HaveCoinInCache(const COutPoint &outpoint) const {
  169|  1.56k|    CCoinsMap::const_iterator it = cacheCoins.find(outpoint);
  170|  1.56k|    return (it != cacheCoins.end() && !it->second.coin.IsSpent());
  ------------------
  |  Branch (170:13): [True: 180, False: 1.38k]
  |  Branch (170:39): [True: 180, False: 0]
  ------------------
  171|  1.56k|}
_ZNK15CCoinsViewCache12GetBestBlockEv:
  173|    327|uint256 CCoinsViewCache::GetBestBlock() const {
  174|    327|    if (hashBlock.IsNull())
  ------------------
  |  Branch (174:9): [True: 109, False: 218]
  ------------------
  175|    109|        hashBlock = base->GetBestBlock();
  176|    327|    return hashBlock;
  177|    327|}
_ZN15CCoinsViewCache7UncacheERK9COutPoint:
  275|    552|{
  276|    552|    CCoinsMap::iterator it = cacheCoins.find(hash);
  277|    552|    if (it != cacheCoins.end() && !it->second.IsDirty() && !it->second.IsFresh()) {
  ------------------
  |  Branch (277:9): [True: 0, False: 552]
  |  Branch (277:9): [True: 0, False: 552]
  |  Branch (277:35): [True: 0, False: 0]
  |  Branch (277:60): [True: 0, False: 0]
  ------------------
  278|      0|        cachedCoinsUsage -= it->second.coin.DynamicMemoryUsage();
  279|      0|        TRACEPOINT(utxocache, uncache,
  280|      0|               hash.hash.data(),
  281|      0|               (uint32_t)hash.n,
  282|      0|               (uint32_t)it->second.coin.nHeight,
  283|      0|               (int64_t)it->second.coin.out.nValue,
  284|      0|               (bool)it->second.coin.IsCoinBase());
  285|      0|        cacheCoins.erase(it);
  286|      0|    }
  287|    552|}
_ZNK15CCoinsViewCache12GetCacheSizeEv:
  289|  1.36k|unsigned int CCoinsViewCache::GetCacheSize() const {
  290|  1.36k|    return cacheCoins.size();
  291|  1.36k|}
_ZNK15CCoinsViewCache10HaveInputsERK12CTransaction:
  294|     92|{
  295|     92|    if (!tx.IsCoinBase()) {
  ------------------
  |  Branch (295:9): [True: 92, False: 0]
  ------------------
  296|    184|        for (unsigned int i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (296:34): [True: 92, False: 92]
  ------------------
  297|     92|            if (!HaveCoin(tx.vin[i].prevout)) {
  ------------------
  |  Branch (297:17): [True: 0, False: 92]
  ------------------
  298|      0|                return false;
  299|      0|            }
  300|     92|        }
  301|     92|    }
  302|     92|    return true;
  303|     92|}
_ZNK22CCoinsViewErrorCatcher7GetCoinERK9COutPoint:
  381|    552|{
  382|    552|    return ExecuteBackedWrapper<std::optional<Coin>>([&]() { return CCoinsViewBacked::GetCoin(outpoint); }, m_err_callbacks);
  383|    552|}
coins.cpp:_ZL20ExecuteBackedWrapperINSt3__18optionalI4CoinEEZNK22CCoinsViewErrorCatcher7GetCoinERK9COutPointE3$_0ET_T0_RKNS0_6vectorINS0_8functionIFvvEEENS0_9allocatorISE_EEEE:
  364|    552|{
  365|    552|    try {
  366|    552|        return func();
  367|    552|    } catch(const std::runtime_error& e) {
  368|      0|        for (const auto& f : err_callbacks) {
  ------------------
  |  Branch (368:28): [True: 0, False: 0]
  ------------------
  369|      0|            f();
  370|      0|        }
  371|      0|        LogError("Error reading from database: %s\n", e.what());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  372|       |        // Starting the shutdown sequence and returning false to the caller would be
  373|       |        // interpreted as 'entry not found' (as opposed to unable to read data), and
  374|       |        // could lead to invalid interpretation. Just exit immediately, as we can't
  375|       |        // continue anyway, and all writes should be atomic.
  376|      0|        std::abort();
  377|      0|    }
  378|    552|}
coins.cpp:_ZZNK22CCoinsViewErrorCatcher7GetCoinERK9COutPointENK3$_0clEv:
  382|    552|    return ExecuteBackedWrapper<std::optional<Coin>>([&]() { return CCoinsViewBacked::GetCoin(outpoint); }, m_err_callbacks);

_ZN4CoinC2Ev:
   55|  4.55k|    Coin() : fCoinBase(false), nHeight(0) { }
_ZNK4Coin10IsCoinBaseEv:
   57|     92|    bool IsCoinBase() const {
   58|     92|        return fCoinBase;
   59|     92|    }
_ZNK4Coin7IsSpentEv:
   81|  1.01k|    bool IsSpent() const {
   82|  1.01k|        return out.IsNull();
   83|  1.01k|    }
_ZNK4Coin18DynamicMemoryUsageEv:
   85|    180|    size_t DynamicMemoryUsage() const {
   86|    180|        return memusage::DynamicUsage(out.scriptPubKey);
   87|    180|    }
_ZN16CCoinsCacheEntryD2Ev:
  173|  4.40k|    {
  174|  4.40k|        SetClean();
  175|  4.40k|    }
_ZN16CCoinsCacheEntry8SetCleanEv:
  181|  4.40k|    {
  182|  4.40k|        if (!m_flags) return;
  ------------------
  |  Branch (182:13): [True: 1.28k, False: 3.12k]
  ------------------
  183|  3.12k|        m_next->second.m_prev = m_prev;
  184|  3.12k|        m_prev->second.m_next = m_next;
  185|  3.12k|        m_flags = 0;
  186|  3.12k|        m_prev = m_next = nullptr;
  187|  3.12k|    }
_ZN16CCoinsCacheEntry7SelfRefERNSt3__14pairIK9COutPointS_EE:
  207|  2.72k|    {
  208|  2.72k|        Assume(&pair.second == this);
  ------------------
  |  |   97|  2.72k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  209|  2.72k|        m_prev = &pair;
  210|  2.72k|        m_next = &pair;
  211|       |        // Set sentinel to DIRTY so we can call Next on it
  212|  2.72k|        m_flags = DIRTY;
  213|  2.72k|    }
_ZN10CCoinsViewD2Ev:
  335|  5.45k|    virtual ~CCoinsView() = default;
_ZN16CCoinsCacheEntryC2Ev:
  170|  4.00k|    CCoinsCacheEntry() noexcept = default;

_ZN11ArgsManagerD2Ev:
  134|      2|ArgsManager::~ArgsManager() = default;
_ZNK11ArgsManager7GetArgsERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  363|  3.91k|{
  364|  3.91k|    std::vector<std::string> result;
  365|  3.91k|    for (const common::SettingsValue& value : GetSettingsList(strArg)) {
  ------------------
  |  Branch (365:45): [True: 0, False: 3.91k]
  ------------------
  366|      0|        result.push_back(value.isFalse() ? "0" : value.isTrue() ? "1" : value.get_str());
  ------------------
  |  Branch (366:26): [True: 0, False: 0]
  |  Branch (366:50): [True: 0, False: 0]
  ------------------
  367|      0|    }
  368|  3.91k|    return result;
  369|  3.91k|}
_ZNK11ArgsManager9GetIntArgERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEl:
  483|  1.95k|{
  484|  1.95k|    return GetIntArg(strArg).value_or(nDefault);
  485|  1.95k|}
_ZNK11ArgsManager9GetIntArgERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  488|  1.95k|{
  489|  1.95k|    const common::SettingsValue value = GetSetting(strArg);
  490|  1.95k|    return SettingToInt(value);
  491|  1.95k|}
_Z12SettingToIntRK8UniValue:
  494|  1.95k|{
  495|  1.95k|    if (value.isNull()) return std::nullopt;
  ------------------
  |  Branch (495:9): [True: 1.95k, False: 0]
  ------------------
  496|      0|    if (value.isFalse()) return 0;
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|    if (value.isTrue()) return 1;
  ------------------
  |  Branch (497:9): [True: 0, False: 0]
  ------------------
  498|      0|    if (value.isNum()) return value.getInt<int64_t>();
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  ------------------
  499|      0|    return LocaleIndependentAtoi<int64_t>(value.get_str());
  500|      0|}
_ZNK11ArgsManager10GetBoolArgERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEb:
  508|  81.9k|{
  509|  81.9k|    return GetBoolArg(strArg).value_or(fDefault);
  510|  81.9k|}
_ZNK11ArgsManager10GetBoolArgERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  513|  81.9k|{
  514|  81.9k|    const common::SettingsValue value = GetSetting(strArg);
  515|  81.9k|    return SettingToBool(value);
  516|  81.9k|}
_Z13SettingToBoolRK8UniValue:
  519|  81.9k|{
  520|  81.9k|    if (value.isNull()) return std::nullopt;
  ------------------
  |  Branch (520:9): [True: 81.9k, False: 0]
  ------------------
  521|      0|    if (value.isBool()) return value.get_bool();
  ------------------
  |  Branch (521:9): [True: 0, False: 0]
  ------------------
  522|      0|    return InterpretBool(value.get_str());
  523|      0|}
_ZNK11ArgsManager17UseDefaultSectionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  821|  87.7k|{
  822|  87.7k|    return m_network == ChainTypeToString(ChainType::MAIN) || m_network_only_args.count(arg) == 0;
  ------------------
  |  Branch (822:12): [True: 0, False: 87.7k]
  |  Branch (822:63): [True: 83.8k, False: 3.91k]
  ------------------
  823|  87.7k|}
_ZNK11ArgsManager10GetSettingERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  826|  83.8k|{
  827|  83.8k|    LOCK(cs_args);
  ------------------
  |  |  257|  83.8k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  83.8k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  83.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  83.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|  83.8k|    return common::GetSetting(
  829|  83.8k|        m_settings, m_network, SettingName(arg), !UseDefaultSection(arg),
  830|  83.8k|        /*ignore_nonpersistent=*/false, /*get_chain_type=*/false);
  831|  83.8k|}
_ZNK11ArgsManager15GetSettingsListERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  834|  3.91k|{
  835|  3.91k|    LOCK(cs_args);
  ------------------
  |  |  257|  3.91k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.91k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.91k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.91k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  836|  3.91k|    return common::GetSettingsList(m_settings, m_network, SettingName(arg), !UseDefaultSection(arg));
  837|  3.91k|}
args.cpp:_ZL11SettingNameRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
   67|  87.7k|{
   68|  87.7k|    return arg.size() > 0 && arg[0] == '-' ? arg.substr(1) : arg;
  ------------------
  |  Branch (68:12): [True: 87.7k, False: 0]
  |  Branch (68:30): [True: 87.7k, False: 0]
  ------------------
   69|  87.7k|}

_ZN11ArgsManager9ClearArgsEv:
  362|      2|    void ClearArgs() {
  363|      2|        LOCK(cs_args);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|      2|        m_available_args.clear();
  365|      2|        m_network_only_args.clear();
  366|      2|    }

_ZNK12CBloomFilter23IsWithinSizeConstraintsEv:
   90|     22|{
   91|     22|    return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS;
  ------------------
  |  Branch (91:12): [True: 21, False: 1]
  |  Branch (91:53): [True: 5, False: 16]
  ------------------
   92|     22|}
_ZN19CRollingBloomFilterC2Ejd:
  163|  9.94k|{
  164|  9.94k|    double logFpRate = log(fpRate);
  165|       |    /* The optimal number of hash functions is log(fpRate) / log(0.5), but
  166|       |     * restrict it to the range 1-50. */
  167|  9.94k|    nHashFuncs = std::max(1, std::min((int)round(logFpRate / log(0.5)), 50));
  168|       |    /* In this rolling bloom filter, we'll store between 2 and 3 generations of nElements / 2 entries. */
  169|  9.94k|    nEntriesPerGeneration = (nElements + 1) / 2;
  170|  9.94k|    uint32_t nMaxElements = nEntriesPerGeneration * 3;
  171|       |    /* The maximum fpRate = pow(1.0 - exp(-nHashFuncs * nMaxElements / nFilterBits), nHashFuncs)
  172|       |     * =>          pow(fpRate, 1.0 / nHashFuncs) = 1.0 - exp(-nHashFuncs * nMaxElements / nFilterBits)
  173|       |     * =>          1.0 - pow(fpRate, 1.0 / nHashFuncs) = exp(-nHashFuncs * nMaxElements / nFilterBits)
  174|       |     * =>          log(1.0 - pow(fpRate, 1.0 / nHashFuncs)) = -nHashFuncs * nMaxElements / nFilterBits
  175|       |     * =>          nFilterBits = -nHashFuncs * nMaxElements / log(1.0 - pow(fpRate, 1.0 / nHashFuncs))
  176|       |     * =>          nFilterBits = -nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs))
  177|       |     */
  178|  9.94k|    uint32_t nFilterBits = (uint32_t)ceil(-1.0 * nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs)));
  179|  9.94k|    data.clear();
  180|       |    /* For each data element we need to store 2 bits. If both bits are 0, the
  181|       |     * bit is treated as unset. If the bits are (01), (10), or (11), the bit is
  182|       |     * treated as set in generation 1, 2, or 3 respectively.
  183|       |     * These bits are stored in separate integers: position P corresponds to bit
  184|       |     * (P & 63) of the integers data[(P >> 6) * 2] and data[(P >> 6) * 2 + 1]. */
  185|  9.94k|    data.resize(((nFilterBits + 63) / 64) << 1);
  186|  9.94k|    reset();
  187|  9.94k|}
_ZN19CRollingBloomFilter6insertE4SpanIKhE:
  196|   862k|{
  197|   862k|    if (nEntriesThisGeneration == nEntriesPerGeneration) {
  ------------------
  |  Branch (197:9): [True: 0, False: 862k]
  ------------------
  198|      0|        nEntriesThisGeneration = 0;
  199|      0|        nGeneration++;
  200|      0|        if (nGeneration == 4) {
  ------------------
  |  Branch (200:13): [True: 0, False: 0]
  ------------------
  201|      0|            nGeneration = 1;
  202|      0|        }
  203|      0|        uint64_t nGenerationMask1 = 0 - (uint64_t)(nGeneration & 1);
  204|      0|        uint64_t nGenerationMask2 = 0 - (uint64_t)(nGeneration >> 1);
  205|       |        /* Wipe old entries that used this generation number. */
  206|      0|        for (uint32_t p = 0; p < data.size(); p += 2) {
  ------------------
  |  Branch (206:30): [True: 0, False: 0]
  ------------------
  207|      0|            uint64_t p1 = data[p], p2 = data[p + 1];
  208|      0|            uint64_t mask = (p1 ^ nGenerationMask1) | (p2 ^ nGenerationMask2);
  209|      0|            data[p] = p1 & mask;
  210|      0|            data[p + 1] = p2 & mask;
  211|      0|        }
  212|      0|    }
  213|   862k|    nEntriesThisGeneration++;
  214|       |
  215|  17.3M|    for (int n = 0; n < nHashFuncs; n++) {
  ------------------
  |  Branch (215:21): [True: 16.4M, False: 862k]
  ------------------
  216|  16.4M|        uint32_t h = RollingBloomHash(n, nTweak, vKey);
  217|  16.4M|        int bit = h & 0x3F;
  218|       |        /* FastMod works with the upper bits of h, so it is safe to ignore that the lower bits of h are already used for bit. */
  219|  16.4M|        uint32_t pos = FastRange32(h, data.size());
  220|       |        /* The lowest bit of pos is ignored, and set to zero for the first bit, and to one for the second. */
  221|  16.4M|        data[pos & ~1U] = (data[pos & ~1U] & ~(uint64_t{1} << bit)) | (uint64_t(nGeneration & 1)) << bit;
  222|  16.4M|        data[pos | 1] = (data[pos | 1] & ~(uint64_t{1} << bit)) | (uint64_t(nGeneration >> 1)) << bit;
  223|  16.4M|    }
  224|   862k|}
_ZNK19CRollingBloomFilter8containsE4SpanIKhE:
  227|  4.50M|{
  228|  4.51M|    for (int n = 0; n < nHashFuncs; n++) {
  ------------------
  |  Branch (228:21): [True: 4.51M, False: 22]
  ------------------
  229|  4.51M|        uint32_t h = RollingBloomHash(n, nTweak, vKey);
  230|  4.51M|        int bit = h & 0x3F;
  231|  4.51M|        uint32_t pos = FastRange32(h, data.size());
  232|       |        /* If the relevant bit is not set in either data[pos & ~1] or data[pos | 1], the filter does not contain vKey */
  233|  4.51M|        if (!(((data[pos & ~1U] | data[pos | 1]) >> bit) & 1)) {
  ------------------
  |  Branch (233:13): [True: 4.50M, False: 7.43k]
  ------------------
  234|  4.50M|            return false;
  235|  4.50M|        }
  236|  4.51M|    }
  237|     22|    return true;
  238|  4.50M|}
_ZN19CRollingBloomFilter5resetEv:
  241|  9.94k|{
  242|  9.94k|    nTweak = FastRandomContext().rand<unsigned int>();
  243|  9.94k|    nEntriesThisGeneration = 0;
  244|  9.94k|    nGeneration = 1;
  245|  9.94k|    std::fill(data.begin(), data.end(), 0);
  246|  9.94k|}
bloom.cpp:_ZL16RollingBloomHashjj4SpanIKhE:
  191|  20.9M|{
  192|  20.9M|    return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash);
  193|  20.9M|}

_ZN12CBloomFilterC2Ev:
   65|     34|    CBloomFilter() : nHashFuncs(0), nTweak(0), nFlags(0) {}
_ZN12CBloomFilter16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   67|     34|    SERIALIZE_METHODS(CBloomFilter, obj) { READWRITE(obj.vData, obj.nHashFuncs, obj.nTweak, obj.nFlags); }
  ------------------
  |  |  156|     34|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------

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

_ZN6common7FindKeyIRKNSt3__13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE8UniValueNS1_4lessIS8_EENS6_INS1_4pairIKS8_S9_EEEEEERSD_EEDTadcldtfp_2atfp0_EEOT_OT0_:
  108|   175k|{
  109|   175k|    auto it = map.find(key);
  110|   175k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (110:12): [True: 175k, False: 0]
  ------------------
  111|   175k|}
_ZN6common7FindKeyIRKNSt3__13mapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_6vectorI8UniValueNS6_ISA_EEEENS1_4lessIS8_EENS6_INS1_4pairIKS8_SC_EEEEEERSG_EEDTadcldtfp_2atfp0_EEOT_OT0_:
  108|  87.7k|{
  109|  87.7k|    auto it = map.find(key);
  110|  87.7k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (110:12): [True: 87.7k, False: 0]
  ------------------
  111|  87.7k|}
_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_:
  108|  87.7k|{
  109|  87.7k|    auto it = map.find(key);
  110|  87.7k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (110:12): [True: 87.7k, False: 0]
  ------------------
  111|  87.7k|}
_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_:
  108|  87.7k|{
  109|  87.7k|    auto it = map.find(key);
  110|  87.7k|    return it == map.end() ? nullptr : &it->second;
  ------------------
  |  Branch (110:12): [True: 87.7k, False: 0]
  ------------------
  111|  87.7k|}

_Z17internal_bswap_16t:
   45|  2.61k|{
   46|  2.61k|#ifdef bitcoin_builtin_bswap16
   47|  2.61k|    return bitcoin_builtin_bswap16(x);
  ------------------
  |  |   21|  2.61k|#      define bitcoin_builtin_bswap16(x) __builtin_bswap16(x)
  ------------------
   48|       |#else
   49|       |    return (x >> 8) | (x << 8);
   50|       |#endif
   51|  2.61k|}
_Z17internal_bswap_32j:
   54|  4.52M|{
   55|  4.52M|#ifdef bitcoin_builtin_bswap32
   56|  4.52M|    return bitcoin_builtin_bswap32(x);
  ------------------
  |  |   24|  4.52M|#      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|  4.52M|}
_Z17internal_bswap_64m:
   64|  1.71M|{
   65|  1.71M|#ifdef bitcoin_builtin_bswap64
   66|  1.71M|    return bitcoin_builtin_bswap64(x);
  ------------------
  |  |   27|  1.71M|#      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|  1.71M|}

_Z16htole16_internalt:
   19|  4.87k|{
   20|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_16(host_16bits);
   21|  4.87k|        else return host_16bits;
   22|  4.87k|}
_Z16be16toh_internalt:
   24|  2.61k|{
   25|  2.61k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_16(big_endian_16bits);
   26|       |        else return big_endian_16bits;
   27|  2.61k|}
_Z16le16toh_internalt:
   29|  3.01k|{
   30|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_16(little_endian_16bits);
   31|  3.01k|        else return little_endian_16bits;
   32|  3.01k|}
_Z16htobe32_internalj:
   34|  4.43M|{
   35|  4.43M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(host_32bits);
   36|       |        else return host_32bits;
   37|  4.43M|}
_Z16htole32_internalj:
   39|  2.89M|{
   40|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(host_32bits);
   41|  2.89M|        else return host_32bits;
   42|  2.89M|}
_Z16be32toh_internalj:
   44|  88.5k|{
   45|  88.5k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(big_endian_32bits);
   46|       |        else return big_endian_32bits;
   47|  88.5k|}
_Z16le32toh_internalj:
   49|   168M|{
   50|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(little_endian_32bits);
   51|   168M|        else return little_endian_32bits;
   52|   168M|}
_Z16htobe64_internalm:
   54|   887k|{
   55|   887k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(host_64bits);
   56|       |        else return host_64bits;
   57|   887k|}
_Z16htole64_internalm:
   59|   208k|{
   60|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(host_64bits);
   61|   208k|        else return host_64bits;
   62|   208k|}
_Z16be64toh_internalm:
   64|   830k|{
   65|   830k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(big_endian_64bits);
   66|       |        else return big_endian_64bits;
   67|   830k|}
_Z16le64toh_internalm:
   69|  7.96M|{
   70|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(little_endian_64bits);
   71|  7.96M|        else return little_endian_64bits;
   72|  7.96M|}

_Z10MoneyRangeRKl:
   27|  2.96k|inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
  ------------------
  |  Branch (27:57): [True: 2.92k, False: 44]
  |  Branch (27:72): [True: 2.89k, False: 32]
  ------------------

_Z17ComputeMerkleRootNSt3__16vectorI7uint256NS_9allocatorIS1_EEEEPb:
   46|    136|uint256 ComputeMerkleRoot(std::vector<uint256> hashes, bool* mutated) {
   47|    136|    bool mutation = false;
   48|    458|    while (hashes.size() > 1) {
  ------------------
  |  Branch (48:12): [True: 322, False: 136]
  ------------------
   49|    322|        if (mutated) {
  ------------------
  |  Branch (49:13): [True: 320, False: 2]
  ------------------
   50|  9.64k|            for (size_t pos = 0; pos + 1 < hashes.size(); pos += 2) {
  ------------------
  |  Branch (50:34): [True: 9.32k, False: 320]
  ------------------
   51|  9.32k|                if (hashes[pos] == hashes[pos + 1]) mutation = true;
  ------------------
  |  Branch (51:21): [True: 6.95k, False: 2.37k]
  ------------------
   52|  9.32k|            }
   53|    320|        }
   54|    322|        if (hashes.size() & 1) {
  ------------------
  |  Branch (54:13): [True: 125, False: 197]
  ------------------
   55|    125|            hashes.push_back(hashes.back());
   56|    125|        }
   57|    322|        SHA256D64(hashes[0].begin(), hashes[0].begin(), hashes.size() / 2);
   58|    322|        hashes.resize(hashes.size() / 2);
   59|    322|    }
   60|    136|    if (mutated) *mutated = mutation;
  ------------------
  |  Branch (60:9): [True: 134, False: 2]
  ------------------
   61|    136|    if (hashes.size() == 0) return uint256();
  ------------------
  |  Branch (61:9): [True: 8, False: 128]
  ------------------
   62|    128|    return hashes[0];
   63|    136|}
_Z15BlockMerkleRootRK6CBlockPb:
   67|    134|{
   68|    134|    std::vector<uint256> leaves;
   69|    134|    leaves.resize(block.vtx.size());
   70|  9.58k|    for (size_t s = 0; s < block.vtx.size(); s++) {
  ------------------
  |  Branch (70:24): [True: 9.45k, False: 134]
  ------------------
   71|  9.45k|        leaves[s] = block.vtx[s]->GetHash();
   72|  9.45k|    }
   73|    134|    return ComputeMerkleRoot(std::move(leaves), mutated);
   74|    134|}
_Z22BlockWitnessMerkleRootRK6CBlockPb:
   77|      2|{
   78|      2|    std::vector<uint256> leaves;
   79|      2|    leaves.resize(block.vtx.size());
   80|      2|    leaves[0].SetNull(); // The witness hash of the coinbase is 0.
   81|      4|    for (size_t s = 1; s < block.vtx.size(); s++) {
  ------------------
  |  Branch (81:24): [True: 2, False: 2]
  ------------------
   82|      2|        leaves[s] = block.vtx[s]->GetWitnessHash();
   83|      2|    }
   84|      2|    return ComputeMerkleRoot(std::move(leaves), mutated);
   85|      2|}

_ZNK9Consensus6Params16PowTargetSpacingEv:
  120|  1.96k|    {
  121|  1.96k|        return std::chrono::seconds{nPowTargetSpacing};
  122|  1.96k|    }
_ZNK9Consensus6Params28DifficultyAdjustmentIntervalEv:
  123|  2.58k|    int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
_ZNK9Consensus6Params16DeploymentHeightENS_16BuriedDeploymentE:
  137|     75|    {
  138|     75|        switch (dep) {
  ------------------
  |  Branch (138:17): [True: 0, False: 75]
  ------------------
  139|     10|        case DEPLOYMENT_HEIGHTINCB:
  ------------------
  |  Branch (139:9): [True: 10, False: 65]
  ------------------
  140|     10|            return BIP34Height;
  141|      4|        case DEPLOYMENT_CLTV:
  ------------------
  |  Branch (141:9): [True: 4, False: 71]
  ------------------
  142|      4|            return BIP65Height;
  143|      2|        case DEPLOYMENT_DERSIG:
  ------------------
  |  Branch (143:9): [True: 2, False: 73]
  ------------------
  144|      2|            return BIP66Height;
  145|      0|        case DEPLOYMENT_CSV:
  ------------------
  |  Branch (145:9): [True: 0, False: 75]
  ------------------
  146|      0|            return CSVHeight;
  147|     59|        case DEPLOYMENT_SEGWIT:
  ------------------
  |  Branch (147:9): [True: 59, False: 16]
  ------------------
  148|     59|            return SegwitHeight;
  149|     75|        } // no default case, so the compiler can warn about missing cases
  150|      0|        return std::numeric_limits<int>::max();
  151|     75|    }
_ZN9Consensus15ValidDeploymentENS_16BuriedDeploymentE:
   30|     75|constexpr bool ValidDeployment(BuriedDeployment dep) { return dep <= DEPLOYMENT_SEGWIT; }

_Z16CheckTransactionRK12CTransactionR17TxValidationState:
   12|  1.41k|{
   13|       |    // Basic checks that don't depend on any context
   14|  1.41k|    if (tx.vin.empty())
  ------------------
  |  Branch (14:9): [True: 18, False: 1.39k]
  ------------------
   15|     18|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vin-empty");
   16|  1.39k|    if (tx.vout.empty())
  ------------------
  |  Branch (16:9): [True: 46, False: 1.35k]
  ------------------
   17|     46|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vout-empty");
   18|       |    // Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
   19|  1.35k|    if (::GetSerializeSize(TX_NO_WITNESS(tx)) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT) {
  ------------------
  |  Branch (19:9): [True: 0, False: 1.35k]
  ------------------
   20|      0|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-oversize");
   21|      0|    }
   22|       |
   23|       |    // Check for negative or overflow output values (see CVE-2010-5139)
   24|  1.35k|    CAmount nValueOut = 0;
   25|  1.35k|    for (const auto& txout : tx.vout)
  ------------------
  |  Branch (25:28): [True: 2.52k, False: 1.22k]
  ------------------
   26|  2.52k|    {
   27|  2.52k|        if (txout.nValue < 0)
  ------------------
  |  Branch (27:13): [True: 43, False: 2.48k]
  ------------------
   28|     43|            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vout-negative");
   29|  2.48k|        if (txout.nValue > MAX_MONEY)
  ------------------
  |  Branch (29:13): [True: 83, False: 2.39k]
  ------------------
   30|     83|            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vout-toolarge");
   31|  2.39k|        nValueOut += txout.nValue;
   32|  2.39k|        if (!MoneyRange(nValueOut))
  ------------------
  |  Branch (32:13): [True: 2, False: 2.39k]
  ------------------
   33|      2|            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-txouttotal-toolarge");
   34|  2.39k|    }
   35|       |
   36|       |    // Check for duplicate inputs (see CVE-2018-17144)
   37|       |    // While Consensus::CheckTxInputs does check if all inputs of a tx are available, and UpdateCoins marks all inputs
   38|       |    // of a tx as spent, it does not check if the tx has duplicate inputs.
   39|       |    // Failure to run this check will result in either a crash or an inflation bug, depending on the implementation of
   40|       |    // the underlying coins database.
   41|  1.22k|    std::set<COutPoint> vInOutPoints;
   42|  6.78k|    for (const auto& txin : tx.vin) {
  ------------------
  |  Branch (42:27): [True: 6.78k, False: 1.21k]
  ------------------
   43|  6.78k|        if (!vInOutPoints.insert(txin.prevout).second)
  ------------------
  |  Branch (43:13): [True: 8, False: 6.77k]
  ------------------
   44|      8|            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-inputs-duplicate");
   45|  6.78k|    }
   46|       |
   47|  1.21k|    if (tx.IsCoinBase())
  ------------------
  |  Branch (47:9): [True: 51, False: 1.16k]
  ------------------
   48|     51|    {
   49|     51|        if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)
  ------------------
  |  Branch (49:13): [True: 1, False: 50]
  |  Branch (49:47): [True: 0, False: 50]
  ------------------
   50|      1|            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-cb-length");
   51|     51|    }
   52|  1.16k|    else
   53|  1.16k|    {
   54|  1.16k|        for (const auto& txin : tx.vin)
  ------------------
  |  Branch (54:31): [True: 6.48k, False: 1.16k]
  ------------------
   55|  6.48k|            if (txin.prevout.IsNull())
  ------------------
  |  Branch (55:17): [True: 1, False: 6.48k]
  ------------------
   56|      1|                return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-prevout-null");
   57|  1.16k|    }
   58|       |
   59|  1.21k|    return true;
   60|  1.21k|}

_Z9IsFinalTxRK12CTransactionil:
   18|    726|{
   19|    726|    if (tx.nLockTime == 0)
  ------------------
  |  Branch (19:9): [True: 229, False: 497]
  ------------------
   20|    229|        return true;
   21|    497|    if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
  ------------------
  |  Branch (21:9): [True: 424, False: 73]
  |  Branch (21:34): [True: 136, False: 361]
  ------------------
   22|    424|        return true;
   23|       |
   24|       |    // Even if tx.nLockTime isn't satisfied by nBlockHeight/nBlockTime, a
   25|       |    // transaction is still considered final if all inputs' nSequence ==
   26|       |    // SEQUENCE_FINAL (0xffffffff), in which case nLockTime is ignored.
   27|       |    //
   28|       |    // Because of this behavior OP_CHECKLOCKTIMEVERIFY/CheckLockTime() will
   29|       |    // also check that the spending input's nSequence != SEQUENCE_FINAL,
   30|       |    // ensuring that an unsatisfied nLockTime value will actually cause
   31|       |    // IsFinalTx() to return false here:
   32|     80|    for (const auto& txin : tx.vin) {
  ------------------
  |  Branch (32:27): [True: 80, False: 8]
  ------------------
   33|     80|        if (!(txin.nSequence == CTxIn::SEQUENCE_FINAL))
  ------------------
  |  Branch (33:13): [True: 65, False: 15]
  ------------------
   34|     65|            return false;
   35|     80|    }
   36|      8|    return true;
   37|     73|}
_Z22CalculateSequenceLocksRK12CTransactioniRNSt3__16vectorIiNS2_9allocatorIiEEEERK11CBlockIndex:
   40|    109|{
   41|    109|    assert(prevHeights.size() == tx.vin.size());
   42|       |
   43|       |    // Will be set to the equivalent height- and time-based nLockTime
   44|       |    // values that would be necessary to satisfy all relative lock-
   45|       |    // time constraints given our view of block chain history.
   46|       |    // The semantics of nLockTime are the last invalid height/time, so
   47|       |    // use -1 to have the effect of any height or time being valid.
   48|    109|    int nMinHeight = -1;
   49|    109|    int64_t nMinTime = -1;
   50|       |
   51|    109|    bool fEnforceBIP68 = tx.version >= 2 && flags & LOCKTIME_VERIFY_SEQUENCE;
  ------------------
  |  Branch (51:26): [True: 103, False: 6]
  |  Branch (51:45): [True: 103, False: 0]
  ------------------
   52|       |
   53|       |    // Do not enforce sequence numbers as a relative lock time
   54|       |    // unless we have been instructed to
   55|    109|    if (!fEnforceBIP68) {
  ------------------
  |  Branch (55:9): [True: 6, False: 103]
  ------------------
   56|      6|        return std::make_pair(nMinHeight, nMinTime);
   57|      6|    }
   58|       |
   59|    206|    for (size_t txinIndex = 0; txinIndex < tx.vin.size(); txinIndex++) {
  ------------------
  |  Branch (59:32): [True: 103, False: 103]
  ------------------
   60|    103|        const CTxIn& txin = tx.vin[txinIndex];
   61|       |
   62|       |        // Sequence numbers with the most significant bit set are not
   63|       |        // treated as relative lock-times, nor are they given any
   64|       |        // consensus-enforced meaning at this point.
   65|    103|        if (txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG) {
  ------------------
  |  Branch (65:13): [True: 69, False: 34]
  ------------------
   66|       |            // The height of this input is not relevant for sequence locks
   67|     69|            prevHeights[txinIndex] = 0;
   68|     69|            continue;
   69|     69|        }
   70|       |
   71|     34|        int nCoinHeight = prevHeights[txinIndex];
   72|       |
   73|     34|        if (txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) {
  ------------------
  |  Branch (73:13): [True: 20, False: 14]
  ------------------
   74|     20|            const int64_t nCoinTime{Assert(block.GetAncestor(std::max(nCoinHeight - 1, 0)))->GetMedianTimePast()};
  ------------------
  |  |   85|     20|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   75|       |            // NOTE: Subtract 1 to maintain nLockTime semantics
   76|       |            // BIP 68 relative lock times have the semantics of calculating
   77|       |            // the first block or time at which the transaction would be
   78|       |            // valid. When calculating the effective block time or height
   79|       |            // for the entire transaction, we switch to using the
   80|       |            // semantics of nLockTime which is the last invalid block
   81|       |            // time or height.  Thus we subtract 1 from the calculated
   82|       |            // time or height.
   83|       |
   84|       |            // Time-based relative lock-times are measured from the
   85|       |            // smallest allowed timestamp of the block containing the
   86|       |            // txout being spent, which is the median time past of the
   87|       |            // block prior.
   88|     20|            nMinTime = std::max(nMinTime, nCoinTime + (int64_t)((txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_MASK) << CTxIn::SEQUENCE_LOCKTIME_GRANULARITY) - 1);
   89|     20|        } else {
   90|     14|            nMinHeight = std::max(nMinHeight, nCoinHeight + (int)(txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_MASK) - 1);
   91|     14|        }
   92|     34|    }
   93|       |
   94|    103|    return std::make_pair(nMinHeight, nMinTime);
   95|    109|}
_Z21EvaluateSequenceLocksRK11CBlockIndexNSt3__14pairIilEE:
   98|    109|{
   99|    109|    assert(block.pprev);
  100|    109|    int64_t nBlockTime = block.pprev->GetMedianTimePast();
  101|    109|    if (lockPair.first >= block.nHeight || lockPair.second >= nBlockTime)
  ------------------
  |  Branch (101:9): [True: 6, False: 103]
  |  Branch (101:44): [True: 11, False: 92]
  ------------------
  102|     17|        return false;
  103|       |
  104|     92|    return true;
  105|    109|}
_Z19GetLegacySigOpCountRK12CTransaction:
  113|     49|{
  114|     49|    unsigned int nSigOps = 0;
  115|     49|    for (const auto& txin : tx.vin)
  ------------------
  |  Branch (115:27): [True: 51, False: 49]
  ------------------
  116|     51|    {
  117|     51|        nSigOps += txin.scriptSig.GetSigOpCount(false);
  118|     51|    }
  119|     49|    for (const auto& txout : tx.vout)
  ------------------
  |  Branch (119:28): [True: 51, False: 49]
  ------------------
  120|     51|    {
  121|     51|        nSigOps += txout.scriptPubKey.GetSigOpCount(false);
  122|     51|    }
  123|     49|    return nSigOps;
  124|     49|}
_ZN9Consensus13CheckTxInputsERK12CTransactionR17TxValidationStateRK15CCoinsViewCacheiRl:
  165|     92|{
  166|       |    // are the actual inputs available?
  167|     92|    if (!inputs.HaveInputs(tx)) {
  ------------------
  |  Branch (167:9): [True: 0, False: 92]
  ------------------
  168|      0|        return state.Invalid(TxValidationResult::TX_MISSING_INPUTS, "bad-txns-inputs-missingorspent",
  169|      0|                         strprintf("%s: inputs missing/spent", __func__));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  170|      0|    }
  171|       |
  172|     92|    CAmount nValueIn = 0;
  173|    182|    for (unsigned int i = 0; i < tx.vin.size(); ++i) {
  ------------------
  |  Branch (173:30): [True: 92, False: 90]
  ------------------
  174|     92|        const COutPoint &prevout = tx.vin[i].prevout;
  175|     92|        const Coin& coin = inputs.AccessCoin(prevout);
  176|     92|        assert(!coin.IsSpent());
  177|       |
  178|       |        // If prev is coinbase, check that it's matured
  179|     92|        if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY) {
  ------------------
  |  Branch (179:13): [True: 92, False: 0]
  |  Branch (179:34): [True: 2, False: 90]
  ------------------
  180|      2|            return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "bad-txns-premature-spend-of-coinbase",
  181|      2|                strprintf("tried to spend coinbase at depth %d", nSpendHeight - coin.nHeight));
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
  182|      2|        }
  183|       |
  184|       |        // Check for negative or overflow input values
  185|     90|        nValueIn += coin.out.nValue;
  186|     90|        if (!MoneyRange(coin.out.nValue) || !MoneyRange(nValueIn)) {
  ------------------
  |  Branch (186:13): [True: 0, False: 90]
  |  Branch (186:45): [True: 0, False: 90]
  ------------------
  187|      0|            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-inputvalues-outofrange");
  188|      0|        }
  189|     90|    }
  190|       |
  191|     90|    const CAmount value_out = tx.GetValueOut();
  192|     90|    if (nValueIn < value_out) {
  ------------------
  |  Branch (192:9): [True: 67, False: 23]
  ------------------
  193|     67|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-in-belowout",
  194|     67|            strprintf("value in (%s) < value out (%s)", FormatMoney(nValueIn), FormatMoney(value_out)));
  ------------------
  |  | 1172|     67|#define strprintf tfm::format
  ------------------
  195|     67|    }
  196|       |
  197|       |    // Tally transaction fees
  198|     23|    const CAmount txfee_aux = nValueIn - value_out;
  199|     23|    if (!MoneyRange(txfee_aux)) {
  ------------------
  |  Branch (199:9): [True: 0, False: 23]
  ------------------
  200|      0|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-fee-outofrange");
  201|      0|    }
  202|       |
  203|     23|    txfee = txfee_aux;
  204|     23|    return true;
  205|     23|}

_Z25GetWitnessCommitmentIndexRK6CBlock:
  149|     13|{
  150|     13|    int commitpos = NO_WITNESS_COMMITMENT;
  151|     13|    if (!block.vtx.empty()) {
  ------------------
  |  Branch (151:9): [True: 13, False: 0]
  ------------------
  152|     30|        for (size_t o = 0; o < block.vtx[0]->vout.size(); o++) {
  ------------------
  |  Branch (152:28): [True: 17, False: 13]
  ------------------
  153|     17|            const CTxOut& vout = block.vtx[0]->vout[o];
  154|     17|            if (vout.scriptPubKey.size() >= MINIMUM_WITNESS_COMMITMENT &&
  ------------------
  |  Branch (154:17): [True: 5, False: 12]
  ------------------
  155|     17|                vout.scriptPubKey[0] == OP_RETURN &&
  ------------------
  |  Branch (155:17): [True: 4, False: 1]
  ------------------
  156|     17|                vout.scriptPubKey[1] == 0x24 &&
  ------------------
  |  Branch (156:17): [True: 4, False: 0]
  ------------------
  157|     17|                vout.scriptPubKey[2] == 0xaa &&
  ------------------
  |  Branch (157:17): [True: 4, False: 0]
  ------------------
  158|     17|                vout.scriptPubKey[3] == 0x21 &&
  ------------------
  |  Branch (158:17): [True: 4, False: 0]
  ------------------
  159|     17|                vout.scriptPubKey[4] == 0xa9 &&
  ------------------
  |  Branch (159:17): [True: 3, False: 1]
  ------------------
  160|     17|                vout.scriptPubKey[5] == 0xed) {
  ------------------
  |  Branch (160:17): [True: 3, False: 0]
  ------------------
  161|      3|                commitpos = o;
  162|      3|            }
  163|     17|        }
  164|     13|    }
  165|     13|    return commitpos;
  166|     13|}
_ZNK15ValidationStateI21BlockValidationResultE7IsValidEv:
  106|    116|    bool IsValid() const { return m_mode == ModeState::M_VALID; }
_ZNK15ValidationStateI21BlockValidationResultE9IsInvalidEv:
  107|    253|    bool IsInvalid() const { return m_mode == ModeState::M_INVALID; }
_ZNK15ValidationStateI18TxValidationResultE7IsValidEv:
  106|  1.36k|    bool IsValid() const { return m_mode == ModeState::M_VALID; }
_ZN15ValidationStateI21BlockValidationResultE7InvalidES0_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_:
   92|    387|    {
   93|    387|        m_result = result;
   94|    387|        m_reject_reason = reject_reason;
   95|    387|        m_debug_message = debug_message;
   96|    387|        if (m_mode != ModeState::M_ERROR) m_mode = ModeState::M_INVALID;
  ------------------
  |  Branch (96:13): [True: 387, False: 0]
  ------------------
   97|    387|        return false;
   98|    387|    }
_ZN15ValidationStateI18TxValidationResultE7InvalidES0_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_:
   92|  1.36k|    {
   93|  1.36k|        m_result = result;
   94|  1.36k|        m_reject_reason = reject_reason;
   95|  1.36k|        m_debug_message = debug_message;
   96|  1.36k|        if (m_mode != ModeState::M_ERROR) m_mode = ModeState::M_INVALID;
  ------------------
  |  Branch (96:13): [True: 1.36k, False: 0]
  ------------------
   97|  1.36k|        return false;
   98|  1.36k|    }
_ZNK15ValidationStateI18TxValidationResultE9IsInvalidEv:
  107|  1.36k|    bool IsInvalid() const { return m_mode == ModeState::M_INVALID; }
_ZNK15ValidationStateI18TxValidationResultE9GetResultEv:
  109|  7.87k|    Result GetResult() const { return m_result; }
policy.cpp:_ZL20GetTransactionWeightRK12CTransaction:
  134|  1.08k|{
  135|  1.08k|    return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx));
  136|  1.08k|}
_ZNK15ValidationStateI21BlockValidationResultE8ToStringEv:
  113|    116|    {
  114|    116|        if (IsValid()) {
  ------------------
  |  Branch (114:13): [True: 0, False: 116]
  ------------------
  115|      0|            return "Valid";
  116|      0|        }
  117|       |
  118|    116|        if (!m_debug_message.empty()) {
  ------------------
  |  Branch (118:13): [True: 72, False: 44]
  ------------------
  119|     72|            return m_reject_reason + ", " + m_debug_message;
  120|     72|        }
  121|       |
  122|     44|        return m_reject_reason;
  123|    116|    }
_ZNK15ValidationStateI21BlockValidationResultE9GetResultEv:
  109|    253|    Result GetResult() const { return m_result; }
_ZNK15ValidationStateI18TxValidationResultE15GetRejectReasonEv:
  110|      5|    std::string GetRejectReason() const { return m_reject_reason; }
txorphanage.cpp:_ZL20GetTransactionWeightRK12CTransaction:
  134|  1.10k|{
  135|  1.10k|    return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx));
  136|  1.10k|}
_ZNK15ValidationStateI18TxValidationResultE15GetDebugMessageEv:
  111|      5|    std::string GetDebugMessage() const { return m_debug_message; }

net_processing.cpp:_ZL21RecursiveDynamicUsageRK12CTransaction:
   32|  1.36k|static inline size_t RecursiveDynamicUsage(const CTransaction& tx) {
   33|  1.36k|    size_t mem = memusage::DynamicUsage(tx.vin) + memusage::DynamicUsage(tx.vout);
   34|  13.1k|    for (std::vector<CTxIn>::const_iterator it = tx.vin.begin(); it != tx.vin.end(); it++) {
  ------------------
  |  Branch (34:66): [True: 11.7k, False: 1.36k]
  ------------------
   35|  11.7k|        mem += RecursiveDynamicUsage(*it);
   36|  11.7k|    }
   37|  9.01k|    for (std::vector<CTxOut>::const_iterator it = tx.vout.begin(); it != tx.vout.end(); it++) {
  ------------------
  |  Branch (37:68): [True: 7.65k, False: 1.36k]
  ------------------
   38|  7.65k|        mem += RecursiveDynamicUsage(*it);
   39|  7.65k|    }
   40|  1.36k|    return mem;
   41|  1.36k|}
net_processing.cpp:_ZL21RecursiveDynamicUsageRK5CTxIn:
   20|  11.7k|static inline size_t RecursiveDynamicUsage(const CTxIn& in) {
   21|  11.7k|    size_t mem = RecursiveDynamicUsage(in.scriptSig) + RecursiveDynamicUsage(in.prevout) + memusage::DynamicUsage(in.scriptWitness.stack);
   22|   383k|    for (std::vector<std::vector<unsigned char> >::const_iterator it = in.scriptWitness.stack.begin(); it != in.scriptWitness.stack.end(); it++) {
  ------------------
  |  Branch (22:104): [True: 372k, False: 11.7k]
  ------------------
   23|   372k|         mem += memusage::DynamicUsage(*it);
   24|   372k|    }
   25|  11.7k|    return mem;
   26|  11.7k|}
net_processing.cpp:_ZL21RecursiveDynamicUsageRK7CScript:
   12|  19.4k|static inline size_t RecursiveDynamicUsage(const CScript& script) {
   13|  19.4k|    return memusage::DynamicUsage(script);
   14|  19.4k|}
net_processing.cpp:_ZL21RecursiveDynamicUsageRK9COutPoint:
   16|  11.7k|static inline size_t RecursiveDynamicUsage(const COutPoint& out) {
   17|  11.7k|    return 0;
   18|  11.7k|}
net_processing.cpp:_ZL21RecursiveDynamicUsageRK6CTxOut:
   28|  7.65k|static inline size_t RecursiveDynamicUsage(const CTxOut& out) {
   29|  7.65k|    return RecursiveDynamicUsage(out.scriptPubKey);
   30|  7.65k|}

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

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

_Z8ReadLE64ITk8ByteTypehEmPKT_:
   36|  7.41M|{
   37|  7.41M|    uint64_t x;
   38|  7.41M|    memcpy(&x, ptr, 8);
   39|  7.41M|    return le64toh_internal(x);
   40|  7.41M|}
_Z9WriteLE32ITk8ByteTypehEvPT_j:
   51|  72.1k|{
   52|  72.1k|    uint32_t v = htole32_internal(x);
   53|  72.1k|    memcpy(ptr, &v, 4);
   54|  72.1k|}
_Z8ReadLE64ITk8ByteTypeSt4byteEmPKT_:
   36|   321k|{
   37|   321k|    uint64_t x;
   38|   321k|    memcpy(&x, ptr, 8);
   39|   321k|    return le64toh_internal(x);
   40|   321k|}
_Z9WriteLE32ITk8ByteTypeSt4byteEvPT_j:
   51|  1.39M|{
   52|  1.39M|    uint32_t v = htole32_internal(x);
   53|  1.39M|    memcpy(ptr, &v, 4);
   54|  1.39M|}
_Z8ReadLE16ITk8ByteTypehEtPKT_:
   20|     30|{
   21|     30|    uint16_t x;
   22|     30|    memcpy(&x, ptr, 2);
   23|     30|    return le16toh_internal(x);
   24|     30|}
_Z8ReadLE32ITk8ByteTypehEjPKT_:
   28|   164M|{
   29|   164M|    uint32_t x;
   30|   164M|    memcpy(&x, ptr, 4);
   31|   164M|    return le32toh_internal(x);
   32|   164M|}
_Z9WriteLE64ITk8ByteTypehEvPT_m:
   58|    192|{
   59|    192|    uint64_t v = htole64_internal(x);
   60|    192|    memcpy(ptr, &v, 8);
   61|    192|}
_Z8ReadBE16ITk8ByteTypehEtPKT_:
   65|  2.61k|{
   66|  2.61k|    uint16_t x;
   67|  2.61k|    memcpy(&x, ptr, 2);
   68|  2.61k|    return be16toh_internal(x);
   69|  2.61k|}
_Z9WriteBE32ITk8ByteTypehEvPT_j:
   96|  4.43M|{
   97|  4.43M|    uint32_t v = htobe32_internal(x);
   98|  4.43M|    memcpy(ptr, &v, 4);
   99|  4.43M|}
_Z8ReadBE32ITk8ByteTypehEjPKT_:
   73|  88.5k|{
   74|  88.5k|    uint32_t x;
   75|  88.5k|    memcpy(&x, ptr, 4);
   76|  88.5k|    return be32toh_internal(x);
   77|  88.5k|}
_Z9WriteBE64ITk8ByteTypehEvPT_m:
  103|   848k|{
  104|   848k|    uint64_t v = htobe64_internal(x);
  105|   848k|    memcpy(ptr, &v, 8);
  106|   848k|}
_Z8ReadBE64ITk8ByteTypehEmPKT_:
   81|   522k|{
   82|   522k|    uint64_t x;
   83|   522k|    memcpy(&x, ptr, 8);
   84|   522k|    return be64toh_internal(x);
   85|   522k|}
_Z8ReadLE32ITk8ByteTypeSt4byteEjPKT_:
   28|   623k|{
   29|   623k|    uint32_t x;
   30|   623k|    memcpy(&x, ptr, 4);
   31|   623k|    return le32toh_internal(x);
   32|   623k|}

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

_ZN7CSHA256C2Ev:
  697|   261k|{
  698|   261k|    sha256::Initialize(s);
  699|   261k|}
_ZN7CSHA2565WriteEPKhm:
  702|  3.21M|{
  703|  3.21M|    const unsigned char* end = data + len;
  704|  3.21M|    size_t bufsize = bytes % 64;
  705|  3.21M|    if (bufsize && bufsize + len >= 64) {
  ------------------
  |  Branch (705:9): [True: 2.62M, False: 588k]
  |  Branch (705:20): [True: 693k, False: 1.93M]
  ------------------
  706|       |        // Fill the buffer, and process it.
  707|   693k|        memcpy(buf + bufsize, data, 64 - bufsize);
  708|   693k|        bytes += 64 - bufsize;
  709|   693k|        data += 64 - bufsize;
  710|   693k|        Transform(s, buf, 1);
  711|   693k|        bufsize = 0;
  712|   693k|    }
  713|  3.21M|    if (end - data >= 64) {
  ------------------
  |  Branch (713:9): [True: 49.4k, False: 3.16M]
  ------------------
  714|  49.4k|        size_t blocks = (end - data) / 64;
  715|  49.4k|        Transform(s, data, blocks);
  716|  49.4k|        data += 64 * blocks;
  717|  49.4k|        bytes += 64 * blocks;
  718|  49.4k|    }
  719|  3.21M|    if (end > data) {
  ------------------
  |  Branch (719:9): [True: 2.62M, False: 588k]
  ------------------
  720|       |        // Fill the buffer with what remains.
  721|  2.62M|        memcpy(buf + bufsize, data, end - data);
  722|  2.62M|        bytes += end - data;
  723|  2.62M|    }
  724|  3.21M|    return *this;
  725|  3.21M|}
_ZN7CSHA2568FinalizeEPh:
  728|   554k|{
  729|   554k|    static const unsigned char pad[64] = {0x80};
  730|   554k|    unsigned char sizedesc[8];
  731|   554k|    WriteBE64(sizedesc, bytes << 3);
  732|   554k|    Write(pad, 1 + ((119 - (bytes % 64)) % 64));
  733|   554k|    Write(sizedesc, 8);
  734|   554k|    WriteBE32(hash, s[0]);
  735|   554k|    WriteBE32(hash + 4, s[1]);
  736|   554k|    WriteBE32(hash + 8, s[2]);
  737|   554k|    WriteBE32(hash + 12, s[3]);
  738|   554k|    WriteBE32(hash + 16, s[4]);
  739|   554k|    WriteBE32(hash + 20, s[5]);
  740|   554k|    WriteBE32(hash + 24, s[6]);
  741|   554k|    WriteBE32(hash + 28, s[7]);
  742|   554k|}
_ZN7CSHA2565ResetEv:
  745|   309k|{
  746|   309k|    bytes = 0;
  747|   309k|    sha256::Initialize(s);
  748|   309k|    return *this;
  749|   309k|}
_Z9SHA256D64PhPKhm:
  752|    322|{
  753|    322|    if (TransformD64_8way) {
  ------------------
  |  Branch (753:9): [True: 322, False: 0]
  ------------------
  754|  1.40k|        while (blocks >= 8) {
  ------------------
  |  Branch (754:16): [True: 1.08k, False: 322]
  ------------------
  755|  1.08k|            TransformD64_8way(out, in);
  756|  1.08k|            out += 256;
  757|  1.08k|            in += 512;
  758|  1.08k|            blocks -= 8;
  759|  1.08k|        }
  760|    322|    }
  761|    322|    if (TransformD64_4way) {
  ------------------
  |  Branch (761:9): [True: 322, False: 0]
  ------------------
  762|    408|        while (blocks >= 4) {
  ------------------
  |  Branch (762:16): [True: 86, False: 322]
  ------------------
  763|     86|            TransformD64_4way(out, in);
  764|     86|            out += 128;
  765|     86|            in += 256;
  766|     86|            blocks -= 4;
  767|     86|        }
  768|    322|    }
  769|    322|    if (TransformD64_2way) {
  ------------------
  |  Branch (769:9): [True: 0, False: 322]
  ------------------
  770|      0|        while (blocks >= 2) {
  ------------------
  |  Branch (770:16): [True: 0, False: 0]
  ------------------
  771|      0|            TransformD64_2way(out, in);
  772|      0|            out += 64;
  773|      0|            in += 128;
  774|      0|            blocks -= 2;
  775|      0|        }
  776|      0|    }
  777|    762|    while (blocks) {
  ------------------
  |  Branch (777:12): [True: 440, False: 322]
  ------------------
  778|    440|        TransformD64(out, in);
  779|    440|        out += 32;
  780|    440|        in += 64;
  781|    440|        --blocks;
  782|    440|    }
  783|    322|}
sha256.cpp:_ZN12_GLOBAL__N_16sha25610InitializeEPj:
   89|   571k|{
   90|   571k|    s[0] = 0x6a09e667ul;
   91|   571k|    s[1] = 0xbb67ae85ul;
   92|   571k|    s[2] = 0x3c6ef372ul;
   93|   571k|    s[3] = 0xa54ff53aul;
   94|   571k|    s[4] = 0x510e527ful;
   95|   571k|    s[5] = 0x9b05688cul;
   96|   571k|    s[6] = 0x1f83d9abul;
   97|   571k|    s[7] = 0x5be0cd19ul;
   98|   571k|}
sha256.cpp:_ZN12_GLOBAL__N_119TransformD64WrapperIXadL_ZN11sha256_sse49TransformEPjPKhmEEEEvPhS4_:
  445|    440|{
  446|    440|    uint32_t s[8];
  447|    440|    static const unsigned char padding1[64] = {
  448|    440|        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  449|    440|        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  450|    440|        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  451|    440|        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0
  452|    440|    };
  453|    440|    unsigned char buffer2[64] = {
  454|    440|        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  455|    440|        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  456|    440|        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  457|    440|        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
  458|    440|    };
  459|    440|    sha256::Initialize(s);
  460|    440|    tr(s, in, 1);
  461|    440|    tr(s, padding1, 1);
  462|    440|    WriteBE32(buffer2 + 0, s[0]);
  463|    440|    WriteBE32(buffer2 + 4, s[1]);
  464|    440|    WriteBE32(buffer2 + 8, s[2]);
  465|    440|    WriteBE32(buffer2 + 12, s[3]);
  466|    440|    WriteBE32(buffer2 + 16, s[4]);
  467|    440|    WriteBE32(buffer2 + 20, s[5]);
  468|    440|    WriteBE32(buffer2 + 24, s[6]);
  469|    440|    WriteBE32(buffer2 + 28, s[7]);
  470|    440|    sha256::Initialize(s);
  471|    440|    tr(s, buffer2, 1);
  472|    440|    WriteBE32(out + 0, s[0]);
  473|    440|    WriteBE32(out + 4, s[1]);
  474|    440|    WriteBE32(out + 8, s[2]);
  475|    440|    WriteBE32(out + 12, s[3]);
  476|    440|    WriteBE32(out + 16, s[4]);
  477|    440|    WriteBE32(out + 20, s[5]);
  478|    440|    WriteBE32(out + 24, s[6]);
  479|    440|    WriteBE32(out + 28, s[7]);
  480|    440|}

_ZN14sha256d64_avx214Transform_8wayEPhPKh:
   77|  1.08k|{
   78|       |    // Transform 1
   79|  1.08k|    __m256i a = K(0x6a09e667ul);
   80|  1.08k|    __m256i b = K(0xbb67ae85ul);
   81|  1.08k|    __m256i c = K(0x3c6ef372ul);
   82|  1.08k|    __m256i d = K(0xa54ff53aul);
   83|  1.08k|    __m256i e = K(0x510e527ful);
   84|  1.08k|    __m256i f = K(0x9b05688cul);
   85|  1.08k|    __m256i g = K(0x1f83d9abul);
   86|  1.08k|    __m256i h = K(0x5be0cd19ul);
   87|       |
   88|  1.08k|    __m256i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
   89|       |
   90|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x428a2f98ul), w0 = Read8(in, 0)));
   91|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x71374491ul), w1 = Read8(in, 4)));
   92|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0xb5c0fbcful), w2 = Read8(in, 8)));
   93|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0xe9b5dba5ul), w3 = Read8(in, 12)));
   94|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x3956c25bul), w4 = Read8(in, 16)));
   95|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x59f111f1ul), w5 = Read8(in, 20)));
   96|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x923f82a4ul), w6 = Read8(in, 24)));
   97|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0xab1c5ed5ul), w7 = Read8(in, 28)));
   98|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0xd807aa98ul), w8 = Read8(in, 32)));
   99|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x12835b01ul), w9 = Read8(in, 36)));
  100|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x243185beul), w10 = Read8(in, 40)));
  101|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x550c7dc3ul), w11 = Read8(in, 44)));
  102|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x72be5d74ul), w12 = Read8(in, 48)));
  103|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x80deb1feul), w13 = Read8(in, 52)));
  104|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x9bdc06a7ul), w14 = Read8(in, 56)));
  105|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0xc19bf174ul), w15 = Read8(in, 60)));
  106|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0xe49b69c1ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  107|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0xefbe4786ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  108|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x0fc19dc6ul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  109|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x240ca1ccul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  110|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x2de92c6ful), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  111|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x4a7484aaul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  112|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x5cb0a9dcul), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  113|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x76f988daul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  114|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x983e5152ul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  115|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0xa831c66dul), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  116|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0xb00327c8ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  117|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0xbf597fc7ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  118|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0xc6e00bf3ul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  119|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0xd5a79147ul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  120|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x06ca6351ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  121|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x14292967ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  122|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x27b70a85ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  123|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x2e1b2138ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  124|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x4d2c6dfcul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  125|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x53380d13ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  126|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x650a7354ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  127|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x766a0abbul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  128|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x81c2c92eul), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  129|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x92722c85ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  130|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0xa2bfe8a1ul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  131|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0xa81a664bul), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  132|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0xc24b8b70ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  133|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0xc76c51a3ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  134|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0xd192e819ul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  135|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0xd6990624ul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  136|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0xf40e3585ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  137|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x106aa070ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  138|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x19a4c116ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  139|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x1e376c08ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  140|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x2748774cul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  141|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x34b0bcb5ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  142|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x391c0cb3ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  143|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x4ed8aa4aul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  144|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x5b9cca4ful), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  145|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x682e6ff3ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  146|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x748f82eeul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  147|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x78a5636ful), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  148|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x84c87814ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  149|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x8cc70208ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  150|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x90befffaul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  151|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0xa4506cebul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  152|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0xbef9a3f7ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  153|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0xc67178f2ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  154|       |
  155|  1.08k|    a = Add(a, K(0x6a09e667ul));
  156|  1.08k|    b = Add(b, K(0xbb67ae85ul));
  157|  1.08k|    c = Add(c, K(0x3c6ef372ul));
  158|  1.08k|    d = Add(d, K(0xa54ff53aul));
  159|  1.08k|    e = Add(e, K(0x510e527ful));
  160|  1.08k|    f = Add(f, K(0x9b05688cul));
  161|  1.08k|    g = Add(g, K(0x1f83d9abul));
  162|  1.08k|    h = Add(h, K(0x5be0cd19ul));
  163|       |
  164|  1.08k|    __m256i t0 = a, t1 = b, t2 = c, t3 = d, t4 = e, t5 = f, t6 = g, t7 = h;
  165|       |
  166|       |    // Transform 2
  167|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0xc28a2f98ul));
  168|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0x71374491ul));
  169|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0xb5c0fbcful));
  170|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0xe9b5dba5ul));
  171|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x3956c25bul));
  172|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x59f111f1ul));
  173|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0x923f82a4ul));
  174|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0xab1c5ed5ul));
  175|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0xd807aa98ul));
  176|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0x12835b01ul));
  177|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0x243185beul));
  178|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0x550c7dc3ul));
  179|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x72be5d74ul));
  180|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x80deb1feul));
  181|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0x9bdc06a7ul));
  182|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0xc19bf374ul));
  183|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0x649b69c1ul));
  184|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0xf0fe4786ul));
  185|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0x0fe1edc6ul));
  186|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0x240cf254ul));
  187|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x4fe9346ful));
  188|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x6cc984beul));
  189|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0x61b9411eul));
  190|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0x16f988faul));
  191|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0xf2c65152ul));
  192|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0xa88e5a6dul));
  193|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0xb019fc65ul));
  194|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0xb9d99ec7ul));
  195|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x9a1231c3ul));
  196|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0xe70eeaa0ul));
  197|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0xfdb1232bul));
  198|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0xc7353eb0ul));
  199|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0x3069bad5ul));
  200|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0xcb976d5ful));
  201|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0x5a0f118ful));
  202|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0xdc1eeefdul));
  203|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x0a35b689ul));
  204|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0xde0b7a04ul));
  205|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0x58f4ca9dul));
  206|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0xe15d5b16ul));
  207|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0x007f3e86ul));
  208|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0x37088980ul));
  209|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0xa507ea32ul));
  210|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0x6fab9537ul));
  211|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x17406110ul));
  212|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x0d8cd6f1ul));
  213|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0xcdaa3b6dul));
  214|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0xc0bbbe37ul));
  215|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0x83613bdaul));
  216|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0xdb48a363ul));
  217|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0x0b02e931ul));
  218|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0x6fd15ca7ul));
  219|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x521afacaul));
  220|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x31338431ul));
  221|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0x6ed41a95ul));
  222|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0x6d437890ul));
  223|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0xc39c91f2ul));
  224|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0x9eccabbdul));
  225|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0xb5c9a0e6ul));
  226|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0x532fb63cul));
  227|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0xd2c741c6ul));
  228|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x07237ea3ul));
  229|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0xa4954b68ul));
  230|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0x4c191d76ul));
  231|       |
  232|  1.08k|    w0 = Add(t0, a);
  233|  1.08k|    w1 = Add(t1, b);
  234|  1.08k|    w2 = Add(t2, c);
  235|  1.08k|    w3 = Add(t3, d);
  236|  1.08k|    w4 = Add(t4, e);
  237|  1.08k|    w5 = Add(t5, f);
  238|  1.08k|    w6 = Add(t6, g);
  239|  1.08k|    w7 = Add(t7, h);
  240|       |
  241|       |    // Transform 3
  242|  1.08k|    a = K(0x6a09e667ul);
  243|  1.08k|    b = K(0xbb67ae85ul);
  244|  1.08k|    c = K(0x3c6ef372ul);
  245|  1.08k|    d = K(0xa54ff53aul);
  246|  1.08k|    e = K(0x510e527ful);
  247|  1.08k|    f = K(0x9b05688cul);
  248|  1.08k|    g = K(0x1f83d9abul);
  249|  1.08k|    h = K(0x5be0cd19ul);
  250|       |
  251|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x428a2f98ul), w0));
  252|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x71374491ul), w1));
  253|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0xb5c0fbcful), w2));
  254|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0xe9b5dba5ul), w3));
  255|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x3956c25bul), w4));
  256|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x59f111f1ul), w5));
  257|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x923f82a4ul), w6));
  258|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0xab1c5ed5ul), w7));
  259|  1.08k|    Round(a, b, c, d, e, f, g, h, K(0x5807aa98ul));
  260|  1.08k|    Round(h, a, b, c, d, e, f, g, K(0x12835b01ul));
  261|  1.08k|    Round(g, h, a, b, c, d, e, f, K(0x243185beul));
  262|  1.08k|    Round(f, g, h, a, b, c, d, e, K(0x550c7dc3ul));
  263|  1.08k|    Round(e, f, g, h, a, b, c, d, K(0x72be5d74ul));
  264|  1.08k|    Round(d, e, f, g, h, a, b, c, K(0x80deb1feul));
  265|  1.08k|    Round(c, d, e, f, g, h, a, b, K(0x9bdc06a7ul));
  266|  1.08k|    Round(b, c, d, e, f, g, h, a, K(0xc19bf274ul));
  267|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0xe49b69c1ul), Inc(w0, sigma0(w1))));
  268|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0xefbe4786ul), Inc(w1, K(0xa00000ul), sigma0(w2))));
  269|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x0fc19dc6ul), Inc(w2, sigma1(w0), sigma0(w3))));
  270|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x240ca1ccul), Inc(w3, sigma1(w1), sigma0(w4))));
  271|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x2de92c6ful), Inc(w4, sigma1(w2), sigma0(w5))));
  272|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x4a7484aaul), Inc(w5, sigma1(w3), sigma0(w6))));
  273|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x5cb0a9dcul), Inc(w6, sigma1(w4), K(0x100ul), sigma0(w7))));
  274|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x76f988daul), Inc(w7, sigma1(w5), w0, K(0x11002000ul))));
  275|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x983e5152ul), w8 = Add(K(0x80000000ul), sigma1(w6), w1)));
  276|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0xa831c66dul), w9 = Add(sigma1(w7), w2)));
  277|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0xb00327c8ul), w10 = Add(sigma1(w8), w3)));
  278|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0xbf597fc7ul), w11 = Add(sigma1(w9), w4)));
  279|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0xc6e00bf3ul), w12 = Add(sigma1(w10), w5)));
  280|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0xd5a79147ul), w13 = Add(sigma1(w11), w6)));
  281|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x06ca6351ul), w14 = Add(sigma1(w12), w7, K(0x400022ul))));
  282|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x14292967ul), w15 = Add(K(0x100ul), sigma1(w13), w8, sigma0(w0))));
  283|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x27b70a85ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  284|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x2e1b2138ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  285|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x4d2c6dfcul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  286|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x53380d13ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  287|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x650a7354ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  288|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x766a0abbul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  289|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x81c2c92eul), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  290|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x92722c85ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  291|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0xa2bfe8a1ul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  292|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0xa81a664bul), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  293|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0xc24b8b70ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  294|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0xc76c51a3ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  295|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0xd192e819ul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  296|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0xd6990624ul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  297|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0xf40e3585ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  298|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x106aa070ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  299|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x19a4c116ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  300|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x1e376c08ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  301|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x2748774cul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  302|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x34b0bcb5ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  303|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x391c0cb3ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  304|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0x4ed8aa4aul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  305|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0x5b9cca4ful), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  306|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0x682e6ff3ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  307|  1.08k|    Round(a, b, c, d, e, f, g, h, Add(K(0x748f82eeul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  308|  1.08k|    Round(h, a, b, c, d, e, f, g, Add(K(0x78a5636ful), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  309|  1.08k|    Round(g, h, a, b, c, d, e, f, Add(K(0x84c87814ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  310|  1.08k|    Round(f, g, h, a, b, c, d, e, Add(K(0x8cc70208ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  311|  1.08k|    Round(e, f, g, h, a, b, c, d, Add(K(0x90befffaul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  312|  1.08k|    Round(d, e, f, g, h, a, b, c, Add(K(0xa4506cebul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  313|  1.08k|    Round(c, d, e, f, g, h, a, b, Add(K(0xbef9a3f7ul), w14, sigma1(w12), w7, sigma0(w15)));
  314|  1.08k|    Round(b, c, d, e, f, g, h, a, Add(K(0xc67178f2ul), w15, sigma1(w13), w8, sigma0(w0)));
  315|       |
  316|       |    // Output
  317|  1.08k|    Write8(out, 0, Add(a, K(0x6a09e667ul)));
  318|  1.08k|    Write8(out, 4, Add(b, K(0xbb67ae85ul)));
  319|  1.08k|    Write8(out, 8, Add(c, K(0x3c6ef372ul)));
  320|  1.08k|    Write8(out, 12, Add(d, K(0xa54ff53aul)));
  321|  1.08k|    Write8(out, 16, Add(e, K(0x510e527ful)));
  322|  1.08k|    Write8(out, 20, Add(f, K(0x9b05688cul)));
  323|  1.08k|    Write8(out, 24, Add(g, K(0x1f83d9abul)));
  324|  1.08k|    Write8(out, 28, Add(h, K(0x5be0cd19ul)));
  325|  1.08k|}
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_11KEj:
   16|   249k|__m256i inline K(uint32_t x) { return _mm256_set1_epi32(x); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_15RoundEDv4_xS1_S1_RS1_S1_S1_S1_S2_S1_:
   41|   208k|{
   42|   208k|    __m256i t1 = Add(h, Sigma1(e), Ch(e, f, g), k);
   43|   208k|    __m256i t2 = Add(Sigma0(a), Maj(a, b, c));
   44|   208k|    d = Add(d, t1);
   45|   208k|    h = Add(t1, t2);
   46|   208k|}
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_16Sigma1EDv4_x:
   35|   208k|__m256i inline Sigma1(__m256i x) { return Xor(Or(ShR(x, 6), ShL(x, 26)), Or(ShR(x, 11), ShL(x, 21)), Or(ShR(x, 25), ShL(x, 7))); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13XorEDv4_xS1_S1_:
   26|   613k|__m256i inline Xor(__m256i x, __m256i y, __m256i z) { return Xor(Xor(x, y), z); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13XorEDv4_xS1_:
   25|  1.64M|__m256i inline Xor(__m256i x, __m256i y) { return _mm256_xor_si256(x, y); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_12OrEDv4_xS1_:
   27|  2.05M|__m256i inline Or(__m256i x, __m256i y) { return _mm256_or_si256(x, y); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13ShREDv4_xi:
   29|  1.84M|__m256i inline ShR(__m256i x, int n) { return _mm256_srli_epi32(x, n); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13ShLEDv4_xi:
   30|  1.64M|__m256i inline ShL(__m256i x, int n) { return _mm256_slli_epi32(x, n); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_12ChEDv4_xS1_S1_:
   32|   208k|__m256i inline Ch(__m256i x, __m256i y, __m256i z) { return Xor(z, And(x, Xor(y, z))); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13AndEDv4_xS1_:
   28|   624k|__m256i inline And(__m256i x, __m256i y) { return _mm256_and_si256(x, y); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_16Sigma0EDv4_x:
   34|   208k|__m256i inline Sigma0(__m256i x) { return Xor(Or(ShR(x, 2), ShL(x, 30)), Or(ShR(x, 13), ShL(x, 19)), Or(ShR(x, 22), ShL(x, 10))); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13MajEDv4_xS1_S1_:
   33|   208k|__m256i inline Maj(__m256i x, __m256i y, __m256i z) { return Or(And(x, y), And(z, Or(x, y))); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13AddEDv4_xS1_:
   18|  1.69M|__m256i inline Add(__m256i x, __m256i y) { return _mm256_add_epi32(x, y); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_15Read8EPKhi:
   48|  17.3k|__m256i inline Read8(const unsigned char* chunk, int offset) {
   49|  17.3k|    __m256i ret = _mm256_set_epi32(
   50|  17.3k|        ReadLE32(chunk + 0 + offset),
   51|  17.3k|        ReadLE32(chunk + 64 + offset),
   52|  17.3k|        ReadLE32(chunk + 128 + offset),
   53|  17.3k|        ReadLE32(chunk + 192 + offset),
   54|  17.3k|        ReadLE32(chunk + 256 + offset),
   55|  17.3k|        ReadLE32(chunk + 320 + offset),
   56|  17.3k|        ReadLE32(chunk + 384 + offset),
   57|  17.3k|        ReadLE32(chunk + 448 + offset)
   58|  17.3k|    );
   59|  17.3k|    return _mm256_shuffle_epi8(ret, _mm256_set_epi32(0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL, 0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL));
   60|  17.3k|}
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13IncERDv4_xS1_S1_S1_:
   24|  86.7k|__m256i inline Inc(__m256i& x, __m256i y, __m256i z, __m256i w) { x = Add(x, y, z, w); return x; }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_16sigma1EDv4_x:
   37|   101k|__m256i inline sigma1(__m256i x) { return Xor(Or(ShR(x, 17), ShL(x, 15)), Or(ShR(x, 19), ShL(x, 13)), ShR(x, 10)); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_16sigma0EDv4_x:
   36|  95.3k|__m256i inline sigma0(__m256i x) { return Xor(Or(ShR(x, 7), ShL(x, 25)), Or(ShR(x, 18), ShL(x, 14)), ShR(x, 3)); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13IncERDv4_xS1_:
   22|  1.08k|__m256i inline Inc(__m256i& x, __m256i y) { x = Add(x, y); return x; }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13IncERDv4_xS1_S1_:
   23|  5.42k|__m256i inline Inc(__m256i& x, __m256i y, __m256i z) { x = Add(x, y, z); return x; }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13AddEDv4_xS1_S1_:
   19|  9.75k|__m256i inline Add(__m256i x, __m256i y, __m256i z) { return Add(Add(x, y), z); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13AddEDv4_xS1_S1_S1_:
   20|   295k|__m256i inline Add(__m256i x, __m256i y, __m256i z, __m256i w) { return Add(Add(x, y), Add(z, w)); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_13AddEDv4_xS1_S1_S1_S1_:
   21|  2.16k|__m256i inline Add(__m256i x, __m256i y, __m256i z, __m256i w, __m256i v) { return Add(Add(x, y, z), Add(w, v)); }
sha256_avx2.cpp:_ZN14sha256d64_avx212_GLOBAL__N_16Write8EPhiDv4_x:
   62|  8.67k|void inline Write8(unsigned char* out, int offset, __m256i v) {
   63|  8.67k|    v = _mm256_shuffle_epi8(v, _mm256_set_epi32(0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL, 0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL));
   64|  8.67k|    WriteLE32(out + 0 + offset, _mm256_extract_epi32(v, 7));
   65|  8.67k|    WriteLE32(out + 32 + offset, _mm256_extract_epi32(v, 6));
   66|  8.67k|    WriteLE32(out + 64 + offset, _mm256_extract_epi32(v, 5));
   67|  8.67k|    WriteLE32(out + 96 + offset, _mm256_extract_epi32(v, 4));
   68|  8.67k|    WriteLE32(out + 128 + offset, _mm256_extract_epi32(v, 3));
   69|  8.67k|    WriteLE32(out + 160 + offset, _mm256_extract_epi32(v, 2));
   70|  8.67k|    WriteLE32(out + 192 + offset, _mm256_extract_epi32(v, 1));
   71|  8.67k|    WriteLE32(out + 224 + offset, _mm256_extract_epi32(v, 0));
   72|  8.67k|}

_ZN11sha256_sse49TransformEPjPKhm:
   23|   744k|{
   24|   744k|    static const uint32_t K256 alignas(16) [] = {
   25|   744k|        0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
   26|   744k|        0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
   27|   744k|        0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
   28|   744k|        0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
   29|   744k|        0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
   30|   744k|        0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
   31|   744k|        0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
   32|   744k|        0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
   33|   744k|        0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
   34|   744k|        0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
   35|   744k|        0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
   36|   744k|        0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
   37|   744k|        0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
   38|   744k|        0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
   39|   744k|        0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
   40|   744k|        0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
   41|   744k|    };
   42|   744k|    static const uint32_t FLIP_MASK alignas(16) [] = {0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f};
   43|   744k|    static const uint32_t SHUF_00BA alignas(16) [] = {0x03020100, 0x0b0a0908, 0xffffffff, 0xffffffff};
   44|   744k|    static const uint32_t SHUF_DC00 alignas(16) [] = {0xffffffff, 0xffffffff, 0x03020100, 0x0b0a0908};
   45|   744k|    uint32_t a, b, c, d, f, g, h, y0, y1, y2;
   46|   744k|    uint64_t tbl;
   47|   744k|    uint64_t inp_end, inp;
   48|   744k|    uint32_t xfer alignas(16) [4];
   49|       |
   50|   744k|    __asm__ __volatile__(
   51|   744k|        "shl    $0x6,%2;"
   52|   744k|        "je     Ldone_hash_%=;"
   53|   744k|        "add    %1,%2;"
   54|   744k|        "mov    %2,%14;"
   55|   744k|        "mov    (%0),%3;"
   56|   744k|        "mov    0x4(%0),%4;"
   57|   744k|        "mov    0x8(%0),%5;"
   58|   744k|        "mov    0xc(%0),%6;"
   59|   744k|        "mov    0x10(%0),%k2;"
   60|   744k|        "mov    0x14(%0),%7;"
   61|   744k|        "mov    0x18(%0),%8;"
   62|   744k|        "mov    0x1c(%0),%9;"
   63|   744k|        "movdqa %18,%%xmm12;"
   64|   744k|        "movdqa %19,%%xmm10;"
   65|   744k|        "movdqa %20,%%xmm11;"
   66|       |
   67|   744k|        "Lloop0_%=:"
   68|   744k|        "lea    %17,%13;"
   69|   744k|        "movdqu (%1),%%xmm4;"
   70|   744k|        "pshufb %%xmm12,%%xmm4;"
   71|   744k|        "movdqu 0x10(%1),%%xmm5;"
   72|   744k|        "pshufb %%xmm12,%%xmm5;"
   73|   744k|        "movdqu 0x20(%1),%%xmm6;"
   74|   744k|        "pshufb %%xmm12,%%xmm6;"
   75|   744k|        "movdqu 0x30(%1),%%xmm7;"
   76|   744k|        "pshufb %%xmm12,%%xmm7;"
   77|   744k|        "mov    %1,%15;"
   78|   744k|        "mov    $3,%1;"
   79|       |
   80|   744k|        "Lloop1_%=:"
   81|   744k|        "movdqa 0x0(%13),%%xmm9;"
   82|   744k|        "paddd  %%xmm4,%%xmm9;"
   83|   744k|        "movdqa %%xmm9,%16;"
   84|   744k|        "movdqa %%xmm7,%%xmm0;"
   85|   744k|        "mov    %k2,%10;"
   86|   744k|        "ror    $0xe,%10;"
   87|   744k|        "mov    %3,%11;"
   88|   744k|        "palignr $0x4,%%xmm6,%%xmm0;"
   89|   744k|        "ror    $0x9,%11;"
   90|   744k|        "xor    %k2,%10;"
   91|   744k|        "mov    %7,%12;"
   92|   744k|        "ror    $0x5,%10;"
   93|   744k|        "movdqa %%xmm5,%%xmm1;"
   94|   744k|        "xor    %3,%11;"
   95|   744k|        "xor    %8,%12;"
   96|   744k|        "paddd  %%xmm4,%%xmm0;"
   97|   744k|        "xor    %k2,%10;"
   98|   744k|        "and    %k2,%12;"
   99|   744k|        "ror    $0xb,%11;"
  100|   744k|        "palignr $0x4,%%xmm4,%%xmm1;"
  101|   744k|        "xor    %3,%11;"
  102|   744k|        "ror    $0x6,%10;"
  103|   744k|        "xor    %8,%12;"
  104|   744k|        "movdqa %%xmm1,%%xmm2;"
  105|   744k|        "ror    $0x2,%11;"
  106|   744k|        "add    %10,%12;"
  107|   744k|        "add    %16,%12;"
  108|   744k|        "movdqa %%xmm1,%%xmm3;"
  109|   744k|        "mov    %3,%10;"
  110|   744k|        "add    %12,%9;"
  111|   744k|        "mov    %3,%12;"
  112|   744k|        "pslld  $0x19,%%xmm1;"
  113|   744k|        "or     %5,%10;"
  114|   744k|        "add    %9,%6;"
  115|   744k|        "and    %5,%12;"
  116|   744k|        "psrld  $0x7,%%xmm2;"
  117|   744k|        "and    %4,%10;"
  118|   744k|        "add    %11,%9;"
  119|   744k|        "por    %%xmm2,%%xmm1;"
  120|   744k|        "or     %12,%10;"
  121|   744k|        "add    %10,%9;"
  122|   744k|        "movdqa %%xmm3,%%xmm2;"
  123|   744k|        "mov    %6,%10;"
  124|   744k|        "mov    %9,%11;"
  125|   744k|        "movdqa %%xmm3,%%xmm8;"
  126|   744k|        "ror    $0xe,%10;"
  127|   744k|        "xor    %6,%10;"
  128|   744k|        "mov    %k2,%12;"
  129|   744k|        "ror    $0x9,%11;"
  130|   744k|        "pslld  $0xe,%%xmm3;"
  131|   744k|        "xor    %9,%11;"
  132|   744k|        "ror    $0x5,%10;"
  133|   744k|        "xor    %7,%12;"
  134|   744k|        "psrld  $0x12,%%xmm2;"
  135|   744k|        "ror    $0xb,%11;"
  136|   744k|        "xor    %6,%10;"
  137|   744k|        "and    %6,%12;"
  138|   744k|        "ror    $0x6,%10;"
  139|   744k|        "pxor   %%xmm3,%%xmm1;"
  140|   744k|        "xor    %9,%11;"
  141|   744k|        "xor    %7,%12;"
  142|   744k|        "psrld  $0x3,%%xmm8;"
  143|   744k|        "add    %10,%12;"
  144|   744k|        "add    4+%16,%12;"
  145|   744k|        "ror    $0x2,%11;"
  146|   744k|        "pxor   %%xmm2,%%xmm1;"
  147|   744k|        "mov    %9,%10;"
  148|   744k|        "add    %12,%8;"
  149|   744k|        "mov    %9,%12;"
  150|   744k|        "pxor   %%xmm8,%%xmm1;"
  151|   744k|        "or     %4,%10;"
  152|   744k|        "add    %8,%5;"
  153|   744k|        "and    %4,%12;"
  154|   744k|        "pshufd $0xfa,%%xmm7,%%xmm2;"
  155|   744k|        "and    %3,%10;"
  156|   744k|        "add    %11,%8;"
  157|   744k|        "paddd  %%xmm1,%%xmm0;"
  158|   744k|        "or     %12,%10;"
  159|   744k|        "add    %10,%8;"
  160|   744k|        "movdqa %%xmm2,%%xmm3;"
  161|   744k|        "mov    %5,%10;"
  162|   744k|        "mov    %8,%11;"
  163|   744k|        "ror    $0xe,%10;"
  164|   744k|        "movdqa %%xmm2,%%xmm8;"
  165|   744k|        "xor    %5,%10;"
  166|   744k|        "ror    $0x9,%11;"
  167|   744k|        "mov    %6,%12;"
  168|   744k|        "xor    %8,%11;"
  169|   744k|        "ror    $0x5,%10;"
  170|   744k|        "psrlq  $0x11,%%xmm2;"
  171|   744k|        "xor    %k2,%12;"
  172|   744k|        "psrlq  $0x13,%%xmm3;"
  173|   744k|        "xor    %5,%10;"
  174|   744k|        "and    %5,%12;"
  175|   744k|        "psrld  $0xa,%%xmm8;"
  176|   744k|        "ror    $0xb,%11;"
  177|   744k|        "xor    %8,%11;"
  178|   744k|        "xor    %k2,%12;"
  179|   744k|        "ror    $0x6,%10;"
  180|   744k|        "pxor   %%xmm3,%%xmm2;"
  181|   744k|        "add    %10,%12;"
  182|   744k|        "ror    $0x2,%11;"
  183|   744k|        "add    8+%16,%12;"
  184|   744k|        "pxor   %%xmm2,%%xmm8;"
  185|   744k|        "mov    %8,%10;"
  186|   744k|        "add    %12,%7;"
  187|   744k|        "mov    %8,%12;"
  188|   744k|        "pshufb %%xmm10,%%xmm8;"
  189|   744k|        "or     %3,%10;"
  190|   744k|        "add    %7,%4;"
  191|   744k|        "and    %3,%12;"
  192|   744k|        "paddd  %%xmm8,%%xmm0;"
  193|   744k|        "and    %9,%10;"
  194|   744k|        "add    %11,%7;"
  195|   744k|        "pshufd $0x50,%%xmm0,%%xmm2;"
  196|   744k|        "or     %12,%10;"
  197|   744k|        "add    %10,%7;"
  198|   744k|        "movdqa %%xmm2,%%xmm3;"
  199|   744k|        "mov    %4,%10;"
  200|   744k|        "ror    $0xe,%10;"
  201|   744k|        "mov    %7,%11;"
  202|   744k|        "movdqa %%xmm2,%%xmm4;"
  203|   744k|        "ror    $0x9,%11;"
  204|   744k|        "xor    %4,%10;"
  205|   744k|        "mov    %5,%12;"
  206|   744k|        "ror    $0x5,%10;"
  207|   744k|        "psrlq  $0x11,%%xmm2;"
  208|   744k|        "xor    %7,%11;"
  209|   744k|        "xor    %6,%12;"
  210|   744k|        "psrlq  $0x13,%%xmm3;"
  211|   744k|        "xor    %4,%10;"
  212|   744k|        "and    %4,%12;"
  213|   744k|        "ror    $0xb,%11;"
  214|   744k|        "psrld  $0xa,%%xmm4;"
  215|   744k|        "xor    %7,%11;"
  216|   744k|        "ror    $0x6,%10;"
  217|   744k|        "xor    %6,%12;"
  218|   744k|        "pxor   %%xmm3,%%xmm2;"
  219|   744k|        "ror    $0x2,%11;"
  220|   744k|        "add    %10,%12;"
  221|   744k|        "add    12+%16,%12;"
  222|   744k|        "pxor   %%xmm2,%%xmm4;"
  223|   744k|        "mov    %7,%10;"
  224|   744k|        "add    %12,%k2;"
  225|   744k|        "mov    %7,%12;"
  226|   744k|        "pshufb %%xmm11,%%xmm4;"
  227|   744k|        "or     %9,%10;"
  228|   744k|        "add    %k2,%3;"
  229|   744k|        "and    %9,%12;"
  230|   744k|        "paddd  %%xmm0,%%xmm4;"
  231|   744k|        "and    %8,%10;"
  232|   744k|        "add    %11,%k2;"
  233|   744k|        "or     %12,%10;"
  234|   744k|        "add    %10,%k2;"
  235|   744k|        "movdqa 0x10(%13),%%xmm9;"
  236|   744k|        "paddd  %%xmm5,%%xmm9;"
  237|   744k|        "movdqa %%xmm9,%16;"
  238|   744k|        "movdqa %%xmm4,%%xmm0;"
  239|   744k|        "mov    %3,%10;"
  240|   744k|        "ror    $0xe,%10;"
  241|   744k|        "mov    %k2,%11;"
  242|   744k|        "palignr $0x4,%%xmm7,%%xmm0;"
  243|   744k|        "ror    $0x9,%11;"
  244|   744k|        "xor    %3,%10;"
  245|   744k|        "mov    %4,%12;"
  246|   744k|        "ror    $0x5,%10;"
  247|   744k|        "movdqa %%xmm6,%%xmm1;"
  248|   744k|        "xor    %k2,%11;"
  249|   744k|        "xor    %5,%12;"
  250|   744k|        "paddd  %%xmm5,%%xmm0;"
  251|   744k|        "xor    %3,%10;"
  252|   744k|        "and    %3,%12;"
  253|   744k|        "ror    $0xb,%11;"
  254|   744k|        "palignr $0x4,%%xmm5,%%xmm1;"
  255|   744k|        "xor    %k2,%11;"
  256|   744k|        "ror    $0x6,%10;"
  257|   744k|        "xor    %5,%12;"
  258|   744k|        "movdqa %%xmm1,%%xmm2;"
  259|   744k|        "ror    $0x2,%11;"
  260|   744k|        "add    %10,%12;"
  261|   744k|        "add    %16,%12;"
  262|   744k|        "movdqa %%xmm1,%%xmm3;"
  263|   744k|        "mov    %k2,%10;"
  264|   744k|        "add    %12,%6;"
  265|   744k|        "mov    %k2,%12;"
  266|   744k|        "pslld  $0x19,%%xmm1;"
  267|   744k|        "or     %8,%10;"
  268|   744k|        "add    %6,%9;"
  269|   744k|        "and    %8,%12;"
  270|   744k|        "psrld  $0x7,%%xmm2;"
  271|   744k|        "and    %7,%10;"
  272|   744k|        "add    %11,%6;"
  273|   744k|        "por    %%xmm2,%%xmm1;"
  274|   744k|        "or     %12,%10;"
  275|   744k|        "add    %10,%6;"
  276|   744k|        "movdqa %%xmm3,%%xmm2;"
  277|   744k|        "mov    %9,%10;"
  278|   744k|        "mov    %6,%11;"
  279|   744k|        "movdqa %%xmm3,%%xmm8;"
  280|   744k|        "ror    $0xe,%10;"
  281|   744k|        "xor    %9,%10;"
  282|   744k|        "mov    %3,%12;"
  283|   744k|        "ror    $0x9,%11;"
  284|   744k|        "pslld  $0xe,%%xmm3;"
  285|   744k|        "xor    %6,%11;"
  286|   744k|        "ror    $0x5,%10;"
  287|   744k|        "xor    %4,%12;"
  288|   744k|        "psrld  $0x12,%%xmm2;"
  289|   744k|        "ror    $0xb,%11;"
  290|   744k|        "xor    %9,%10;"
  291|   744k|        "and    %9,%12;"
  292|   744k|        "ror    $0x6,%10;"
  293|   744k|        "pxor   %%xmm3,%%xmm1;"
  294|   744k|        "xor    %6,%11;"
  295|   744k|        "xor    %4,%12;"
  296|   744k|        "psrld  $0x3,%%xmm8;"
  297|   744k|        "add    %10,%12;"
  298|   744k|        "add    4+%16,%12;"
  299|   744k|        "ror    $0x2,%11;"
  300|   744k|        "pxor   %%xmm2,%%xmm1;"
  301|   744k|        "mov    %6,%10;"
  302|   744k|        "add    %12,%5;"
  303|   744k|        "mov    %6,%12;"
  304|   744k|        "pxor   %%xmm8,%%xmm1;"
  305|   744k|        "or     %7,%10;"
  306|   744k|        "add    %5,%8;"
  307|   744k|        "and    %7,%12;"
  308|   744k|        "pshufd $0xfa,%%xmm4,%%xmm2;"
  309|   744k|        "and    %k2,%10;"
  310|   744k|        "add    %11,%5;"
  311|   744k|        "paddd  %%xmm1,%%xmm0;"
  312|   744k|        "or     %12,%10;"
  313|   744k|        "add    %10,%5;"
  314|   744k|        "movdqa %%xmm2,%%xmm3;"
  315|   744k|        "mov    %8,%10;"
  316|   744k|        "mov    %5,%11;"
  317|   744k|        "ror    $0xe,%10;"
  318|   744k|        "movdqa %%xmm2,%%xmm8;"
  319|   744k|        "xor    %8,%10;"
  320|   744k|        "ror    $0x9,%11;"
  321|   744k|        "mov    %9,%12;"
  322|   744k|        "xor    %5,%11;"
  323|   744k|        "ror    $0x5,%10;"
  324|   744k|        "psrlq  $0x11,%%xmm2;"
  325|   744k|        "xor    %3,%12;"
  326|   744k|        "psrlq  $0x13,%%xmm3;"
  327|   744k|        "xor    %8,%10;"
  328|   744k|        "and    %8,%12;"
  329|   744k|        "psrld  $0xa,%%xmm8;"
  330|   744k|        "ror    $0xb,%11;"
  331|   744k|        "xor    %5,%11;"
  332|   744k|        "xor    %3,%12;"
  333|   744k|        "ror    $0x6,%10;"
  334|   744k|        "pxor   %%xmm3,%%xmm2;"
  335|   744k|        "add    %10,%12;"
  336|   744k|        "ror    $0x2,%11;"
  337|   744k|        "add    8+%16,%12;"
  338|   744k|        "pxor   %%xmm2,%%xmm8;"
  339|   744k|        "mov    %5,%10;"
  340|   744k|        "add    %12,%4;"
  341|   744k|        "mov    %5,%12;"
  342|   744k|        "pshufb %%xmm10,%%xmm8;"
  343|   744k|        "or     %k2,%10;"
  344|   744k|        "add    %4,%7;"
  345|   744k|        "and    %k2,%12;"
  346|   744k|        "paddd  %%xmm8,%%xmm0;"
  347|   744k|        "and    %6,%10;"
  348|   744k|        "add    %11,%4;"
  349|   744k|        "pshufd $0x50,%%xmm0,%%xmm2;"
  350|   744k|        "or     %12,%10;"
  351|   744k|        "add    %10,%4;"
  352|   744k|        "movdqa %%xmm2,%%xmm3;"
  353|   744k|        "mov    %7,%10;"
  354|   744k|        "ror    $0xe,%10;"
  355|   744k|        "mov    %4,%11;"
  356|   744k|        "movdqa %%xmm2,%%xmm5;"
  357|   744k|        "ror    $0x9,%11;"
  358|   744k|        "xor    %7,%10;"
  359|   744k|        "mov    %8,%12;"
  360|   744k|        "ror    $0x5,%10;"
  361|   744k|        "psrlq  $0x11,%%xmm2;"
  362|   744k|        "xor    %4,%11;"
  363|   744k|        "xor    %9,%12;"
  364|   744k|        "psrlq  $0x13,%%xmm3;"
  365|   744k|        "xor    %7,%10;"
  366|   744k|        "and    %7,%12;"
  367|   744k|        "ror    $0xb,%11;"
  368|   744k|        "psrld  $0xa,%%xmm5;"
  369|   744k|        "xor    %4,%11;"
  370|   744k|        "ror    $0x6,%10;"
  371|   744k|        "xor    %9,%12;"
  372|   744k|        "pxor   %%xmm3,%%xmm2;"
  373|   744k|        "ror    $0x2,%11;"
  374|   744k|        "add    %10,%12;"
  375|   744k|        "add    12+%16,%12;"
  376|   744k|        "pxor   %%xmm2,%%xmm5;"
  377|   744k|        "mov    %4,%10;"
  378|   744k|        "add    %12,%3;"
  379|   744k|        "mov    %4,%12;"
  380|   744k|        "pshufb %%xmm11,%%xmm5;"
  381|   744k|        "or     %6,%10;"
  382|   744k|        "add    %3,%k2;"
  383|   744k|        "and    %6,%12;"
  384|   744k|        "paddd  %%xmm0,%%xmm5;"
  385|   744k|        "and    %5,%10;"
  386|   744k|        "add    %11,%3;"
  387|   744k|        "or     %12,%10;"
  388|   744k|        "add    %10,%3;"
  389|   744k|        "movdqa 0x20(%13),%%xmm9;"
  390|   744k|        "paddd  %%xmm6,%%xmm9;"
  391|   744k|        "movdqa %%xmm9,%16;"
  392|   744k|        "movdqa %%xmm5,%%xmm0;"
  393|   744k|        "mov    %k2,%10;"
  394|   744k|        "ror    $0xe,%10;"
  395|   744k|        "mov    %3,%11;"
  396|   744k|        "palignr $0x4,%%xmm4,%%xmm0;"
  397|   744k|        "ror    $0x9,%11;"
  398|   744k|        "xor    %k2,%10;"
  399|   744k|        "mov    %7,%12;"
  400|   744k|        "ror    $0x5,%10;"
  401|   744k|        "movdqa %%xmm7,%%xmm1;"
  402|   744k|        "xor    %3,%11;"
  403|   744k|        "xor    %8,%12;"
  404|   744k|        "paddd  %%xmm6,%%xmm0;"
  405|   744k|        "xor    %k2,%10;"
  406|   744k|        "and    %k2,%12;"
  407|   744k|        "ror    $0xb,%11;"
  408|   744k|        "palignr $0x4,%%xmm6,%%xmm1;"
  409|   744k|        "xor    %3,%11;"
  410|   744k|        "ror    $0x6,%10;"
  411|   744k|        "xor    %8,%12;"
  412|   744k|        "movdqa %%xmm1,%%xmm2;"
  413|   744k|        "ror    $0x2,%11;"
  414|   744k|        "add    %10,%12;"
  415|   744k|        "add    %16,%12;"
  416|   744k|        "movdqa %%xmm1,%%xmm3;"
  417|   744k|        "mov    %3,%10;"
  418|   744k|        "add    %12,%9;"
  419|   744k|        "mov    %3,%12;"
  420|   744k|        "pslld  $0x19,%%xmm1;"
  421|   744k|        "or     %5,%10;"
  422|   744k|        "add    %9,%6;"
  423|   744k|        "and    %5,%12;"
  424|   744k|        "psrld  $0x7,%%xmm2;"
  425|   744k|        "and    %4,%10;"
  426|   744k|        "add    %11,%9;"
  427|   744k|        "por    %%xmm2,%%xmm1;"
  428|   744k|        "or     %12,%10;"
  429|   744k|        "add    %10,%9;"
  430|   744k|        "movdqa %%xmm3,%%xmm2;"
  431|   744k|        "mov    %6,%10;"
  432|   744k|        "mov    %9,%11;"
  433|   744k|        "movdqa %%xmm3,%%xmm8;"
  434|   744k|        "ror    $0xe,%10;"
  435|   744k|        "xor    %6,%10;"
  436|   744k|        "mov    %k2,%12;"
  437|   744k|        "ror    $0x9,%11;"
  438|   744k|        "pslld  $0xe,%%xmm3;"
  439|   744k|        "xor    %9,%11;"
  440|   744k|        "ror    $0x5,%10;"
  441|   744k|        "xor    %7,%12;"
  442|   744k|        "psrld  $0x12,%%xmm2;"
  443|   744k|        "ror    $0xb,%11;"
  444|   744k|        "xor    %6,%10;"
  445|   744k|        "and    %6,%12;"
  446|   744k|        "ror    $0x6,%10;"
  447|   744k|        "pxor   %%xmm3,%%xmm1;"
  448|   744k|        "xor    %9,%11;"
  449|   744k|        "xor    %7,%12;"
  450|   744k|        "psrld  $0x3,%%xmm8;"
  451|   744k|        "add    %10,%12;"
  452|   744k|        "add    4+%16,%12;"
  453|   744k|        "ror    $0x2,%11;"
  454|   744k|        "pxor   %%xmm2,%%xmm1;"
  455|   744k|        "mov    %9,%10;"
  456|   744k|        "add    %12,%8;"
  457|   744k|        "mov    %9,%12;"
  458|   744k|        "pxor   %%xmm8,%%xmm1;"
  459|   744k|        "or     %4,%10;"
  460|   744k|        "add    %8,%5;"
  461|   744k|        "and    %4,%12;"
  462|   744k|        "pshufd $0xfa,%%xmm5,%%xmm2;"
  463|   744k|        "and    %3,%10;"
  464|   744k|        "add    %11,%8;"
  465|   744k|        "paddd  %%xmm1,%%xmm0;"
  466|   744k|        "or     %12,%10;"
  467|   744k|        "add    %10,%8;"
  468|   744k|        "movdqa %%xmm2,%%xmm3;"
  469|   744k|        "mov    %5,%10;"
  470|   744k|        "mov    %8,%11;"
  471|   744k|        "ror    $0xe,%10;"
  472|   744k|        "movdqa %%xmm2,%%xmm8;"
  473|   744k|        "xor    %5,%10;"
  474|   744k|        "ror    $0x9,%11;"
  475|   744k|        "mov    %6,%12;"
  476|   744k|        "xor    %8,%11;"
  477|   744k|        "ror    $0x5,%10;"
  478|   744k|        "psrlq  $0x11,%%xmm2;"
  479|   744k|        "xor    %k2,%12;"
  480|   744k|        "psrlq  $0x13,%%xmm3;"
  481|   744k|        "xor    %5,%10;"
  482|   744k|        "and    %5,%12;"
  483|   744k|        "psrld  $0xa,%%xmm8;"
  484|   744k|        "ror    $0xb,%11;"
  485|   744k|        "xor    %8,%11;"
  486|   744k|        "xor    %k2,%12;"
  487|   744k|        "ror    $0x6,%10;"
  488|   744k|        "pxor   %%xmm3,%%xmm2;"
  489|   744k|        "add    %10,%12;"
  490|   744k|        "ror    $0x2,%11;"
  491|   744k|        "add    8+%16,%12;"
  492|   744k|        "pxor   %%xmm2,%%xmm8;"
  493|   744k|        "mov    %8,%10;"
  494|   744k|        "add    %12,%7;"
  495|   744k|        "mov    %8,%12;"
  496|   744k|        "pshufb %%xmm10,%%xmm8;"
  497|   744k|        "or     %3,%10;"
  498|   744k|        "add    %7,%4;"
  499|   744k|        "and    %3,%12;"
  500|   744k|        "paddd  %%xmm8,%%xmm0;"
  501|   744k|        "and    %9,%10;"
  502|   744k|        "add    %11,%7;"
  503|   744k|        "pshufd $0x50,%%xmm0,%%xmm2;"
  504|   744k|        "or     %12,%10;"
  505|   744k|        "add    %10,%7;"
  506|   744k|        "movdqa %%xmm2,%%xmm3;"
  507|   744k|        "mov    %4,%10;"
  508|   744k|        "ror    $0xe,%10;"
  509|   744k|        "mov    %7,%11;"
  510|   744k|        "movdqa %%xmm2,%%xmm6;"
  511|   744k|        "ror    $0x9,%11;"
  512|   744k|        "xor    %4,%10;"
  513|   744k|        "mov    %5,%12;"
  514|   744k|        "ror    $0x5,%10;"
  515|   744k|        "psrlq  $0x11,%%xmm2;"
  516|   744k|        "xor    %7,%11;"
  517|   744k|        "xor    %6,%12;"
  518|   744k|        "psrlq  $0x13,%%xmm3;"
  519|   744k|        "xor    %4,%10;"
  520|   744k|        "and    %4,%12;"
  521|   744k|        "ror    $0xb,%11;"
  522|   744k|        "psrld  $0xa,%%xmm6;"
  523|   744k|        "xor    %7,%11;"
  524|   744k|        "ror    $0x6,%10;"
  525|   744k|        "xor    %6,%12;"
  526|   744k|        "pxor   %%xmm3,%%xmm2;"
  527|   744k|        "ror    $0x2,%11;"
  528|   744k|        "add    %10,%12;"
  529|   744k|        "add    12+%16,%12;"
  530|   744k|        "pxor   %%xmm2,%%xmm6;"
  531|   744k|        "mov    %7,%10;"
  532|   744k|        "add    %12,%k2;"
  533|   744k|        "mov    %7,%12;"
  534|   744k|        "pshufb %%xmm11,%%xmm6;"
  535|   744k|        "or     %9,%10;"
  536|   744k|        "add    %k2,%3;"
  537|   744k|        "and    %9,%12;"
  538|   744k|        "paddd  %%xmm0,%%xmm6;"
  539|   744k|        "and    %8,%10;"
  540|   744k|        "add    %11,%k2;"
  541|   744k|        "or     %12,%10;"
  542|   744k|        "add    %10,%k2;"
  543|   744k|        "movdqa 0x30(%13),%%xmm9;"
  544|   744k|        "paddd  %%xmm7,%%xmm9;"
  545|   744k|        "movdqa %%xmm9,%16;"
  546|   744k|        "add    $0x40,%13;"
  547|   744k|        "movdqa %%xmm6,%%xmm0;"
  548|   744k|        "mov    %3,%10;"
  549|   744k|        "ror    $0xe,%10;"
  550|   744k|        "mov    %k2,%11;"
  551|   744k|        "palignr $0x4,%%xmm5,%%xmm0;"
  552|   744k|        "ror    $0x9,%11;"
  553|   744k|        "xor    %3,%10;"
  554|   744k|        "mov    %4,%12;"
  555|   744k|        "ror    $0x5,%10;"
  556|   744k|        "movdqa %%xmm4,%%xmm1;"
  557|   744k|        "xor    %k2,%11;"
  558|   744k|        "xor    %5,%12;"
  559|   744k|        "paddd  %%xmm7,%%xmm0;"
  560|   744k|        "xor    %3,%10;"
  561|   744k|        "and    %3,%12;"
  562|   744k|        "ror    $0xb,%11;"
  563|   744k|        "palignr $0x4,%%xmm7,%%xmm1;"
  564|   744k|        "xor    %k2,%11;"
  565|   744k|        "ror    $0x6,%10;"
  566|   744k|        "xor    %5,%12;"
  567|   744k|        "movdqa %%xmm1,%%xmm2;"
  568|   744k|        "ror    $0x2,%11;"
  569|   744k|        "add    %10,%12;"
  570|   744k|        "add    %16,%12;"
  571|   744k|        "movdqa %%xmm1,%%xmm3;"
  572|   744k|        "mov    %k2,%10;"
  573|   744k|        "add    %12,%6;"
  574|   744k|        "mov    %k2,%12;"
  575|   744k|        "pslld  $0x19,%%xmm1;"
  576|   744k|        "or     %8,%10;"
  577|   744k|        "add    %6,%9;"
  578|   744k|        "and    %8,%12;"
  579|   744k|        "psrld  $0x7,%%xmm2;"
  580|   744k|        "and    %7,%10;"
  581|   744k|        "add    %11,%6;"
  582|   744k|        "por    %%xmm2,%%xmm1;"
  583|   744k|        "or     %12,%10;"
  584|   744k|        "add    %10,%6;"
  585|   744k|        "movdqa %%xmm3,%%xmm2;"
  586|   744k|        "mov    %9,%10;"
  587|   744k|        "mov    %6,%11;"
  588|   744k|        "movdqa %%xmm3,%%xmm8;"
  589|   744k|        "ror    $0xe,%10;"
  590|   744k|        "xor    %9,%10;"
  591|   744k|        "mov    %3,%12;"
  592|   744k|        "ror    $0x9,%11;"
  593|   744k|        "pslld  $0xe,%%xmm3;"
  594|   744k|        "xor    %6,%11;"
  595|   744k|        "ror    $0x5,%10;"
  596|   744k|        "xor    %4,%12;"
  597|   744k|        "psrld  $0x12,%%xmm2;"
  598|   744k|        "ror    $0xb,%11;"
  599|   744k|        "xor    %9,%10;"
  600|   744k|        "and    %9,%12;"
  601|   744k|        "ror    $0x6,%10;"
  602|   744k|        "pxor   %%xmm3,%%xmm1;"
  603|   744k|        "xor    %6,%11;"
  604|   744k|        "xor    %4,%12;"
  605|   744k|        "psrld  $0x3,%%xmm8;"
  606|   744k|        "add    %10,%12;"
  607|   744k|        "add    4+%16,%12;"
  608|   744k|        "ror    $0x2,%11;"
  609|   744k|        "pxor   %%xmm2,%%xmm1;"
  610|   744k|        "mov    %6,%10;"
  611|   744k|        "add    %12,%5;"
  612|   744k|        "mov    %6,%12;"
  613|   744k|        "pxor   %%xmm8,%%xmm1;"
  614|   744k|        "or     %7,%10;"
  615|   744k|        "add    %5,%8;"
  616|   744k|        "and    %7,%12;"
  617|   744k|        "pshufd $0xfa,%%xmm6,%%xmm2;"
  618|   744k|        "and    %k2,%10;"
  619|   744k|        "add    %11,%5;"
  620|   744k|        "paddd  %%xmm1,%%xmm0;"
  621|   744k|        "or     %12,%10;"
  622|   744k|        "add    %10,%5;"
  623|   744k|        "movdqa %%xmm2,%%xmm3;"
  624|   744k|        "mov    %8,%10;"
  625|   744k|        "mov    %5,%11;"
  626|   744k|        "ror    $0xe,%10;"
  627|   744k|        "movdqa %%xmm2,%%xmm8;"
  628|   744k|        "xor    %8,%10;"
  629|   744k|        "ror    $0x9,%11;"
  630|   744k|        "mov    %9,%12;"
  631|   744k|        "xor    %5,%11;"
  632|   744k|        "ror    $0x5,%10;"
  633|   744k|        "psrlq  $0x11,%%xmm2;"
  634|   744k|        "xor    %3,%12;"
  635|   744k|        "psrlq  $0x13,%%xmm3;"
  636|   744k|        "xor    %8,%10;"
  637|   744k|        "and    %8,%12;"
  638|   744k|        "psrld  $0xa,%%xmm8;"
  639|   744k|        "ror    $0xb,%11;"
  640|   744k|        "xor    %5,%11;"
  641|   744k|        "xor    %3,%12;"
  642|   744k|        "ror    $0x6,%10;"
  643|   744k|        "pxor   %%xmm3,%%xmm2;"
  644|   744k|        "add    %10,%12;"
  645|   744k|        "ror    $0x2,%11;"
  646|   744k|        "add    8+%16,%12;"
  647|   744k|        "pxor   %%xmm2,%%xmm8;"
  648|   744k|        "mov    %5,%10;"
  649|   744k|        "add    %12,%4;"
  650|   744k|        "mov    %5,%12;"
  651|   744k|        "pshufb %%xmm10,%%xmm8;"
  652|   744k|        "or     %k2,%10;"
  653|   744k|        "add    %4,%7;"
  654|   744k|        "and    %k2,%12;"
  655|   744k|        "paddd  %%xmm8,%%xmm0;"
  656|   744k|        "and    %6,%10;"
  657|   744k|        "add    %11,%4;"
  658|   744k|        "pshufd $0x50,%%xmm0,%%xmm2;"
  659|   744k|        "or     %12,%10;"
  660|   744k|        "add    %10,%4;"
  661|   744k|        "movdqa %%xmm2,%%xmm3;"
  662|   744k|        "mov    %7,%10;"
  663|   744k|        "ror    $0xe,%10;"
  664|   744k|        "mov    %4,%11;"
  665|   744k|        "movdqa %%xmm2,%%xmm7;"
  666|   744k|        "ror    $0x9,%11;"
  667|   744k|        "xor    %7,%10;"
  668|   744k|        "mov    %8,%12;"
  669|   744k|        "ror    $0x5,%10;"
  670|   744k|        "psrlq  $0x11,%%xmm2;"
  671|   744k|        "xor    %4,%11;"
  672|   744k|        "xor    %9,%12;"
  673|   744k|        "psrlq  $0x13,%%xmm3;"
  674|   744k|        "xor    %7,%10;"
  675|   744k|        "and    %7,%12;"
  676|   744k|        "ror    $0xb,%11;"
  677|   744k|        "psrld  $0xa,%%xmm7;"
  678|   744k|        "xor    %4,%11;"
  679|   744k|        "ror    $0x6,%10;"
  680|   744k|        "xor    %9,%12;"
  681|   744k|        "pxor   %%xmm3,%%xmm2;"
  682|   744k|        "ror    $0x2,%11;"
  683|   744k|        "add    %10,%12;"
  684|   744k|        "add    12+%16,%12;"
  685|   744k|        "pxor   %%xmm2,%%xmm7;"
  686|   744k|        "mov    %4,%10;"
  687|   744k|        "add    %12,%3;"
  688|   744k|        "mov    %4,%12;"
  689|   744k|        "pshufb %%xmm11,%%xmm7;"
  690|   744k|        "or     %6,%10;"
  691|   744k|        "add    %3,%k2;"
  692|   744k|        "and    %6,%12;"
  693|   744k|        "paddd  %%xmm0,%%xmm7;"
  694|   744k|        "and    %5,%10;"
  695|   744k|        "add    %11,%3;"
  696|   744k|        "or     %12,%10;"
  697|   744k|        "add    %10,%3;"
  698|   744k|        "sub    $0x1,%1;"
  699|   744k|        "jne    Lloop1_%=;"
  700|   744k|        "mov    $0x2,%1;"
  701|       |
  702|   744k|        "Lloop2_%=:"
  703|   744k|        "paddd  0x0(%13),%%xmm4;"
  704|   744k|        "movdqa %%xmm4,%16;"
  705|   744k|        "mov    %k2,%10;"
  706|   744k|        "ror    $0xe,%10;"
  707|   744k|        "mov    %3,%11;"
  708|   744k|        "xor    %k2,%10;"
  709|   744k|        "ror    $0x9,%11;"
  710|   744k|        "mov    %7,%12;"
  711|   744k|        "xor    %3,%11;"
  712|   744k|        "ror    $0x5,%10;"
  713|   744k|        "xor    %8,%12;"
  714|   744k|        "xor    %k2,%10;"
  715|   744k|        "ror    $0xb,%11;"
  716|   744k|        "and    %k2,%12;"
  717|   744k|        "xor    %3,%11;"
  718|   744k|        "ror    $0x6,%10;"
  719|   744k|        "xor    %8,%12;"
  720|   744k|        "add    %10,%12;"
  721|   744k|        "ror    $0x2,%11;"
  722|   744k|        "add    %16,%12;"
  723|   744k|        "mov    %3,%10;"
  724|   744k|        "add    %12,%9;"
  725|   744k|        "mov    %3,%12;"
  726|   744k|        "or     %5,%10;"
  727|   744k|        "add    %9,%6;"
  728|   744k|        "and    %5,%12;"
  729|   744k|        "and    %4,%10;"
  730|   744k|        "add    %11,%9;"
  731|   744k|        "or     %12,%10;"
  732|   744k|        "add    %10,%9;"
  733|   744k|        "mov    %6,%10;"
  734|   744k|        "ror    $0xe,%10;"
  735|   744k|        "mov    %9,%11;"
  736|   744k|        "xor    %6,%10;"
  737|   744k|        "ror    $0x9,%11;"
  738|   744k|        "mov    %k2,%12;"
  739|   744k|        "xor    %9,%11;"
  740|   744k|        "ror    $0x5,%10;"
  741|   744k|        "xor    %7,%12;"
  742|   744k|        "xor    %6,%10;"
  743|   744k|        "ror    $0xb,%11;"
  744|   744k|        "and    %6,%12;"
  745|   744k|        "xor    %9,%11;"
  746|   744k|        "ror    $0x6,%10;"
  747|   744k|        "xor    %7,%12;"
  748|   744k|        "add    %10,%12;"
  749|   744k|        "ror    $0x2,%11;"
  750|   744k|        "add    4+%16,%12;"
  751|   744k|        "mov    %9,%10;"
  752|   744k|        "add    %12,%8;"
  753|   744k|        "mov    %9,%12;"
  754|   744k|        "or     %4,%10;"
  755|   744k|        "add    %8,%5;"
  756|   744k|        "and    %4,%12;"
  757|   744k|        "and    %3,%10;"
  758|   744k|        "add    %11,%8;"
  759|   744k|        "or     %12,%10;"
  760|   744k|        "add    %10,%8;"
  761|   744k|        "mov    %5,%10;"
  762|   744k|        "ror    $0xe,%10;"
  763|   744k|        "mov    %8,%11;"
  764|   744k|        "xor    %5,%10;"
  765|   744k|        "ror    $0x9,%11;"
  766|   744k|        "mov    %6,%12;"
  767|   744k|        "xor    %8,%11;"
  768|   744k|        "ror    $0x5,%10;"
  769|   744k|        "xor    %k2,%12;"
  770|   744k|        "xor    %5,%10;"
  771|   744k|        "ror    $0xb,%11;"
  772|   744k|        "and    %5,%12;"
  773|   744k|        "xor    %8,%11;"
  774|   744k|        "ror    $0x6,%10;"
  775|   744k|        "xor    %k2,%12;"
  776|   744k|        "add    %10,%12;"
  777|   744k|        "ror    $0x2,%11;"
  778|   744k|        "add    8+%16,%12;"
  779|   744k|        "mov    %8,%10;"
  780|   744k|        "add    %12,%7;"
  781|   744k|        "mov    %8,%12;"
  782|   744k|        "or     %3,%10;"
  783|   744k|        "add    %7,%4;"
  784|   744k|        "and    %3,%12;"
  785|   744k|        "and    %9,%10;"
  786|   744k|        "add    %11,%7;"
  787|   744k|        "or     %12,%10;"
  788|   744k|        "add    %10,%7;"
  789|   744k|        "mov    %4,%10;"
  790|   744k|        "ror    $0xe,%10;"
  791|   744k|        "mov    %7,%11;"
  792|   744k|        "xor    %4,%10;"
  793|   744k|        "ror    $0x9,%11;"
  794|   744k|        "mov    %5,%12;"
  795|   744k|        "xor    %7,%11;"
  796|   744k|        "ror    $0x5,%10;"
  797|   744k|        "xor    %6,%12;"
  798|   744k|        "xor    %4,%10;"
  799|   744k|        "ror    $0xb,%11;"
  800|   744k|        "and    %4,%12;"
  801|   744k|        "xor    %7,%11;"
  802|   744k|        "ror    $0x6,%10;"
  803|   744k|        "xor    %6,%12;"
  804|   744k|        "add    %10,%12;"
  805|   744k|        "ror    $0x2,%11;"
  806|   744k|        "add    12+%16,%12;"
  807|   744k|        "mov    %7,%10;"
  808|   744k|        "add    %12,%k2;"
  809|   744k|        "mov    %7,%12;"
  810|   744k|        "or     %9,%10;"
  811|   744k|        "add    %k2,%3;"
  812|   744k|        "and    %9,%12;"
  813|   744k|        "and    %8,%10;"
  814|   744k|        "add    %11,%k2;"
  815|   744k|        "or     %12,%10;"
  816|   744k|        "add    %10,%k2;"
  817|   744k|        "paddd  0x10(%13),%%xmm5;"
  818|   744k|        "movdqa %%xmm5,%16;"
  819|   744k|        "add    $0x20,%13;"
  820|   744k|        "mov    %3,%10;"
  821|   744k|        "ror    $0xe,%10;"
  822|   744k|        "mov    %k2,%11;"
  823|   744k|        "xor    %3,%10;"
  824|   744k|        "ror    $0x9,%11;"
  825|   744k|        "mov    %4,%12;"
  826|   744k|        "xor    %k2,%11;"
  827|   744k|        "ror    $0x5,%10;"
  828|   744k|        "xor    %5,%12;"
  829|   744k|        "xor    %3,%10;"
  830|   744k|        "ror    $0xb,%11;"
  831|   744k|        "and    %3,%12;"
  832|   744k|        "xor    %k2,%11;"
  833|   744k|        "ror    $0x6,%10;"
  834|   744k|        "xor    %5,%12;"
  835|   744k|        "add    %10,%12;"
  836|   744k|        "ror    $0x2,%11;"
  837|   744k|        "add    %16,%12;"
  838|   744k|        "mov    %k2,%10;"
  839|   744k|        "add    %12,%6;"
  840|   744k|        "mov    %k2,%12;"
  841|   744k|        "or     %8,%10;"
  842|   744k|        "add    %6,%9;"
  843|   744k|        "and    %8,%12;"
  844|   744k|        "and    %7,%10;"
  845|   744k|        "add    %11,%6;"
  846|   744k|        "or     %12,%10;"
  847|   744k|        "add    %10,%6;"
  848|   744k|        "mov    %9,%10;"
  849|   744k|        "ror    $0xe,%10;"
  850|   744k|        "mov    %6,%11;"
  851|   744k|        "xor    %9,%10;"
  852|   744k|        "ror    $0x9,%11;"
  853|   744k|        "mov    %3,%12;"
  854|   744k|        "xor    %6,%11;"
  855|   744k|        "ror    $0x5,%10;"
  856|   744k|        "xor    %4,%12;"
  857|   744k|        "xor    %9,%10;"
  858|   744k|        "ror    $0xb,%11;"
  859|   744k|        "and    %9,%12;"
  860|   744k|        "xor    %6,%11;"
  861|   744k|        "ror    $0x6,%10;"
  862|   744k|        "xor    %4,%12;"
  863|   744k|        "add    %10,%12;"
  864|   744k|        "ror    $0x2,%11;"
  865|   744k|        "add    4+%16,%12;"
  866|   744k|        "mov    %6,%10;"
  867|   744k|        "add    %12,%5;"
  868|   744k|        "mov    %6,%12;"
  869|   744k|        "or     %7,%10;"
  870|   744k|        "add    %5,%8;"
  871|   744k|        "and    %7,%12;"
  872|   744k|        "and    %k2,%10;"
  873|   744k|        "add    %11,%5;"
  874|   744k|        "or     %12,%10;"
  875|   744k|        "add    %10,%5;"
  876|   744k|        "mov    %8,%10;"
  877|   744k|        "ror    $0xe,%10;"
  878|   744k|        "mov    %5,%11;"
  879|   744k|        "xor    %8,%10;"
  880|   744k|        "ror    $0x9,%11;"
  881|   744k|        "mov    %9,%12;"
  882|   744k|        "xor    %5,%11;"
  883|   744k|        "ror    $0x5,%10;"
  884|   744k|        "xor    %3,%12;"
  885|   744k|        "xor    %8,%10;"
  886|   744k|        "ror    $0xb,%11;"
  887|   744k|        "and    %8,%12;"
  888|   744k|        "xor    %5,%11;"
  889|   744k|        "ror    $0x6,%10;"
  890|   744k|        "xor    %3,%12;"
  891|   744k|        "add    %10,%12;"
  892|   744k|        "ror    $0x2,%11;"
  893|   744k|        "add    8+%16,%12;"
  894|   744k|        "mov    %5,%10;"
  895|   744k|        "add    %12,%4;"
  896|   744k|        "mov    %5,%12;"
  897|   744k|        "or     %k2,%10;"
  898|   744k|        "add    %4,%7;"
  899|   744k|        "and    %k2,%12;"
  900|   744k|        "and    %6,%10;"
  901|   744k|        "add    %11,%4;"
  902|   744k|        "or     %12,%10;"
  903|   744k|        "add    %10,%4;"
  904|   744k|        "mov    %7,%10;"
  905|   744k|        "ror    $0xe,%10;"
  906|   744k|        "mov    %4,%11;"
  907|   744k|        "xor    %7,%10;"
  908|   744k|        "ror    $0x9,%11;"
  909|   744k|        "mov    %8,%12;"
  910|   744k|        "xor    %4,%11;"
  911|   744k|        "ror    $0x5,%10;"
  912|   744k|        "xor    %9,%12;"
  913|   744k|        "xor    %7,%10;"
  914|   744k|        "ror    $0xb,%11;"
  915|   744k|        "and    %7,%12;"
  916|   744k|        "xor    %4,%11;"
  917|   744k|        "ror    $0x6,%10;"
  918|   744k|        "xor    %9,%12;"
  919|   744k|        "add    %10,%12;"
  920|   744k|        "ror    $0x2,%11;"
  921|   744k|        "add    12+%16,%12;"
  922|   744k|        "mov    %4,%10;"
  923|   744k|        "add    %12,%3;"
  924|   744k|        "mov    %4,%12;"
  925|   744k|        "or     %6,%10;"
  926|   744k|        "add    %3,%k2;"
  927|   744k|        "and    %6,%12;"
  928|   744k|        "and    %5,%10;"
  929|   744k|        "add    %11,%3;"
  930|   744k|        "or     %12,%10;"
  931|   744k|        "add    %10,%3;"
  932|   744k|        "movdqa %%xmm6,%%xmm4;"
  933|   744k|        "movdqa %%xmm7,%%xmm5;"
  934|   744k|        "sub    $0x1,%1;"
  935|   744k|        "jne    Lloop2_%=;"
  936|   744k|        "add    (%0),%3;"
  937|   744k|        "mov    %3,(%0);"
  938|   744k|        "add    0x4(%0),%4;"
  939|   744k|        "mov    %4,0x4(%0);"
  940|   744k|        "add    0x8(%0),%5;"
  941|   744k|        "mov    %5,0x8(%0);"
  942|   744k|        "add    0xc(%0),%6;"
  943|   744k|        "mov    %6,0xc(%0);"
  944|   744k|        "add    0x10(%0),%k2;"
  945|   744k|        "mov    %k2,0x10(%0);"
  946|   744k|        "add    0x14(%0),%7;"
  947|   744k|        "mov    %7,0x14(%0);"
  948|   744k|        "add    0x18(%0),%8;"
  949|   744k|        "mov    %8,0x18(%0);"
  950|   744k|        "add    0x1c(%0),%9;"
  951|   744k|        "mov    %9,0x1c(%0);"
  952|   744k|        "mov    %15,%1;"
  953|   744k|        "add    $0x40,%1;"
  954|   744k|        "cmp    %14,%1;"
  955|   744k|        "jne    Lloop0_%=;"
  956|       |
  957|   744k|        "Ldone_hash_%=:"
  958|       |
  959|   744k|        : "+r"(s), "+r"(chunk), "+r"(blocks), "=r"(a), "=r"(b), "=r"(c), "=r"(d), /* e = chunk */ "=r"(f), "=r"(g), "=r"(h), "=r"(y0), "=r"(y1), "=r"(y2), "=r"(tbl), "+m"(inp_end), "+m"(inp), "+m"(xfer)
  960|   744k|        : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00)
  961|   744k|        : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12"
  962|   744k|   );
  963|   744k|}

_ZN15sha256d64_sse4114Transform_4wayEPhPKh:
   69|     86|{
   70|       |    // Transform 1
   71|     86|    __m128i a = K(0x6a09e667ul);
   72|     86|    __m128i b = K(0xbb67ae85ul);
   73|     86|    __m128i c = K(0x3c6ef372ul);
   74|     86|    __m128i d = K(0xa54ff53aul);
   75|     86|    __m128i e = K(0x510e527ful);
   76|     86|    __m128i f = K(0x9b05688cul);
   77|     86|    __m128i g = K(0x1f83d9abul);
   78|     86|    __m128i h = K(0x5be0cd19ul);
   79|       |
   80|     86|    __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
   81|       |
   82|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x428a2f98ul), w0 = Read4(in, 0)));
   83|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x71374491ul), w1 = Read4(in, 4)));
   84|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0xb5c0fbcful), w2 = Read4(in, 8)));
   85|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0xe9b5dba5ul), w3 = Read4(in, 12)));
   86|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x3956c25bul), w4 = Read4(in, 16)));
   87|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x59f111f1ul), w5 = Read4(in, 20)));
   88|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x923f82a4ul), w6 = Read4(in, 24)));
   89|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0xab1c5ed5ul), w7 = Read4(in, 28)));
   90|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0xd807aa98ul), w8 = Read4(in, 32)));
   91|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x12835b01ul), w9 = Read4(in, 36)));
   92|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x243185beul), w10 = Read4(in, 40)));
   93|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x550c7dc3ul), w11 = Read4(in, 44)));
   94|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x72be5d74ul), w12 = Read4(in, 48)));
   95|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x80deb1feul), w13 = Read4(in, 52)));
   96|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x9bdc06a7ul), w14 = Read4(in, 56)));
   97|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0xc19bf174ul), w15 = Read4(in, 60)));
   98|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0xe49b69c1ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
   99|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0xefbe4786ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  100|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x0fc19dc6ul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  101|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x240ca1ccul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  102|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x2de92c6ful), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  103|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x4a7484aaul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  104|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x5cb0a9dcul), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  105|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x76f988daul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  106|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x983e5152ul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  107|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0xa831c66dul), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  108|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0xb00327c8ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  109|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0xbf597fc7ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  110|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0xc6e00bf3ul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  111|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0xd5a79147ul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  112|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x06ca6351ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  113|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x14292967ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  114|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x27b70a85ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  115|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x2e1b2138ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  116|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x4d2c6dfcul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  117|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x53380d13ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  118|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x650a7354ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  119|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x766a0abbul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  120|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x81c2c92eul), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  121|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x92722c85ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  122|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0xa2bfe8a1ul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  123|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0xa81a664bul), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  124|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0xc24b8b70ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  125|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0xc76c51a3ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  126|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0xd192e819ul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  127|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0xd6990624ul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  128|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0xf40e3585ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  129|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x106aa070ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  130|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x19a4c116ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  131|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x1e376c08ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  132|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x2748774cul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  133|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x34b0bcb5ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  134|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x391c0cb3ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  135|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x4ed8aa4aul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  136|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x5b9cca4ful), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  137|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x682e6ff3ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  138|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x748f82eeul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  139|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x78a5636ful), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  140|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x84c87814ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  141|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x8cc70208ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  142|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x90befffaul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  143|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0xa4506cebul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  144|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0xbef9a3f7ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  145|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0xc67178f2ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  146|       |
  147|     86|    a = Add(a, K(0x6a09e667ul));
  148|     86|    b = Add(b, K(0xbb67ae85ul));
  149|     86|    c = Add(c, K(0x3c6ef372ul));
  150|     86|    d = Add(d, K(0xa54ff53aul));
  151|     86|    e = Add(e, K(0x510e527ful));
  152|     86|    f = Add(f, K(0x9b05688cul));
  153|     86|    g = Add(g, K(0x1f83d9abul));
  154|     86|    h = Add(h, K(0x5be0cd19ul));
  155|       |
  156|     86|    __m128i t0 = a, t1 = b, t2 = c, t3 = d, t4 = e, t5 = f, t6 = g, t7 = h;
  157|       |
  158|       |    // Transform 2
  159|     86|    Round(a, b, c, d, e, f, g, h, K(0xc28a2f98ul));
  160|     86|    Round(h, a, b, c, d, e, f, g, K(0x71374491ul));
  161|     86|    Round(g, h, a, b, c, d, e, f, K(0xb5c0fbcful));
  162|     86|    Round(f, g, h, a, b, c, d, e, K(0xe9b5dba5ul));
  163|     86|    Round(e, f, g, h, a, b, c, d, K(0x3956c25bul));
  164|     86|    Round(d, e, f, g, h, a, b, c, K(0x59f111f1ul));
  165|     86|    Round(c, d, e, f, g, h, a, b, K(0x923f82a4ul));
  166|     86|    Round(b, c, d, e, f, g, h, a, K(0xab1c5ed5ul));
  167|     86|    Round(a, b, c, d, e, f, g, h, K(0xd807aa98ul));
  168|     86|    Round(h, a, b, c, d, e, f, g, K(0x12835b01ul));
  169|     86|    Round(g, h, a, b, c, d, e, f, K(0x243185beul));
  170|     86|    Round(f, g, h, a, b, c, d, e, K(0x550c7dc3ul));
  171|     86|    Round(e, f, g, h, a, b, c, d, K(0x72be5d74ul));
  172|     86|    Round(d, e, f, g, h, a, b, c, K(0x80deb1feul));
  173|     86|    Round(c, d, e, f, g, h, a, b, K(0x9bdc06a7ul));
  174|     86|    Round(b, c, d, e, f, g, h, a, K(0xc19bf374ul));
  175|     86|    Round(a, b, c, d, e, f, g, h, K(0x649b69c1ul));
  176|     86|    Round(h, a, b, c, d, e, f, g, K(0xf0fe4786ul));
  177|     86|    Round(g, h, a, b, c, d, e, f, K(0x0fe1edc6ul));
  178|     86|    Round(f, g, h, a, b, c, d, e, K(0x240cf254ul));
  179|     86|    Round(e, f, g, h, a, b, c, d, K(0x4fe9346ful));
  180|     86|    Round(d, e, f, g, h, a, b, c, K(0x6cc984beul));
  181|     86|    Round(c, d, e, f, g, h, a, b, K(0x61b9411eul));
  182|     86|    Round(b, c, d, e, f, g, h, a, K(0x16f988faul));
  183|     86|    Round(a, b, c, d, e, f, g, h, K(0xf2c65152ul));
  184|     86|    Round(h, a, b, c, d, e, f, g, K(0xa88e5a6dul));
  185|     86|    Round(g, h, a, b, c, d, e, f, K(0xb019fc65ul));
  186|     86|    Round(f, g, h, a, b, c, d, e, K(0xb9d99ec7ul));
  187|     86|    Round(e, f, g, h, a, b, c, d, K(0x9a1231c3ul));
  188|     86|    Round(d, e, f, g, h, a, b, c, K(0xe70eeaa0ul));
  189|     86|    Round(c, d, e, f, g, h, a, b, K(0xfdb1232bul));
  190|     86|    Round(b, c, d, e, f, g, h, a, K(0xc7353eb0ul));
  191|     86|    Round(a, b, c, d, e, f, g, h, K(0x3069bad5ul));
  192|     86|    Round(h, a, b, c, d, e, f, g, K(0xcb976d5ful));
  193|     86|    Round(g, h, a, b, c, d, e, f, K(0x5a0f118ful));
  194|     86|    Round(f, g, h, a, b, c, d, e, K(0xdc1eeefdul));
  195|     86|    Round(e, f, g, h, a, b, c, d, K(0x0a35b689ul));
  196|     86|    Round(d, e, f, g, h, a, b, c, K(0xde0b7a04ul));
  197|     86|    Round(c, d, e, f, g, h, a, b, K(0x58f4ca9dul));
  198|     86|    Round(b, c, d, e, f, g, h, a, K(0xe15d5b16ul));
  199|     86|    Round(a, b, c, d, e, f, g, h, K(0x007f3e86ul));
  200|     86|    Round(h, a, b, c, d, e, f, g, K(0x37088980ul));
  201|     86|    Round(g, h, a, b, c, d, e, f, K(0xa507ea32ul));
  202|     86|    Round(f, g, h, a, b, c, d, e, K(0x6fab9537ul));
  203|     86|    Round(e, f, g, h, a, b, c, d, K(0x17406110ul));
  204|     86|    Round(d, e, f, g, h, a, b, c, K(0x0d8cd6f1ul));
  205|     86|    Round(c, d, e, f, g, h, a, b, K(0xcdaa3b6dul));
  206|     86|    Round(b, c, d, e, f, g, h, a, K(0xc0bbbe37ul));
  207|     86|    Round(a, b, c, d, e, f, g, h, K(0x83613bdaul));
  208|     86|    Round(h, a, b, c, d, e, f, g, K(0xdb48a363ul));
  209|     86|    Round(g, h, a, b, c, d, e, f, K(0x0b02e931ul));
  210|     86|    Round(f, g, h, a, b, c, d, e, K(0x6fd15ca7ul));
  211|     86|    Round(e, f, g, h, a, b, c, d, K(0x521afacaul));
  212|     86|    Round(d, e, f, g, h, a, b, c, K(0x31338431ul));
  213|     86|    Round(c, d, e, f, g, h, a, b, K(0x6ed41a95ul));
  214|     86|    Round(b, c, d, e, f, g, h, a, K(0x6d437890ul));
  215|     86|    Round(a, b, c, d, e, f, g, h, K(0xc39c91f2ul));
  216|     86|    Round(h, a, b, c, d, e, f, g, K(0x9eccabbdul));
  217|     86|    Round(g, h, a, b, c, d, e, f, K(0xb5c9a0e6ul));
  218|     86|    Round(f, g, h, a, b, c, d, e, K(0x532fb63cul));
  219|     86|    Round(e, f, g, h, a, b, c, d, K(0xd2c741c6ul));
  220|     86|    Round(d, e, f, g, h, a, b, c, K(0x07237ea3ul));
  221|     86|    Round(c, d, e, f, g, h, a, b, K(0xa4954b68ul));
  222|     86|    Round(b, c, d, e, f, g, h, a, K(0x4c191d76ul));
  223|       |
  224|     86|    w0 = Add(t0, a);
  225|     86|    w1 = Add(t1, b);
  226|     86|    w2 = Add(t2, c);
  227|     86|    w3 = Add(t3, d);
  228|     86|    w4 = Add(t4, e);
  229|     86|    w5 = Add(t5, f);
  230|     86|    w6 = Add(t6, g);
  231|     86|    w7 = Add(t7, h);
  232|       |
  233|       |    // Transform 3
  234|     86|    a = K(0x6a09e667ul);
  235|     86|    b = K(0xbb67ae85ul);
  236|     86|    c = K(0x3c6ef372ul);
  237|     86|    d = K(0xa54ff53aul);
  238|     86|    e = K(0x510e527ful);
  239|     86|    f = K(0x9b05688cul);
  240|     86|    g = K(0x1f83d9abul);
  241|     86|    h = K(0x5be0cd19ul);
  242|       |
  243|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x428a2f98ul), w0));
  244|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x71374491ul), w1));
  245|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0xb5c0fbcful), w2));
  246|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0xe9b5dba5ul), w3));
  247|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x3956c25bul), w4));
  248|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x59f111f1ul), w5));
  249|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x923f82a4ul), w6));
  250|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0xab1c5ed5ul), w7));
  251|     86|    Round(a, b, c, d, e, f, g, h, K(0x5807aa98ul));
  252|     86|    Round(h, a, b, c, d, e, f, g, K(0x12835b01ul));
  253|     86|    Round(g, h, a, b, c, d, e, f, K(0x243185beul));
  254|     86|    Round(f, g, h, a, b, c, d, e, K(0x550c7dc3ul));
  255|     86|    Round(e, f, g, h, a, b, c, d, K(0x72be5d74ul));
  256|     86|    Round(d, e, f, g, h, a, b, c, K(0x80deb1feul));
  257|     86|    Round(c, d, e, f, g, h, a, b, K(0x9bdc06a7ul));
  258|     86|    Round(b, c, d, e, f, g, h, a, K(0xc19bf274ul));
  259|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0xe49b69c1ul), Inc(w0, sigma0(w1))));
  260|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0xefbe4786ul), Inc(w1, K(0xa00000ul), sigma0(w2))));
  261|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x0fc19dc6ul), Inc(w2, sigma1(w0), sigma0(w3))));
  262|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x240ca1ccul), Inc(w3, sigma1(w1), sigma0(w4))));
  263|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x2de92c6ful), Inc(w4, sigma1(w2), sigma0(w5))));
  264|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x4a7484aaul), Inc(w5, sigma1(w3), sigma0(w6))));
  265|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x5cb0a9dcul), Inc(w6, sigma1(w4), K(0x100ul), sigma0(w7))));
  266|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x76f988daul), Inc(w7, sigma1(w5), w0, K(0x11002000ul))));
  267|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x983e5152ul), w8 = Add(K(0x80000000ul), sigma1(w6), w1)));
  268|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0xa831c66dul), w9 = Add(sigma1(w7), w2)));
  269|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0xb00327c8ul), w10 = Add(sigma1(w8), w3)));
  270|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0xbf597fc7ul), w11 = Add(sigma1(w9), w4)));
  271|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0xc6e00bf3ul), w12 = Add(sigma1(w10), w5)));
  272|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0xd5a79147ul), w13 = Add(sigma1(w11), w6)));
  273|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x06ca6351ul), w14 = Add(sigma1(w12), w7, K(0x400022ul))));
  274|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x14292967ul), w15 = Add(K(0x100ul), sigma1(w13), w8, sigma0(w0))));
  275|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x27b70a85ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  276|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x2e1b2138ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  277|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x4d2c6dfcul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  278|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x53380d13ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  279|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x650a7354ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  280|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x766a0abbul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  281|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x81c2c92eul), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  282|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x92722c85ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  283|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0xa2bfe8a1ul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  284|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0xa81a664bul), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  285|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0xc24b8b70ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  286|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0xc76c51a3ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  287|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0xd192e819ul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  288|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0xd6990624ul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  289|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0xf40e3585ul), Inc(w14, sigma1(w12), w7, sigma0(w15))));
  290|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x106aa070ul), Inc(w15, sigma1(w13), w8, sigma0(w0))));
  291|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x19a4c116ul), Inc(w0, sigma1(w14), w9, sigma0(w1))));
  292|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x1e376c08ul), Inc(w1, sigma1(w15), w10, sigma0(w2))));
  293|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x2748774cul), Inc(w2, sigma1(w0), w11, sigma0(w3))));
  294|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x34b0bcb5ul), Inc(w3, sigma1(w1), w12, sigma0(w4))));
  295|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x391c0cb3ul), Inc(w4, sigma1(w2), w13, sigma0(w5))));
  296|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0x4ed8aa4aul), Inc(w5, sigma1(w3), w14, sigma0(w6))));
  297|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0x5b9cca4ful), Inc(w6, sigma1(w4), w15, sigma0(w7))));
  298|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0x682e6ff3ul), Inc(w7, sigma1(w5), w0, sigma0(w8))));
  299|     86|    Round(a, b, c, d, e, f, g, h, Add(K(0x748f82eeul), Inc(w8, sigma1(w6), w1, sigma0(w9))));
  300|     86|    Round(h, a, b, c, d, e, f, g, Add(K(0x78a5636ful), Inc(w9, sigma1(w7), w2, sigma0(w10))));
  301|     86|    Round(g, h, a, b, c, d, e, f, Add(K(0x84c87814ul), Inc(w10, sigma1(w8), w3, sigma0(w11))));
  302|     86|    Round(f, g, h, a, b, c, d, e, Add(K(0x8cc70208ul), Inc(w11, sigma1(w9), w4, sigma0(w12))));
  303|     86|    Round(e, f, g, h, a, b, c, d, Add(K(0x90befffaul), Inc(w12, sigma1(w10), w5, sigma0(w13))));
  304|     86|    Round(d, e, f, g, h, a, b, c, Add(K(0xa4506cebul), Inc(w13, sigma1(w11), w6, sigma0(w14))));
  305|     86|    Round(c, d, e, f, g, h, a, b, Add(K(0xbef9a3f7ul), w14, sigma1(w12), w7, sigma0(w15)));
  306|     86|    Round(b, c, d, e, f, g, h, a, Add(K(0xc67178f2ul), w15, sigma1(w13), w8, sigma0(w0)));
  307|       |
  308|       |    // Output
  309|     86|    Write4(out, 0, Add(a, K(0x6a09e667ul)));
  310|     86|    Write4(out, 4, Add(b, K(0xbb67ae85ul)));
  311|     86|    Write4(out, 8, Add(c, K(0x3c6ef372ul)));
  312|     86|    Write4(out, 12, Add(d, K(0xa54ff53aul)));
  313|     86|    Write4(out, 16, Add(e, K(0x510e527ful)));
  314|     86|    Write4(out, 20, Add(f, K(0x9b05688cul)));
  315|     86|    Write4(out, 24, Add(g, K(0x1f83d9abul)));
  316|     86|    Write4(out, 28, Add(h, K(0x5be0cd19ul)));
  317|     86|}
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_11KEj:
   16|  19.7k|__m128i inline K(uint32_t x) { return _mm_set1_epi32(x); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_15RoundEDv2_xS1_S1_RS1_S1_S1_S1_S2_S1_:
   41|  16.5k|{
   42|  16.5k|    __m128i t1 = Add(h, Sigma1(e), Ch(e, f, g), k);
   43|  16.5k|    __m128i t2 = Add(Sigma0(a), Maj(a, b, c));
   44|  16.5k|    d = Add(d, t1);
   45|  16.5k|    h = Add(t1, t2);
   46|  16.5k|}
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_16Sigma1EDv2_x:
   35|  16.5k|__m128i inline Sigma1(__m128i x) { return Xor(Or(ShR(x, 6), ShL(x, 26)), Or(ShR(x, 11), ShL(x, 21)), Or(ShR(x, 25), ShL(x, 7))); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13XorEDv2_xS1_S1_:
   26|  48.6k|__m128i inline Xor(__m128i x, __m128i y, __m128i z) { return Xor(Xor(x, y), z); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13XorEDv2_xS1_:
   25|   130k|__m128i inline Xor(__m128i x, __m128i y) { return _mm_xor_si128(x, y); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_12OrEDv2_xS1_:
   27|   163k|__m128i inline Or(__m128i x, __m128i y) { return _mm_or_si128(x, y); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13ShREDv2_xi:
   29|   146k|__m128i inline ShR(__m128i x, int n) { return _mm_srli_epi32(x, n); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13ShLEDv2_xi:
   30|   130k|__m128i inline ShL(__m128i x, int n) { return _mm_slli_epi32(x, n); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_12ChEDv2_xS1_S1_:
   32|  16.5k|__m128i inline Ch(__m128i x, __m128i y, __m128i z) { return Xor(z, And(x, Xor(y, z))); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13AndEDv2_xS1_:
   28|  49.5k|__m128i inline And(__m128i x, __m128i y) { return _mm_and_si128(x, y); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_16Sigma0EDv2_x:
   34|  16.5k|__m128i inline Sigma0(__m128i x) { return Xor(Or(ShR(x, 2), ShL(x, 30)), Or(ShR(x, 13), ShL(x, 19)), Or(ShR(x, 22), ShL(x, 10))); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13MajEDv2_xS1_S1_:
   33|  16.5k|__m128i inline Maj(__m128i x, __m128i y, __m128i z) { return Or(And(x, y), And(z, Or(x, y))); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13AddEDv2_xS1_:
   18|   134k|__m128i inline Add(__m128i x, __m128i y) { return _mm_add_epi32(x, y); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_15Read4EPKhi:
   48|  1.37k|__m128i inline Read4(const unsigned char* chunk, int offset) {
   49|  1.37k|    __m128i ret = _mm_set_epi32(
   50|  1.37k|        ReadLE32(chunk + 0 + offset),
   51|  1.37k|        ReadLE32(chunk + 64 + offset),
   52|  1.37k|        ReadLE32(chunk + 128 + offset),
   53|  1.37k|        ReadLE32(chunk + 192 + offset)
   54|  1.37k|    );
   55|  1.37k|    return _mm_shuffle_epi8(ret, _mm_set_epi32(0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL));
   56|  1.37k|}
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13IncERDv2_xS1_S1_S1_:
   24|  6.88k|__m128i inline Inc(__m128i& x, __m128i y, __m128i z, __m128i w) { x = Add(x, y, z, w); return x; }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_16sigma1EDv2_x:
   37|  8.08k|__m128i inline sigma1(__m128i x) { return Xor(Or(ShR(x, 17), ShL(x, 15)), Or(ShR(x, 19), ShL(x, 13)), ShR(x, 10)); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_16sigma0EDv2_x:
   36|  7.56k|__m128i inline sigma0(__m128i x) { return Xor(Or(ShR(x, 7), ShL(x, 25)), Or(ShR(x, 18), ShL(x, 14)), ShR(x, 3)); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13IncERDv2_xS1_:
   22|     86|__m128i inline Inc(__m128i& x, __m128i y) { x = Add(x, y); return x; }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13IncERDv2_xS1_S1_:
   23|    430|__m128i inline Inc(__m128i& x, __m128i y, __m128i z) { x = Add(x, y, z); return x; }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13AddEDv2_xS1_S1_:
   19|    774|__m128i inline Add(__m128i x, __m128i y, __m128i z) { return Add(Add(x, y), z); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13AddEDv2_xS1_S1_S1_:
   20|  23.4k|__m128i inline Add(__m128i x, __m128i y, __m128i z, __m128i w) { return Add(Add(x, y), Add(z, w)); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_13AddEDv2_xS1_S1_S1_S1_:
   21|    172|__m128i inline Add(__m128i x, __m128i y, __m128i z, __m128i w, __m128i v) { return Add(Add(x, y, z), Add(w, v)); }
sha256_sse41.cpp:_ZN15sha256d64_sse4112_GLOBAL__N_16Write4EPhiDv2_x:
   58|    688|void inline Write4(unsigned char* out, int offset, __m128i v) {
   59|    688|    v = _mm_shuffle_epi8(v, _mm_set_epi32(0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL));
   60|    688|    WriteLE32(out + 0 + offset, _mm_extract_epi32(v, 3));
   61|    688|    WriteLE32(out + 32 + offset, _mm_extract_epi32(v, 2));
   62|    688|    WriteLE32(out + 64 + offset, _mm_extract_epi32(v, 1));
   63|    688|    WriteLE32(out + 96 + offset, _mm_extract_epi32(v, 0));
   64|    688|}

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

_ZN8SHA3_256C2Ev:
   35|     48|    SHA3_256() = default;

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

_ZN10CSipHasherC2Emm:
   19|  1.81M|{
   20|  1.81M|    v[0] = 0x736f6d6570736575ULL ^ k0;
   21|  1.81M|    v[1] = 0x646f72616e646f6dULL ^ k1;
   22|  1.81M|    v[2] = 0x6c7967656e657261ULL ^ k0;
   23|  1.81M|    v[3] = 0x7465646279746573ULL ^ k1;
   24|  1.81M|    count = 0;
   25|  1.81M|    tmp = 0;
   26|  1.81M|}
_ZN10CSipHasher5WriteEm:
   29|  1.95M|{
   30|  1.95M|    uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];
   31|       |
   32|  1.95M|    assert(count % 8 == 0);
   33|       |
   34|  1.95M|    v3 ^= data;
   35|  1.95M|    SIPROUND;
  ------------------
  |  |    9|  1.95M|#define SIPROUND do { \
  |  |   10|  1.95M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.95M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.95M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.95M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.95M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.95M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.95M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   36|  1.95M|    SIPROUND;
  ------------------
  |  |    9|  1.95M|#define SIPROUND do { \
  |  |   10|  1.95M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.95M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.95M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.95M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.95M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.95M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.95M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   37|  1.95M|    v0 ^= data;
   38|       |
   39|  1.95M|    v[0] = v0;
   40|  1.95M|    v[1] = v1;
   41|  1.95M|    v[2] = v2;
   42|  1.95M|    v[3] = v3;
   43|       |
   44|  1.95M|    count += 8;
   45|  1.95M|    return *this;
   46|  1.95M|}
_ZN10CSipHasher5WriteE4SpanIKhE:
   49|  1.81M|{
   50|  1.81M|    uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];
   51|  1.81M|    uint64_t t = tmp;
   52|  1.81M|    uint8_t c = count;
   53|       |
   54|  57.7M|    while (data.size() > 0) {
  ------------------
  |  Branch (54:12): [True: 55.9M, False: 1.81M]
  ------------------
   55|  55.9M|        t |= uint64_t{data.front()} << (8 * (c % 8));
   56|  55.9M|        c++;
   57|  55.9M|        if ((c & 7) == 0) {
  ------------------
  |  Branch (57:13): [True: 6.98M, False: 48.9M]
  ------------------
   58|  6.98M|            v3 ^= t;
   59|  6.98M|            SIPROUND;
  ------------------
  |  |    9|  6.98M|#define SIPROUND do { \
  |  |   10|  6.98M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  6.98M|    v0 = std::rotl(v0, 32); \
  |  |   12|  6.98M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  6.98M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  6.98M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  6.98M|    v2 = std::rotl(v2, 32); \
  |  |   16|  6.98M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   60|  6.98M|            SIPROUND;
  ------------------
  |  |    9|  6.98M|#define SIPROUND do { \
  |  |   10|  6.98M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  6.98M|    v0 = std::rotl(v0, 32); \
  |  |   12|  6.98M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  6.98M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  6.98M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  6.98M|    v2 = std::rotl(v2, 32); \
  |  |   16|  6.98M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   61|  6.98M|            v0 ^= t;
   62|  6.98M|            t = 0;
   63|  6.98M|        }
   64|  55.9M|        data = data.subspan(1);
   65|  55.9M|    }
   66|       |
   67|  1.81M|    v[0] = v0;
   68|  1.81M|    v[1] = v1;
   69|  1.81M|    v[2] = v2;
   70|  1.81M|    v[3] = v3;
   71|  1.81M|    count = c;
   72|  1.81M|    tmp = t;
   73|       |
   74|  1.81M|    return *this;
   75|  1.81M|}
_ZNK10CSipHasher8FinalizeEv:
   78|  1.81M|{
   79|  1.81M|    uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];
   80|       |
   81|  1.81M|    uint64_t t = tmp | (((uint64_t)count) << 56);
   82|       |
   83|  1.81M|    v3 ^= t;
   84|  1.81M|    SIPROUND;
  ------------------
  |  |    9|  1.81M|#define SIPROUND do { \
  |  |   10|  1.81M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.81M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.81M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.81M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.81M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.81M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.81M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   85|  1.81M|    SIPROUND;
  ------------------
  |  |    9|  1.81M|#define SIPROUND do { \
  |  |   10|  1.81M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.81M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.81M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.81M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.81M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.81M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.81M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   86|  1.81M|    v0 ^= t;
   87|  1.81M|    v2 ^= 0xFF;
   88|  1.81M|    SIPROUND;
  ------------------
  |  |    9|  1.81M|#define SIPROUND do { \
  |  |   10|  1.81M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.81M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.81M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.81M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.81M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.81M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.81M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   89|  1.81M|    SIPROUND;
  ------------------
  |  |    9|  1.81M|#define SIPROUND do { \
  |  |   10|  1.81M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.81M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.81M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.81M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.81M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.81M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.81M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   90|  1.81M|    SIPROUND;
  ------------------
  |  |    9|  1.81M|#define SIPROUND do { \
  |  |   10|  1.81M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.81M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.81M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.81M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.81M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.81M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.81M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   91|  1.81M|    SIPROUND;
  ------------------
  |  |    9|  1.81M|#define SIPROUND do { \
  |  |   10|  1.81M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.81M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.81M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.81M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.81M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.81M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.81M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
   92|  1.81M|    return v0 ^ v1 ^ v2 ^ v3;
   93|  1.81M|}
_Z14SipHashUint256mmRK7uint256:
   96|  1.80M|{
   97|       |    /* Specialized implementation for efficiency */
   98|  1.80M|    uint64_t d = val.GetUint64(0);
   99|       |
  100|  1.80M|    uint64_t v0 = 0x736f6d6570736575ULL ^ k0;
  101|  1.80M|    uint64_t v1 = 0x646f72616e646f6dULL ^ k1;
  102|  1.80M|    uint64_t v2 = 0x6c7967656e657261ULL ^ k0;
  103|  1.80M|    uint64_t v3 = 0x7465646279746573ULL ^ k1 ^ d;
  104|       |
  105|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  106|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  107|  1.80M|    v0 ^= d;
  108|  1.80M|    d = val.GetUint64(1);
  109|  1.80M|    v3 ^= d;
  110|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  111|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  112|  1.80M|    v0 ^= d;
  113|  1.80M|    d = val.GetUint64(2);
  114|  1.80M|    v3 ^= d;
  115|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  116|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  117|  1.80M|    v0 ^= d;
  118|  1.80M|    d = val.GetUint64(3);
  119|  1.80M|    v3 ^= d;
  120|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  121|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  122|  1.80M|    v0 ^= d;
  123|  1.80M|    v3 ^= (uint64_t{4}) << 59;
  124|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  125|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  126|  1.80M|    v0 ^= (uint64_t{4}) << 59;
  127|  1.80M|    v2 ^= 0xFF;
  128|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  129|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  130|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  131|  1.80M|    SIPROUND;
  ------------------
  |  |    9|  1.80M|#define SIPROUND do { \
  |  |   10|  1.80M|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  1.80M|    v0 = std::rotl(v0, 32); \
  |  |   12|  1.80M|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  1.80M|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  1.80M|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  1.80M|    v2 = std::rotl(v2, 32); \
  |  |   16|  1.80M|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  132|  1.80M|    return v0 ^ v1 ^ v2 ^ v3;
  133|  1.80M|}
_Z19SipHashUint256ExtrammRK7uint256j:
  136|  4.62k|{
  137|       |    /* Specialized implementation for efficiency */
  138|  4.62k|    uint64_t d = val.GetUint64(0);
  139|       |
  140|  4.62k|    uint64_t v0 = 0x736f6d6570736575ULL ^ k0;
  141|  4.62k|    uint64_t v1 = 0x646f72616e646f6dULL ^ k1;
  142|  4.62k|    uint64_t v2 = 0x6c7967656e657261ULL ^ k0;
  143|  4.62k|    uint64_t v3 = 0x7465646279746573ULL ^ k1 ^ d;
  144|       |
  145|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  146|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  147|  4.62k|    v0 ^= d;
  148|  4.62k|    d = val.GetUint64(1);
  149|  4.62k|    v3 ^= d;
  150|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  151|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  152|  4.62k|    v0 ^= d;
  153|  4.62k|    d = val.GetUint64(2);
  154|  4.62k|    v3 ^= d;
  155|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  156|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  157|  4.62k|    v0 ^= d;
  158|  4.62k|    d = val.GetUint64(3);
  159|  4.62k|    v3 ^= d;
  160|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  161|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  162|  4.62k|    v0 ^= d;
  163|  4.62k|    d = ((uint64_t{36}) << 56) | extra;
  164|  4.62k|    v3 ^= d;
  165|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  166|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  167|  4.62k|    v0 ^= d;
  168|  4.62k|    v2 ^= 0xFF;
  169|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  170|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  171|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  172|  4.62k|    SIPROUND;
  ------------------
  |  |    9|  4.62k|#define SIPROUND do { \
  |  |   10|  4.62k|    v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
  |  |   11|  4.62k|    v0 = std::rotl(v0, 32); \
  |  |   12|  4.62k|    v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
  |  |   13|  4.62k|    v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
  |  |   14|  4.62k|    v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
  |  |   15|  4.62k|    v2 = std::rotl(v2, 32); \
  |  |   16|  4.62k|} while (0)
  |  |  ------------------
  |  |  |  Branch (16:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  173|  4.62k|    return v0 ^ v1 ^ v2 ^ v3;
  174|  4.62k|}

_ZN10CDBWrapperD2Ev:
  279|      4|{
  280|      4|    delete DBContext().pdb;
  281|      4|    DBContext().pdb = nullptr;
  282|      4|    delete DBContext().options.filter_policy;
  283|      4|    DBContext().options.filter_policy = nullptr;
  284|      4|    delete DBContext().options.info_log;
  285|      4|    DBContext().options.info_log = nullptr;
  286|      4|    delete DBContext().options.block_cache;
  287|      4|    DBContext().options.block_cache = nullptr;
  288|      4|    delete DBContext().penv;
  289|      4|    DBContext().options.env = nullptr;
  290|      4|}
_ZNK10CDBWrapper8ReadImplE4SpanIKSt4byteE:
  340|    552|{
  341|    552|    leveldb::Slice slKey(CharCast(key.data()), key.size());
  342|    552|    std::string strValue;
  343|    552|    leveldb::Status status = DBContext().pdb->Get(DBContext().readoptions, slKey, &strValue);
  344|    552|    if (!status.ok()) {
  ------------------
  |  Branch (344:9): [True: 552, False: 0]
  ------------------
  345|    552|        if (status.IsNotFound())
  ------------------
  |  Branch (345:13): [True: 552, False: 0]
  ------------------
  346|    552|            return std::nullopt;
  347|      0|        LogPrintf("LevelDB read failure: %s\n", status.ToString());
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  348|      0|        HandleError(status);
  349|      0|    }
  350|      0|    return strValue;
  351|    552|}
dbwrapper.cpp:_ZL8CharCastPKSt4byte:
   35|    552|static auto CharCast(const std::byte* data) { return reinterpret_cast<const char*>(data); }

_ZNK10CDBWrapper9DBContextEv:
  212|  1.14k|    auto& DBContext() const LIFETIMEBOUND { return *Assert(m_db_context); }
  ------------------
  |  |   85|  1.14k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
txdb.cpp:_ZNK10CDBWrapper4ReadIN12_GLOBAL__N_19CoinEntryE4CoinEEbRKT_RT0_:
  223|    552|    {
  224|    552|        DataStream ssKey{};
  225|    552|        ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
  226|    552|        ssKey << key;
  227|    552|        std::optional<std::string> strValue{ReadImpl(ssKey)};
  228|    552|        if (!strValue) {
  ------------------
  |  Branch (228:13): [True: 552, False: 0]
  ------------------
  229|    552|            return false;
  230|    552|        }
  231|      0|        try {
  232|      0|            DataStream ssValue{MakeByteSpan(*strValue)};
  233|      0|            ssValue.Xor(obfuscate_key);
  234|      0|            ssValue >> value;
  235|      0|        } catch (const std::exception&) {
  236|      0|            return false;
  237|      0|        }
  238|      0|        return true;
  239|      0|    }

_Z21DeploymentActiveAfterPK11CBlockIndexRKN9Consensus6ParamsENS2_16BuriedDeploymentER16VersionBitsCache:
   15|     62|{
   16|     62|    assert(Consensus::ValidDeployment(dep));
   17|     62|    return (pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1) >= params.DeploymentHeight(dep);
  ------------------
  |  Branch (17:13): [True: 0, False: 62]
  ------------------
   18|     62|}
_Z18DeploymentActiveAtRK11CBlockIndexRKN9Consensus6ParamsENS2_16BuriedDeploymentER16VersionBitsCache:
   28|     13|{
   29|     13|    assert(Consensus::ValidDeployment(dep));
   30|     13|    return index.nHeight >= params.DeploymentHeight(dep);
   31|     13|}

_ZNK11FlatFileSeq8FileNameERK11FlatFilePos:
   29|  1.59k|{
   30|  1.59k|    return m_dir / fs::u8path(strprintf("%s%05u.dat", m_prefix, pos.nFile));
  ------------------
  |  | 1172|  1.59k|#define strprintf tfm::format
  ------------------
   31|  1.59k|}
_ZNK11FlatFileSeq4OpenERK11FlatFilePosb:
   34|  1.59k|{
   35|  1.59k|    if (pos.IsNull()) {
  ------------------
  |  Branch (35:9): [True: 0, False: 1.59k]
  ------------------
   36|      0|        return nullptr;
   37|      0|    }
   38|  1.59k|    fs::path path = FileName(pos);
   39|  1.59k|    fs::create_directories(path.parent_path());
   40|  1.59k|    FILE* file = fsbridge::fopen(path, read_only ? "rb": "rb+");
  ------------------
  |  Branch (40:40): [True: 1.59k, False: 0]
  ------------------
   41|  1.59k|    if (!file && !read_only)
  ------------------
  |  Branch (41:9): [True: 0, False: 1.59k]
  |  Branch (41:18): [True: 0, False: 0]
  ------------------
   42|      0|        file = fsbridge::fopen(path, "wb+");
   43|  1.59k|    if (!file) {
  ------------------
  |  Branch (43:9): [True: 0, False: 1.59k]
  ------------------
   44|      0|        LogPrintf("Unable to open file %s\n", fs::PathToString(path));
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   45|      0|        return nullptr;
   46|      0|    }
   47|  1.59k|    if (pos.nPos && fseek(file, pos.nPos, SEEK_SET)) {
  ------------------
  |  Branch (47:9): [True: 1.54k, False: 51]
  |  Branch (47:21): [True: 0, False: 1.54k]
  ------------------
   48|      0|        LogPrintf("Unable to seek to position %u of %s\n", pos.nPos, fs::PathToString(path));
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|      0|        fclose(file);
   50|      0|        return nullptr;
   51|      0|    }
   52|  1.59k|    return file;
   53|  1.59k|}

_ZNK11FlatFilePos6IsNullEv:
   36|  1.61k|    bool IsNull() const { return (nFile == -1); }
_ZN11FlatFilePosC2Ev:
   21|  10.5k|    FlatFilePos() = default;

_Z11MurmurHash3j4SpanIKhE:
   14|  20.9M|{
   15|       |    // The following is MurmurHash3 (x86_32), see https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp
   16|  20.9M|    uint32_t h1 = nHashSeed;
   17|  20.9M|    const uint32_t c1 = 0xcc9e2d51;
   18|  20.9M|    const uint32_t c2 = 0x1b873593;
   19|       |
   20|  20.9M|    const int nblocks = vDataToHash.size() / 4;
   21|       |
   22|       |    //----------
   23|       |    // body
   24|  20.9M|    const uint8_t* blocks = vDataToHash.data();
   25|       |
   26|   185M|    for (int i = 0; i < nblocks; ++i) {
  ------------------
  |  Branch (26:21): [True: 164M, False: 20.9M]
  ------------------
   27|   164M|        uint32_t k1 = ReadLE32(blocks + i*4);
   28|       |
   29|   164M|        k1 *= c1;
   30|   164M|        k1 = std::rotl(k1, 15);
   31|   164M|        k1 *= c2;
   32|       |
   33|   164M|        h1 ^= k1;
   34|   164M|        h1 = std::rotl(h1, 13);
   35|   164M|        h1 = h1 * 5 + 0xe6546b64;
   36|   164M|    }
   37|       |
   38|       |    //----------
   39|       |    // tail
   40|  20.9M|    const uint8_t* tail = vDataToHash.data() + nblocks * 4;
   41|       |
   42|  20.9M|    uint32_t k1 = 0;
   43|       |
   44|  20.9M|    switch (vDataToHash.size() & 3) {
  ------------------
  |  Branch (44:13): [True: 20.1M, False: 797k]
  ------------------
   45|      0|        case 3:
  ------------------
  |  Branch (45:9): [True: 0, False: 20.9M]
  ------------------
   46|      0|            k1 ^= tail[2] << 16;
   47|      0|            [[fallthrough]];
   48|   797k|        case 2:
  ------------------
  |  Branch (48:9): [True: 797k, False: 20.1M]
  ------------------
   49|   797k|            k1 ^= tail[1] << 8;
   50|   797k|            [[fallthrough]];
   51|   797k|        case 1:
  ------------------
  |  Branch (51:9): [True: 0, False: 20.9M]
  ------------------
   52|   797k|            k1 ^= tail[0];
   53|   797k|            k1 *= c1;
   54|   797k|            k1 = std::rotl(k1, 15);
   55|   797k|            k1 *= c2;
   56|   797k|            h1 ^= k1;
   57|  20.9M|    }
   58|       |
   59|       |    //----------
   60|       |    // finalization
   61|  20.9M|    h1 ^= vDataToHash.size();
   62|  20.9M|    h1 ^= h1 >> 16;
   63|  20.9M|    h1 *= 0x85ebca6b;
   64|  20.9M|    h1 ^= h1 >> 13;
   65|  20.9M|    h1 *= 0xc2b2ae35;
   66|  20.9M|    h1 ^= h1 >> 16;
   67|       |
   68|  20.9M|    return h1;
   69|  20.9M|}

_ZN8CHash2568FinalizeE4SpanIhE:
   30|  90.7k|    void Finalize(Span<unsigned char> output) {
   31|  90.7k|        assert(output.size() == OUTPUT_SIZE);
   32|  90.7k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   33|  90.7k|        sha.Finalize(buf);
   34|  90.7k|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   35|  90.7k|    }
_ZN8CHash2565WriteE4SpanIKhE:
   37|  82.2k|    CHash256& Write(Span<const unsigned char> input) {
   38|  82.2k|        sha.Write(input.data(), input.size());
   39|  82.2k|        return *this;
   40|  82.2k|    }
_ZN8CHash2565ResetEv:
   42|  32.9k|    CHash256& Reset() {
   43|  32.9k|        sha.Reset();
   44|  32.9k|        return *this;
   45|  32.9k|    }
_ZN10HashWriter5writeE4SpanIKSt4byteE:
  107|  1.69M|    {
  108|  1.69M|        ctx.Write(UCharCast(src.data()), src.size());
  109|  1.69M|    }
_ZN10HashWriter7GetHashEv:
  115|   185k|    uint256 GetHash() {
  116|   185k|        uint256 result;
  117|   185k|        ctx.Finalize(result.begin());
  118|   185k|        ctx.Reset().Write(result.begin(), CSHA256::OUTPUT_SIZE).Finalize(result.begin());
  119|   185k|        return result;
  120|   185k|    }
_ZN10HashWriter9GetSHA256Ev:
  126|     50|    uint256 GetSHA256() {
  127|     50|        uint256 result;
  128|     50|        ctx.Finalize(result.begin());
  129|     50|        return result;
  130|     50|    }
_ZN10HashWriter12GetCheapHashEv:
  135|   141k|    inline uint64_t GetCheapHash() {
  136|   141k|        uint256 result = GetHash();
  137|   141k|        return ReadLE64(result.begin());
  138|   141k|    }
_Z4HashINSt3__16vectorIhNS0_9allocatorIhEEEEE7uint256RKT_:
   76|  66.2k|{
   77|  66.2k|    uint256 result;
   78|  66.2k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|  66.2k|    return result;
   80|  66.2k|}
_ZN10HashWriterlsINSt3__16vectorIhNS1_9allocatorIhEEEEEERS_RKT_:
  142|   188k|    {
  143|   188k|        ::Serialize(*this, obj);
  144|   188k|        return *this;
  145|   188k|    }
_ZN10HashWriterlsI7uint256EERS_RKT_:
  142|   141k|    {
  143|   141k|        ::Serialize(*this, obj);
  144|   141k|        return *this;
  145|   141k|    }
_ZN10HashWriterlsI4SpanIKhEEERS_RKT_:
  142|   152k|    {
  143|   152k|        ::Serialize(*this, obj);
  144|   152k|        return *this;
  145|   152k|    }
_ZN10HashWriterlsImEERS_RKT_:
  142|  46.8k|    {
  143|  46.8k|        ::Serialize(*this, obj);
  144|  46.8k|        return *this;
  145|  46.8k|    }
_ZN10HashWriterlsIhEERS_RKT_:
  142|  48.0k|    {
  143|  48.0k|        ::Serialize(*this, obj);
  144|  48.0k|        return *this;
  145|  48.0k|    }
_ZN10HashWriterlsIiEERS_RKT_:
  142|  48.0k|    {
  143|  48.0k|        ::Serialize(*this, obj);
  144|  48.0k|        return *this;
  145|  48.0k|    }
_ZN10HashWriterlsI12CBlockHeaderEERS_RKT_:
  142|  5.45k|    {
  143|  5.45k|        ::Serialize(*this, obj);
  144|  5.45k|        return *this;
  145|  5.45k|    }
_ZN10HashWriterlsI13ParamsWrapperI20TransactionSerParamsK12CTransactionEEERS_RKT_:
  142|  38.8k|    {
  143|  38.8k|        ::Serialize(*this, obj);
  144|  38.8k|        return *this;
  145|  38.8k|    }

_Z19GetBlockFilterIndex15BlockFilterType:
  497|      1|{
  498|      1|    auto it = g_filter_indexes.find(filter_type);
  499|      1|    return it != g_filter_indexes.end() ? &it->second : nullptr;
  ------------------
  |  Branch (499:12): [True: 0, False: 1]
  ------------------
  500|      1|}

_ZNK11indirectmapI9COutPointPK12CTransactionE4sizeEv:
   47|  1.36k|    size_type size() const          { return m.size(); }
_ZNK11indirectmapI9COutPointPK12CTransactionE4findERKS0_:
   39|  3.19k|    const_iterator find(const K& key) const         { return m.find(&key); }
_ZNK11indirectmapI9COutPointPK12CTransactionE3endEv:
   53|  3.19k|    const_iterator end() const      { return m.end(); }
_ZNK11indirectmapI9COutPointPK12CTransactionE6cbeginEv:
   54|  1.36k|    const_iterator cbegin() const   { return m.cbegin(); }
_ZNK11indirectmapI9COutPointPK12CTransactionE4cendEv:
   55|  1.36k|    const_iterator cend() const     { return m.cend(); }

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

_ZNK12CChainParams12GetConsensusEv:
   93|   477k|    const Consensus::Params& GetConsensus() const { return consensus; }
_ZNK12CChainParams12MessageStartEv:
   94|  8.53k|    const MessageStartChars& MessageStart() const { return pchMessageStart; }
_ZNK12CChainParams14GetDefaultPortEv:
   95|  1.95k|    uint16_t GetDefaultPort() const { return nDefaultPort; }
_ZNK12CChainParams11CheckpointsEv:
  121|    357|    const CCheckpointData& Checkpoints() const { return checkpointData; }

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

_ZN11ECC_ContextD2Ev:
  482|      2|{
  483|      2|    ECC_Stop();
  484|      2|}
key.cpp:_ZL8ECC_Stopv:
  467|      2|static void ECC_Stop() {
  468|      2|    secp256k1_context *ctx = secp256k1_context_sign;
  469|      2|    secp256k1_context_sign = nullptr;
  470|       |
  471|      2|    if (ctx) {
  ------------------
  |  Branch (471:9): [True: 2, False: 0]
  ------------------
  472|      2|        secp256k1_context_destroy(ctx);
  473|      2|    }
  474|      2|}

_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|}
_ZN7leveldb6DBImpl3GetERKNS_11ReadOptionsERKNS_5SliceEPNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE:
 1112|    552|                   std::string* value) {
 1113|    552|  Status s;
 1114|    552|  MutexLock l(&mutex_);
 1115|    552|  SequenceNumber snapshot;
 1116|    552|  if (options.snapshot != nullptr) {
  ------------------
  |  Branch (1116:7): [True: 0, False: 552]
  ------------------
 1117|      0|    snapshot =
 1118|      0|        static_cast<const SnapshotImpl*>(options.snapshot)->sequence_number();
 1119|    552|  } else {
 1120|    552|    snapshot = versions_->LastSequence();
 1121|    552|  }
 1122|       |
 1123|    552|  MemTable* mem = mem_;
 1124|    552|  MemTable* imm = imm_;
 1125|    552|  Version* current = versions_->current();
 1126|    552|  mem->Ref();
 1127|    552|  if (imm != nullptr) imm->Ref();
  ------------------
  |  Branch (1127:7): [True: 0, False: 552]
  ------------------
 1128|    552|  current->Ref();
 1129|       |
 1130|    552|  bool have_stat_update = false;
 1131|    552|  Version::GetStats stats;
 1132|       |
 1133|       |  // Unlock while reading from files and memtables
 1134|    552|  {
 1135|    552|    mutex_.Unlock();
 1136|       |    // First look in the memtable, then in the immutable memtable (if any).
 1137|    552|    LookupKey lkey(key, snapshot);
 1138|    552|    if (mem->Get(lkey, value, &s)) {
  ------------------
  |  Branch (1138:9): [True: 0, False: 552]
  ------------------
 1139|       |      // Done
 1140|    552|    } else if (imm != nullptr && imm->Get(lkey, value, &s)) {
  ------------------
  |  Branch (1140:16): [True: 0, False: 552]
  |  Branch (1140:34): [True: 0, False: 0]
  ------------------
 1141|       |      // Done
 1142|    552|    } else {
 1143|    552|      s = current->Get(options, lkey, value, &stats);
 1144|    552|      have_stat_update = true;
 1145|    552|    }
 1146|    552|    mutex_.Lock();
 1147|    552|  }
 1148|       |
 1149|    552|  if (have_stat_update && current->UpdateStats(stats)) {
  ------------------
  |  Branch (1149:7): [True: 552, False: 0]
  |  Branch (1149:27): [True: 0, False: 552]
  ------------------
 1150|      0|    MaybeScheduleCompaction();
 1151|      0|  }
 1152|    552|  mem->Unref();
 1153|    552|  if (imm != nullptr) imm->Unref();
  ------------------
  |  Branch (1153:7): [True: 0, False: 552]
  ------------------
 1154|    552|  current->Unref();
 1155|    552|  return s;
 1156|    552|}
_ZN7leveldb2DBD2Ev:
 1477|      4|DB::~DB() = default;
_ZN7leveldb8SnapshotD2Ev:
 1522|      4|Snapshot::~Snapshot() = default;

_ZNK7leveldb21InternalKeyComparator7CompareERKNS_5SliceES3_:
   48|    552|int InternalKeyComparator::Compare(const Slice& akey, const Slice& bkey) const {
   49|       |  // Order by:
   50|       |  //    increasing user key (according to user-supplied comparator)
   51|       |  //    decreasing sequence number
   52|       |  //    decreasing type (though sequence# should be enough to disambiguate)
   53|    552|  int r = user_comparator_->Compare(ExtractUserKey(akey), ExtractUserKey(bkey));
   54|    552|  if (r == 0) {
  ------------------
  |  Branch (54:7): [True: 0, False: 552]
  ------------------
   55|      0|    const uint64_t anum = DecodeFixed64(akey.data() + akey.size() - 8);
   56|      0|    const uint64_t bnum = DecodeFixed64(bkey.data() + bkey.size() - 8);
   57|      0|    if (anum > bnum) {
  ------------------
  |  Branch (57:9): [True: 0, False: 0]
  ------------------
   58|      0|      r = -1;
   59|      0|    } else if (anum < bnum) {
  ------------------
  |  Branch (59:16): [True: 0, False: 0]
  ------------------
   60|      0|      r = +1;
   61|      0|    }
   62|      0|  }
   63|    552|  return r;
   64|    552|}
_ZN7leveldb9LookupKeyC2ERKNS_5SliceEm:
  118|    552|LookupKey::LookupKey(const Slice& user_key, SequenceNumber s) {
  119|    552|  size_t usize = user_key.size();
  120|    552|  size_t needed = usize + 13;  // A conservative estimate
  121|    552|  char* dst;
  122|    552|  if (needed <= sizeof(space_)) {
  ------------------
  |  Branch (122:7): [True: 552, False: 0]
  ------------------
  123|    552|    dst = space_;
  124|    552|  } else {
  125|      0|    dst = new char[needed];
  126|      0|  }
  127|    552|  start_ = dst;
  128|    552|  dst = EncodeVarint32(dst, usize + 8);
  129|    552|  kstart_ = dst;
  130|    552|  memcpy(dst, user_key.data(), usize);
  131|    552|  dst += usize;
  132|    552|  EncodeFixed64(dst, PackSequenceAndType(s, kValueTypeForSeek));
  133|    552|  dst += 8;
  134|    552|  end_ = dst;
  135|    552|}
dbformat.cc:_ZN7leveldbL19PackSequenceAndTypeEmNS_9ValueTypeE:
   16|    552|static uint64_t PackSequenceAndType(uint64_t seq, ValueType t) {
   17|    552|  assert(seq <= kMaxSequenceNumber);
   18|    552|  assert(t <= kValueTypeForSeek);
   19|    552|  return (seq << 8) | t;
   20|    552|}

_ZNK7leveldb21InternalKeyComparator15user_comparatorEv:
  114|  1.10k|  const Comparator* user_comparator() const { return user_comparator_; }
_ZN7leveldb14ExtractUserKeyERKNS_5SliceE:
   95|  1.10k|inline Slice ExtractUserKey(const Slice& internal_key) {
   96|  1.10k|  assert(internal_key.size() >= 8);
   97|  1.10k|  return Slice(internal_key.data(), internal_key.size() - 8);
   98|  1.10k|}
_ZN7leveldb9LookupKeyD2Ev:
  218|    552|inline LookupKey::~LookupKey() {
  219|    552|  if (start_ != space_) delete[] start_;
  ------------------
  |  Branch (219:7): [True: 0, False: 552]
  ------------------
  220|    552|}
_ZNK7leveldb9LookupKey12memtable_keyEv:
  196|    552|  Slice memtable_key() const { return Slice(start_, end_ - start_); }
_ZNK7leveldb9LookupKey12internal_keyEv:
  199|    552|  Slice internal_key() const { return Slice(kstart_, end_ - kstart_); }
_ZNK7leveldb9LookupKey8user_keyEv:
  202|    552|  Slice user_key() const { return Slice(kstart_, end_ - kstart_ - 8); }

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

_ZN7leveldb8MemTableD2Ev:
   24|      4|MemTable::~MemTable() { assert(refs_ == 0); }
_ZNK7leveldb8MemTable13KeyComparatorclEPKcS3_:
   29|    552|                                        const char* bptr) const {
   30|       |  // Internal keys are encoded as length-prefixed strings.
   31|    552|  Slice a = GetLengthPrefixedSlice(aptr);
   32|    552|  Slice b = GetLengthPrefixedSlice(bptr);
   33|    552|  return comparator.Compare(a, b);
   34|    552|}
_ZN7leveldb8MemTable3GetERKNS_9LookupKeyEPNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPNS_6StatusE:
  101|    552|bool MemTable::Get(const LookupKey& key, std::string* value, Status* s) {
  102|    552|  Slice memkey = key.memtable_key();
  103|    552|  Table::Iterator iter(&table_);
  104|    552|  iter.Seek(memkey.data());
  105|    552|  if (iter.Valid()) {
  ------------------
  |  Branch (105:7): [True: 0, False: 552]
  ------------------
  106|       |    // entry format is:
  107|       |    //    klength  varint32
  108|       |    //    userkey  char[klength]
  109|       |    //    tag      uint64
  110|       |    //    vlength  varint32
  111|       |    //    value    char[vlength]
  112|       |    // Check that it belongs to same user key.  We do not check the
  113|       |    // sequence number since the Seek() call above should have skipped
  114|       |    // all entries with overly large sequence numbers.
  115|      0|    const char* entry = iter.key();
  116|      0|    uint32_t key_length;
  117|      0|    const char* key_ptr = GetVarint32Ptr(entry, entry + 5, &key_length);
  118|      0|    if (comparator_.comparator.user_comparator()->Compare(
  ------------------
  |  Branch (118:9): [True: 0, False: 0]
  ------------------
  119|      0|            Slice(key_ptr, key_length - 8), key.user_key()) == 0) {
  120|       |      // Correct user key
  121|      0|      const uint64_t tag = DecodeFixed64(key_ptr + key_length - 8);
  122|      0|      switch (static_cast<ValueType>(tag & 0xff)) {
  ------------------
  |  Branch (122:15): [True: 0, False: 0]
  ------------------
  123|      0|        case kTypeValue: {
  ------------------
  |  Branch (123:9): [True: 0, False: 0]
  ------------------
  124|      0|          Slice v = GetLengthPrefixedSlice(key_ptr + key_length);
  125|      0|          value->assign(v.data(), v.size());
  126|      0|          return true;
  127|      0|        }
  128|      0|        case kTypeDeletion:
  ------------------
  |  Branch (128:9): [True: 0, False: 0]
  ------------------
  129|      0|          *s = Status::NotFound(Slice());
  130|      0|          return true;
  131|      0|      }
  132|      0|    }
  133|      0|  }
  134|    552|  return false;
  135|    552|}
memtable.cc:_ZN7leveldbL22GetLengthPrefixedSliceEPKc:
   14|  1.10k|static Slice GetLengthPrefixedSlice(const char* data) {
   15|  1.10k|  uint32_t len;
   16|  1.10k|  const char* p = data;
   17|  1.10k|  p = GetVarint32Ptr(p, p + 5, &len);  // +5: we assume "p" is not corrupted
   18|  1.10k|  return Slice(p, len);
   19|  1.10k|}

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

_ZN7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE4Node4NextEi:
  153|  1.65k|  Node* Next(int n) {
  154|  1.65k|    assert(n >= 0);
  155|       |    // Use an 'acquire load' so that we observe a fully initialized
  156|       |    // version of the returned Node.
  157|  1.65k|    return next_[n].load(std::memory_order_acquire);
  158|  1.65k|  }
_ZNK7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE12GetMaxHeightEv:
  104|    552|  inline int GetMaxHeight() const {
  105|    552|    return max_height_.load(std::memory_order_relaxed);
  106|    552|  }
_ZN7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE8IteratorC2EPKS5_:
  190|    552|inline SkipList<Key, Comparator>::Iterator::Iterator(const SkipList* list) {
  191|    552|  list_ = list;
  192|    552|  node_ = nullptr;
  193|    552|}
_ZNK7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE8Iterator5ValidEv:
  196|    552|inline bool SkipList<Key, Comparator>::Iterator::Valid() const {
  197|    552|  return node_ != nullptr;
  198|    552|}
_ZN7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE8Iterator4SeekERKS2_:
  224|    552|inline void SkipList<Key, Comparator>::Iterator::Seek(const Key& target) {
  225|    552|  node_ = list_->FindGreaterOrEqual(target, nullptr);
  226|    552|}
_ZNK7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE18FindGreaterOrEqualERKS2_PPNS5_4NodeE:
  263|    552|                                              Node** prev) const {
  264|    552|  Node* x = head_;
  265|    552|  int level = GetMaxHeight() - 1;
  266|  1.65k|  while (true) {
  ------------------
  |  Branch (266:10): [Folded - Ignored]
  ------------------
  267|  1.65k|    Node* next = x->Next(level);
  268|  1.65k|    if (KeyIsAfterNode(key, next)) {
  ------------------
  |  Branch (268:9): [True: 552, False: 1.10k]
  ------------------
  269|       |      // Keep searching in this list
  270|    552|      x = next;
  271|  1.10k|    } else {
  272|  1.10k|      if (prev != nullptr) prev[level] = x;
  ------------------
  |  Branch (272:11): [True: 0, False: 1.10k]
  ------------------
  273|  1.10k|      if (level == 0) {
  ------------------
  |  Branch (273:11): [True: 552, False: 552]
  ------------------
  274|    552|        return next;
  275|    552|      } else {
  276|       |        // Switch to next list
  277|    552|        level--;
  278|    552|      }
  279|  1.10k|    }
  280|  1.65k|  }
  281|    552|}
_ZNK7leveldb8SkipListIPKcNS_8MemTable13KeyComparatorEE14KeyIsAfterNodeERKS2_PNS5_4NodeE:
  255|  1.65k|bool SkipList<Key, Comparator>::KeyIsAfterNode(const Key& key, Node* n) const {
  256|       |  // null n is considered infinite
  257|  1.65k|  return (n != nullptr) && (compare_(n->key, key) < 0);
  ------------------
  |  Branch (257:10): [True: 552, False: 1.10k]
  |  Branch (257:28): [True: 552, False: 0]
  ------------------
  258|  1.65k|}

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

_ZN7leveldb7VersionD2Ev:
   68|      8|Version::~Version() {
   69|      8|  assert(refs_ == 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);
   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|}
_ZN7leveldb7Version18ForEachOverlappingENS_5SliceES1_PvPFbS2_iPNS_12FileMetaDataEE:
  283|    552|                                 bool (*func)(void*, int, FileMetaData*)) {
  284|    552|  const Comparator* ucmp = vset_->icmp_.user_comparator();
  285|       |
  286|       |  // Search level-0 in order from newest to oldest.
  287|    552|  std::vector<FileMetaData*> tmp;
  288|    552|  tmp.reserve(files_[0].size());
  289|    552|  for (uint32_t i = 0; i < files_[0].size(); i++) {
  ------------------
  |  Branch (289:24): [True: 0, False: 552]
  ------------------
  290|      0|    FileMetaData* f = files_[0][i];
  291|      0|    if (ucmp->Compare(user_key, f->smallest.user_key()) >= 0 &&
  ------------------
  |  Branch (291:9): [True: 0, False: 0]
  |  Branch (291:9): [True: 0, False: 0]
  ------------------
  292|      0|        ucmp->Compare(user_key, f->largest.user_key()) <= 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|      0|      tmp.push_back(f);
  294|      0|    }
  295|      0|  }
  296|    552|  if (!tmp.empty()) {
  ------------------
  |  Branch (296:7): [True: 0, False: 552]
  ------------------
  297|      0|    std::sort(tmp.begin(), tmp.end(), NewestFirst);
  298|      0|    for (uint32_t i = 0; i < tmp.size(); i++) {
  ------------------
  |  Branch (298:26): [True: 0, False: 0]
  ------------------
  299|      0|      if (!(*func)(arg, 0, tmp[i])) {
  ------------------
  |  Branch (299:11): [True: 0, False: 0]
  ------------------
  300|      0|        return;
  301|      0|      }
  302|      0|    }
  303|      0|  }
  304|       |
  305|       |  // Search other levels.
  306|  3.86k|  for (int level = 1; level < config::kNumLevels; level++) {
  ------------------
  |  Branch (306:23): [True: 3.31k, False: 552]
  ------------------
  307|  3.31k|    size_t num_files = files_[level].size();
  308|  3.31k|    if (num_files == 0) continue;
  ------------------
  |  Branch (308:9): [True: 3.31k, False: 0]
  ------------------
  309|       |
  310|       |    // Binary search to find earliest index whose largest key >= internal_key.
  311|      0|    uint32_t index = FindFile(vset_->icmp_, files_[level], internal_key);
  312|      0|    if (index < num_files) {
  ------------------
  |  Branch (312:9): [True: 0, False: 0]
  ------------------
  313|      0|      FileMetaData* f = files_[level][index];
  314|      0|      if (ucmp->Compare(user_key, f->smallest.user_key()) < 0) {
  ------------------
  |  Branch (314:11): [True: 0, False: 0]
  ------------------
  315|       |        // All of "f" is past any data for user_key
  316|      0|      } else {
  317|      0|        if (!(*func)(arg, level, f)) {
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|          return;
  319|      0|        }
  320|      0|      }
  321|      0|    }
  322|      0|  }
  323|    552|}
_ZN7leveldb7Version3GetERKNS_11ReadOptionsERKNS_9LookupKeyEPNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEPNS0_8GetStatsE:
  326|    552|                    std::string* value, GetStats* stats) {
  327|    552|  stats->seek_file = nullptr;
  328|    552|  stats->seek_file_level = -1;
  329|       |
  330|    552|  struct State {
  331|    552|    Saver saver;
  332|    552|    GetStats* stats;
  333|    552|    const ReadOptions* options;
  334|    552|    Slice ikey;
  335|    552|    FileMetaData* last_file_read;
  336|    552|    int last_file_read_level;
  337|       |
  338|    552|    VersionSet* vset;
  339|    552|    Status s;
  340|    552|    bool found;
  341|       |
  342|    552|    static bool Match(void* arg, int level, FileMetaData* f) {
  343|    552|      State* state = reinterpret_cast<State*>(arg);
  344|       |
  345|    552|      if (state->stats->seek_file == nullptr &&
  346|    552|          state->last_file_read != nullptr) {
  347|       |        // We have had more than one seek for this read.  Charge the 1st file.
  348|    552|        state->stats->seek_file = state->last_file_read;
  349|    552|        state->stats->seek_file_level = state->last_file_read_level;
  350|    552|      }
  351|       |
  352|    552|      state->last_file_read = f;
  353|    552|      state->last_file_read_level = level;
  354|       |
  355|    552|      state->s = state->vset->table_cache_->Get(*state->options, f->number,
  356|    552|                                                f->file_size, state->ikey,
  357|    552|                                                &state->saver, SaveValue);
  358|    552|      if (!state->s.ok()) {
  359|    552|        state->found = true;
  360|    552|        return false;
  361|    552|      }
  362|    552|      switch (state->saver.state) {
  363|    552|        case kNotFound:
  364|    552|          return true;  // Keep searching in other files
  365|    552|        case kFound:
  366|    552|          state->found = true;
  367|    552|          return false;
  368|    552|        case kDeleted:
  369|    552|          return false;
  370|    552|        case kCorrupt:
  371|    552|          state->s =
  372|    552|              Status::Corruption("corrupted key for ", state->saver.user_key);
  373|    552|          state->found = true;
  374|    552|          return false;
  375|    552|      }
  376|       |
  377|       |      // Not reached. Added to avoid false compilation warnings of
  378|       |      // "control reaches end of non-void function".
  379|    552|      return false;
  380|    552|    }
  381|    552|  };
  382|       |
  383|    552|  State state;
  384|    552|  state.found = false;
  385|    552|  state.stats = stats;
  386|    552|  state.last_file_read = nullptr;
  387|    552|  state.last_file_read_level = -1;
  388|       |
  389|    552|  state.options = &options;
  390|    552|  state.ikey = k.internal_key();
  391|    552|  state.vset = vset_;
  392|       |
  393|    552|  state.saver.state = kNotFound;
  394|    552|  state.saver.ucmp = vset_->icmp_.user_comparator();
  395|    552|  state.saver.user_key = k.user_key();
  396|    552|  state.saver.value = value;
  397|       |
  398|    552|  ForEachOverlapping(state.saver.user_key, state.ikey, &state, &State::Match);
  399|       |
  400|    552|  return state.found ? state.s : Status::NotFound(Slice());
  ------------------
  |  Branch (400:10): [True: 0, False: 552]
  ------------------
  401|    552|}
_ZN7leveldb7Version11UpdateStatsERKNS0_8GetStatsE:
  403|    552|bool Version::UpdateStats(const GetStats& stats) {
  404|    552|  FileMetaData* f = stats.seek_file;
  405|    552|  if (f != nullptr) {
  ------------------
  |  Branch (405:7): [True: 0, False: 552]
  ------------------
  406|      0|    f->allowed_seeks--;
  407|      0|    if (f->allowed_seeks <= 0 && file_to_compact_ == nullptr) {
  ------------------
  |  Branch (407:9): [True: 0, False: 0]
  |  Branch (407:34): [True: 0, False: 0]
  ------------------
  408|      0|      file_to_compact_ = f;
  409|      0|      file_to_compact_level_ = stats.seek_file_level;
  410|      0|      return true;
  411|      0|    }
  412|      0|  }
  413|    552|  return false;
  414|    552|}
_ZN7leveldb7Version3RefEv:
  454|    552|void Version::Ref() { ++refs_; }
_ZN7leveldb7Version5UnrefEv:
  456|    556|void Version::Unref() {
  457|    556|  assert(this != &vset_->dummy_versions_);
  458|    556|  assert(refs_ >= 1);
  459|    556|  --refs_;
  460|    556|  if (refs_ == 0) {
  ------------------
  |  Branch (460:7): [True: 4, False: 552]
  ------------------
  461|      4|    delete this;
  462|      4|  }
  463|    556|}
_ZN7leveldb10VersionSetD2Ev:
  754|      4|VersionSet::~VersionSet() {
  755|      4|  current_->Unref();
  756|      4|  assert(dummy_versions_.next_ == &dummy_versions_);  // List must be empty
  757|      4|  delete descriptor_log_;
  758|      4|  delete descriptor_file_;
  759|      4|}

_ZNK7leveldb10VersionSet12LastSequenceEv:
  212|    552|  uint64_t LastSequence() const { return last_sequence_; }
_ZNK7leveldb10VersionSet7currentEv:
  188|    552|  Version* current() const { return current_; }

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

_ZN7leveldb5SliceC2EPKcm:
   34|  4.41k|  Slice(const char* d, size_t n) : data_(d), size_(n) {}
_ZNK7leveldb5Slice4sizeEv:
   50|  3.86k|  size_t size() const { return size_; }
_ZNK7leveldb5Slice4dataEv:
   47|  2.76k|  const char* data() const { return data_; }
_ZN7leveldb5SliceC2Ev:
   31|  2.20k|  Slice() : data_(""), size_(0) {}
_ZNK7leveldb5Slice7compareERKS0_:
  104|    552|inline int Slice::compare(const Slice& b) const {
  105|    552|  const size_t min_len = (size_ < b.size_) ? size_ : b.size_;
  ------------------
  |  Branch (105:26): [True: 552, False: 0]
  ------------------
  106|    552|  int r = memcmp(data_, b.data_, min_len);
  107|    552|  if (r == 0) {
  ------------------
  |  Branch (107:7): [True: 0, False: 552]
  ------------------
  108|      0|    if (size_ < b.size_)
  ------------------
  |  Branch (108:9): [True: 0, False: 0]
  ------------------
  109|      0|      r = -1;
  110|      0|    else if (size_ > b.size_)
  ------------------
  |  Branch (110:14): [True: 0, False: 0]
  ------------------
  111|      0|      r = +1;
  112|      0|  }
  113|    552|  return r;
  114|    552|}

_ZNK7leveldb6Status2okEv:
   57|    552|  bool ok() const { return (state_ == nullptr); }
_ZN7leveldb6StatusD2Ev:
   28|  1.66k|  ~Status() { delete[] state_; }
_ZNK7leveldb6Status10IsNotFoundEv:
   60|    552|  bool IsNotFound() const { return code() == kNotFound; }
_ZNK7leveldb6Status4codeEv:
   88|    552|  Code code() const {
   89|    552|    return (state_ == nullptr) ? kOk : static_cast<Code>(state_[4]);
  ------------------
  |  Branch (89:12): [True: 0, False: 552]
  ------------------
   90|    552|  }
_ZN7leveldb6StatusC2Ev:
   27|  1.10k|  Status() noexcept : state_(nullptr) {}
_ZN7leveldb6Status2OKEv:
   37|      4|  static Status OK() { return Status(); }
_ZN7leveldb6Status8NotFoundERKNS_5SliceES3_:
   40|    552|  static Status NotFound(const Slice& msg, const Slice& msg2 = Slice()) {
   41|    552|    return Status(kNotFound, msg, msg2);
   42|    552|  }
_ZN7leveldb6StatusaSEOS0_:
  119|    552|inline Status& Status::operator=(Status&& rhs) noexcept {
  120|    552|  std::swap(state_, rhs.state_);
  121|    552|  return *this;
  122|    552|}

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

_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
  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);
  210|      0|    e->in_cache = false;
  211|      0|    assert(e->refs == 1);  // Invariant of lru_ list.
  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 {}

_ZN7leveldb14EncodeVarint32EPcj:
   21|    552|char* EncodeVarint32(char* dst, uint32_t v) {
   22|       |  // Operate on characters as unsigneds
   23|    552|  uint8_t* ptr = reinterpret_cast<uint8_t*>(dst);
   24|    552|  static const int B = 128;
   25|    552|  if (v < (1 << 7)) {
  ------------------
  |  Branch (25:7): [True: 552, False: 0]
  ------------------
   26|    552|    *(ptr++) = v;
   27|    552|  } else if (v < (1 << 14)) {
  ------------------
  |  Branch (27:14): [True: 0, False: 0]
  ------------------
   28|      0|    *(ptr++) = v | B;
   29|      0|    *(ptr++) = v >> 7;
   30|      0|  } else if (v < (1 << 21)) {
  ------------------
  |  Branch (30:14): [True: 0, False: 0]
  ------------------
   31|      0|    *(ptr++) = v | B;
   32|      0|    *(ptr++) = (v >> 7) | B;
   33|      0|    *(ptr++) = v >> 14;
   34|      0|  } else if (v < (1 << 28)) {
  ------------------
  |  Branch (34:14): [True: 0, False: 0]
  ------------------
   35|      0|    *(ptr++) = v | B;
   36|      0|    *(ptr++) = (v >> 7) | B;
   37|      0|    *(ptr++) = (v >> 14) | B;
   38|      0|    *(ptr++) = v >> 21;
   39|      0|  } else {
   40|      0|    *(ptr++) = v | B;
   41|      0|    *(ptr++) = (v >> 7) | B;
   42|      0|    *(ptr++) = (v >> 14) | B;
   43|      0|    *(ptr++) = (v >> 21) | B;
   44|      0|    *(ptr++) = v >> 28;
   45|      0|  }
   46|    552|  return reinterpret_cast<char*>(ptr);
   47|    552|}

_ZN7leveldb13EncodeFixed64EPcm:
   64|    552|inline void EncodeFixed64(char* dst, uint64_t value) {
   65|    552|  uint8_t* const buffer = reinterpret_cast<uint8_t*>(dst);
   66|       |
   67|       |  // Recent clang and gcc optimize this to a single mov / str instruction.
   68|    552|  buffer[0] = static_cast<uint8_t>(value);
   69|    552|  buffer[1] = static_cast<uint8_t>(value >> 8);
   70|    552|  buffer[2] = static_cast<uint8_t>(value >> 16);
   71|    552|  buffer[3] = static_cast<uint8_t>(value >> 24);
   72|    552|  buffer[4] = static_cast<uint8_t>(value >> 32);
   73|    552|  buffer[5] = static_cast<uint8_t>(value >> 40);
   74|    552|  buffer[6] = static_cast<uint8_t>(value >> 48);
   75|    552|  buffer[7] = static_cast<uint8_t>(value >> 56);
   76|    552|}
_ZN7leveldb14GetVarint32PtrEPKcS1_Pj:
  109|  1.10k|                                  uint32_t* value) {
  110|  1.10k|  if (p < limit) {
  ------------------
  |  Branch (110:7): [True: 1.10k, False: 0]
  ------------------
  111|  1.10k|    uint32_t result = *(reinterpret_cast<const uint8_t*>(p));
  112|  1.10k|    if ((result & 128) == 0) {
  ------------------
  |  Branch (112:9): [True: 1.10k, False: 0]
  ------------------
  113|  1.10k|      *value = result;
  114|  1.10k|      return p + 1;
  115|  1.10k|    }
  116|  1.10k|  }
  117|      0|  return GetVarint32PtrFallback(p, limit, value);
  118|  1.10k|}

_ZN7leveldb10ComparatorD2Ev:
   18|     16|Comparator::~Comparator() = default;
comparator.cc:_ZNK7leveldb12_GLOBAL__N_122BytewiseComparatorImpl7CompareERKNS_5SliceES4_:
   27|    552|  int Compare(const Slice& a, const Slice& b) const override {
   28|    552|    return a.compare(b);
   29|    552|  }

_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|    584|  explicit MutexLock(port::Mutex* mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mu_(mu) {
   26|    584|    this->mu_->Lock();
   27|    584|  }
_ZN7leveldb9MutexLockD2Ev:
   28|    584|  ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); }

_ZN7leveldb6StatusC2ENS0_4CodeERKNS_5SliceES4_:
   21|    552|Status::Status(Code code, const Slice& msg, const Slice& msg2) {
   22|    552|  assert(code != kOk);
   23|    552|  const uint32_t len1 = static_cast<uint32_t>(msg.size());
   24|    552|  const uint32_t len2 = static_cast<uint32_t>(msg2.size());
   25|    552|  const uint32_t size = len1 + (len2 ? (2 + len2) : 0);
  ------------------
  |  Branch (25:33): [True: 0, False: 552]
  ------------------
   26|    552|  char* result = new char[size + 5];
   27|    552|  memcpy(result, &size, sizeof(size));
   28|    552|  result[4] = static_cast<char>(code);
   29|    552|  memcpy(result + 5, msg.data(), len1);
   30|    552|  if (len2) {
  ------------------
  |  Branch (30:7): [True: 0, False: 552]
  ------------------
   31|      0|    result[5 + len1] = ':';
   32|      0|    result[6 + len1] = ' ';
   33|      0|    memcpy(result + 7 + len1, msg2.data(), len2);
   34|      0|  }
   35|    552|  state_ = result;
   36|    552|}

_Z11LogInstancev:
   25|  3.41M|{
   26|       |/**
   27|       | * NOTE: the logger instances is leaked on exit. This is ugly, but will be
   28|       | * cleaned up by the OS/libc. Defining a logger as a global object doesn't work
   29|       | * since the order of destruction of static/global objects is undefined.
   30|       | * Consider if the logger gets destroyed, and then some later destructor calls
   31|       | * LogPrintf, maybe indirectly, and you get a core dump at shutdown trying to
   32|       | * access the logger. When the shutdown sequence is fully audited and tested,
   33|       | * explicit destruction of these objects can be implemented by changing this
   34|       | * from a raw pointer to a std::unique_ptr.
   35|       | * Since the ~Logger() destructor is never called, the Logger class and all
   36|       | * its subclasses must have implicitly-defined destructors.
   37|       | *
   38|       | * This method of initialization was originally introduced in
   39|       | * ee3374234c60aba2cc4c5cd5cac1c0aefc2d817c.
   40|       | */
   41|  3.41M|    static BCLog::Logger* g_logger{new BCLog::Logger()};
   42|  3.41M|    return *g_logger;
   43|  3.41M|}
_ZN5BCLog6Logger20DisconnectTestLoggerEv:
   97|      2|{
   98|      2|    StdLockGuard scoped_lock(m_cs);
   99|      2|    m_buffering = true;
  100|      2|    if (m_fileout != nullptr) fclose(m_fileout);
  ------------------
  |  Branch (100:9): [True: 0, False: 2]
  ------------------
  101|      2|    m_fileout = nullptr;
  102|      2|    m_print_callbacks.clear();
  103|      2|    m_max_buffer_memusage = DEFAULT_MAX_LOG_BUFFER;
  104|      2|    m_cur_buffer_memusage = 0;
  105|      2|    m_buffer_lines_discarded = 0;
  106|      2|    m_msgs_before_open.clear();
  107|      2|}
_ZNK5BCLog6Logger15WillLogCategoryENS_8LogFlagsE:
  148|  3.40M|{
  149|  3.40M|    return (m_categories.load(std::memory_order_relaxed) & category) != 0;
  150|  3.40M|}
_ZNK5BCLog6Logger20WillLogCategoryLevelENS_8LogFlagsENS_5LevelE:
  153|  3.40M|{
  154|       |    // Log messages at Info, Warning and Error level unconditionally, so that
  155|       |    // important troubleshooting information doesn't get lost.
  156|  3.40M|    if (level >= BCLog::Level::Info) return true;
  ------------------
  |  Branch (156:9): [True: 0, False: 3.40M]
  ------------------
  157|       |
  158|  3.40M|    if (!WillLogCategory(category)) return false;
  ------------------
  |  Branch (158:9): [True: 3.40M, False: 0]
  ------------------
  159|       |
  160|      0|    StdLockGuard scoped_lock(m_cs);
  161|      0|    const auto it{m_category_log_levels.find(category)};
  162|      0|    return level >= (it == m_category_log_levels.end() ? LogLevel() : it->second);
  ------------------
  |  Branch (162:22): [True: 0, False: 0]
  ------------------
  163|  3.40M|}

_ZNK5BCLog6Logger7EnabledEv:
  150|  18.9k|        {
  151|  18.9k|            StdLockGuard scoped_lock(m_cs);
  152|  18.9k|            return m_buffering || m_print_to_console || m_print_to_file || !m_print_callbacks.empty();
  ------------------
  |  Branch (152:20): [True: 0, False: 18.9k]
  |  Branch (152:35): [True: 0, False: 18.9k]
  |  Branch (152:57): [True: 0, False: 18.9k]
  |  Branch (152:76): [True: 0, False: 18.9k]
  ------------------
  153|  18.9k|        }
addrman.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|  51.5k|{
  235|  51.5k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|  51.5k|}
net.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|   111k|{
  235|   111k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|   111k|}
_Z22LogPrintFormatInternalIJNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEEvNS0_17basic_string_viewIcS3_EES8_iN5BCLog8LogFlagsENS9_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|  3.18k|{
  244|  3.18k|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 3.18k]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|  3.18k|}
_Z22LogPrintFormatInternalIJEEvNSt3__117basic_string_viewIcNS0_11char_traitsIcEEEES4_iN5BCLog8LogFlagsENS5_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|  3.80k|{
  244|  3.80k|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 3.80k]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|  3.80k|}
_Z22LogPrintFormatInternalIJNSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEEEvS4_S4_iN5BCLog8LogFlagsENS5_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|      2|{
  244|      2|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 2]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|      2|}
_Z22LogPrintFormatInternalIJPKcNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvNS2_17basic_string_viewIcS5_EESA_iN5BCLog8LogFlagsENSB_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|  8.47k|{
  244|  8.47k|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 8.47k]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|  8.47k|}
txmempool.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|  1.36k|{
  235|  1.36k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|  1.36k|}
validation.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|    576|{
  235|    576|    return LogInstance().WillLogCategoryLevel(category, level);
  236|    576|}
_Z22LogPrintFormatInternalIJA16_cNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvNS1_17basic_string_viewIcS4_EES9_iN5BCLog8LogFlagsENSA_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|    116|{
  244|    116|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 116]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|    116|}
blockencodings.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|     71|{
  235|     71|    return LogInstance().WillLogCategoryLevel(category, level);
  236|     71|}
_Z22LogPrintFormatInternalIJNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEElEEvNS0_17basic_string_viewIcS3_EES8_iN5BCLog8LogFlagsENS9_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|     44|{
  244|     44|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 44]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|     44|}
_Z22LogPrintFormatInternalIJlEEvNSt3__117basic_string_viewIcNS0_11char_traitsIcEEEES4_iN5BCLog8LogFlagsENS5_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|    244|{
  244|    244|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 244]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|    244|}
net_processing.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|  2.38M|{
  235|  2.38M|    return LogInstance().WillLogCategoryLevel(category, level);
  236|  2.38M|}
_Z22LogPrintFormatInternalIJNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES6_iNS0_6atomicIiEElS6_S6_EEvNS0_17basic_string_viewIcS3_EESA_iN5BCLog8LogFlagsENSB_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|  3.07k|{
  244|  3.07k|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 3.07k]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|  3.07k|}
_Z22LogPrintFormatInternalIJNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES6_lEEvNS0_17basic_string_viewIcS3_EES8_iN5BCLog8LogFlagsENS9_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|      3|{
  244|      3|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 3]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|      3|}
timeoffsets.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|  3.19k|{
  235|  3.19k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|  3.19k|}
txdownloadman_impl.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|   842k|{
  235|   842k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|   842k|}
txreconciliation.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|  7.60k|{
  235|  7.60k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|  7.60k|}
txorphanage.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|  1.65k|{
  235|  1.65k|    return LogInstance().WillLogCategoryLevel(category, level);
  236|  1.65k|}
_Z22LogPrintFormatInternalIJidEEvNSt3__117basic_string_viewIcNS0_11char_traitsIcEEEES4_iN5BCLog8LogFlagsENS5_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|      1|{
  244|      1|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 0, False: 1]
  ------------------
  245|      0|        std::string log_msg;
  246|      0|        try {
  247|      0|            log_msg = tfm::format(fmt, args...);
  248|      0|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|      0|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|      0|    }
  253|      1|}
validationinterface.cpp:_ZL17LogAcceptCategoryN5BCLog8LogFlagsENS_5LevelE:
  234|    116|{
  235|    116|    return LogInstance().WillLogCategoryLevel(category, level);
  236|    116|}

net.cpp:_ZN8memusageL11MallocUsageEm:
   53|   247k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|   247k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 112k, False: 134k]
  ------------------
   56|   112k|        return 0;
   57|   134k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [Folded - Ignored]
  ------------------
   58|   134k|        return ((alloc + 31) >> 4) << 4;
   59|   134k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded - Ignored]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|      0|        assert(0);
   63|      0|    }
   64|   247k|}
net.cpp:_ZN8memusageL12DynamicUsageERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   95|   295k|{
   96|   295k|    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|   295k|    if (!std::less{}(s.data(), s_ptr) && !std::greater{}(s.data() + s.size(), s_ptr + sizeof(s))) {
  ------------------
  |  Branch (100:9): [True: 295k, False: 0]
  |  Branch (100:9): [True: 295k, False: 0]
  |  Branch (100:42): [True: 295k, False: 0]
  ------------------
  101|   295k|        return 0;
  102|   295k|    }
  103|      0|    return MallocUsage(s.capacity());
  104|   295k|}
net.cpp:_ZN8memusageL12DynamicUsageIhNSt3__19allocatorIhEEEEmRKNS1_6vectorIT_T0_EE:
   90|   247k|{
   91|   247k|    return MallocUsage(v.capacity() * sizeof(T));
   92|   247k|}
coins.cpp:_ZN8memusageL12DynamicUsageILj28EhjiEEmRK9prevectorIXT_ET0_T1_T2_E:
  108|    180|{
  109|    180|    return MallocUsage(v.allocated_memory());
  110|    180|}
coins.cpp:_ZN8memusageL11MallocUsageEm:
   53|  8.34k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|  8.34k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 180, False: 8.16k]
  ------------------
   56|    180|        return 0;
   57|  8.16k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [Folded - Ignored]
  ------------------
   58|  8.16k|        return ((alloc + 31) >> 4) << 4;
   59|  8.16k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded - Ignored]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|      0|        assert(0);
   63|      0|    }
   64|  8.34k|}
coins.cpp:_ZN8memusageL12DynamicUsageI9COutPoint16CCoinsCacheEntry20SaltedOutpointHasherNSt3__18equal_toIS1_EELm144ELm8EEEmRKNS4_13unordered_mapIT_T0_T1_T2_13PoolAllocatorINS4_4pairIKS8_S9_EEXT3_EXT4_EEEE:
  207|  2.72k|{
  208|  2.72k|    auto* pool_resource = m.get_allocator().resource();
  209|       |
  210|       |    // The allocated chunks are stored in a std::list. Size per node should
  211|       |    // therefore be 3 pointers: next, previous, and a pointer to the chunk.
  212|  2.72k|    size_t estimated_list_node_size = MallocUsage(sizeof(void*) * 3);
  213|  2.72k|    size_t usage_resource = estimated_list_node_size * pool_resource->NumAllocatedChunks();
  214|  2.72k|    size_t usage_chunks = MallocUsage(pool_resource->ChunkSizeBytes()) * pool_resource->NumAllocatedChunks();
  215|  2.72k|    return usage_resource + usage_chunks + MallocUsage(sizeof(void*) * m.bucket_count());
  216|  2.72k|}
streams.cpp:_ZN8memusageL12DynamicUsageISt4byte25zero_after_free_allocatorIS1_EEEmRKNSt3__16vectorIT_T0_EE:
   90|  47.8k|{
   91|  47.8k|    return MallocUsage(v.capacity() * sizeof(T));
   92|  47.8k|}
streams.cpp:_ZN8memusageL11MallocUsageEm:
   53|  47.8k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|  47.8k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 16.1k, False: 31.6k]
  ------------------
   56|  16.1k|        return 0;
   57|  31.6k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [Folded - Ignored]
  ------------------
   58|  31.6k|        return ((alloc + 31) >> 4) << 4;
   59|  31.6k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded - Ignored]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|      0|        assert(0);
   63|      0|    }
   64|  47.8k|}
txmempool.cpp:_ZN8memusageL11MallocUsageEm:
   53|  5.44k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|  5.44k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 1.36k, False: 4.08k]
  ------------------
   56|  1.36k|        return 0;
   57|  4.08k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [Folded - Ignored]
  ------------------
   58|  4.08k|        return ((alloc + 31) >> 4) << 4;
   59|  4.08k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded - Ignored]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|      0|        assert(0);
   63|      0|    }
   64|  5.44k|}
txmempool.cpp:_ZN8memusageL12DynamicUsageINSt3__110shared_ptrIK12CTransactionEENS1_9allocatorIS5_EEEEmRKNS1_6vectorIT_T0_EE:
   90|  1.36k|{
   91|  1.36k|    return MallocUsage(v.capacity() * sizeof(T));
   92|  1.36k|}
net_processing.cpp:_ZN8memusageL12DynamicUsageI5CTxInNSt3__19allocatorIS1_EEEEmRKNS2_6vectorIT_T0_EE:
   90|  1.36k|{
   91|  1.36k|    return MallocUsage(v.capacity() * sizeof(T));
   92|  1.36k|}
net_processing.cpp:_ZN8memusageL11MallocUsageEm:
   53|   406k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|   406k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 378k, False: 27.6k]
  ------------------
   56|   378k|        return 0;
   57|   378k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [Folded - Ignored]
  ------------------
   58|  27.6k|        return ((alloc + 31) >> 4) << 4;
   59|  27.6k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded - Ignored]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|      0|        assert(0);
   63|      0|    }
   64|   406k|}
net_processing.cpp:_ZN8memusageL12DynamicUsageI6CTxOutNSt3__19allocatorIS1_EEEEmRKNS2_6vectorIT_T0_EE:
   90|  1.36k|{
   91|  1.36k|    return MallocUsage(v.capacity() * sizeof(T));
   92|  1.36k|}
net_processing.cpp:_ZN8memusageL12DynamicUsageILj28EhjiEEmRK9prevectorIXT_ET0_T1_T2_E:
  108|  19.4k|{
  109|  19.4k|    return MallocUsage(v.allocated_memory());
  110|  19.4k|}
net_processing.cpp:_ZN8memusageL12DynamicUsageINSt3__16vectorIhNS1_9allocatorIhEEEENS3_IS5_EEEEmRKNS2_IT_T0_EE:
   90|  11.7k|{
   91|  11.7k|    return MallocUsage(v.capacity() * sizeof(T));
   92|  11.7k|}
net_processing.cpp:_ZN8memusageL12DynamicUsageIhNSt3__19allocatorIhEEEEmRKNS1_6vectorIT_T0_EE:
   90|   372k|{
   91|   372k|    return MallocUsage(v.capacity() * sizeof(T));
   92|   372k|}
txmempool.cpp:_ZN8memusageL12DynamicUsageI9COutPointPK12CTransactionEEmRK11indirectmapIT_T0_E:
  140|  1.36k|{
  141|  1.36k|    return MallocUsage(sizeof(stl_tree_node<std::pair<const X*, Y> >)) * m.size();
  142|  1.36k|}
txmempool.cpp:_ZN8memusageL12DynamicUsageI7uint256lNSt3__14lessIS1_EEEEmRKNS2_3mapIT_T0_T1_NS2_9allocatorINS2_4pairIKS6_S7_EEEEEE:
  126|  1.36k|{
  127|  1.36k|    return MallocUsage(sizeof(stl_tree_node<std::pair<const X, Y> >)) * m.size();
  128|  1.36k|}

_ZN18CPartialMerkleTreeC2Ev:
  150|     27|CPartialMerkleTree::CPartialMerkleTree() : nTransactions(0), fBad(true) {}

_ZN12CMerkleBlockC2Ev:
  150|     27|    CMerkleBlock() = default;

_ZNK17CSerializedNetMsg14GetMemoryUsageEv:
  129|   247k|{
  130|   247k|    return sizeof(*this) + memusage::DynamicUsage(m_type) + memusage::DynamicUsage(data);
  131|   247k|}
_ZNK11CNetMessage14GetMemoryUsageEv:
  134|  47.8k|{
  135|  47.8k|    return sizeof(*this) + memusage::DynamicUsage(m_type) + m_recv.GetMemoryUsage();
  136|  47.8k|}
_Z13GetListenPortv:
  145|  1.95k|{
  146|       |    // If -bind= is provided with ":port" part, use that (first one if multiple are provided).
  147|  1.95k|    for (const std::string& bind_arg : gArgs.GetArgs("-bind")) {
  ------------------
  |  Branch (147:38): [True: 0, False: 1.95k]
  ------------------
  148|      0|        constexpr uint16_t dummy_port = 0;
  149|       |
  150|      0|        const std::optional<CService> bind_addr{Lookup(bind_arg, dummy_port, /*fAllowLookup=*/false)};
  151|      0|        if (bind_addr.has_value() && bind_addr->GetPort() != dummy_port) return bind_addr->GetPort();
  ------------------
  |  Branch (151:13): [True: 0, False: 0]
  |  Branch (151:38): [True: 0, False: 0]
  ------------------
  152|      0|    }
  153|       |
  154|       |    // Otherwise, if -whitebind= without NetPermissionFlags::NoBan is provided, use that
  155|       |    // (-whitebind= is required to have ":port").
  156|  1.95k|    for (const std::string& whitebind_arg : gArgs.GetArgs("-whitebind")) {
  ------------------
  |  Branch (156:43): [True: 0, False: 1.95k]
  ------------------
  157|      0|        NetWhitebindPermissions whitebind;
  158|      0|        bilingual_str error;
  159|      0|        if (NetWhitebindPermissions::TryParse(whitebind_arg, whitebind, error)) {
  ------------------
  |  Branch (159:13): [True: 0, False: 0]
  ------------------
  160|      0|            if (!NetPermissions::HasFlag(whitebind.m_flags, NetPermissionFlags::NoBan)) {
  ------------------
  |  Branch (160:17): [True: 0, False: 0]
  ------------------
  161|      0|                return whitebind.m_service.GetPort();
  162|      0|            }
  163|      0|        }
  164|      0|    }
  165|       |
  166|       |    // Otherwise, if -port= is provided, use that. Otherwise use the default port.
  167|  1.95k|    return static_cast<uint16_t>(gArgs.GetIntArg("-port", Params().GetDefaultPort()));
  168|  1.95k|}
_Z15GetLocalAddressRK5CNode:
  227|  1.95k|{
  228|  1.95k|    return GetLocal(peer).value_or(CService{CNetAddr(), GetListenPort()});
  229|  1.95k|}
_Z19GetLocalAddrForPeerR5CNode:
  247|  1.95k|{
  248|  1.95k|    CService addrLocal{GetLocalAddress(node)};
  249|       |    // If discovery is enabled, sometimes give our peer the address it
  250|       |    // tells us that it sees us as in case it has a better idea of our
  251|       |    // address than we do.
  252|  1.95k|    FastRandomContext rng;
  253|  1.95k|    if (IsPeerAddrLocalGood(&node) && (!addrLocal.IsRoutable() ||
  ------------------
  |  Branch (253:9): [True: 0, False: 1.95k]
  |  Branch (253:40): [True: 0, False: 0]
  ------------------
  254|      0|         rng.randbits((GetnScore(addrLocal) > LOCAL_MANUAL) ? 3 : 1) == 0))
  ------------------
  |  Branch (254:10): [True: 0, False: 0]
  |  Branch (254:23): [True: 0, False: 0]
  ------------------
  255|      0|    {
  256|      0|        if (node.IsInboundConn()) {
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|       |            // For inbound connections, assume both the address and the port
  258|       |            // as seen from the peer.
  259|      0|            addrLocal = CService{node.GetAddrLocal()};
  260|      0|        } else {
  261|       |            // For outbound connections, assume just the address as seen from
  262|       |            // the peer and leave the port in `addrLocal` as returned by
  263|       |            // `GetLocalAddress()` above. The peer has no way to observe our
  264|       |            // listening port when we have initiated the connection.
  265|      0|            addrLocal.SetIP(node.GetAddrLocal());
  266|      0|        }
  267|      0|    }
  268|  1.95k|    if (addrLocal.IsRoutable()) {
  ------------------
  |  Branch (268:9): [True: 0, False: 1.95k]
  ------------------
  269|      0|        LogDebug(BCLog::NET, "Advertising address %s to peer=%d\n", addrLocal.ToStringAddrPort(), node.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|      0|        return addrLocal;
  271|      0|    }
  272|       |    // Address is unroutable. Don't advertise.
  273|  1.95k|    return std::nullopt;
  274|  1.95k|}
_ZN8CConnman18CheckIncomingNonceEm:
  374|  5.16k|{
  375|  5.16k|    LOCK(m_nodes_mutex);
  ------------------
  |  |  257|  5.16k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.16k|#define 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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  376|  5.16k|    for (const CNode* pnode : m_nodes) {
  ------------------
  |  Branch (376:29): [True: 5.16k, False: 5.16k]
  ------------------
  377|  5.16k|        if (!pnode->fSuccessfullyConnected && !pnode->IsInboundConn() && pnode->GetLocalNonce() == nonce)
  ------------------
  |  Branch (377:13): [True: 5.16k, False: 0]
  |  Branch (377:47): [True: 0, False: 5.16k]
  |  Branch (377:74): [True: 0, False: 0]
  ------------------
  378|      0|            return false;
  379|  5.16k|    }
  380|  5.16k|    return true;
  381|  5.16k|}
_ZN5CNode21CloseSocketDisconnectEv:
  561|  12.5k|{
  562|  12.5k|    fDisconnect = true;
  563|  12.5k|    LOCK(m_sock_mutex);
  ------------------
  |  |  257|  12.5k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  12.5k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  12.5k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  12.5k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  564|  12.5k|    if (m_sock) {
  ------------------
  |  Branch (564:9): [True: 8.47k, False: 4.05k]
  ------------------
  565|  8.47k|        LogDebug(BCLog::NET, "Resetting socket for peer=%d%s", GetId(), LogIP(fLogIPs));
  ------------------
  |  |  280|  8.47k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  8.47k|    do {                                                  \
  |  |  |  |  274|  8.47k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8.47k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  8.47k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|  8.47k|        m_sock.reset();
  567|       |
  568|  8.47k|        TRACEPOINT(net, closed_connection,
  569|  8.47k|            GetId(),
  570|  8.47k|            m_addr_name.c_str(),
  571|  8.47k|            ConnectionTypeAsString().c_str(),
  572|  8.47k|            ConnectedThroughNetwork(),
  573|  8.47k|            Ticks<std::chrono::seconds>(m_connected));
  574|  8.47k|    }
  575|  12.5k|    m_i2p_sam_session.reset();
  576|  12.5k|}
_ZNK5CNode12GetAddrLocalEv:
  594|  1.95k|{
  595|  1.95k|    AssertLockNotHeld(m_addr_local_mutex);
  ------------------
  |  |  147|  1.95k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  596|  1.95k|    LOCK(m_addr_local_mutex);
  ------------------
  |  |  257|  1.95k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.95k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.95k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.95k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|  1.95k|    return m_addr_local;
  598|  1.95k|}
_ZN5CNode12SetAddrLocalERK8CService:
  600|  8.35k|void CNode::SetAddrLocal(const CService& addrLocalIn) {
  601|  8.35k|    AssertLockNotHeld(m_addr_local_mutex);
  ------------------
  |  |  147|  8.35k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  602|  8.35k|    LOCK(m_addr_local_mutex);
  ------------------
  |  |  257|  8.35k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.35k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.35k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.35k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  8.35k|    if (Assume(!m_addr_local.IsValid())) { // Addr local can only be set once during version msg processing
  ------------------
  |  |   97|  8.35k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  |  |  ------------------
  |  |  |  Branch (97:21): [True: 8.35k, False: 0]
  |  |  ------------------
  ------------------
  604|  8.35k|        m_addr_local = addrLocalIn;
  605|  8.35k|    }
  606|  8.35k|}
_ZNK5CNode23ConnectedThroughNetworkEv:
  609|    246|{
  610|    246|    return m_inbound_onion ? NET_ONION : addr.GetNetClass();
  ------------------
  |  Branch (610:12): [True: 64, False: 182]
  ------------------
  611|    246|}
_ZN5CNode15ReceiveMsgBytesE4SpanIKhERb:
  667|  40.4k|{
  668|  40.4k|    complete = false;
  669|  40.4k|    const auto time = GetTime<std::chrono::microseconds>();
  670|  40.4k|    LOCK(cs_vRecv);
  ------------------
  |  |  257|  40.4k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  40.4k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  40.4k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  40.4k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  671|  40.4k|    m_last_recv = std::chrono::duration_cast<std::chrono::seconds>(time);
  672|  40.4k|    nRecvBytes += msg_bytes.size();
  673|  80.9k|    while (msg_bytes.size() > 0) {
  ------------------
  |  Branch (673:12): [True: 40.4k, False: 40.4k]
  ------------------
  674|       |        // absorb network data
  675|  40.4k|        if (!m_transport->ReceivedBytes(msg_bytes)) {
  ------------------
  |  Branch (675:13): [True: 0, False: 40.4k]
  ------------------
  676|       |            // Serious transport problem, disconnect from the peer.
  677|      0|            return false;
  678|      0|        }
  679|       |
  680|  40.4k|        if (m_transport->ReceivedMessageComplete()) {
  ------------------
  |  Branch (680:13): [True: 24.5k, False: 15.9k]
  ------------------
  681|       |            // decompose a transport agnostic CNetMessage from the deserializer
  682|  24.5k|            bool reject_message{false};
  683|  24.5k|            CNetMessage msg = m_transport->GetReceivedMessage(time, reject_message);
  684|  24.5k|            if (reject_message) {
  ------------------
  |  Branch (684:17): [True: 319, False: 24.1k]
  ------------------
  685|       |                // Message deserialization failed. Drop the message but don't disconnect the peer.
  686|       |                // store the size of the corrupt message
  687|    319|                mapRecvBytesPerMsgType.at(NET_MESSAGE_TYPE_OTHER) += msg.m_raw_message_size;
  688|    319|                continue;
  689|    319|            }
  690|       |
  691|       |            // Store received bytes per message type.
  692|       |            // To prevent a memory DOS, only allow known message types.
  693|  24.1k|            auto i = mapRecvBytesPerMsgType.find(msg.m_type);
  694|  24.1k|            if (i == mapRecvBytesPerMsgType.end()) {
  ------------------
  |  Branch (694:17): [True: 370, False: 23.8k]
  ------------------
  695|    370|                i = mapRecvBytesPerMsgType.find(NET_MESSAGE_TYPE_OTHER);
  696|    370|            }
  697|  24.1k|            assert(i != mapRecvBytesPerMsgType.end());
  698|  24.1k|            i->second += msg.m_raw_message_size;
  699|       |
  700|       |            // push the message to the process queue,
  701|  24.1k|            vRecvMsg.push_back(std::move(msg));
  702|       |
  703|  24.1k|            complete = true;
  704|  24.1k|        }
  705|  40.4k|    }
  706|       |
  707|  40.4k|    return true;
  708|  40.4k|}
_ZNK5CNode5LogIPEb:
  711|  3.07k|{
  712|  3.07k|    return log_ip ? strprintf(" peeraddr=%s", addr.ToStringAddrPort()) : "";
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  |  Branch (712:12): [True: 0, False: 3.07k]
  ------------------
  713|  3.07k|}
_ZN11V1TransportC2El:
  723|  8.47k|    : m_magic_bytes{Params().MessageStart()}, m_node_id{node_id}
  724|  8.47k|{
  725|  8.47k|    LOCK(m_recv_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  726|  8.47k|    Reset();
  727|  8.47k|}
_ZNK11V1Transport7GetInfoEv:
  730|  3.07k|{
  731|  3.07k|    return {.transport_type = TransportProtocolType::V1, .session_id = {}};
  732|  3.07k|}
_ZN11V1Transport10readHeaderE4SpanIKhE:
  735|  24.5k|{
  736|  24.5k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  142|  24.5k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  737|       |    // copy data to temporary parsing buffer
  738|  24.5k|    unsigned int nRemaining = CMessageHeader::HEADER_SIZE - nHdrPos;
  739|  24.5k|    unsigned int nCopy = std::min<unsigned int>(nRemaining, msg_bytes.size());
  740|       |
  741|  24.5k|    memcpy(&hdrbuf[nHdrPos], msg_bytes.data(), nCopy);
  742|  24.5k|    nHdrPos += nCopy;
  743|       |
  744|       |    // if header incomplete, exit
  745|  24.5k|    if (nHdrPos < CMessageHeader::HEADER_SIZE)
  ------------------
  |  Branch (745:9): [True: 0, False: 24.5k]
  ------------------
  746|      0|        return nCopy;
  747|       |
  748|       |    // deserialize to CMessageHeader
  749|  24.5k|    try {
  750|  24.5k|        hdrbuf >> hdr;
  751|  24.5k|    }
  752|  24.5k|    catch (const std::exception&) {
  753|      0|        LogDebug(BCLog::NET, "Header error: Unable to deserialize, peer=%d\n", m_node_id);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|      0|        return -1;
  755|      0|    }
  756|       |
  757|       |    // Check start string, network magic
  758|  24.5k|    if (hdr.pchMessageStart != m_magic_bytes) {
  ------------------
  |  Branch (758:9): [True: 0, False: 24.5k]
  ------------------
  759|      0|        LogDebug(BCLog::NET, "Header error: Wrong MessageStart %s received, peer=%d\n", HexStr(hdr.pchMessageStart), m_node_id);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  760|      0|        return -1;
  761|      0|    }
  762|       |
  763|       |    // reject messages larger than MAX_SIZE or MAX_PROTOCOL_MESSAGE_LENGTH
  764|  24.5k|    if (hdr.nMessageSize > MAX_SIZE || hdr.nMessageSize > MAX_PROTOCOL_MESSAGE_LENGTH) {
  ------------------
  |  Branch (764:9): [True: 0, False: 24.5k]
  |  Branch (764:40): [True: 0, False: 24.5k]
  ------------------
  765|      0|        LogDebug(BCLog::NET, "Header error: Size too large (%s, %u bytes), peer=%d\n", SanitizeString(hdr.GetMessageType()), hdr.nMessageSize, m_node_id);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|        return -1;
  767|      0|    }
  768|       |
  769|       |    // switch state to reading message data
  770|  24.5k|    in_data = true;
  771|       |
  772|  24.5k|    return nCopy;
  773|  24.5k|}
_ZN11V1Transport8readDataE4SpanIKhE:
  776|  15.9k|{
  777|  15.9k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  142|  15.9k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  778|  15.9k|    unsigned int nRemaining = hdr.nMessageSize - nDataPos;
  779|  15.9k|    unsigned int nCopy = std::min<unsigned int>(nRemaining, msg_bytes.size());
  780|       |
  781|  15.9k|    if (vRecv.size() < nDataPos + nCopy) {
  ------------------
  |  Branch (781:9): [True: 15.9k, False: 0]
  ------------------
  782|       |        // Allocate up to 256 KiB ahead, but never more than the total message size.
  783|  15.9k|        vRecv.resize(std::min(hdr.nMessageSize, nDataPos + nCopy + 256 * 1024));
  784|  15.9k|    }
  785|       |
  786|  15.9k|    hasher.Write(msg_bytes.first(nCopy));
  787|  15.9k|    memcpy(&vRecv[nDataPos], msg_bytes.data(), nCopy);
  788|  15.9k|    nDataPos += nCopy;
  789|       |
  790|  15.9k|    return nCopy;
  791|  15.9k|}
_ZNK11V1Transport14GetMessageHashEv:
  794|  24.5k|{
  795|  24.5k|    AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  142|  24.5k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  796|  24.5k|    assert(CompleteInternal());
  797|  24.5k|    if (data_hash.IsNull())
  ------------------
  |  Branch (797:9): [True: 24.5k, False: 0]
  ------------------
  798|  24.5k|        hasher.Finalize(data_hash);
  799|  24.5k|    return data_hash;
  800|  24.5k|}
_ZN11V1Transport18GetReceivedMessageENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000000EEEEERb:
  803|  24.5k|{
  804|  24.5k|    AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  147|  24.5k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  805|       |    // Initialize out parameter
  806|  24.5k|    reject_message = false;
  807|       |    // decompose a single CNetMessage from the TransportDeserializer
  808|  24.5k|    LOCK(m_recv_mutex);
  ------------------
  |  |  257|  24.5k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  24.5k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  24.5k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  24.5k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  809|  24.5k|    CNetMessage msg(std::move(vRecv));
  810|       |
  811|       |    // store message type string, time, and sizes
  812|  24.5k|    msg.m_type = hdr.GetMessageType();
  813|  24.5k|    msg.m_time = time;
  814|  24.5k|    msg.m_message_size = hdr.nMessageSize;
  815|  24.5k|    msg.m_raw_message_size = hdr.nMessageSize + CMessageHeader::HEADER_SIZE;
  816|       |
  817|  24.5k|    uint256 hash = GetMessageHash();
  818|       |
  819|       |    // We just received a message off the wire, harvest entropy from the time (and the message checksum)
  820|  24.5k|    RandAddEvent(ReadLE32(hash.begin()));
  821|       |
  822|       |    // Check checksum and header message type string
  823|  24.5k|    if (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != 0) {
  ------------------
  |  Branch (823:9): [True: 0, False: 24.5k]
  ------------------
  824|      0|        LogDebug(BCLog::NET, "Header error: Wrong checksum (%s, %u bytes), expected %s was %s, peer=%d\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  825|      0|                 SanitizeString(msg.m_type), msg.m_message_size,
  826|      0|                 HexStr(Span{hash}.first(CMessageHeader::CHECKSUM_SIZE)),
  827|      0|                 HexStr(hdr.pchChecksum),
  828|      0|                 m_node_id);
  829|      0|        reject_message = true;
  830|  24.5k|    } else if (!hdr.IsMessageTypeValid()) {
  ------------------
  |  Branch (830:16): [True: 319, False: 24.1k]
  ------------------
  831|    319|        LogDebug(BCLog::NET, "Header error: Invalid message type (%s, %u bytes), peer=%d\n",
  ------------------
  |  |  280|    319|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    319|    do {                                                  \
  |  |  |  |  274|    319|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 319]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    319|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  832|    319|                 SanitizeString(hdr.GetMessageType()), msg.m_message_size, m_node_id);
  833|    319|        reject_message = true;
  834|    319|    }
  835|       |
  836|       |    // Always reset the network deserializer (prepare for the next message)
  837|  24.5k|    Reset();
  838|  24.5k|    return msg;
  839|  24.5k|}
_ZN11V1Transport16SetMessageToSendER17CSerializedNetMsg:
  842|  66.2k|{
  843|  66.2k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  147|  66.2k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  844|       |    // Determine whether a new message can be set.
  845|  66.2k|    LOCK(m_send_mutex);
  ------------------
  |  |  257|  66.2k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  66.2k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  66.2k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  66.2k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  846|  66.2k|    if (m_sending_header || m_bytes_sent < m_message_to_send.data.size()) return false;
  ------------------
  |  Branch (846:9): [True: 0, False: 66.2k]
  |  Branch (846:29): [True: 0, False: 66.2k]
  ------------------
  847|       |
  848|       |    // create dbl-sha256 checksum
  849|  66.2k|    uint256 hash = Hash(msg.data);
  850|       |
  851|       |    // create header
  852|  66.2k|    CMessageHeader hdr(m_magic_bytes, msg.m_type.c_str(), msg.data.size());
  853|  66.2k|    memcpy(hdr.pchChecksum, hash.begin(), CMessageHeader::CHECKSUM_SIZE);
  854|       |
  855|       |    // serialize header
  856|  66.2k|    m_header_to_send.clear();
  857|  66.2k|    VectorWriter{m_header_to_send, 0, hdr};
  858|       |
  859|       |    // update state
  860|  66.2k|    m_message_to_send = std::move(msg);
  861|  66.2k|    m_sending_header = true;
  862|  66.2k|    m_bytes_sent = 0;
  863|  66.2k|    return true;
  864|  66.2k|}
_ZNK11V1Transport14GetBytesToSendEb:
  867|   280k|{
  868|   280k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  147|   280k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  869|   280k|    LOCK(m_send_mutex);
  ------------------
  |  |  257|   280k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   280k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   280k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   280k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  870|   280k|    if (m_sending_header) {
  ------------------
  |  Branch (870:9): [True: 109k, False: 171k]
  ------------------
  871|   109k|        return {Span{m_header_to_send}.subspan(m_bytes_sent),
  872|       |                // We have more to send after the header if the message has payload, or if there
  873|       |                // is a next message after that.
  874|   109k|                have_next_message || !m_message_to_send.data.empty(),
  ------------------
  |  Branch (874:17): [True: 30.8k, False: 78.5k]
  |  Branch (874:38): [True: 56.5k, False: 21.9k]
  ------------------
  875|   109k|                m_message_to_send.m_type
  876|   109k|               };
  877|   171k|    } else {
  878|   171k|        return {Span{m_message_to_send.data}.subspan(m_bytes_sent),
  879|       |                // We only have more to send after this message's payload if there is another
  880|       |                // message.
  881|   171k|                have_next_message,
  882|   171k|                m_message_to_send.m_type
  883|   171k|               };
  884|   171k|    }
  885|   280k|}
_ZN11V1Transport13MarkBytesSentEm:
  888|   119k|{
  889|   119k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  147|   119k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  890|   119k|    LOCK(m_send_mutex);
  ------------------
  |  |  257|   119k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   119k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   119k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   119k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  891|   119k|    m_bytes_sent += bytes_sent;
  892|   119k|    if (m_sending_header && m_bytes_sent == m_header_to_send.size()) {
  ------------------
  |  Branch (892:9): [True: 72.7k, False: 46.5k]
  |  Branch (892:29): [True: 62.7k, False: 10.0k]
  ------------------
  893|       |        // We're done sending a message's header. Switch to sending its data bytes.
  894|  62.7k|        m_sending_header = false;
  895|  62.7k|        m_bytes_sent = 0;
  896|  62.7k|    } else if (!m_sending_header && m_bytes_sent == m_message_to_send.data.size()) {
  ------------------
  |  Branch (896:16): [True: 46.5k, False: 10.0k]
  |  Branch (896:37): [True: 44.0k, False: 2.44k]
  ------------------
  897|       |        // We're done sending a message's data. Wipe the data vector to reduce memory consumption.
  898|  44.0k|        ClearShrink(m_message_to_send.data);
  899|  44.0k|        m_bytes_sent = 0;
  900|  44.0k|    }
  901|   119k|}
_ZNK11V1Transport18GetSendMemoryUsageEv:
  904|   123k|{
  905|   123k|    AssertLockNotHeld(m_send_mutex);
  ------------------
  |  |  147|   123k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  906|   123k|    LOCK(m_send_mutex);
  ------------------
  |  |  257|   123k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   123k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   123k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   123k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  907|       |    // Don't count sending-side fields besides m_message_to_send, as they're all small and bounded.
  908|   123k|    return m_message_to_send.GetMemoryUsage();
  909|   123k|}
_ZNK8CConnman14SocketSendDataER5CNode:
 1600|  41.7k|{
 1601|  41.7k|    auto it = node.vSendMsg.begin();
 1602|  41.7k|    size_t nSentSize = 0;
 1603|  41.7k|    bool data_left{false}; //!< second return value (whether unsent data remains)
 1604|  41.7k|    std::optional<bool> expected_more;
 1605|       |
 1606|  83.9k|    while (true) {
  ------------------
  |  Branch (1606:12): [Folded - Ignored]
  ------------------
 1607|  83.9k|        if (it != node.vSendMsg.end()) {
  ------------------
  |  Branch (1607:13): [True: 41.7k, False: 42.1k]
  ------------------
 1608|       |            // If possible, move one message from the send queue to the transport. This fails when
 1609|       |            // there is an existing message still being sent, or (for v2 transports) when the
 1610|       |            // handshake has not yet completed.
 1611|  41.7k|            size_t memusage = it->GetMemoryUsage();
 1612|  41.7k|            if (node.m_transport->SetMessageToSend(*it)) {
  ------------------
  |  Branch (1612:17): [True: 41.7k, False: 0]
  ------------------
 1613|       |                // Update memory usage of send buffer (as *it will be deleted).
 1614|  41.7k|                node.m_send_memusage -= memusage;
 1615|  41.7k|                ++it;
 1616|  41.7k|            }
 1617|  41.7k|        }
 1618|  83.9k|        const auto& [data, more, msg_type] = node.m_transport->GetBytesToSend(it != node.vSendMsg.end());
 1619|       |        // We rely on the 'more' value returned by GetBytesToSend to correctly predict whether more
 1620|       |        // bytes are still to be sent, to correctly set the MSG_MORE flag. As a sanity check,
 1621|       |        // verify that the previously returned 'more' was correct.
 1622|  83.9k|        if (expected_more.has_value()) Assume(!data.empty() == *expected_more);
  ------------------
  |  |   97|  42.1k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (1622:13): [True: 42.1k, False: 41.7k]
  ------------------
 1623|  83.9k|        expected_more = more;
 1624|  83.9k|        data_left = !data.empty(); // will be overwritten on next loop if all of data gets sent
 1625|  83.9k|        int nBytes = 0;
 1626|  83.9k|        if (!data.empty()) {
  ------------------
  |  Branch (1626:13): [True: 60.8k, False: 23.0k]
  ------------------
 1627|  60.8k|            LOCK(node.m_sock_mutex);
  ------------------
  |  |  257|  60.8k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  60.8k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  60.8k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  60.8k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1628|       |            // There is no socket in case we've already disconnected, or in test cases without
 1629|       |            // real connections. In these cases, we bail out immediately and just leave things
 1630|       |            // in the send queue and transport.
 1631|  60.8k|            if (!node.m_sock) {
  ------------------
  |  Branch (1631:17): [True: 0, False: 60.8k]
  ------------------
 1632|      0|                break;
 1633|      0|            }
 1634|  60.8k|            int flags = MSG_NOSIGNAL | MSG_DONTWAIT;
 1635|  60.8k|#ifdef MSG_MORE
 1636|  60.8k|            if (more) {
  ------------------
  |  Branch (1636:17): [True: 31.5k, False: 29.3k]
  ------------------
 1637|  31.5k|                flags |= MSG_MORE;
 1638|  31.5k|            }
 1639|  60.8k|#endif
 1640|  60.8k|            nBytes = node.m_sock->Send(reinterpret_cast<const char*>(data.data()), data.size(), flags);
 1641|  60.8k|        }
 1642|  83.9k|        if (nBytes > 0) {
  ------------------
  |  Branch (1642:13): [True: 54.6k, False: 29.2k]
  ------------------
 1643|  54.6k|            node.m_last_send = GetTime<std::chrono::seconds>();
 1644|  54.6k|            node.nSendBytes += nBytes;
 1645|       |            // Notify transport that bytes have been processed.
 1646|  54.6k|            node.m_transport->MarkBytesSent(nBytes);
 1647|       |            // Update statistics per message type.
 1648|  54.6k|            if (!msg_type.empty()) { // don't report v2 handshake bytes for now
  ------------------
  |  Branch (1648:17): [True: 54.6k, False: 0]
  ------------------
 1649|  54.6k|                node.AccountForSentBytes(msg_type, nBytes);
 1650|  54.6k|            }
 1651|  54.6k|            nSentSize += nBytes;
 1652|  54.6k|            if ((size_t)nBytes != data.size()) {
  ------------------
  |  Branch (1652:17): [True: 12.4k, False: 42.1k]
  ------------------
 1653|       |                // could not send full message; stop sending more
 1654|  12.4k|                break;
 1655|  12.4k|            }
 1656|  54.6k|        } else {
 1657|  29.2k|            if (nBytes < 0) {
  ------------------
  |  Branch (1657:17): [True: 4.63k, False: 24.6k]
  ------------------
 1658|       |                // error
 1659|  4.63k|                int nErr = WSAGetLastError();
  ------------------
  |  |   48|  4.63k|#define WSAGetLastError()   errno
  ------------------
 1660|  4.63k|                if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   50|  9.27k|#define WSAEWOULDBLOCK      EWOULDBLOCK
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   52|  8.96k|#define WSAEMSGSIZE         EMSGSIZE
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   53|  8.78k|#define WSAEINTR            EINTR
  ------------------
                              if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
  ------------------
  |  |   54|  4.05k|#define WSAEINPROGRESS      EINPROGRESS
  ------------------
  |  Branch (1660:21): [True: 4.32k, False: 313]
  |  Branch (1660:47): [True: 4.15k, False: 175]
  |  Branch (1660:70): [True: 4.05k, False: 94]
  |  Branch (1660:90): [True: 4.05k, False: 0]
  ------------------
 1661|  4.05k|                    LogDebug(BCLog::NET, "socket send error, %s: %s\n", node.DisconnectMsg(fLogIPs), NetworkErrorString(nErr));
  ------------------
  |  |  280|  4.05k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  4.05k|    do {                                                  \
  |  |  |  |  274|  4.05k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 4.05k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  4.05k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1662|  4.05k|                    node.CloseSocketDisconnect();
 1663|  4.05k|                }
 1664|  4.63k|            }
 1665|  29.2k|            break;
 1666|  29.2k|        }
 1667|  83.9k|    }
 1668|       |
 1669|  41.7k|    node.fPauseSend = node.m_send_memusage + node.m_transport->GetSendMemoryUsage() > nSendBufferMaxSize;
 1670|       |
 1671|  41.7k|    if (it == node.vSendMsg.end()) {
  ------------------
  |  Branch (1671:9): [True: 41.7k, False: 0]
  ------------------
 1672|  41.7k|        assert(node.m_send_memusage == 0);
 1673|  41.7k|    }
 1674|  41.7k|    node.vSendMsg.erase(node.vSendMsg.begin(), it);
 1675|  41.7k|    return {nSentSize, data_left};
 1676|  41.7k|}
_ZNK8CConnman25ShouldRunInactivityChecksERK5CNodeNSt3__16chrono8durationIxNS3_5ratioILl1ELl1EEEEE:
 1995|   444k|{
 1996|   444k|    return node.m_connected + m_peer_connect_timeout < now;
 1997|   444k|}
_ZN8CConnman9InterruptEv:
 3416|      2|{
 3417|      2|    {
 3418|      2|        LOCK(mutexMsgProc);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3419|      2|        flagInterruptMsgProc = true;
 3420|      2|    }
 3421|      2|    condMsgProc.notify_all();
 3422|       |
 3423|      2|    interruptNet();
 3424|      2|    g_socks5_interrupt();
 3425|       |
 3426|      2|    if (semOutbound) {
  ------------------
  |  Branch (3426:9): [True: 0, False: 2]
  ------------------
 3427|      0|        for (int i=0; i<m_max_automatic_outbound; i++) {
  ------------------
  |  Branch (3427:23): [True: 0, False: 0]
  ------------------
 3428|      0|            semOutbound->post();
 3429|      0|        }
 3430|      0|    }
 3431|       |
 3432|      2|    if (semAddnode) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 2]
  ------------------
 3433|      0|        for (int i=0; i<m_max_addnode; i++) {
  ------------------
  |  Branch (3433:23): [True: 0, False: 0]
  ------------------
 3434|      0|            semAddnode->post();
 3435|      0|        }
 3436|      0|    }
 3437|      2|}
_ZN8CConnman11StopThreadsEv:
 3440|      2|{
 3441|      2|    if (threadI2PAcceptIncoming.joinable()) {
  ------------------
  |  Branch (3441:9): [True: 0, False: 2]
  ------------------
 3442|      0|        threadI2PAcceptIncoming.join();
 3443|      0|    }
 3444|      2|    if (threadMessageHandler.joinable())
  ------------------
  |  Branch (3444:9): [True: 0, False: 2]
  ------------------
 3445|      0|        threadMessageHandler.join();
 3446|      2|    if (threadOpenConnections.joinable())
  ------------------
  |  Branch (3446:9): [True: 0, False: 2]
  ------------------
 3447|      0|        threadOpenConnections.join();
 3448|      2|    if (threadOpenAddedConnections.joinable())
  ------------------
  |  Branch (3448:9): [True: 0, False: 2]
  ------------------
 3449|      0|        threadOpenAddedConnections.join();
 3450|      2|    if (threadDNSAddressSeed.joinable())
  ------------------
  |  Branch (3450:9): [True: 0, False: 2]
  ------------------
 3451|      0|        threadDNSAddressSeed.join();
 3452|      2|    if (threadSocketHandler.joinable())
  ------------------
  |  Branch (3452:9): [True: 0, False: 2]
  ------------------
 3453|      0|        threadSocketHandler.join();
 3454|      2|}
_ZN8CConnman9StopNodesEv:
 3457|  8.47k|{
 3458|  8.47k|    if (fAddressesInitialized) {
  ------------------
  |  Branch (3458:9): [True: 0, False: 8.47k]
  ------------------
 3459|      0|        DumpAddresses();
 3460|      0|        fAddressesInitialized = false;
 3461|       |
 3462|      0|        if (m_use_addrman_outgoing) {
  ------------------
  |  Branch (3462:13): [True: 0, False: 0]
  ------------------
 3463|       |            // Anchor connections are only dumped during clean shutdown.
 3464|      0|            std::vector<CAddress> anchors_to_dump = GetCurrentBlockRelayOnlyConns();
 3465|      0|            if (anchors_to_dump.size() > MAX_BLOCK_RELAY_ONLY_ANCHORS) {
  ------------------
  |  Branch (3465:17): [True: 0, False: 0]
  ------------------
 3466|      0|                anchors_to_dump.resize(MAX_BLOCK_RELAY_ONLY_ANCHORS);
 3467|      0|            }
 3468|      0|            DumpAnchors(gArgs.GetDataDirNet() / ANCHORS_DATABASE_FILENAME, anchors_to_dump);
 3469|      0|        }
 3470|      0|    }
 3471|       |
 3472|       |    // Delete peer connections.
 3473|  8.47k|    std::vector<CNode*> nodes;
 3474|  8.47k|    WITH_LOCK(m_nodes_mutex, nodes.swap(m_nodes));
  ------------------
  |  |  301|  8.47k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 3475|  8.47k|    for (CNode* pnode : nodes) {
  ------------------
  |  Branch (3475:23): [True: 8.47k, False: 8.47k]
  ------------------
 3476|  8.47k|        LogDebug(BCLog::NET, "Stopping node, %s", pnode->DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|  8.47k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  8.47k|    do {                                                  \
  |  |  |  |  274|  8.47k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8.47k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  8.47k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3477|  8.47k|        pnode->CloseSocketDisconnect();
 3478|  8.47k|        DeleteNode(pnode);
 3479|  8.47k|    }
 3480|       |
 3481|  8.47k|    for (CNode* pnode : m_nodes_disconnected) {
  ------------------
  |  Branch (3481:23): [True: 0, False: 8.47k]
  ------------------
 3482|      0|        DeleteNode(pnode);
 3483|      0|    }
 3484|  8.47k|    m_nodes_disconnected.clear();
 3485|  8.47k|    vhListenSocket.clear();
 3486|  8.47k|    semOutbound.reset();
 3487|  8.47k|    semAddnode.reset();
 3488|  8.47k|}
_ZN8CConnman10DeleteNodeEP5CNode:
 3491|  8.47k|{
 3492|  8.47k|    assert(pnode);
 3493|  8.47k|    m_msgproc->FinalizeNode(*pnode);
 3494|  8.47k|    delete pnode;
 3495|  8.47k|}
_ZN8CConnmanD2Ev:
 3498|      2|{
 3499|      2|    Interrupt();
 3500|      2|    Stop();
 3501|      2|}
_ZNK8CConnman12GetAddressesEmmNSt3__18optionalI7NetworkEEb:
 3504|    323|{
 3505|    323|    std::vector<CAddress> addresses = addrman.GetAddr(max_addresses, max_pct, network, filtered);
 3506|    323|    if (m_banman) {
  ------------------
  |  Branch (3506:9): [True: 0, False: 323]
  ------------------
 3507|      0|        addresses.erase(std::remove_if(addresses.begin(), addresses.end(),
 3508|      0|                        [this](const CAddress& addr){return m_banman->IsDiscouraged(addr) || m_banman->IsBanned(addr);}),
 3509|      0|                        addresses.end());
 3510|      0|    }
 3511|    323|    return addresses;
 3512|    323|}
_ZN8CConnman12GetAddressesER5CNodemm:
 3515|    246|{
 3516|    246|    auto local_socket_bytes = requestor.addrBind.GetAddrBytes();
 3517|    246|    uint64_t cache_id = GetDeterministicRandomizer(RANDOMIZER_ID_ADDRCACHE)
 3518|    246|        .Write(requestor.ConnectedThroughNetwork())
 3519|    246|        .Write(local_socket_bytes)
 3520|       |        // For outbound connections, the port of the bound address is randomly
 3521|       |        // assigned by the OS and would therefore not be useful for seeding.
 3522|    246|        .Write(requestor.IsInboundConn() ? requestor.addrBind.GetPort() : 0)
  ------------------
  |  Branch (3522:16): [True: 246, False: 0]
  ------------------
 3523|    246|        .Finalize();
 3524|    246|    const auto current_time = GetTime<std::chrono::microseconds>();
 3525|    246|    auto r = m_addr_response_caches.emplace(cache_id, CachedAddrResponse{});
 3526|    246|    CachedAddrResponse& cache_entry = r.first->second;
 3527|    246|    if (cache_entry.m_cache_entry_expiration < current_time) { // If emplace() added new one it has expiration 0.
  ------------------
  |  Branch (3527:9): [True: 230, False: 16]
  ------------------
 3528|    230|        cache_entry.m_addrs_response_cache = GetAddresses(max_addresses, max_pct, /*network=*/std::nullopt);
 3529|       |        // Choosing a proper cache lifetime is a trade-off between the privacy leak minimization
 3530|       |        // and the usefulness of ADDR responses to honest users.
 3531|       |        //
 3532|       |        // Longer cache lifetime makes it more difficult for an attacker to scrape
 3533|       |        // enough AddrMan data to maliciously infer something useful.
 3534|       |        // By the time an attacker scraped enough AddrMan records, most of
 3535|       |        // the records should be old enough to not leak topology info by
 3536|       |        // e.g. analyzing real-time changes in timestamps.
 3537|       |        //
 3538|       |        // It takes only several hundred requests to scrape everything from an AddrMan containing 100,000 nodes,
 3539|       |        // so ~24 hours of cache lifetime indeed makes the data less inferable by the time
 3540|       |        // most of it could be scraped (considering that timestamps are updated via
 3541|       |        // ADDR self-announcements and when nodes communicate).
 3542|       |        // We also should be robust to those attacks which may not require scraping *full* victim's AddrMan
 3543|       |        // (because even several timestamps of the same handful of nodes may leak privacy).
 3544|       |        //
 3545|       |        // On the other hand, longer cache lifetime makes ADDR responses
 3546|       |        // outdated and less useful for an honest requestor, e.g. if most nodes
 3547|       |        // in the ADDR response are no longer active.
 3548|       |        //
 3549|       |        // However, the churn in the network is known to be rather low. Since we consider
 3550|       |        // nodes to be "terrible" (see IsTerrible()) if the timestamps are older than 30 days,
 3551|       |        // max. 24 hours of "penalty" due to cache shouldn't make any meaningful difference
 3552|       |        // in terms of the freshness of the response.
 3553|    230|        cache_entry.m_cache_entry_expiration = current_time +
 3554|    230|            21h + FastRandomContext().randrange<std::chrono::microseconds>(6h);
 3555|    230|    }
 3556|    246|    return cache_entry.m_addrs_response_cache;
 3557|    246|}
_ZNK8CConnman11GetMappedASERK8CNetAddr:
 3620|  11.4k|{
 3621|  11.4k|    return m_netgroupman.GetMappedAS(addr);
 3622|  11.4k|}
_ZN8CConnman14DisconnectNodeERK7CSubNet:
 3648|    225|{
 3649|    225|    bool disconnected = false;
 3650|    225|    LOCK(m_nodes_mutex);
  ------------------
  |  |  257|    225|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    225|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    225|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    225|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3651|    225|    for (CNode* pnode : m_nodes) {
  ------------------
  |  Branch (3651:23): [True: 225, False: 225]
  ------------------
 3652|    225|        if (subnet.Match(pnode->addr)) {
  ------------------
  |  Branch (3652:13): [True: 214, False: 11]
  ------------------
 3653|    214|            LogDebug(BCLog::NET, "disconnect by subnet%s match, %s", (fLogIPs ? strprintf("=%s", subnet.ToString()) : ""), pnode->DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|    214|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    214|    do {                                                  \
  |  |  |  |  274|    214|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 214]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    214|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3654|    214|            pnode->fDisconnect = true;
 3655|    214|            disconnected = true;
 3656|    214|        }
 3657|    225|    }
 3658|    225|    return disconnected;
 3659|    225|}
_ZN8CConnman14DisconnectNodeERK8CNetAddr:
 3662|    225|{
 3663|    225|    return DisconnectNode(CSubNet(addr));
 3664|    225|}
_ZN8CConnman15RecordBytesSentEm:
 3685|  35.9k|{
 3686|  35.9k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  147|  35.9k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3687|  35.9k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  257|  35.9k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  35.9k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  35.9k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  35.9k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3688|       |
 3689|  35.9k|    nTotalBytesSent += bytes;
 3690|       |
 3691|  35.9k|    const auto now = GetTime<std::chrono::seconds>();
 3692|  35.9k|    if (nMaxOutboundCycleStartTime + MAX_UPLOAD_TIMEFRAME < now)
  ------------------
  |  Branch (3692:9): [True: 3, False: 35.9k]
  ------------------
 3693|      3|    {
 3694|       |        // timeframe expired, reset cycle
 3695|      3|        nMaxOutboundCycleStartTime = now;
 3696|      3|        nMaxOutboundTotalBytesSentInCycle = 0;
 3697|      3|    }
 3698|       |
 3699|  35.9k|    nMaxOutboundTotalBytesSentInCycle += bytes;
 3700|  35.9k|}
_ZNK8CConnman21OutboundTargetReachedEb:
 3737|  1.58k|{
 3738|  1.58k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  147|  1.58k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3739|  1.58k|    LOCK(m_total_bytes_sent_mutex);
  ------------------
  |  |  257|  1.58k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.58k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.58k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.58k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3740|  1.58k|    if (nMaxOutboundLimit == 0)
  ------------------
  |  Branch (3740:9): [True: 1.58k, False: 0]
  ------------------
 3741|  1.58k|        return false;
 3742|       |
 3743|      0|    if (historicalBlockServingLimit)
  ------------------
  |  Branch (3743:9): [True: 0, False: 0]
  ------------------
 3744|      0|    {
 3745|       |        // keep a large enough buffer to at least relay each block once
 3746|      0|        const std::chrono::seconds timeLeftInCycle = GetMaxOutboundTimeLeftInCycle_();
 3747|      0|        const uint64_t buffer = timeLeftInCycle / std::chrono::minutes{10} * MAX_BLOCK_SERIALIZED_SIZE;
 3748|      0|        if (buffer >= nMaxOutboundLimit || nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit - buffer)
  ------------------
  |  Branch (3748:13): [True: 0, False: 0]
  |  Branch (3748:44): [True: 0, False: 0]
  ------------------
 3749|      0|            return true;
 3750|      0|    }
 3751|      0|    else if (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit)
  ------------------
  |  Branch (3751:14): [True: 0, False: 0]
  ------------------
 3752|      0|        return true;
 3753|       |
 3754|      0|    return false;
 3755|      0|}
_ZN5CNodeC2ElNSt3__110shared_ptrI4SockEERK8CAddressmmRK8CServiceRKNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE14ConnectionTypebO12CNodeOptions:
 3803|  8.47k|    : m_transport{MakeTransport(idIn, node_opts.use_v2transport, conn_type_in == ConnectionType::INBOUND)},
 3804|  8.47k|      m_permission_flags{node_opts.permission_flags},
 3805|  8.47k|      m_sock{sock},
 3806|  8.47k|      m_connected{GetTime<std::chrono::seconds>()},
 3807|  8.47k|      addr{addrIn},
 3808|  8.47k|      addrBind{addrBindIn},
 3809|  8.47k|      m_addr_name{addrNameIn.empty() ? addr.ToStringAddrPort() : addrNameIn},
  ------------------
  |  Branch (3809:19): [True: 2.65k, False: 5.81k]
  ------------------
 3810|  8.47k|      m_dest(addrNameIn),
 3811|  8.47k|      m_inbound_onion{inbound_onion},
 3812|  8.47k|      m_prefer_evict{node_opts.prefer_evict},
 3813|  8.47k|      nKeyedNetGroup{nKeyedNetGroupIn},
 3814|  8.47k|      m_conn_type{conn_type_in},
 3815|  8.47k|      id{idIn},
 3816|  8.47k|      nLocalHostNonce{nLocalHostNonceIn},
 3817|  8.47k|      m_recv_flood_size{node_opts.recv_flood_size},
 3818|  8.47k|      m_i2p_sam_session{std::move(node_opts.i2p_sam_session)}
 3819|  8.47k|{
 3820|  8.47k|    if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND);
  ------------------
  |  Branch (3820:9): [True: 1.51k, False: 6.95k]
  ------------------
 3821|       |
 3822|   296k|    for (const auto& msg : ALL_NET_MESSAGE_TYPES) {
  ------------------
  |  Branch (3822:26): [True: 296k, False: 8.47k]
  ------------------
 3823|   296k|        mapRecvBytesPerMsgType[msg] = 0;
 3824|   296k|    }
 3825|  8.47k|    mapRecvBytesPerMsgType[NET_MESSAGE_TYPE_OTHER] = 0;
 3826|       |
 3827|  8.47k|    if (fLogIPs) {
  ------------------
  |  Branch (3827:9): [True: 0, False: 8.47k]
  ------------------
 3828|      0|        LogDebug(BCLog::NET, "Added connection to %s peer=%d\n", m_addr_name, id);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3829|  8.47k|    } else {
 3830|  8.47k|        LogDebug(BCLog::NET, "Added connection peer=%d\n", id);
  ------------------
  |  |  280|  8.47k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  8.47k|    do {                                                  \
  |  |  |  |  274|  8.47k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8.47k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  8.47k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3831|  8.47k|    }
 3832|  8.47k|}
_ZN5CNode29MarkReceivedMsgsForProcessingEv:
 3835|  24.1k|{
 3836|  24.1k|    AssertLockNotHeld(m_msg_process_queue_mutex);
  ------------------
  |  |  147|  24.1k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3837|       |
 3838|  24.1k|    size_t nSizeAdded = 0;
 3839|  24.1k|    for (const auto& msg : vRecvMsg) {
  ------------------
  |  Branch (3839:26): [True: 24.1k, False: 24.1k]
  ------------------
 3840|       |        // vRecvMsg contains only completed CNetMessage
 3841|       |        // the single possible partially deserialized message are held by TransportDeserializer
 3842|  24.1k|        nSizeAdded += msg.GetMemoryUsage();
 3843|  24.1k|    }
 3844|       |
 3845|  24.1k|    LOCK(m_msg_process_queue_mutex);
  ------------------
  |  |  257|  24.1k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  24.1k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  24.1k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  24.1k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3846|  24.1k|    m_msg_process_queue.splice(m_msg_process_queue.end(), vRecvMsg);
 3847|  24.1k|    m_msg_process_queue_size += nSizeAdded;
 3848|  24.1k|    fPauseRecv = m_msg_process_queue_size > m_recv_flood_size;
 3849|  24.1k|}
_ZN5CNode11PollMessageEv:
 3852|  24.0k|{
 3853|  24.0k|    LOCK(m_msg_process_queue_mutex);
  ------------------
  |  |  257|  24.0k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  24.0k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  24.0k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  24.0k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3854|  24.0k|    if (m_msg_process_queue.empty()) return std::nullopt;
  ------------------
  |  Branch (3854:9): [True: 465, False: 23.6k]
  ------------------
 3855|       |
 3856|  23.6k|    std::list<CNetMessage> msgs;
 3857|       |    // Just take one message
 3858|  23.6k|    msgs.splice(msgs.begin(), m_msg_process_queue, m_msg_process_queue.begin());
 3859|  23.6k|    m_msg_process_queue_size -= msgs.front().GetMemoryUsage();
 3860|  23.6k|    fPauseRecv = m_msg_process_queue_size > m_recv_flood_size;
 3861|       |
 3862|  23.6k|    return std::make_pair(std::move(msgs.front()), !m_msg_process_queue.empty());
 3863|  24.0k|}
_ZN8CConnman11PushMessageEP5CNodeO17CSerializedNetMsg:
 3871|  81.9k|{
 3872|  81.9k|    AssertLockNotHeld(m_total_bytes_sent_mutex);
  ------------------
  |  |  147|  81.9k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3873|  81.9k|    size_t nMessageSize = msg.data.size();
 3874|  81.9k|    LogDebug(BCLog::NET, "sending %s (%d bytes) peer=%d\n", msg.m_type, nMessageSize, pnode->GetId());
  ------------------
  |  |  280|  81.9k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  81.9k|    do {                                                  \
  |  |  |  |  274|  81.9k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 81.9k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  81.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3875|  81.9k|    if (gArgs.GetBoolArg("-capturemessages", false)) {
  ------------------
  |  Branch (3875:9): [True: 0, False: 81.9k]
  ------------------
 3876|      0|        CaptureMessage(pnode->addr, msg.m_type, msg.data, /*is_incoming=*/false);
 3877|      0|    }
 3878|       |
 3879|  81.9k|    TRACEPOINT(net, outbound_message,
 3880|  81.9k|        pnode->GetId(),
 3881|  81.9k|        pnode->m_addr_name.c_str(),
 3882|  81.9k|        pnode->ConnectionTypeAsString().c_str(),
 3883|  81.9k|        msg.m_type.c_str(),
 3884|  81.9k|        msg.data.size(),
 3885|  81.9k|        msg.data.data()
 3886|  81.9k|    );
 3887|       |
 3888|  81.9k|    size_t nBytesSent = 0;
 3889|  81.9k|    {
 3890|  81.9k|        LOCK(pnode->cs_vSend);
  ------------------
  |  |  257|  81.9k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  81.9k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  81.9k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  81.9k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3891|       |        // Check if the transport still has unsent bytes, and indicate to it that we're about to
 3892|       |        // give it a message to send.
 3893|  81.9k|        const auto& [to_send, more, _msg_type] =
 3894|  81.9k|            pnode->m_transport->GetBytesToSend(/*have_next_message=*/true);
 3895|  81.9k|        const bool queue_was_empty{to_send.empty() && pnode->vSendMsg.empty()};
  ------------------
  |  Branch (3895:36): [True: 41.7k, False: 40.1k]
  |  Branch (3895:55): [True: 41.7k, False: 0]
  ------------------
 3896|       |
 3897|       |        // Update memory usage of send buffer.
 3898|  81.9k|        pnode->m_send_memusage += msg.GetMemoryUsage();
 3899|  81.9k|        if (pnode->m_send_memusage + pnode->m_transport->GetSendMemoryUsage() > nSendBufferMaxSize) pnode->fPauseSend = true;
  ------------------
  |  Branch (3899:13): [True: 81.9k, False: 0]
  ------------------
 3900|       |        // Move message to vSendMsg queue.
 3901|  81.9k|        pnode->vSendMsg.push_back(std::move(msg));
 3902|       |
 3903|       |        // If there was nothing to send before, and there is now (predicted by the "more" value
 3904|       |        // returned by the GetBytesToSend call above), attempt "optimistic write":
 3905|       |        // because the poll/select loop may pause for SELECT_TIMEOUT_MILLISECONDS before actually
 3906|       |        // doing a send, try sending from the calling thread if the queue was empty before.
 3907|       |        // With a V1Transport, more will always be true here, because adding a message always
 3908|       |        // results in sendable bytes there, but with V2Transport this is not the case (it may
 3909|       |        // still be in the handshake).
 3910|  81.9k|        if (queue_was_empty && more) {
  ------------------
  |  Branch (3910:13): [True: 41.7k, False: 40.1k]
  |  Branch (3910:32): [True: 41.7k, False: 0]
  ------------------
 3911|  41.7k|            std::tie(nBytesSent, std::ignore) = SocketSendData(*pnode);
 3912|  41.7k|        }
 3913|  81.9k|    }
 3914|  81.9k|    if (nBytesSent) RecordBytesSent(nBytesSent);
  ------------------
  |  Branch (3914:9): [True: 35.9k, False: 45.9k]
  ------------------
 3915|  81.9k|}
_ZNK8CConnman26GetDeterministicRandomizerEm:
 3931|    321|{
 3932|    321|    return CSipHasher(nSeed0, nSeed1).Write(id);
 3933|    321|}
net.cpp:_ZL8GetLocalRK5CNode:
  172|  1.95k|{
  173|  1.95k|    if (!fListen) return std::nullopt;
  ------------------
  |  Branch (173:9): [True: 0, False: 1.95k]
  ------------------
  174|       |
  175|  1.95k|    std::optional<CService> addr;
  176|  1.95k|    int nBestScore = -1;
  177|  1.95k|    int nBestReachability = -1;
  178|  1.95k|    {
  179|  1.95k|        LOCK(g_maplocalhost_mutex);
  ------------------
  |  |  257|  1.95k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.95k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.95k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.95k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  1.95k|        for (const auto& [local_addr, local_service_info] : mapLocalHost) {
  ------------------
  |  Branch (180:59): [True: 0, False: 1.95k]
  ------------------
  181|       |            // For privacy reasons, don't advertise our privacy-network address
  182|       |            // to other networks and don't advertise our other-network address
  183|       |            // to privacy networks.
  184|      0|            if (local_addr.GetNetwork() != peer.ConnectedThroughNetwork()
  ------------------
  |  Branch (184:17): [True: 0, False: 0]
  ------------------
  185|      0|                && (local_addr.IsPrivacyNet() || peer.IsConnectedThroughPrivacyNet())) {
  ------------------
  |  Branch (185:21): [True: 0, False: 0]
  |  Branch (185:50): [True: 0, False: 0]
  ------------------
  186|      0|                continue;
  187|      0|            }
  188|      0|            const int nScore{local_service_info.nScore};
  189|      0|            const int nReachability{local_addr.GetReachabilityFrom(peer.addr)};
  190|      0|            if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore)) {
  ------------------
  |  Branch (190:17): [True: 0, False: 0]
  |  Branch (190:55): [True: 0, False: 0]
  |  Branch (190:93): [True: 0, False: 0]
  ------------------
  191|      0|                addr.emplace(CService{local_addr, local_service_info.nPort});
  192|      0|                nBestReachability = nReachability;
  193|      0|                nBestScore = nScore;
  194|      0|            }
  195|      0|        }
  196|  1.95k|    }
  197|  1.95k|    return addr;
  198|  1.95k|}
net.cpp:_ZL19IsPeerAddrLocalGoodP5CNode:
  240|  1.95k|{
  241|  1.95k|    CService addrLocal = pnode->GetAddrLocal();
  242|  1.95k|    return fDiscover && pnode->addr.IsRoutable() && addrLocal.IsRoutable() &&
  ------------------
  |  Branch (242:12): [True: 1.95k, False: 0]
  |  Branch (242:25): [True: 1.16k, False: 793]
  |  Branch (242:53): [True: 0, False: 1.16k]
  ------------------
  243|  1.95k|           g_reachable_nets.Contains(addrLocal);
  ------------------
  |  Branch (243:12): [True: 0, False: 0]
  ------------------
  244|  1.95k|}
net.cpp:_ZL13MakeTransportlbb:
 3785|  8.47k|{
 3786|  8.47k|    if (use_v2transport) {
  ------------------
  |  Branch (3786:9): [True: 0, False: 8.47k]
  ------------------
 3787|      0|        return std::make_unique<V2Transport>(id, /*initiating=*/!inbound);
 3788|  8.47k|    } else {
 3789|  8.47k|        return std::make_unique<V1Transport>(id);
 3790|  8.47k|    }
 3791|  8.47k|}

_ZN11CNetMessageC2EO10DataStream:
  239|  24.5k|    explicit CNetMessage(DataStream&& recv_in) : m_recv(std::move(recv_in)) {}
_ZN11V1Transport5ResetEv:
  386|  32.9k|    void Reset() EXCLUSIVE_LOCKS_REQUIRED(m_recv_mutex) {
  387|  32.9k|        AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  142|  32.9k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  388|  32.9k|        vRecv.clear();
  389|  32.9k|        hdrbuf.clear();
  390|  32.9k|        hdrbuf.resize(24);
  391|  32.9k|        in_data = false;
  392|  32.9k|        nHdrPos = 0;
  393|  32.9k|        nDataPos = 0;
  394|  32.9k|        data_hash.SetNull();
  395|  32.9k|        hasher.Reset();
  396|  32.9k|    }
_ZNK11V1Transport16CompleteInternalEv:
  399|  65.0k|    {
  400|  65.0k|        AssertLockHeld(m_recv_mutex);
  ------------------
  |  |  142|  65.0k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  401|  65.0k|        if (!in_data) return false;
  ------------------
  |  Branch (401:13): [True: 0, False: 65.0k]
  ------------------
  402|  65.0k|        return hdr.nMessageSize == nDataPos;
  403|  65.0k|    }
_ZNK11V1Transport23ReceivedMessageCompleteEv:
  420|  40.4k|    {
  421|  40.4k|        AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  147|  40.4k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  422|  40.4k|        return WITH_LOCK(m_recv_mutex, return CompleteInternal());
  ------------------
  |  |  301|  40.4k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  423|  40.4k|    }
_ZN11V1Transport13ReceivedBytesER4SpanIKhE:
  428|  40.4k|    {
  429|  40.4k|        AssertLockNotHeld(m_recv_mutex);
  ------------------
  |  |  147|  40.4k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  430|  40.4k|        LOCK(m_recv_mutex);
  ------------------
  |  |  257|  40.4k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  40.4k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  40.4k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  40.4k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|  40.4k|        int ret = in_data ? readData(msg_bytes) : readHeader(msg_bytes);
  ------------------
  |  Branch (431:19): [True: 15.9k, False: 24.5k]
  ------------------
  432|  40.4k|        if (ret < 0) {
  ------------------
  |  Branch (432:13): [True: 0, False: 40.4k]
  ------------------
  433|      0|            Reset();
  434|  40.4k|        } else {
  435|  40.4k|            msg_bytes = msg_bytes.subspan(ret);
  436|  40.4k|        }
  437|  40.4k|        return ret >= 0;
  438|  40.4k|    }
_ZNK5CNode13HasPermissionE18NetPermissionFlags:
  724|   882k|    bool HasPermission(NetPermissionFlags permission) const {
  725|   882k|        return NetPermissions::HasFlag(m_permission_flags, permission);
  726|   882k|    }
_ZN5CNode19AccountForSentBytesERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
  756|  54.6k|    {
  757|  54.6k|        mapSendBytesPerMsgType[msg_type] += sent_bytes;
  758|  54.6k|    }
_ZNK5CNode26IsOutboundOrBlockRelayConnEv:
  760|   442k|    bool IsOutboundOrBlockRelayConn() const {
  761|   442k|        switch (m_conn_type) {
  ------------------
  |  Branch (761:17): [True: 0, False: 442k]
  ------------------
  762|   131k|            case ConnectionType::OUTBOUND_FULL_RELAY:
  ------------------
  |  Branch (762:13): [True: 131k, False: 310k]
  ------------------
  763|   133k|            case ConnectionType::BLOCK_RELAY:
  ------------------
  |  Branch (763:13): [True: 2.68k, False: 439k]
  ------------------
  764|   133k|                return true;
  765|   265k|            case ConnectionType::INBOUND:
  ------------------
  |  Branch (765:13): [True: 265k, False: 176k]
  ------------------
  766|   306k|            case ConnectionType::MANUAL:
  ------------------
  |  Branch (766:13): [True: 41.8k, False: 400k]
  ------------------
  767|   308k|            case ConnectionType::ADDR_FETCH:
  ------------------
  |  Branch (767:13): [True: 1.08k, False: 440k]
  ------------------
  768|   308k|            case ConnectionType::FEELER:
  ------------------
  |  Branch (768:13): [True: 0, False: 442k]
  ------------------
  769|   308k|                return false;
  770|   442k|        } // no default case, so the compiler can warn about missing cases
  771|       |
  772|      0|        assert(false);
  773|      0|    }
_ZNK5CNode18IsFullOutboundConnEv:
  775|    221|    bool IsFullOutboundConn() const {
  776|    221|        return m_conn_type == ConnectionType::OUTBOUND_FULL_RELAY;
  777|    221|    }
_ZNK5CNode12IsManualConnEv:
  779|    434|    bool IsManualConn() const {
  780|    434|        return m_conn_type == ConnectionType::MANUAL;
  781|    434|    }
_ZNK5CNode26IsManualOrFullOutboundConnEv:
  784|  8.47k|    {
  785|  8.47k|        switch (m_conn_type) {
  ------------------
  |  Branch (785:17): [True: 0, False: 8.47k]
  ------------------
  786|  5.16k|        case ConnectionType::INBOUND:
  ------------------
  |  Branch (786:9): [True: 5.16k, False: 3.31k]
  ------------------
  787|  5.21k|        case ConnectionType::FEELER:
  ------------------
  |  Branch (787:9): [True: 57, False: 8.41k]
  ------------------
  788|  5.29k|        case ConnectionType::BLOCK_RELAY:
  ------------------
  |  Branch (788:9): [True: 82, False: 8.39k]
  ------------------
  789|  5.53k|        case ConnectionType::ADDR_FETCH:
  ------------------
  |  Branch (789:9): [True: 234, False: 8.23k]
  ------------------
  790|  5.53k|                return false;
  791|    345|        case ConnectionType::OUTBOUND_FULL_RELAY:
  ------------------
  |  Branch (791:9): [True: 345, False: 8.12k]
  ------------------
  792|  2.94k|        case ConnectionType::MANUAL:
  ------------------
  |  Branch (792:9): [True: 2.59k, False: 5.87k]
  ------------------
  793|  2.94k|                return true;
  794|  8.47k|        } // no default case, so the compiler can warn about missing cases
  795|       |
  796|      0|        assert(false);
  797|      0|    }
_ZNK5CNode15IsBlockOnlyConnEv:
  799|   447k|    bool IsBlockOnlyConn() const {
  800|   447k|        return m_conn_type == ConnectionType::BLOCK_RELAY;
  801|   447k|    }
_ZNK5CNode12IsFeelerConnEv:
  803|  27.9k|    bool IsFeelerConn() const {
  804|  27.9k|        return m_conn_type == ConnectionType::FEELER;
  805|  27.9k|    }
_ZNK5CNode15IsAddrFetchConnEv:
  807|   590k|    bool IsAddrFetchConn() const {
  808|   590k|        return m_conn_type == ConnectionType::ADDR_FETCH;
  809|   590k|    }
_ZNK5CNode13IsInboundConnEv:
  811|  1.01M|    bool IsInboundConn() const {
  812|  1.01M|        return m_conn_type == ConnectionType::INBOUND;
  813|  1.01M|    }
_ZNK5CNode22ExpectServicesFromConnEv:
  815|  8.40k|    bool ExpectServicesFromConn() const {
  816|  8.40k|        switch (m_conn_type) {
  ------------------
  |  Branch (816:17): [True: 0, False: 8.40k]
  ------------------
  817|  5.16k|            case ConnectionType::INBOUND:
  ------------------
  |  Branch (817:13): [True: 5.16k, False: 3.24k]
  ------------------
  818|  7.73k|            case ConnectionType::MANUAL:
  ------------------
  |  Branch (818:13): [True: 2.57k, False: 5.82k]
  ------------------
  819|  7.76k|            case ConnectionType::FEELER:
  ------------------
  |  Branch (819:13): [True: 27, False: 8.37k]
  ------------------
  820|  7.76k|                return false;
  821|    339|            case ConnectionType::OUTBOUND_FULL_RELAY:
  ------------------
  |  Branch (821:13): [True: 339, False: 8.06k]
  ------------------
  822|    409|            case ConnectionType::BLOCK_RELAY:
  ------------------
  |  Branch (822:13): [True: 70, False: 8.33k]
  ------------------
  823|    634|            case ConnectionType::ADDR_FETCH:
  ------------------
  |  Branch (823:13): [True: 225, False: 8.17k]
  ------------------
  824|    634|                return true;
  825|  8.40k|        } // no default case, so the compiler can warn about missing cases
  826|       |
  827|      0|        assert(false);
  828|      0|    }
_ZNK5CNode5GetIdEv:
  894|  4.12M|    NodeId GetId() const {
  895|  4.12M|        return id;
  896|  4.12M|    }
_ZNK5CNode13GetLocalNonceEv:
  898|  8.47k|    uint64_t GetLocalNonce() const {
  899|  8.47k|        return nLocalHostNonce;
  900|  8.47k|    }
_ZN5CNode16SetCommonVersionEi:
  920|  8.35k|    {
  921|  8.35k|        Assume(m_greatest_common_version == INIT_PROTO_VERSION);
  ------------------
  |  |   97|  8.35k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  922|  8.35k|        m_greatest_common_version = greatest_common_version;
  923|  8.35k|    }
_ZNK5CNode16GetCommonVersionEv:
  925|   907k|    {
  926|   907k|        return m_greatest_common_version;
  927|   907k|    }
_ZNK5CNode22ConnectionTypeAsStringEv:
  948|  3.07k|    std::string ConnectionTypeAsString() const { return ::ConnectionTypeAsString(m_conn_type); }
_ZN5CNode12PongReceivedENSt3__16chrono8durationIxNS0_5ratioILl1ELl1000000EEEEE:
  967|     17|    void PongReceived(std::chrono::microseconds ping_time) {
  968|     17|        m_last_ping_time = ping_time;
  969|     17|        m_min_ping_time = std::min(m_min_ping_time.load(), ping_time);
  970|     17|    }
_ZN8CConnman4StopEv:
 1130|      2|    {
 1131|      2|        StopThreads();
 1132|      2|        StopNodes();
 1133|      2|    };
_ZN17CSerializedNetMsgC2Ev:
  115|   114k|    CSerializedNetMsg() = default;
_ZN9TransportD2Ev:
  256|  8.47k|    virtual ~Transport() = default;
_ZN17CSerializedNetMsgC2EOS_:
  116|  81.9k|    CSerializedNetMsg(CSerializedNetMsg&&) = default;
_ZN17CSerializedNetMsgaSEOS_:
  117|  66.2k|    CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;
_ZN11CNetMessageC2EOS_:
  244|  71.4k|    CNetMessage(CNetMessage&&) = default;

_ZN14NetPermissions7HasFlagE18NetPermissionFlagsS0_:
   61|   891k|    {
   62|   891k|        using t = typename std::underlying_type<NetPermissionFlags>::type;
   63|   891k|        return (static_cast<t>(flags) & static_cast<t>(f)) == static_cast<t>(f);
   64|   891k|    }

net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl5StateEl:
 1055|  2.36M|{
 1056|  2.36M|    return const_cast<CNodeState*>(std::as_const(*this).State(pnode));
 1057|  2.36M|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl5StateEl:
 1047|  2.37M|{
 1048|  2.37M|    std::map<NodeId, CNodeState>::const_iterator it = m_node_states.find(pnode);
 1049|  2.37M|    if (it == m_node_states.end())
  ------------------
  |  Branch (1049:9): [True: 0, False: 2.37M]
  ------------------
 1050|      0|        return nullptr;
 1051|  2.37M|    return &it->second;
 1052|  2.37M|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl23MaybePunishNodeForBlockElRK20BlockValidationStatebRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
 1764|    253|{
 1765|    253|    PeerRef peer{GetPeerRef(nodeid)};
 1766|    253|    switch (state.GetResult()) {
  ------------------
  |  Branch (1766:13): [True: 0, False: 253]
  ------------------
 1767|      0|    case BlockValidationResult::BLOCK_RESULT_UNSET:
  ------------------
  |  Branch (1767:5): [True: 0, False: 253]
  ------------------
 1768|      0|        break;
 1769|      0|    case BlockValidationResult::BLOCK_HEADER_LOW_WORK:
  ------------------
  |  Branch (1769:5): [True: 0, False: 253]
  ------------------
 1770|       |        // We didn't try to process the block because the header chain may have
 1771|       |        // too little work.
 1772|      0|        break;
 1773|       |    // The node is providing invalid data:
 1774|      0|    case BlockValidationResult::BLOCK_CONSENSUS:
  ------------------
  |  Branch (1774:5): [True: 0, False: 253]
  ------------------
 1775|      0|    case BlockValidationResult::BLOCK_MUTATED:
  ------------------
  |  Branch (1775:5): [True: 0, False: 253]
  ------------------
 1776|      0|        if (!via_compact_block) {
  ------------------
  |  Branch (1776:13): [True: 0, False: 0]
  ------------------
 1777|      0|            if (peer) Misbehaving(*peer, message);
  ------------------
  |  Branch (1777:17): [True: 0, False: 0]
  ------------------
 1778|      0|            return;
 1779|      0|        }
 1780|      0|        break;
 1781|      0|    case BlockValidationResult::BLOCK_CACHED_INVALID:
  ------------------
  |  Branch (1781:5): [True: 0, False: 253]
  ------------------
 1782|      0|        {
 1783|       |            // Discourage outbound (but not inbound) peers if on an invalid chain.
 1784|       |            // Exempt HB compact block peers. Manual connections are always protected from discouragement.
 1785|      0|            if (peer && !via_compact_block && !peer->m_is_inbound) {
  ------------------
  |  Branch (1785:17): [True: 0, False: 0]
  |  Branch (1785:25): [True: 0, False: 0]
  |  Branch (1785:47): [True: 0, False: 0]
  ------------------
 1786|      0|                if (peer) Misbehaving(*peer, message);
  ------------------
  |  Branch (1786:21): [True: 0, False: 0]
  ------------------
 1787|      0|                return;
 1788|      0|            }
 1789|      0|            break;
 1790|      0|        }
 1791|    186|    case BlockValidationResult::BLOCK_INVALID_HEADER:
  ------------------
  |  Branch (1791:5): [True: 186, False: 67]
  ------------------
 1792|    186|    case BlockValidationResult::BLOCK_CHECKPOINT:
  ------------------
  |  Branch (1792:5): [True: 0, False: 253]
  ------------------
 1793|    186|    case BlockValidationResult::BLOCK_INVALID_PREV:
  ------------------
  |  Branch (1793:5): [True: 0, False: 253]
  ------------------
 1794|    186|        if (peer) Misbehaving(*peer, message);
  ------------------
  |  Branch (1794:13): [True: 186, False: 0]
  ------------------
 1795|    186|        return;
 1796|       |    // Conflicting (but not necessarily invalid) data or different policy:
 1797|      0|    case BlockValidationResult::BLOCK_MISSING_PREV:
  ------------------
  |  Branch (1797:5): [True: 0, False: 253]
  ------------------
 1798|      0|        if (peer) Misbehaving(*peer, message);
  ------------------
  |  Branch (1798:13): [True: 0, False: 0]
  ------------------
 1799|      0|        return;
 1800|     67|    case BlockValidationResult::BLOCK_TIME_FUTURE:
  ------------------
  |  Branch (1800:5): [True: 67, False: 186]
  ------------------
 1801|     67|        break;
 1802|    253|    }
 1803|     67|    if (message != "") {
  ------------------
  |  Branch (1803:9): [True: 67, False: 0]
  ------------------
 1804|     67|        LogDebug(BCLog::NET, "peer=%d: %s\n", nodeid, message);
  ------------------
  |  |  280|     67|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     67|    do {                                                  \
  |  |  |  |  274|     67|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 67]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     67|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1805|     67|    }
 1806|     67|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl10GetPeerRefEl:
 1654|   951k|{
 1655|   951k|    LOCK(m_peer_mutex);
  ------------------
  |  |  257|   951k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   951k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   951k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   951k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1656|   951k|    auto it = m_peer_map.find(id);
 1657|   951k|    return it != m_peer_map.end() ? it->second : nullptr;
  ------------------
  |  Branch (1657:12): [True: 951k, False: 0]
  ------------------
 1658|   951k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl11MisbehavingERNS_4PeerERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1750|    554|{
 1751|    554|    LOCK(peer.m_misbehavior_mutex);
  ------------------
  |  |  257|    554|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    554|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    554|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    554|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1752|       |
 1753|    554|    const std::string message_prefixed = message.empty() ? "" : (": " + message);
  ------------------
  |  Branch (1753:42): [True: 266, False: 288]
  ------------------
 1754|    554|    peer.m_should_discourage = true;
 1755|    554|    LogDebug(BCLog::NET, "Misbehaving: peer=%d%s\n", peer.m_id, message_prefixed);
  ------------------
  |  |  280|    554|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    554|    do {                                                  \
  |  |  |  |  274|    554|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 554]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    554|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1756|    554|    TRACEPOINT(net, misbehaving_connection,
 1757|    554|        peer.m_id,
 1758|    554|        message.c_str()
 1759|    554|    );
 1760|    554|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJbRKmEEEvR5CNodeNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
  690|  6.69k|    {
  691|  6.69k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  6.69k|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl24ProcessBlockAvailabilityEl:
 1308|   732k|void PeerManagerImpl::ProcessBlockAvailability(NodeId nodeid) {
 1309|   732k|    CNodeState *state = State(nodeid);
 1310|   732k|    assert(state != nullptr);
 1311|       |
 1312|   732k|    if (!state->hashLastUnknownBlock.IsNull()) {
  ------------------
  |  Branch (1312:9): [True: 1.75k, False: 731k]
  ------------------
 1313|  1.75k|        const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(state->hashLastUnknownBlock);
 1314|  1.75k|        if (pindex && pindex->nChainWork > 0) {
  ------------------
  |  Branch (1314:13): [True: 0, False: 1.75k]
  |  Branch (1314:13): [True: 0, False: 1.75k]
  |  Branch (1314:23): [True: 0, False: 0]
  ------------------
 1315|      0|            if (state->pindexBestKnownBlock == nullptr || pindex->nChainWork >= state->pindexBestKnownBlock->nChainWork) {
  ------------------
  |  Branch (1315:17): [True: 0, False: 0]
  |  Branch (1315:59): [True: 0, False: 0]
  ------------------
 1316|      0|                state->pindexBestKnownBlock = pindex;
 1317|      0|            }
 1318|      0|            state->hashLastUnknownBlock.SetNull();
 1319|      0|        }
 1320|  1.75k|    }
 1321|   732k|}
net_processing.cpp:_ZN12_GLOBAL__N_117CanServeWitnessesERKNS_4PeerE:
 1115|   841k|{
 1116|   841k|    return peer.m_their_services & NODE_WITNESS;
 1117|   841k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl18RemoveBlockRequestERK7uint256NSt3__18optionalIlEE:
 1148|    294|{
 1149|    294|    auto range = mapBlocksInFlight.equal_range(hash);
 1150|    294|    if (range.first == range.second) {
  ------------------
  |  Branch (1150:9): [True: 291, False: 3]
  ------------------
 1151|       |        // Block was not requested from any peer
 1152|    291|        return;
 1153|    291|    }
 1154|       |
 1155|       |    // We should not have requested too many of this block
 1156|      3|    Assume(mapBlocksInFlight.count(hash) <= MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK);
  ------------------
  |  |   97|      3|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 1157|       |
 1158|      6|    while (range.first != range.second) {
  ------------------
  |  Branch (1158:12): [True: 3, False: 3]
  ------------------
 1159|      3|        auto [node_id, list_it] = range.first->second;
 1160|       |
 1161|      3|        if (from_peer && *from_peer != node_id) {
  ------------------
  |  Branch (1161:13): [True: 3, False: 0]
  |  Branch (1161:26): [True: 0, False: 3]
  ------------------
 1162|      0|            range.first++;
 1163|      0|            continue;
 1164|      0|        }
 1165|       |
 1166|      3|        CNodeState& state = *Assert(State(node_id));
  ------------------
  |  |   85|      3|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 1167|       |
 1168|      3|        if (state.vBlocksInFlight.begin() == list_it) {
  ------------------
  |  Branch (1168:13): [True: 3, False: 0]
  ------------------
 1169|       |            // First block on the queue was received, update the start download time for the next one
 1170|      3|            state.m_downloading_since = std::max(state.m_downloading_since, GetTime<std::chrono::microseconds>());
 1171|      3|        }
 1172|      3|        state.vBlocksInFlight.erase(list_it);
 1173|       |
 1174|      3|        if (state.vBlocksInFlight.empty()) {
  ------------------
  |  Branch (1174:13): [True: 3, False: 0]
  ------------------
 1175|       |            // Last validated block on the queue for this peer was received.
 1176|      3|            m_peers_downloading_from--;
 1177|      3|        }
 1178|      3|        state.m_stalling_since = 0us;
 1179|       |
 1180|      3|        range.first = mapBlocksInFlight.erase(range.first);
 1181|      3|    }
 1182|      3|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl14BlockRequestedElRK11CBlockIndexPPNSt3__115__list_iteratorINS_11QueuedBlockEPvEE:
 1185|    153|{
 1186|    153|    const uint256& hash{block.GetBlockHash()};
 1187|       |
 1188|    153|    CNodeState *state = State(nodeid);
 1189|    153|    assert(state != nullptr);
 1190|       |
 1191|    153|    Assume(mapBlocksInFlight.count(hash) <= MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK);
  ------------------
  |  |   97|    153|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 1192|       |
 1193|       |    // Short-circuit most stuff in case it is from the same node
 1194|    153|    for (auto range = mapBlocksInFlight.equal_range(hash); range.first != range.second; range.first++) {
  ------------------
  |  Branch (1194:60): [True: 0, False: 153]
  ------------------
 1195|      0|        if (range.first->second.first == nodeid) {
  ------------------
  |  Branch (1195:13): [True: 0, False: 0]
  ------------------
 1196|      0|            if (pit) {
  ------------------
  |  Branch (1196:17): [True: 0, False: 0]
  ------------------
 1197|      0|                *pit = &range.first->second.second;
 1198|      0|            }
 1199|      0|            return false;
 1200|      0|        }
 1201|      0|    }
 1202|       |
 1203|       |    // Make sure it's not being fetched already from same peer.
 1204|    153|    RemoveBlockRequest(hash, nodeid);
 1205|       |
 1206|    153|    std::list<QueuedBlock>::iterator it = state->vBlocksInFlight.insert(state->vBlocksInFlight.end(),
 1207|    153|            {&block, std::unique_ptr<PartiallyDownloadedBlock>(pit ? new PartiallyDownloadedBlock(&m_mempool) : nullptr)});
  ------------------
  |  Branch (1207:64): [True: 141, False: 12]
  ------------------
 1208|    153|    if (state->vBlocksInFlight.size() == 1) {
  ------------------
  |  Branch (1208:9): [True: 149, False: 4]
  ------------------
 1209|       |        // We're starting a block download (batch) from this peer.
 1210|    149|        state->m_downloading_since = GetTime<std::chrono::microseconds>();
 1211|    149|        m_peers_downloading_from++;
 1212|    149|    }
 1213|    153|    auto itInFlight = mapBlocksInFlight.insert(std::make_pair(hash, std::make_pair(nodeid, it)));
 1214|    153|    if (pit) {
  ------------------
  |  Branch (1214:9): [True: 141, False: 12]
  ------------------
 1215|    141|        *pit = &itInFlight->second.second;
 1216|    141|    }
 1217|    153|    return true;
 1218|    153|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRNSt3__16vectorI4CInvNS2_9allocatorIS4_EEEEEEEvR5CNodeNS2_12basic_stringIcNS2_11char_traitsIcEENS5_IcEEEEDpOT_:
  690|  15.5k|    {
  691|  15.5k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  15.5k|    }
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl17GetNodeStateStatsElR15CNodeStateStats:
 1673|  7.74k|{
 1674|  7.74k|    {
 1675|  7.74k|        LOCK(cs_main);
  ------------------
  |  |  257|  7.74k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  7.74k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  7.74k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  7.74k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1676|  7.74k|        const CNodeState* state = State(nodeid);
 1677|  7.74k|        if (state == nullptr)
  ------------------
  |  Branch (1677:13): [True: 0, False: 7.74k]
  ------------------
 1678|      0|            return false;
 1679|  7.74k|        stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;
  ------------------
  |  Branch (1679:29): [True: 0, False: 7.74k]
  ------------------
 1680|  7.74k|        stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;
  ------------------
  |  Branch (1680:31): [True: 0, False: 7.74k]
  ------------------
 1681|  7.74k|        for (const QueuedBlock& queue : state->vBlocksInFlight) {
  ------------------
  |  Branch (1681:39): [True: 0, False: 7.74k]
  ------------------
 1682|      0|            if (queue.pindex)
  ------------------
  |  Branch (1682:17): [True: 0, False: 0]
  ------------------
 1683|      0|                stats.vHeightInFlight.push_back(queue.pindex->nHeight);
 1684|      0|        }
 1685|  7.74k|    }
 1686|       |
 1687|      0|    PeerRef peer = GetPeerRef(nodeid);
 1688|  7.74k|    if (peer == nullptr) return false;
  ------------------
  |  Branch (1688:9): [True: 0, False: 7.74k]
  ------------------
 1689|  7.74k|    stats.their_services = peer->m_their_services;
 1690|  7.74k|    stats.m_starting_height = peer->m_starting_height;
 1691|       |    // It is common for nodes with good ping times to suddenly become lagged,
 1692|       |    // due to a new block arriving or other large transfer.
 1693|       |    // Merely reporting pingtime might fool the caller into thinking the node was still responsive,
 1694|       |    // since pingtime does not update until the ping is complete, which might take a while.
 1695|       |    // So, if a ping is taking an unusually long time in flight,
 1696|       |    // the caller can immediately detect that this is happening.
 1697|  7.74k|    auto ping_wait{0us};
 1698|  7.74k|    if ((0 != peer->m_ping_nonce_sent) && (0 != peer->m_ping_start.load().count())) {
  ------------------
  |  Branch (1698:9): [True: 0, False: 7.74k]
  |  Branch (1698:9): [True: 0, False: 7.74k]
  |  Branch (1698:43): [True: 0, False: 0]
  ------------------
 1699|      0|        ping_wait = GetTime<std::chrono::microseconds>() - peer->m_ping_start.load();
 1700|      0|    }
 1701|       |
 1702|  7.74k|    if (auto tx_relay = peer->GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (1702:45): [True: 5.82k, False: 1.91k]
  ------------------
 1703|  5.82k|        stats.m_relay_txs = WITH_LOCK(tx_relay->m_bloom_filter_mutex, return tx_relay->m_relay_txs);
  ------------------
  |  |  301|  5.82k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 1704|  5.82k|        stats.m_fee_filter_received = tx_relay->m_fee_filter_received.load();
 1705|  5.82k|    } else {
 1706|  1.91k|        stats.m_relay_txs = false;
 1707|  1.91k|        stats.m_fee_filter_received = 0;
 1708|  1.91k|    }
 1709|       |
 1710|  7.74k|    stats.m_ping_wait = ping_wait;
 1711|  7.74k|    stats.m_addr_processed = peer->m_addr_processed.load();
 1712|  7.74k|    stats.m_addr_rate_limited = peer->m_addr_rate_limited.load();
 1713|  7.74k|    stats.m_addr_relay_enabled = peer->m_addr_relay_enabled.load();
 1714|  7.74k|    {
 1715|  7.74k|        LOCK(peer->m_headers_sync_mutex);
  ------------------
  |  |  257|  7.74k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  7.74k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  7.74k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  7.74k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1716|  7.74k|        if (peer->m_headers_sync) {
  ------------------
  |  Branch (1716:13): [True: 0, False: 7.74k]
  ------------------
 1717|      0|            stats.presync_height = peer->m_headers_sync->GetPresyncHeight();
 1718|      0|        }
 1719|  7.74k|    }
 1720|  7.74k|    stats.time_offset = peer->m_time_offset;
 1721|       |
 1722|  7.74k|    return true;
 1723|  7.74k|}
net_processing.cpp:_ZN12_GLOBAL__N_14Peer10GetTxRelayEv:
  301|  1.80M|    {
  302|  1.80M|        return WITH_LOCK(m_tx_relay_mutex, return m_tx_relay.get());
  ------------------
  |  |  301|  1.80M|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  303|  1.80M|    };
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl14CanDirectFetchEv:
 1295|  1.96k|{
 1296|  1.96k|    return m_chainman.ActiveChain().Tip()->Time() > NodeClock::now() - m_chainparams.GetConsensus().PowTargetSpacing() * 20;
 1297|  1.96k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEE:
 3377|  23.6k|{
 3378|  23.6k|    AssertLockHeld(g_msgproc_mutex);
  ------------------
  |  |  142|  23.6k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3379|       |
 3380|  23.6k|    LogDebug(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(msg_type), vRecv.size(), pfrom.GetId());
  ------------------
  |  |  280|  23.6k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  23.6k|    do {                                                  \
  |  |  |  |  274|  23.6k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 23.6k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  23.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3381|       |
 3382|  23.6k|    PeerRef peer = GetPeerRef(pfrom.GetId());
 3383|  23.6k|    if (peer == nullptr) return;
  ------------------
  |  Branch (3383:9): [True: 0, False: 23.6k]
  ------------------
 3384|       |
 3385|  23.6k|    if (msg_type == NetMsgType::VERSION) {
  ------------------
  |  Branch (3385:9): [True: 8.42k, False: 15.1k]
  ------------------
 3386|  8.42k|        if (pfrom.nVersion != 0) {
  ------------------
  |  Branch (3386:13): [True: 20, False: 8.40k]
  ------------------
 3387|     20|            LogDebug(BCLog::NET, "redundant version message from peer=%d\n", pfrom.GetId());
  ------------------
  |  |  280|     20|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     20|    do {                                                  \
  |  |  |  |  274|     20|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3388|     20|            return;
 3389|     20|        }
 3390|       |
 3391|  8.40k|        int64_t nTime;
 3392|  8.40k|        CService addrMe;
 3393|  8.40k|        uint64_t nNonce = 1;
 3394|  8.40k|        ServiceFlags nServices;
 3395|  8.40k|        int nVersion;
 3396|  8.40k|        std::string cleanSubVer;
 3397|  8.40k|        int starting_height = -1;
 3398|  8.40k|        bool fRelay = true;
 3399|       |
 3400|  8.40k|        vRecv >> nVersion >> Using<CustomUintFormatter<8>>(nServices) >> nTime;
 3401|  8.40k|        if (nTime < 0) {
  ------------------
  |  Branch (3401:13): [True: 0, False: 8.40k]
  ------------------
 3402|      0|            nTime = 0;
 3403|      0|        }
 3404|  8.40k|        vRecv.ignore(8); // Ignore the addrMe service bits sent by the peer
 3405|  8.40k|        vRecv >> CNetAddr::V1(addrMe);
 3406|  8.40k|        if (!pfrom.IsInboundConn())
  ------------------
  |  Branch (3406:13): [True: 3.24k, False: 5.16k]
  ------------------
 3407|  3.24k|        {
 3408|       |            // Overwrites potentially existing services. In contrast to this,
 3409|       |            // unvalidated services received via gossip relay in ADDR/ADDRV2
 3410|       |            // messages are only ever added but cannot replace existing ones.
 3411|  3.24k|            m_addrman.SetServices(pfrom.addr, nServices);
 3412|  3.24k|        }
 3413|  8.40k|        if (pfrom.ExpectServicesFromConn() && !HasAllDesirableServiceFlags(nServices))
  ------------------
  |  Branch (3413:13): [True: 634, False: 7.76k]
  |  Branch (3413:47): [True: 50, False: 584]
  ------------------
 3414|     50|        {
 3415|     50|            LogDebug(BCLog::NET, "peer does not offer the expected services (%08x offered, %08x expected), %s\n",
  ------------------
  |  |  280|     50|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     50|    do {                                                  \
  |  |  |  |  274|     50|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 50]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     50|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3416|     50|                     nServices,
 3417|     50|                     GetDesirableServiceFlags(nServices),
 3418|     50|                     pfrom.DisconnectMsg(fLogIPs));
 3419|     50|            pfrom.fDisconnect = true;
 3420|     50|            return;
 3421|     50|        }
 3422|       |
 3423|  8.35k|        if (nVersion < MIN_PEER_PROTO_VERSION) {
  ------------------
  |  Branch (3423:13): [True: 0, False: 8.35k]
  ------------------
 3424|       |            // disconnect from peers older than this proto version
 3425|      0|            LogDebug(BCLog::NET, "peer using obsolete version %i, %s\n", nVersion, pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3426|      0|            pfrom.fDisconnect = true;
 3427|      0|            return;
 3428|      0|        }
 3429|       |
 3430|  8.35k|        if (!vRecv.empty()) {
  ------------------
  |  Branch (3430:13): [True: 8.35k, False: 0]
  ------------------
 3431|       |            // The version message includes information about the sending node which we don't use:
 3432|       |            //   - 8 bytes (service bits)
 3433|       |            //   - 16 bytes (ipv6 address)
 3434|       |            //   - 2 bytes (port)
 3435|  8.35k|            vRecv.ignore(26);
 3436|  8.35k|            vRecv >> nNonce;
 3437|  8.35k|        }
 3438|  8.35k|        if (!vRecv.empty()) {
  ------------------
  |  Branch (3438:13): [True: 8.35k, False: 0]
  ------------------
 3439|  8.35k|            std::string strSubVer;
 3440|  8.35k|            vRecv >> LIMITED_STRING(strSubVer, MAX_SUBVERSION_LENGTH);
  ------------------
  |  |  502|  8.35k|#define LIMITED_STRING(obj,n) Using<LimitedStringFormatter<n>>(obj)
  ------------------
 3441|  8.35k|            cleanSubVer = SanitizeString(strSubVer);
 3442|  8.35k|        }
 3443|  8.35k|        if (!vRecv.empty()) {
  ------------------
  |  Branch (3443:13): [True: 8.35k, False: 0]
  ------------------
 3444|  8.35k|            vRecv >> starting_height;
 3445|  8.35k|        }
 3446|  8.35k|        if (!vRecv.empty())
  ------------------
  |  Branch (3446:13): [True: 8.35k, False: 0]
  ------------------
 3447|  8.35k|            vRecv >> fRelay;
 3448|       |        // Disconnect if we connected to ourself
 3449|  8.35k|        if (pfrom.IsInboundConn() && !m_connman.CheckIncomingNonce(nNonce))
  ------------------
  |  Branch (3449:13): [True: 5.16k, False: 3.19k]
  |  Branch (3449:38): [True: 0, False: 5.16k]
  ------------------
 3450|      0|        {
 3451|      0|            LogPrintf("connected to self at %s, disconnecting\n", pfrom.addr.ToStringAddrPort());
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3452|      0|            pfrom.fDisconnect = true;
 3453|      0|            return;
 3454|      0|        }
 3455|       |
 3456|  8.35k|        if (pfrom.IsInboundConn() && addrMe.IsRoutable())
  ------------------
  |  Branch (3456:13): [True: 5.16k, False: 3.19k]
  |  Branch (3456:38): [True: 0, False: 5.16k]
  ------------------
 3457|      0|        {
 3458|      0|            SeenLocal(addrMe);
 3459|      0|        }
 3460|       |
 3461|       |        // Inbound peers send us their version message when they connect.
 3462|       |        // We send our version message in response.
 3463|  8.35k|        if (pfrom.IsInboundConn()) {
  ------------------
  |  Branch (3463:13): [True: 5.16k, False: 3.19k]
  ------------------
 3464|  5.16k|            PushNodeVersion(pfrom, *peer);
 3465|  5.16k|        }
 3466|       |
 3467|       |        // Change version
 3468|  8.35k|        const int greatest_common_version = std::min(nVersion, PROTOCOL_VERSION);
 3469|  8.35k|        pfrom.SetCommonVersion(greatest_common_version);
 3470|  8.35k|        pfrom.nVersion = nVersion;
 3471|       |
 3472|  8.35k|        if (greatest_common_version >= WTXID_RELAY_VERSION) {
  ------------------
  |  Branch (3472:13): [True: 6.88k, False: 1.46k]
  ------------------
 3473|  6.88k|            MakeAndPushMessage(pfrom, NetMsgType::WTXIDRELAY);
 3474|  6.88k|        }
 3475|       |
 3476|       |        // Signal ADDRv2 support (BIP155).
 3477|  8.35k|        if (greatest_common_version >= 70016) {
  ------------------
  |  Branch (3477:13): [True: 6.88k, False: 1.46k]
  ------------------
 3478|       |            // BIP155 defines addrv2 and sendaddrv2 for all protocol versions, but some
 3479|       |            // implementations reject messages they don't know. As a courtesy, don't send
 3480|       |            // it to nodes with a version before 70016, as no software is known to support
 3481|       |            // BIP155 that doesn't announce at least that protocol version number.
 3482|  6.88k|            MakeAndPushMessage(pfrom, NetMsgType::SENDADDRV2);
 3483|  6.88k|        }
 3484|       |
 3485|  8.35k|        pfrom.m_has_all_wanted_services = HasAllDesirableServiceFlags(nServices);
 3486|  8.35k|        peer->m_their_services = nServices;
 3487|  8.35k|        pfrom.SetAddrLocal(addrMe);
 3488|  8.35k|        {
 3489|  8.35k|            LOCK(pfrom.m_subver_mutex);
  ------------------
  |  |  257|  8.35k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.35k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.35k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.35k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3490|  8.35k|            pfrom.cleanSubVer = cleanSubVer;
 3491|  8.35k|        }
 3492|  8.35k|        peer->m_starting_height = starting_height;
 3493|       |
 3494|       |        // Only initialize the Peer::TxRelay m_relay_txs data structure if:
 3495|       |        // - this isn't an outbound block-relay-only connection, and
 3496|       |        // - this isn't an outbound feeler connection, and
 3497|       |        // - fRelay=true (the peer wishes to receive transaction announcements)
 3498|       |        //   or we're offering NODE_BLOOM to this peer. NODE_BLOOM means that
 3499|       |        //   the peer may turn on transaction relay later.
 3500|  8.35k|        if (!pfrom.IsBlockOnlyConn() &&
  ------------------
  |  Branch (3500:13): [True: 8.28k, False: 61]
  ------------------
 3501|  8.35k|            !pfrom.IsFeelerConn() &&
  ------------------
  |  Branch (3501:13): [True: 8.26k, False: 27]
  ------------------
 3502|  8.35k|            (fRelay || (peer->m_our_services & NODE_BLOOM))) {
  ------------------
  |  Branch (3502:14): [True: 4.36k, False: 3.89k]
  |  Branch (3502:24): [True: 1.49k, False: 2.40k]
  ------------------
 3503|  5.86k|            auto* const tx_relay = peer->SetTxRelay();
 3504|  5.86k|            {
 3505|  5.86k|                LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|  5.86k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.86k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.86k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.86k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3506|  5.86k|                tx_relay->m_relay_txs = fRelay; // set to true after we get the first filter* message
 3507|  5.86k|            }
 3508|  5.86k|            if (fRelay) pfrom.m_relays_txs = true;
  ------------------
  |  Branch (3508:17): [True: 4.36k, False: 1.49k]
  ------------------
 3509|  5.86k|        }
 3510|       |
 3511|  8.35k|        if (greatest_common_version >= WTXID_RELAY_VERSION && m_txreconciliation) {
  ------------------
  |  Branch (3511:13): [True: 6.88k, False: 1.46k]
  |  Branch (3511:63): [True: 6.88k, False: 0]
  ------------------
 3512|       |            // Per BIP-330, we announce txreconciliation support if:
 3513|       |            // - protocol version per the peer's VERSION message supports WTXID_RELAY;
 3514|       |            // - transaction relay is supported per the peer's VERSION message
 3515|       |            // - this is not a block-relay-only connection and not a feeler
 3516|       |            // - this is not an addr fetch connection;
 3517|       |            // - we are not in -blocksonly mode.
 3518|  6.88k|            const auto* tx_relay = peer->GetTxRelay();
 3519|  6.88k|            if (tx_relay && WITH_LOCK(tx_relay->m_bloom_filter_mutex, return tx_relay->m_relay_txs) &&
  ------------------
  |  |  301|  12.1k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  |  |  ------------------
  |  |  |  Branch (301:29): [True: 3.90k, False: 1.33k]
  |  |  ------------------
  ------------------
  |  Branch (3519:17): [True: 5.23k, False: 1.64k]
  |  Branch (3519:17): [True: 3.77k, False: 3.11k]
  ------------------
 3520|  6.88k|                !pfrom.IsAddrFetchConn() && !m_opts.ignore_incoming_txs) {
  ------------------
  |  Branch (3520:17): [True: 3.77k, False: 128]
  |  Branch (3520:45): [True: 3.77k, False: 0]
  ------------------
 3521|  3.77k|                const uint64_t recon_salt = m_txreconciliation->PreRegisterPeer(pfrom.GetId());
 3522|  3.77k|                MakeAndPushMessage(pfrom, NetMsgType::SENDTXRCNCL,
 3523|  3.77k|                                   TXRECONCILIATION_VERSION, recon_salt);
 3524|  3.77k|            }
 3525|  6.88k|        }
 3526|       |
 3527|  8.35k|        MakeAndPushMessage(pfrom, NetMsgType::VERACK);
 3528|       |
 3529|       |        // Potentially mark this peer as a preferred download peer.
 3530|  8.35k|        {
 3531|  8.35k|            LOCK(cs_main);
  ------------------
  |  |  257|  8.35k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.35k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.35k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.35k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3532|  8.35k|            CNodeState* state = State(pfrom.GetId());
 3533|  8.35k|            state->fPreferredDownload = (!pfrom.IsInboundConn() || pfrom.HasPermission(NetPermissionFlags::NoBan)) && !pfrom.IsAddrFetchConn() && CanServeBlocks(*peer);
  ------------------
  |  Branch (3533:42): [True: 3.19k, False: 5.16k]
  |  Branch (3533:68): [True: 1.46k, False: 3.69k]
  |  Branch (3533:119): [True: 4.44k, False: 205]
  |  Branch (3533:147): [True: 2.69k, False: 1.75k]
  ------------------
 3534|  8.35k|            m_num_preferred_download_peers += state->fPreferredDownload;
 3535|  8.35k|        }
 3536|       |
 3537|       |        // Attempt to initialize address relay for outbound peers and use result
 3538|       |        // to decide whether to send GETADDR, so that we don't send it to
 3539|       |        // inbound or outbound block-relay-only peers.
 3540|  8.35k|        bool send_getaddr{false};
 3541|  8.35k|        if (!pfrom.IsInboundConn()) {
  ------------------
  |  Branch (3541:13): [True: 3.19k, False: 5.16k]
  ------------------
 3542|  3.19k|            send_getaddr = SetupAddressRelay(pfrom, *peer);
 3543|  3.19k|        }
 3544|  8.35k|        if (send_getaddr) {
  ------------------
  |  Branch (3544:13): [True: 3.12k, False: 5.22k]
  ------------------
 3545|       |            // Do a one-time address fetch to help populate/update our addrman.
 3546|       |            // If we're starting up for the first time, our addrman may be pretty
 3547|       |            // empty, so this mechanism is important to help us connect to the network.
 3548|       |            // We skip this for block-relay-only peers. We want to avoid
 3549|       |            // potentially leaking addr information and we do not want to
 3550|       |            // indicate to the peer that we will participate in addr relay.
 3551|  3.12k|            MakeAndPushMessage(pfrom, NetMsgType::GETADDR);
 3552|  3.12k|            peer->m_getaddr_sent = true;
 3553|       |            // When requesting a getaddr, accept an additional MAX_ADDR_TO_SEND addresses in response
 3554|       |            // (bypassing the MAX_ADDR_PROCESSING_TOKEN_BUCKET limit).
 3555|  3.12k|            peer->m_addr_token_bucket += MAX_ADDR_TO_SEND;
 3556|  3.12k|        }
 3557|       |
 3558|  8.35k|        if (!pfrom.IsInboundConn()) {
  ------------------
  |  Branch (3558:13): [True: 3.19k, False: 5.16k]
  ------------------
 3559|       |            // For non-inbound connections, we update the addrman to record
 3560|       |            // connection success so that addrman will have an up-to-date
 3561|       |            // notion of which peers are online and available.
 3562|       |            //
 3563|       |            // While we strive to not leak information about block-relay-only
 3564|       |            // connections via the addrman, not moving an address to the tried
 3565|       |            // table is also potentially detrimental because new-table entries
 3566|       |            // are subject to eviction in the event of addrman collisions.  We
 3567|       |            // mitigate the information-leak by never calling
 3568|       |            // AddrMan::Connected() on block-relay-only peers; see
 3569|       |            // FinalizeNode().
 3570|       |            //
 3571|       |            // This moves an address from New to Tried table in Addrman,
 3572|       |            // resolves tried-table collisions, etc.
 3573|  3.19k|            m_addrman.Good(pfrom.addr);
 3574|  3.19k|        }
 3575|       |
 3576|  8.35k|        const auto mapped_as{m_connman.GetMappedAS(pfrom.addr)};
 3577|  8.35k|        LogDebug(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d%s%s\n",
  ------------------
  |  |  280|  8.35k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  8.35k|    do {                                                  \
  |  |  |  |  274|  8.35k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8.35k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  8.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3578|  8.35k|                  cleanSubVer, pfrom.nVersion,
 3579|  8.35k|                  peer->m_starting_height, addrMe.ToStringAddrPort(), fRelay, pfrom.GetId(),
 3580|  8.35k|                  pfrom.LogIP(fLogIPs), (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""));
 3581|       |
 3582|  8.35k|        peer->m_time_offset = NodeSeconds{std::chrono::seconds{nTime}} - Now<NodeSeconds>();
 3583|  8.35k|        if (!pfrom.IsInboundConn()) {
  ------------------
  |  Branch (3583:13): [True: 3.19k, False: 5.16k]
  ------------------
 3584|       |            // Don't use timedata samples from inbound peers to make it
 3585|       |            // harder for others to create false warnings about our clock being out of sync.
 3586|  3.19k|            m_outbound_time_offsets.Add(peer->m_time_offset);
 3587|  3.19k|            m_outbound_time_offsets.WarnIfOutOfSync();
 3588|  3.19k|        }
 3589|       |
 3590|       |        // If the peer is old enough to have the old alert system, send it the final alert.
 3591|  8.35k|        if (greatest_common_version <= 70012) {
  ------------------
  |  Branch (3591:13): [True: 1.45k, False: 6.89k]
  ------------------
 3592|  1.45k|            constexpr auto finalAlert{"60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50"_hex};
 3593|  1.45k|            MakeAndPushMessage(pfrom, "alert", finalAlert);
 3594|  1.45k|        }
 3595|       |
 3596|       |        // Feeler connections exist only to verify if address is online.
 3597|  8.35k|        if (pfrom.IsFeelerConn()) {
  ------------------
  |  Branch (3597:13): [True: 27, False: 8.32k]
  ------------------
 3598|     27|            LogDebug(BCLog::NET, "feeler connection completed, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|     27|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     27|    do {                                                  \
  |  |  |  |  274|     27|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 27]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     27|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3599|     27|            pfrom.fDisconnect = true;
 3600|     27|        }
 3601|  8.35k|        return;
 3602|  8.35k|    }
 3603|       |
 3604|  15.1k|    if (pfrom.nVersion == 0) {
  ------------------
  |  Branch (3604:9): [True: 0, False: 15.1k]
  ------------------
 3605|       |        // Must have a version message before anything else
 3606|      0|        LogDebug(BCLog::NET, "non-version message before version handshake. Message \"%s\" from peer=%d\n", SanitizeString(msg_type), pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3607|      0|        return;
 3608|      0|    }
 3609|       |
 3610|  15.1k|    if (msg_type == NetMsgType::VERACK) {
  ------------------
  |  Branch (3610:9): [True: 7.59k, False: 7.59k]
  ------------------
 3611|  7.59k|        if (pfrom.fSuccessfullyConnected) {
  ------------------
  |  Branch (3611:13): [True: 2, False: 7.59k]
  ------------------
 3612|      2|            LogDebug(BCLog::NET, "ignoring redundant verack message from peer=%d\n", pfrom.GetId());
  ------------------
  |  |  280|      2|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      2|    do {                                                  \
  |  |  |  |  274|      2|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3613|      2|            return;
 3614|      2|        }
 3615|       |
 3616|       |        // Log successful connections unconditionally for outbound, but not for inbound as those
 3617|       |        // can be triggered by an attacker at high rate.
 3618|  7.59k|        if (!pfrom.IsInboundConn() || LogAcceptCategory(BCLog::NET, BCLog::Level::Debug)) {
  ------------------
  |  Branch (3618:13): [True: 3.07k, False: 4.51k]
  |  Branch (3618:39): [True: 0, False: 4.51k]
  ------------------
 3619|  3.07k|            const auto mapped_as{m_connman.GetMappedAS(pfrom.addr)};
 3620|  3.07k|            LogPrintf("New %s %s peer connected: version: %d, blocks=%d, peer=%d%s%s\n",
  ------------------
  |  |  266|  3.07k|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|  3.07k|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|  6.15k|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 3.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3621|  3.07k|                      pfrom.ConnectionTypeAsString(),
 3622|  3.07k|                      TransportTypeAsString(pfrom.m_transport->GetInfo().transport_type),
 3623|  3.07k|                      pfrom.nVersion.load(), peer->m_starting_height,
 3624|  3.07k|                      pfrom.GetId(), pfrom.LogIP(fLogIPs),
 3625|  3.07k|                      (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""));
 3626|  3.07k|        }
 3627|       |
 3628|  7.59k|        if (pfrom.GetCommonVersion() >= SHORT_IDS_BLOCKS_VERSION) {
  ------------------
  |  Branch (3628:13): [True: 6.69k, False: 902]
  ------------------
 3629|       |            // Tell our peer we are willing to provide version 2 cmpctblocks.
 3630|       |            // However, we do not request new block announcements using
 3631|       |            // cmpctblock messages.
 3632|       |            // We send this to non-NODE NETWORK peers as well, because
 3633|       |            // they may wish to request compact blocks from us
 3634|  6.69k|            MakeAndPushMessage(pfrom, NetMsgType::SENDCMPCT, /*high_bandwidth=*/false, /*version=*/CMPCTBLOCKS_VERSION);
 3635|  6.69k|        }
 3636|       |
 3637|  7.59k|        if (m_txreconciliation) {
  ------------------
  |  Branch (3637:13): [True: 7.59k, False: 0]
  ------------------
 3638|  7.59k|            if (!peer->m_wtxid_relay || !m_txreconciliation->IsPeerRegistered(pfrom.GetId())) {
  ------------------
  |  Branch (3638:17): [True: 7.59k, False: 0]
  |  Branch (3638:41): [True: 0, False: 0]
  ------------------
 3639|       |                // We could have optimistically pre-registered/registered the peer. In that case,
 3640|       |                // we should forget about the reconciliation state here if this wasn't followed
 3641|       |                // by WTXIDRELAY (since WTXIDRELAY can't be announced later).
 3642|  7.59k|                m_txreconciliation->ForgetPeer(pfrom.GetId());
 3643|  7.59k|            }
 3644|  7.59k|        }
 3645|       |
 3646|  7.59k|        if (auto tx_relay = peer->GetTxRelay()) {
  ------------------
  |  Branch (3646:18): [True: 5.70k, False: 1.88k]
  ------------------
 3647|       |            // `TxRelay::m_tx_inventory_to_send` must be empty before the
 3648|       |            // version handshake is completed as
 3649|       |            // `TxRelay::m_next_inv_send_time` is first initialised in
 3650|       |            // `SendMessages` after the verack is received. Any transactions
 3651|       |            // received during the version handshake would otherwise
 3652|       |            // immediately be advertised without random delay, potentially
 3653|       |            // leaking the time of arrival to a spy.
 3654|  5.70k|            Assume(WITH_LOCK(
  ------------------
  |  |   97|  5.70k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 3655|  5.70k|                tx_relay->m_tx_inventory_mutex,
 3656|  5.70k|                return tx_relay->m_tx_inventory_to_send.empty() &&
 3657|  5.70k|                       tx_relay->m_next_inv_send_time == 0s));
 3658|  5.70k|        }
 3659|       |
 3660|  7.59k|        {
 3661|  7.59k|            LOCK2(::cs_main, m_tx_download_mutex);
  ------------------
  |  |  259|  7.59k|    UniqueLock criticalblock1(MaybeCheckNotHeld(cs1), #cs1, __FILE__, __LINE__); \
  |  |  260|  7.59k|    UniqueLock criticalblock2(MaybeCheckNotHeld(cs2), #cs2, __FILE__, __LINE__)
  ------------------
 3662|  7.59k|            const CNodeState* state = State(pfrom.GetId());
 3663|  7.59k|            m_txdownloadman.ConnectedPeer(pfrom.GetId(), node::TxDownloadConnectionInfo {
 3664|  7.59k|                .m_preferred = state->fPreferredDownload,
 3665|  7.59k|                .m_relay_permissions = pfrom.HasPermission(NetPermissionFlags::Relay),
 3666|  7.59k|                .m_wtxid_relay = peer->m_wtxid_relay,
 3667|  7.59k|            });
 3668|  7.59k|        }
 3669|       |
 3670|  7.59k|        pfrom.fSuccessfullyConnected = true;
 3671|  7.59k|        return;
 3672|  7.59k|    }
 3673|       |
 3674|  7.59k|    if (msg_type == NetMsgType::SENDHEADERS) {
  ------------------
  |  Branch (3674:9): [True: 3, False: 7.59k]
  ------------------
 3675|      3|        peer->m_prefers_headers = true;
 3676|      3|        return;
 3677|      3|    }
 3678|       |
 3679|  7.59k|    if (msg_type == NetMsgType::SENDCMPCT) {
  ------------------
  |  Branch (3679:9): [True: 88, False: 7.50k]
  ------------------
 3680|     88|        bool sendcmpct_hb{false};
 3681|     88|        uint64_t sendcmpct_version{0};
 3682|     88|        vRecv >> sendcmpct_hb >> sendcmpct_version;
 3683|       |
 3684|       |        // Only support compact block relay with witnesses
 3685|     88|        if (sendcmpct_version != CMPCTBLOCKS_VERSION) return;
  ------------------
  |  Branch (3685:13): [True: 85, False: 3]
  ------------------
 3686|       |
 3687|      3|        LOCK(cs_main);
  ------------------
  |  |  257|      3|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      3|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      3|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      3|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3688|      3|        CNodeState* nodestate = State(pfrom.GetId());
 3689|      3|        nodestate->m_provides_cmpctblocks = true;
 3690|      3|        nodestate->m_requested_hb_cmpctblocks = sendcmpct_hb;
 3691|       |        // save whether peer selects us as BIP152 high-bandwidth peer
 3692|       |        // (receiving sendcmpct(1) signals high-bandwidth, sendcmpct(0) low-bandwidth)
 3693|      3|        pfrom.m_bip152_highbandwidth_from = sendcmpct_hb;
 3694|      3|        return;
 3695|     88|    }
 3696|       |
 3697|       |    // BIP339 defines feature negotiation of wtxidrelay, which must happen between
 3698|       |    // VERSION and VERACK to avoid relay problems from switching after a connection is up.
 3699|  7.50k|    if (msg_type == NetMsgType::WTXIDRELAY) {
  ------------------
  |  Branch (3699:9): [True: 14, False: 7.48k]
  ------------------
 3700|     14|        if (pfrom.fSuccessfullyConnected) {
  ------------------
  |  Branch (3700:13): [True: 3, False: 11]
  ------------------
 3701|       |            // Disconnect peers that send a wtxidrelay message after VERACK.
 3702|      3|            LogDebug(BCLog::NET, "wtxidrelay received after verack, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      3|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      3|    do {                                                  \
  |  |  |  |  274|      3|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3703|      3|            pfrom.fDisconnect = true;
 3704|      3|            return;
 3705|      3|        }
 3706|     11|        if (pfrom.GetCommonVersion() >= WTXID_RELAY_VERSION) {
  ------------------
  |  Branch (3706:13): [True: 1, False: 10]
  ------------------
 3707|      1|            if (!peer->m_wtxid_relay) {
  ------------------
  |  Branch (3707:17): [True: 1, False: 0]
  ------------------
 3708|      1|                peer->m_wtxid_relay = true;
 3709|      1|                m_wtxid_relay_peers++;
 3710|      1|            } else {
 3711|      0|                LogDebug(BCLog::NET, "ignoring duplicate wtxidrelay from peer=%d\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3712|      0|            }
 3713|     10|        } else {
 3714|     10|            LogDebug(BCLog::NET, "ignoring wtxidrelay due to old common version=%d from peer=%d\n", pfrom.GetCommonVersion(), pfrom.GetId());
  ------------------
  |  |  280|     10|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     10|    do {                                                  \
  |  |  |  |  274|     10|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3715|     10|        }
 3716|     11|        return;
 3717|     14|    }
 3718|       |
 3719|       |    // BIP155 defines feature negotiation of addrv2 and sendaddrv2, which must happen
 3720|       |    // between VERSION and VERACK.
 3721|  7.48k|    if (msg_type == NetMsgType::SENDADDRV2) {
  ------------------
  |  Branch (3721:9): [True: 4, False: 7.48k]
  ------------------
 3722|      4|        if (pfrom.fSuccessfullyConnected) {
  ------------------
  |  Branch (3722:13): [True: 3, False: 1]
  ------------------
 3723|       |            // Disconnect peers that send a SENDADDRV2 message after VERACK.
 3724|      3|            LogDebug(BCLog::NET, "sendaddrv2 received after verack, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      3|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      3|    do {                                                  \
  |  |  |  |  274|      3|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3725|      3|            pfrom.fDisconnect = true;
 3726|      3|            return;
 3727|      3|        }
 3728|      1|        peer->m_wants_addrv2 = true;
 3729|      1|        return;
 3730|      4|    }
 3731|       |
 3732|       |    // Received from a peer demonstrating readiness to announce transactions via reconciliations.
 3733|       |    // This feature negotiation must happen between VERSION and VERACK to avoid relay problems
 3734|       |    // from switching announcement protocols after the connection is up.
 3735|  7.48k|    if (msg_type == NetMsgType::SENDTXRCNCL) {
  ------------------
  |  Branch (3735:9): [True: 59, False: 7.42k]
  ------------------
 3736|     59|        if (!m_txreconciliation) {
  ------------------
  |  Branch (3736:13): [True: 0, False: 59]
  ------------------
 3737|      0|            LogDebug(BCLog::NET, "sendtxrcncl from peer=%d ignored, as our node does not have txreconciliation enabled\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3738|      0|            return;
 3739|      0|        }
 3740|       |
 3741|     59|        if (pfrom.fSuccessfullyConnected) {
  ------------------
  |  Branch (3741:13): [True: 1, False: 58]
  ------------------
 3742|      1|            LogDebug(BCLog::NET, "sendtxrcncl received after verack, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3743|      1|            pfrom.fDisconnect = true;
 3744|      1|            return;
 3745|      1|        }
 3746|       |
 3747|       |        // Peer must not offer us reconciliations if we specified no tx relay support in VERSION.
 3748|     58|        if (RejectIncomingTxs(pfrom)) {
  ------------------
  |  Branch (3748:13): [True: 2, False: 56]
  ------------------
 3749|      2|            LogDebug(BCLog::NET, "sendtxrcncl received to which we indicated no tx relay, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      2|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      2|    do {                                                  \
  |  |  |  |  274|      2|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3750|      2|            pfrom.fDisconnect = true;
 3751|      2|            return;
 3752|      2|        }
 3753|       |
 3754|       |        // Peer must not offer us reconciliations if they specified no tx relay support in VERSION.
 3755|       |        // This flag might also be false in other cases, but the RejectIncomingTxs check above
 3756|       |        // eliminates them, so that this flag fully represents what we are looking for.
 3757|     56|        const auto* tx_relay = peer->GetTxRelay();
 3758|     56|        if (!tx_relay || !WITH_LOCK(tx_relay->m_bloom_filter_mutex, return tx_relay->m_relay_txs)) {
  ------------------
  |  |  301|     55|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  Branch (3758:13): [True: 1, False: 55]
  |  Branch (3758:13): [True: 1, False: 55]
  |  Branch (3758:26): [True: 0, False: 55]
  ------------------
 3759|      1|            LogDebug(BCLog::NET, "sendtxrcncl received which indicated no tx relay to us, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3760|      1|            pfrom.fDisconnect = true;
 3761|      1|            return;
 3762|      1|        }
 3763|       |
 3764|     55|        uint32_t peer_txreconcl_version;
 3765|     55|        uint64_t remote_salt;
 3766|     55|        vRecv >> peer_txreconcl_version >> remote_salt;
 3767|       |
 3768|     55|        const ReconciliationRegisterResult result = m_txreconciliation->RegisterPeer(pfrom.GetId(), pfrom.IsInboundConn(),
 3769|     55|                                                                                     peer_txreconcl_version, remote_salt);
 3770|     55|        switch (result) {
  ------------------
  |  Branch (3770:17): [True: 3, False: 52]
  ------------------
 3771|      1|        case ReconciliationRegisterResult::NOT_FOUND:
  ------------------
  |  Branch (3771:9): [True: 1, False: 54]
  ------------------
 3772|      1|            LogDebug(BCLog::NET, "Ignore unexpected txreconciliation signal from peer=%d\n", pfrom.GetId());
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3773|      1|            break;
 3774|     50|        case ReconciliationRegisterResult::SUCCESS:
  ------------------
  |  Branch (3774:9): [True: 50, False: 5]
  ------------------
 3775|     50|            break;
 3776|      0|        case ReconciliationRegisterResult::ALREADY_REGISTERED:
  ------------------
  |  Branch (3776:9): [True: 0, False: 55]
  ------------------
 3777|      0|            LogDebug(BCLog::NET, "txreconciliation protocol violation (sendtxrcncl received from already registered peer), %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3778|      0|            pfrom.fDisconnect = true;
 3779|      0|            return;
 3780|      1|        case ReconciliationRegisterResult::PROTOCOL_VIOLATION:
  ------------------
  |  Branch (3780:9): [True: 1, False: 54]
  ------------------
 3781|      1|            LogDebug(BCLog::NET, "txreconciliation protocol violation, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3782|      1|            pfrom.fDisconnect = true;
 3783|      1|            return;
 3784|     55|        }
 3785|     51|        return;
 3786|     55|    }
 3787|       |
 3788|  7.42k|    if (!pfrom.fSuccessfullyConnected) {
  ------------------
  |  Branch (3788:9): [True: 19, False: 7.40k]
  ------------------
 3789|     19|        LogDebug(BCLog::NET, "Unsupported message \"%s\" prior to verack from peer=%d\n", SanitizeString(msg_type), pfrom.GetId());
  ------------------
  |  |  280|     19|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     19|    do {                                                  \
  |  |  |  |  274|     19|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 19]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     19|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3790|     19|        return;
 3791|     19|    }
 3792|       |
 3793|  7.40k|    if (msg_type == NetMsgType::ADDR || msg_type == NetMsgType::ADDRV2) {
  ------------------
  |  Branch (3793:9): [True: 770, False: 6.63k]
  |  Branch (3793:41): [True: 634, False: 6.00k]
  ------------------
 3794|  1.40k|        const auto ser_params{
 3795|  1.40k|            msg_type == NetMsgType::ADDRV2 ?
  ------------------
  |  Branch (3795:13): [True: 634, False: 770]
  ------------------
 3796|       |            // Set V2 param so that the CNetAddr and CAddress
 3797|       |            // unserialize methods know that an address in v2 format is coming.
 3798|    634|            CAddress::V2_NETWORK :
 3799|  1.40k|            CAddress::V1_NETWORK,
 3800|  1.40k|        };
 3801|       |
 3802|  1.40k|        std::vector<CAddress> vAddr;
 3803|       |
 3804|  1.40k|        vRecv >> ser_params(vAddr);
 3805|       |
 3806|  1.40k|        if (!SetupAddressRelay(pfrom, *peer)) {
  ------------------
  |  Branch (3806:13): [True: 1, False: 1.40k]
  ------------------
 3807|      1|            LogDebug(BCLog::NET, "ignoring %s message from %s peer=%d\n", msg_type, pfrom.ConnectionTypeAsString(), pfrom.GetId());
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3808|      1|            return;
 3809|      1|        }
 3810|       |
 3811|  1.40k|        if (vAddr.size() > MAX_ADDR_TO_SEND)
  ------------------
  |  Branch (3811:13): [True: 1, False: 1.40k]
  ------------------
 3812|      1|        {
 3813|      1|            Misbehaving(*peer, strprintf("%s message size = %u", msg_type, vAddr.size()));
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 3814|      1|            return;
 3815|      1|        }
 3816|       |
 3817|       |        // Store the new addresses
 3818|  1.40k|        std::vector<CAddress> vAddrOk;
 3819|  1.40k|        const auto current_a_time{Now<NodeSeconds>()};
 3820|       |
 3821|       |        // Update/increment addr rate limiting bucket.
 3822|  1.40k|        const auto current_time{GetTime<std::chrono::microseconds>()};
 3823|  1.40k|        if (peer->m_addr_token_bucket < MAX_ADDR_PROCESSING_TOKEN_BUCKET) {
  ------------------
  |  Branch (3823:13): [True: 611, False: 791]
  ------------------
 3824|       |            // Don't increment bucket if it's already full
 3825|    611|            const auto time_diff = std::max(current_time - peer->m_addr_token_timestamp, 0us);
 3826|    611|            const double increment = Ticks<SecondsDouble>(time_diff) * MAX_ADDR_RATE_PER_SECOND;
 3827|    611|            peer->m_addr_token_bucket = std::min<double>(peer->m_addr_token_bucket + increment, MAX_ADDR_PROCESSING_TOKEN_BUCKET);
 3828|    611|        }
 3829|  1.40k|        peer->m_addr_token_timestamp = current_time;
 3830|       |
 3831|  1.40k|        const bool rate_limited = !pfrom.HasPermission(NetPermissionFlags::Addr);
 3832|  1.40k|        uint64_t num_proc = 0;
 3833|  1.40k|        uint64_t num_rate_limit = 0;
 3834|  1.40k|        std::shuffle(vAddr.begin(), vAddr.end(), m_rng);
 3835|  1.40k|        for (CAddress& addr : vAddr)
  ------------------
  |  Branch (3835:29): [True: 111k, False: 1.40k]
  ------------------
 3836|   111k|        {
 3837|   111k|            if (interruptMsgProc)
  ------------------
  |  Branch (3837:17): [True: 0, False: 111k]
  ------------------
 3838|      0|                return;
 3839|       |
 3840|       |            // Apply rate limiting.
 3841|   111k|            if (peer->m_addr_token_bucket < 1.0) {
  ------------------
  |  Branch (3841:17): [True: 3.76k, False: 107k]
  ------------------
 3842|  3.76k|                if (rate_limited) {
  ------------------
  |  Branch (3842:21): [True: 323, False: 3.43k]
  ------------------
 3843|    323|                    ++num_rate_limit;
 3844|    323|                    continue;
 3845|    323|                }
 3846|   107k|            } else {
 3847|   107k|                peer->m_addr_token_bucket -= 1.0;
 3848|   107k|            }
 3849|       |            // We only bother storing full nodes, though this may include
 3850|       |            // things which we would not make an outbound connection to, in
 3851|       |            // part because we may make feeler connections to them.
 3852|   111k|            if (!MayHaveUsefulAddressDB(addr.nServices) && !HasAllDesirableServiceFlags(addr.nServices))
  ------------------
  |  Branch (3852:17): [True: 38.6k, False: 72.6k]
  |  Branch (3852:60): [True: 38.6k, False: 0]
  ------------------
 3853|  38.6k|                continue;
 3854|       |
 3855|  72.6k|            if (addr.nTime <= NodeSeconds{100000000s} || addr.nTime > current_a_time + 10min) {
  ------------------
  |  Branch (3855:17): [True: 20.2k, False: 52.4k]
  |  Branch (3855:17): [True: 42.6k, False: 30.0k]
  |  Branch (3855:58): [True: 22.3k, False: 30.0k]
  ------------------
 3856|  42.6k|                addr.nTime = current_a_time - 5 * 24h;
 3857|  42.6k|            }
 3858|  72.6k|            AddAddressKnown(*peer, addr);
 3859|  72.6k|            if (m_banman && (m_banman->IsDiscouraged(addr) || m_banman->IsBanned(addr))) {
  ------------------
  |  Branch (3859:17): [True: 72.6k, False: 0]
  |  Branch (3859:30): [True: 13, False: 72.6k]
  |  Branch (3859:63): [True: 0, False: 72.6k]
  ------------------
 3860|       |                // Do not process banned/discouraged addresses beyond remembering we received them
 3861|     13|                continue;
 3862|     13|            }
 3863|  72.6k|            ++num_proc;
 3864|  72.6k|            const bool reachable{g_reachable_nets.Contains(addr)};
 3865|  72.6k|            if (addr.nTime > current_a_time - 10min && !peer->m_getaddr_sent && vAddr.size() <= 10 && addr.IsRoutable()) {
  ------------------
  |  Branch (3865:17): [True: 1.20k, False: 71.4k]
  |  Branch (3865:17): [True: 75, False: 72.5k]
  |  Branch (3865:56): [True: 674, False: 535]
  |  Branch (3865:81): [True: 89, False: 585]
  |  Branch (3865:103): [True: 75, False: 14]
  ------------------
 3866|       |                // Relay to a limited number of other nodes
 3867|     75|                RelayAddress(pfrom.GetId(), addr, reachable);
 3868|     75|            }
 3869|       |            // Do not store addresses outside our network
 3870|  72.6k|            if (reachable) {
  ------------------
  |  Branch (3870:17): [True: 72.6k, False: 0]
  ------------------
 3871|  72.6k|                vAddrOk.push_back(addr);
 3872|  72.6k|            }
 3873|  72.6k|        }
 3874|  1.40k|        peer->m_addr_processed += num_proc;
 3875|  1.40k|        peer->m_addr_rate_limited += num_rate_limit;
 3876|  1.40k|        LogDebug(BCLog::NET, "Received addr: %u addresses (%u processed, %u rate-limited) from peer=%d\n",
  ------------------
  |  |  280|  1.40k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  1.40k|    do {                                                  \
  |  |  |  |  274|  1.40k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1.40k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  1.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3877|  1.40k|                 vAddr.size(), num_proc, num_rate_limit, pfrom.GetId());
 3878|       |
 3879|  1.40k|        m_addrman.Add(vAddrOk, pfrom.addr, 2h);
 3880|  1.40k|        if (vAddr.size() < 1000) peer->m_getaddr_sent = false;
  ------------------
  |  Branch (3880:13): [True: 955, False: 447]
  ------------------
 3881|       |
 3882|       |        // AddrFetch: Require multiple addresses to avoid disconnecting on self-announcements
 3883|  1.40k|        if (pfrom.IsAddrFetchConn() && vAddr.size() > 1) {
  ------------------
  |  Branch (3883:13): [True: 47, False: 1.35k]
  |  Branch (3883:40): [True: 45, False: 2]
  ------------------
 3884|     45|            LogDebug(BCLog::NET, "addrfetch connection completed, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|     45|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     45|    do {                                                  \
  |  |  |  |  274|     45|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 45]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     45|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3885|     45|            pfrom.fDisconnect = true;
 3886|     45|        }
 3887|  1.40k|        return;
 3888|  1.40k|    }
 3889|       |
 3890|  6.00k|    if (msg_type == NetMsgType::INV) {
  ------------------
  |  Branch (3890:9): [True: 1.25k, False: 4.75k]
  ------------------
 3891|  1.25k|        std::vector<CInv> vInv;
 3892|  1.25k|        vRecv >> vInv;
 3893|  1.25k|        if (vInv.size() > MAX_INV_SZ)
  ------------------
  |  Branch (3893:13): [True: 0, False: 1.25k]
  ------------------
 3894|      0|        {
 3895|      0|            Misbehaving(*peer, strprintf("inv message size = %u", vInv.size()));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 3896|      0|            return;
 3897|      0|        }
 3898|       |
 3899|  1.25k|        const bool reject_tx_invs{RejectIncomingTxs(pfrom)};
 3900|       |
 3901|  1.25k|        LOCK2(cs_main, m_tx_download_mutex);
  ------------------
  |  |  259|  1.25k|    UniqueLock criticalblock1(MaybeCheckNotHeld(cs1), #cs1, __FILE__, __LINE__); \
  |  |  260|  1.25k|    UniqueLock criticalblock2(MaybeCheckNotHeld(cs2), #cs2, __FILE__, __LINE__)
  ------------------
 3902|       |
 3903|  1.25k|        const auto current_time{GetTime<std::chrono::microseconds>()};
 3904|  1.25k|        uint256* best_block{nullptr};
 3905|       |
 3906|  2.43M|        for (CInv& inv : vInv) {
  ------------------
  |  Branch (3906:24): [True: 2.43M, False: 1.25k]
  ------------------
 3907|  2.43M|            if (interruptMsgProc) return;
  ------------------
  |  Branch (3907:17): [True: 0, False: 2.43M]
  ------------------
 3908|       |
 3909|       |            // Ignore INVs that don't match wtxidrelay setting.
 3910|       |            // Note that orphan parent fetching always uses MSG_TX GETDATAs regardless of the wtxidrelay setting.
 3911|       |            // This is fine as no INV messages are involved in that process.
 3912|  2.43M|            if (peer->m_wtxid_relay) {
  ------------------
  |  Branch (3912:17): [True: 0, False: 2.43M]
  ------------------
 3913|      0|                if (inv.IsMsgTx()) continue;
  ------------------
  |  Branch (3913:21): [True: 0, False: 0]
  ------------------
 3914|  2.43M|            } else {
 3915|  2.43M|                if (inv.IsMsgWtx()) continue;
  ------------------
  |  Branch (3915:21): [True: 117k, False: 2.31M]
  ------------------
 3916|  2.43M|            }
 3917|       |
 3918|  2.31M|            if (inv.IsMsgBlk()) {
  ------------------
  |  Branch (3918:17): [True: 2.19k, False: 2.31M]
  ------------------
 3919|  2.19k|                const bool fAlreadyHave = AlreadyHaveBlock(inv.hash);
 3920|  2.19k|                LogDebug(BCLog::NET, "got inv: %s  %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
  ------------------
  |  |  280|  2.19k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  2.19k|    do {                                                  \
  |  |  |  |  274|  2.19k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 2.19k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  2.19k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3921|       |
 3922|  2.19k|                UpdateBlockAvailability(pfrom.GetId(), inv.hash);
 3923|  2.19k|                if (!fAlreadyHave && !m_chainman.m_blockman.LoadingBlocks() && !IsBlockRequested(inv.hash)) {
  ------------------
  |  Branch (3923:21): [True: 1.90k, False: 293]
  |  Branch (3923:38): [True: 1.90k, False: 0]
  |  Branch (3923:80): [True: 1.90k, False: 0]
  ------------------
 3924|       |                    // Headers-first is the primary method of announcement on
 3925|       |                    // the network. If a node fell back to sending blocks by
 3926|       |                    // inv, it may be for a re-org, or because we haven't
 3927|       |                    // completed initial headers sync. The final block hash
 3928|       |                    // provided should be the highest, so send a getheaders and
 3929|       |                    // then fetch the blocks we need to catch up.
 3930|  1.90k|                    best_block = &inv.hash;
 3931|  1.90k|                }
 3932|  2.31M|            } else if (inv.IsGenTxMsg()) {
  ------------------
  |  Branch (3932:24): [True: 906k, False: 1.40M]
  ------------------
 3933|   906k|                if (reject_tx_invs) {
  ------------------
  |  Branch (3933:21): [True: 1, False: 906k]
  ------------------
 3934|      1|                    LogDebug(BCLog::NET, "transaction (%s) inv sent in violation of protocol, %s\n", inv.hash.ToString(), pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3935|      1|                    pfrom.fDisconnect = true;
 3936|      1|                    return;
 3937|      1|                }
 3938|   906k|                const GenTxid gtxid = ToGenTxid(inv);
 3939|   906k|                AddKnownTx(*peer, inv.hash);
 3940|       |
 3941|   906k|                if (!m_chainman.IsInitialBlockDownload()) {
  ------------------
  |  Branch (3941:21): [True: 906k, False: 252]
  ------------------
 3942|   906k|                    const bool fAlreadyHave{m_txdownloadman.AddTxAnnouncement(pfrom.GetId(), gtxid, current_time)};
 3943|   906k|                    LogDebug(BCLog::NET, "got inv: %s  %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
  ------------------
  |  |  280|   906k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|   906k|    do {                                                  \
  |  |  |  |  274|   906k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 906k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|   906k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3944|   906k|                }
 3945|  1.40M|            } else {
 3946|  1.40M|                LogDebug(BCLog::NET, "Unknown inv type \"%s\" received from peer=%d\n", inv.ToString(), pfrom.GetId());
  ------------------
  |  |  280|  1.40M|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  1.40M|    do {                                                  \
  |  |  |  |  274|  1.40M|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1.40M]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  1.40M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3947|  1.40M|            }
 3948|  2.31M|        }
 3949|       |
 3950|  1.25k|        if (best_block != nullptr) {
  ------------------
  |  Branch (3950:13): [True: 272, False: 978]
  ------------------
 3951|       |            // If we haven't started initial headers-sync with this peer, then
 3952|       |            // consider sending a getheaders now. On initial startup, there's a
 3953|       |            // reliability vs bandwidth tradeoff, where we are only trying to do
 3954|       |            // initial headers sync with one peer at a time, with a long
 3955|       |            // timeout (at which point, if the sync hasn't completed, we will
 3956|       |            // disconnect the peer and then choose another). In the meantime,
 3957|       |            // as new blocks are found, we are willing to add one new peer per
 3958|       |            // block to sync with as well, to sync quicker in the case where
 3959|       |            // our initial peer is unresponsive (but less bandwidth than we'd
 3960|       |            // use if we turned on sync with all peers).
 3961|    272|            CNodeState& state{*Assert(State(pfrom.GetId()))};
  ------------------
  |  |   85|    272|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 3962|    272|            if (state.fSyncStarted || (!peer->m_inv_triggered_getheaders_before_sync && *best_block != m_last_block_inv_triggering_headers_sync)) {
  ------------------
  |  Branch (3962:17): [True: 248, False: 24]
  |  Branch (3962:40): [True: 24, False: 0]
  |  Branch (3962:89): [True: 23, False: 1]
  ------------------
 3963|    271|                if (MaybeSendGetHeaders(pfrom, GetLocator(m_chainman.m_best_header), *peer)) {
  ------------------
  |  Branch (3963:21): [True: 33, False: 238]
  ------------------
 3964|     33|                    LogDebug(BCLog::NET, "getheaders (%d) %s to peer=%d\n",
  ------------------
  |  |  280|     33|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     33|    do {                                                  \
  |  |  |  |  274|     33|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 33]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     33|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3965|     33|                            m_chainman.m_best_header->nHeight, best_block->ToString(),
 3966|     33|                            pfrom.GetId());
 3967|     33|                }
 3968|    271|                if (!state.fSyncStarted) {
  ------------------
  |  Branch (3968:21): [True: 23, False: 248]
  ------------------
 3969|     23|                    peer->m_inv_triggered_getheaders_before_sync = true;
 3970|       |                    // Update the last block hash that triggered a new headers
 3971|       |                    // sync, so that we don't turn on headers sync with more
 3972|       |                    // than 1 new peer every new block.
 3973|     23|                    m_last_block_inv_triggering_headers_sync = *best_block;
 3974|     23|                }
 3975|    271|            }
 3976|    272|        }
 3977|       |
 3978|  1.25k|        return;
 3979|  1.25k|    }
 3980|       |
 3981|  4.75k|    if (msg_type == NetMsgType::GETDATA) {
  ------------------
  |  Branch (3981:9): [True: 620, False: 4.13k]
  ------------------
 3982|    620|        std::vector<CInv> vInv;
 3983|    620|        vRecv >> vInv;
 3984|    620|        if (vInv.size() > MAX_INV_SZ)
  ------------------
  |  Branch (3984:13): [True: 0, False: 620]
  ------------------
 3985|      0|        {
 3986|      0|            Misbehaving(*peer, strprintf("getdata message size = %u", vInv.size()));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 3987|      0|            return;
 3988|      0|        }
 3989|       |
 3990|    620|        LogDebug(BCLog::NET, "received getdata (%u invsz) peer=%d\n", vInv.size(), pfrom.GetId());
  ------------------
  |  |  280|    620|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    620|    do {                                                  \
  |  |  |  |  274|    620|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 620]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    620|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3991|       |
 3992|    620|        if (vInv.size() > 0) {
  ------------------
  |  Branch (3992:13): [True: 582, False: 38]
  ------------------
 3993|    582|            LogDebug(BCLog::NET, "received getdata for: %s peer=%d\n", vInv[0].ToString(), pfrom.GetId());
  ------------------
  |  |  280|    582|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    582|    do {                                                  \
  |  |  |  |  274|    582|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 582]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    582|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3994|    582|        }
 3995|       |
 3996|    620|        {
 3997|    620|            LOCK(peer->m_getdata_requests_mutex);
  ------------------
  |  |  257|    620|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    620|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    620|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    620|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3998|    620|            peer->m_getdata_requests.insert(peer->m_getdata_requests.end(), vInv.begin(), vInv.end());
 3999|    620|            ProcessGetData(pfrom, *peer, interruptMsgProc);
 4000|    620|        }
 4001|       |
 4002|    620|        return;
 4003|    620|    }
 4004|       |
 4005|  4.13k|    if (msg_type == NetMsgType::GETBLOCKS) {
  ------------------
  |  Branch (4005:9): [True: 73, False: 4.05k]
  ------------------
 4006|     73|        CBlockLocator locator;
 4007|     73|        uint256 hashStop;
 4008|     73|        vRecv >> locator >> hashStop;
 4009|       |
 4010|     73|        if (locator.vHave.size() > MAX_LOCATOR_SZ) {
  ------------------
  |  Branch (4010:13): [True: 1, False: 72]
  ------------------
 4011|      1|            LogDebug(BCLog::NET, "getblocks locator size %lld > %d, %s\n", locator.vHave.size(), MAX_LOCATOR_SZ, pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4012|      1|            pfrom.fDisconnect = true;
 4013|      1|            return;
 4014|      1|        }
 4015|       |
 4016|       |        // We might have announced the currently-being-connected tip using a
 4017|       |        // compact block, which resulted in the peer sending a getblocks
 4018|       |        // request, which we would otherwise respond to without the new block.
 4019|       |        // To avoid this situation we simply verify that we are on our best
 4020|       |        // known chain now. This is super overkill, but we handle it better
 4021|       |        // for getheaders requests, and there are no known nodes which support
 4022|       |        // compact blocks but still use getblocks to request blocks.
 4023|     72|        {
 4024|     72|            std::shared_ptr<const CBlock> a_recent_block;
 4025|     72|            {
 4026|     72|                LOCK(m_most_recent_block_mutex);
  ------------------
  |  |  257|     72|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     72|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     72|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     72|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4027|     72|                a_recent_block = m_most_recent_block;
 4028|     72|            }
 4029|     72|            BlockValidationState state;
 4030|     72|            if (!m_chainman.ActiveChainstate().ActivateBestChain(state, a_recent_block)) {
  ------------------
  |  Branch (4030:17): [True: 0, False: 72]
  ------------------
 4031|      0|                LogDebug(BCLog::NET, "failed to activate chain (%s)\n", state.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4032|      0|            }
 4033|     72|        }
 4034|       |
 4035|     72|        LOCK(cs_main);
  ------------------
  |  |  257|     72|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     72|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     72|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     72|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4036|       |
 4037|       |        // Find the last block the caller has in the main chain
 4038|     72|        const CBlockIndex* pindex = m_chainman.ActiveChainstate().FindForkInGlobalIndex(locator);
 4039|       |
 4040|       |        // Send the rest of the chain
 4041|     72|        if (pindex)
  ------------------
  |  Branch (4041:13): [True: 44, False: 28]
  ------------------
 4042|     44|            pindex = m_chainman.ActiveChain().Next(pindex);
 4043|     72|        int nLimit = 500;
 4044|     72|        LogDebug(BCLog::NET, "getblocks %d to %s limit %d from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? "end" : hashStop.ToString(), nLimit, pfrom.GetId());
  ------------------
  |  |  280|     72|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     72|    do {                                                  \
  |  |  |  |  274|     72|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 72]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     72|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4045|  4.45k|        for (; pindex; pindex = m_chainman.ActiveChain().Next(pindex))
  ------------------
  |  Branch (4045:16): [True: 4.40k, False: 55]
  ------------------
 4046|  4.40k|        {
 4047|  4.40k|            if (pindex->GetBlockHash() == hashStop)
  ------------------
  |  Branch (4047:17): [True: 17, False: 4.38k]
  ------------------
 4048|     17|            {
 4049|     17|                LogDebug(BCLog::NET, "  getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
  ------------------
  |  |  280|     17|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     17|    do {                                                  \
  |  |  |  |  274|     17|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 17]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     17|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4050|     17|                break;
 4051|     17|            }
 4052|       |            // If pruning, don't inv blocks unless we have on disk and are likely to still have
 4053|       |            // for some reasonable time window (1 hour) that block relay might require.
 4054|  4.38k|            const int nPrunedBlocksLikelyToHave = MIN_BLOCKS_TO_KEEP - 3600 / m_chainparams.GetConsensus().nPowTargetSpacing;
 4055|  4.38k|            if (m_chainman.m_blockman.IsPruneMode() && (!(pindex->nStatus & BLOCK_HAVE_DATA) || pindex->nHeight <= m_chainman.ActiveChain().Tip()->nHeight - nPrunedBlocksLikelyToHave)) {
  ------------------
  |  Branch (4055:17): [True: 0, False: 4.38k]
  |  Branch (4055:57): [True: 0, False: 0]
  |  Branch (4055:97): [True: 0, False: 0]
  ------------------
 4056|      0|                LogDebug(BCLog::NET, " getblocks stopping, pruned or too old block at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4057|      0|                break;
 4058|      0|            }
 4059|  4.38k|            WITH_LOCK(peer->m_block_inv_mutex, peer->m_blocks_for_inv_relay.push_back(pindex->GetBlockHash()));
  ------------------
  |  |  301|  4.38k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 4060|  4.38k|            if (--nLimit <= 0) {
  ------------------
  |  Branch (4060:17): [True: 0, False: 4.38k]
  ------------------
 4061|       |                // When this block is requested, we'll send an inv that'll
 4062|       |                // trigger the peer to getblocks the next batch of inventory.
 4063|      0|                LogDebug(BCLog::NET, "  getblocks stopping at limit %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4064|      0|                WITH_LOCK(peer->m_block_inv_mutex, {peer->m_continuation_block = pindex->GetBlockHash();});
  ------------------
  |  |  301|      0|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 4065|      0|                break;
 4066|      0|            }
 4067|  4.38k|        }
 4068|     72|        return;
 4069|     73|    }
 4070|       |
 4071|  4.05k|    if (msg_type == NetMsgType::GETBLOCKTXN) {
  ------------------
  |  Branch (4071:9): [True: 139, False: 3.91k]
  ------------------
 4072|    139|        BlockTransactionsRequest req;
 4073|    139|        vRecv >> req;
 4074|       |
 4075|    139|        std::shared_ptr<const CBlock> recent_block;
 4076|    139|        {
 4077|    139|            LOCK(m_most_recent_block_mutex);
  ------------------
  |  |  257|    139|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    139|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    139|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    139|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4078|    139|            if (m_most_recent_block_hash == req.blockhash)
  ------------------
  |  Branch (4078:17): [True: 1, False: 138]
  ------------------
 4079|      1|                recent_block = m_most_recent_block;
 4080|       |            // Unlock m_most_recent_block_mutex to avoid cs_main lock inversion
 4081|    139|        }
 4082|    139|        if (recent_block) {
  ------------------
  |  Branch (4082:13): [True: 0, False: 139]
  ------------------
 4083|      0|            SendBlockTransactions(pfrom, *peer, *recent_block, req);
 4084|      0|            return;
 4085|      0|        }
 4086|       |
 4087|    139|        FlatFilePos block_pos{};
 4088|    139|        {
 4089|    139|            LOCK(cs_main);
  ------------------
  |  |  257|    139|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    139|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    139|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    139|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4090|       |
 4091|    139|            const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(req.blockhash);
 4092|    139|            if (!pindex || !(pindex->nStatus & BLOCK_HAVE_DATA)) {
  ------------------
  |  Branch (4092:17): [True: 117, False: 22]
  |  Branch (4092:28): [True: 0, False: 22]
  ------------------
 4093|     20|                LogDebug(BCLog::NET, "Peer %d sent us a getblocktxn for a block we don't have\n", pfrom.GetId());
  ------------------
  |  |  280|     20|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     20|    do {                                                  \
  |  |  |  |  274|     20|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4094|     20|                return;
 4095|     20|            }
 4096|       |
 4097|    119|            if (pindex->nHeight >= m_chainman.ActiveChain().Height() - MAX_BLOCKTXN_DEPTH) {
  ------------------
  |  Branch (4097:17): [True: 15, False: 104]
  ------------------
 4098|     15|                block_pos = pindex->GetBlockPos();
 4099|     15|            }
 4100|    119|        }
 4101|       |
 4102|    119|        if (!block_pos.IsNull()) {
  ------------------
  |  Branch (4102:13): [True: 15, False: 104]
  ------------------
 4103|     15|            CBlock block;
 4104|     15|            const bool ret{m_chainman.m_blockman.ReadBlock(block, block_pos)};
 4105|       |            // If height is above MAX_BLOCKTXN_DEPTH then this block cannot get
 4106|       |            // pruned after we release cs_main above, so this read should never fail.
 4107|     15|            assert(ret);
 4108|       |
 4109|     15|            SendBlockTransactions(pfrom, *peer, block, req);
 4110|     15|            return;
 4111|     15|        }
 4112|       |
 4113|       |        // If an older block is requested (should never happen in practice,
 4114|       |        // but can happen in tests) send a block response instead of a
 4115|       |        // blocktxn response. Sending a full block response instead of a
 4116|       |        // small blocktxn response is preferable in the case where a peer
 4117|       |        // might maliciously send lots of getblocktxn requests to trigger
 4118|       |        // expensive disk reads, because it will require the peer to
 4119|       |        // actually receive all the data read from disk over the network.
 4120|    104|        LogDebug(BCLog::NET, "Peer %d sent us a getblocktxn for a block > %i deep\n", pfrom.GetId(), MAX_BLOCKTXN_DEPTH);
  ------------------
  |  |  280|    104|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    104|    do {                                                  \
  |  |  |  |  274|    104|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 104]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    104|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4121|    104|        CInv inv{MSG_WITNESS_BLOCK, req.blockhash};
 4122|    104|        WITH_LOCK(peer->m_getdata_requests_mutex, peer->m_getdata_requests.push_back(inv));
  ------------------
  |  |  301|    104|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 4123|       |        // The message processing loop will go around again (without pausing) and we'll respond then
 4124|    104|        return;
 4125|    119|    }
 4126|       |
 4127|  3.91k|    if (msg_type == NetMsgType::GETHEADERS) {
  ------------------
  |  Branch (4127:9): [True: 87, False: 3.83k]
  ------------------
 4128|     87|        CBlockLocator locator;
 4129|     87|        uint256 hashStop;
 4130|     87|        vRecv >> locator >> hashStop;
 4131|       |
 4132|     87|        if (locator.vHave.size() > MAX_LOCATOR_SZ) {
  ------------------
  |  Branch (4132:13): [True: 1, False: 86]
  ------------------
 4133|      1|            LogDebug(BCLog::NET, "getheaders locator size %lld > %d, %s\n", locator.vHave.size(), MAX_LOCATOR_SZ, pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4134|      1|            pfrom.fDisconnect = true;
 4135|      1|            return;
 4136|      1|        }
 4137|       |
 4138|     86|        if (m_chainman.m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (4138:13): [True: 0, False: 86]
  ------------------
 4139|      0|            LogDebug(BCLog::NET, "Ignoring getheaders from peer=%d while importing/reindexing\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4140|      0|            return;
 4141|      0|        }
 4142|       |
 4143|     86|        LOCK(cs_main);
  ------------------
  |  |  257|     86|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     86|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     86|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     86|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4144|       |
 4145|       |        // Note that if we were to be on a chain that forks from the checkpointed
 4146|       |        // chain, then serving those headers to a peer that has seen the
 4147|       |        // checkpointed chain would cause that peer to disconnect us. Requiring
 4148|       |        // that our chainwork exceed the minimum chain work is a protection against
 4149|       |        // being fed a bogus chain when we started up for the first time and
 4150|       |        // getting partitioned off the honest network for serving that chain to
 4151|       |        // others.
 4152|     86|        if (m_chainman.ActiveTip() == nullptr ||
  ------------------
  |  Branch (4152:13): [True: 37, False: 49]
  ------------------
 4153|     86|                (m_chainman.ActiveTip()->nChainWork < m_chainman.MinimumChainWork() && !pfrom.HasPermission(NetPermissionFlags::Download))) {
  ------------------
  |  Branch (4153:18): [True: 0, False: 49]
  |  Branch (4153:88): [True: 0, False: 0]
  ------------------
 4154|      0|            LogDebug(BCLog::NET, "Ignoring getheaders from peer=%d because active chain has too little work; sending empty response\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4155|       |            // Just respond with an empty headers message, to tell the peer to
 4156|       |            // go away but not treat us as unresponsive.
 4157|      0|            MakeAndPushMessage(pfrom, NetMsgType::HEADERS, std::vector<CBlockHeader>());
 4158|      0|            return;
 4159|      0|        }
 4160|       |
 4161|     86|        CNodeState *nodestate = State(pfrom.GetId());
 4162|     86|        const CBlockIndex* pindex = nullptr;
 4163|     86|        if (locator.IsNull())
  ------------------
  |  Branch (4163:13): [True: 7, False: 79]
  ------------------
 4164|      7|        {
 4165|       |            // If locator is null, return the hashStop block
 4166|      7|            pindex = m_chainman.m_blockman.LookupBlockIndex(hashStop);
 4167|      7|            if (!pindex) {
  ------------------
  |  Branch (4167:17): [True: 4, False: 3]
  ------------------
 4168|      4|                return;
 4169|      4|            }
 4170|       |
 4171|      3|            if (!BlockRequestAllowed(pindex)) {
  ------------------
  |  Branch (4171:17): [True: 0, False: 3]
  ------------------
 4172|      0|                LogDebug(BCLog::NET, "%s: ignoring request from peer=%i for old block header that isn't in the main chain\n", __func__, pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4173|      0|                return;
 4174|      0|            }
 4175|      3|        }
 4176|     79|        else
 4177|     79|        {
 4178|       |            // Find the last block the caller has in the main chain
 4179|     79|            pindex = m_chainman.ActiveChainstate().FindForkInGlobalIndex(locator);
 4180|     79|            if (pindex)
  ------------------
  |  Branch (4180:17): [True: 42, False: 37]
  ------------------
 4181|     42|                pindex = m_chainman.ActiveChain().Next(pindex);
 4182|     79|        }
 4183|       |
 4184|       |        // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end
 4185|     82|        std::vector<CBlock> vHeaders;
 4186|     82|        int nLimit = m_opts.max_headers_result;
 4187|     82|        LogDebug(BCLog::NET, "getheaders %d to %s from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? "end" : hashStop.ToString(), pfrom.GetId());
  ------------------
  |  |  280|     82|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     82|    do {                                                  \
  |  |  |  |  274|     82|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 82]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     82|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4188|  4.96k|        for (; pindex; pindex = m_chainman.ActiveChain().Next(pindex))
  ------------------
  |  Branch (4188:16): [True: 4.90k, False: 63]
  ------------------
 4189|  4.90k|        {
 4190|  4.90k|            vHeaders.emplace_back(pindex->GetBlockHeader());
 4191|  4.90k|            if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)
  ------------------
  |  Branch (4191:17): [True: 0, False: 4.90k]
  |  Branch (4191:17): [True: 19, False: 4.88k]
  |  Branch (4191:34): [True: 19, False: 4.88k]
  ------------------
 4192|     19|                break;
 4193|  4.90k|        }
 4194|       |        // pindex can be nullptr either if we sent m_chainman.ActiveChain().Tip() OR
 4195|       |        // if our peer has m_chainman.ActiveChain().Tip() (and thus we are sending an empty
 4196|       |        // headers message). In both cases it's safe to update
 4197|       |        // pindexBestHeaderSent to be our tip.
 4198|       |        //
 4199|       |        // It is important that we simply reset the BestHeaderSent value here,
 4200|       |        // and not max(BestHeaderSent, newHeaderSent). We might have announced
 4201|       |        // the currently-being-connected tip using a compact block, which
 4202|       |        // resulted in the peer sending a headers request, which we respond to
 4203|       |        // without the new block. By resetting the BestHeaderSent, we ensure we
 4204|       |        // will re-announce the new block via headers (or compact blocks again)
 4205|       |        // in the SendMessages logic.
 4206|     82|        nodestate->pindexBestHeaderSent = pindex ? pindex : m_chainman.ActiveChain().Tip();
  ------------------
  |  Branch (4206:43): [True: 19, False: 63]
  ------------------
 4207|     82|        MakeAndPushMessage(pfrom, NetMsgType::HEADERS, TX_WITH_WITNESS(vHeaders));
 4208|     82|        return;
 4209|     86|    }
 4210|       |
 4211|  3.83k|    if (msg_type == NetMsgType::TX) {
  ------------------
  |  Branch (4211:9): [True: 1.67k, False: 2.15k]
  ------------------
 4212|  1.67k|        if (RejectIncomingTxs(pfrom)) {
  ------------------
  |  Branch (4212:13): [True: 2, False: 1.67k]
  ------------------
 4213|      2|            LogDebug(BCLog::NET, "transaction sent in violation of protocol, %s", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      2|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      2|    do {                                                  \
  |  |  |  |  274|      2|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4214|      2|            pfrom.fDisconnect = true;
 4215|      2|            return;
 4216|      2|        }
 4217|       |
 4218|       |        // Stop processing the transaction early if we are still in IBD since we don't
 4219|       |        // have enough information to validate it yet. Sending unsolicited transactions
 4220|       |        // is not considered a protocol violation, so don't punish the peer.
 4221|  1.67k|        if (m_chainman.IsInitialBlockDownload()) return;
  ------------------
  |  Branch (4221:13): [True: 11, False: 1.66k]
  ------------------
 4222|       |
 4223|  1.66k|        CTransactionRef ptx;
 4224|  1.66k|        vRecv >> TX_WITH_WITNESS(ptx);
 4225|  1.66k|        const CTransaction& tx = *ptx;
 4226|       |
 4227|  1.66k|        const uint256& txid = ptx->GetHash();
 4228|  1.66k|        const uint256& wtxid = ptx->GetWitnessHash();
 4229|       |
 4230|  1.66k|        const uint256& hash = peer->m_wtxid_relay ? wtxid : txid;
  ------------------
  |  Branch (4230:31): [True: 0, False: 1.66k]
  ------------------
 4231|  1.66k|        AddKnownTx(*peer, hash);
 4232|       |
 4233|  1.66k|        LOCK2(cs_main, m_tx_download_mutex);
  ------------------
  |  |  259|  1.66k|    UniqueLock criticalblock1(MaybeCheckNotHeld(cs1), #cs1, __FILE__, __LINE__); \
  |  |  260|  1.66k|    UniqueLock criticalblock2(MaybeCheckNotHeld(cs2), #cs2, __FILE__, __LINE__)
  ------------------
 4234|       |
 4235|  1.66k|        const auto& [should_validate, package_to_validate] = m_txdownloadman.ReceivedTx(pfrom.GetId(), ptx);
 4236|  1.66k|        if (!should_validate) {
  ------------------
  |  Branch (4236:13): [True: 9, False: 1.65k]
  ------------------
 4237|      9|            if (pfrom.HasPermission(NetPermissionFlags::ForceRelay)) {
  ------------------
  |  Branch (4237:17): [True: 3, False: 6]
  ------------------
 4238|       |                // Always relay transactions received from peers with forcerelay
 4239|       |                // permission, even if they were already in the mempool, allowing
 4240|       |                // the node to function as a gateway for nodes hidden behind it.
 4241|      3|                if (!m_mempool.exists(GenTxid::Txid(tx.GetHash()))) {
  ------------------
  |  Branch (4241:21): [True: 3, False: 0]
  ------------------
 4242|      3|                    LogPrintf("Not relaying non-mempool transaction %s (wtxid=%s) from forcerelay peer=%d\n",
  ------------------
  |  |  266|      3|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      3|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      3|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4243|      3|                              tx.GetHash().ToString(), tx.GetWitnessHash().ToString(), pfrom.GetId());
 4244|      3|                } else {
 4245|      0|                    LogPrintf("Force relaying tx %s (wtxid=%s) from peer=%d\n",
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4246|      0|                              tx.GetHash().ToString(), tx.GetWitnessHash().ToString(), pfrom.GetId());
 4247|      0|                    RelayTransaction(tx.GetHash(), tx.GetWitnessHash());
 4248|      0|                }
 4249|      3|            }
 4250|       |
 4251|      9|            if (package_to_validate) {
  ------------------
  |  Branch (4251:17): [True: 0, False: 9]
  ------------------
 4252|      0|                const auto package_result{ProcessNewPackage(m_chainman.ActiveChainstate(), m_mempool, package_to_validate->m_txns, /*test_accept=*/false, /*client_maxfeerate=*/std::nullopt)};
 4253|      0|                LogDebug(BCLog::TXPACKAGES, "package evaluation for %s: %s\n", package_to_validate->ToString(),
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4254|      0|                         package_result.m_state.IsValid() ? "package accepted" : "package rejected");
 4255|      0|                ProcessPackageResult(package_to_validate.value(), package_result);
 4256|      0|            }
 4257|      9|            return;
 4258|      9|        }
 4259|       |
 4260|       |        // ReceivedTx should not be telling us to validate the tx and a package.
 4261|  1.65k|        Assume(!package_to_validate.has_value());
  ------------------
  |  |   97|  1.65k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 4262|       |
 4263|  1.65k|        const MempoolAcceptResult result = m_chainman.ProcessTransaction(ptx);
 4264|  1.65k|        const TxValidationState& state = result.m_state;
 4265|       |
 4266|  1.65k|        if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
  ------------------
  |  Branch (4266:13): [True: 0, False: 1.65k]
  ------------------
 4267|      0|            ProcessValidTx(pfrom.GetId(), ptx, result.m_replaced_transactions);
 4268|      0|            pfrom.m_last_tx_time = GetTime<std::chrono::seconds>();
 4269|      0|        }
 4270|  1.65k|        if (state.IsInvalid()) {
  ------------------
  |  Branch (4270:13): [True: 1.36k, False: 295]
  ------------------
 4271|  1.36k|            if (auto package_to_validate{ProcessInvalidTx(pfrom.GetId(), ptx, state, /*first_time_failure=*/true)}) {
  ------------------
  |  Branch (4271:22): [True: 0, False: 1.36k]
  ------------------
 4272|      0|                const auto package_result{ProcessNewPackage(m_chainman.ActiveChainstate(), m_mempool, package_to_validate->m_txns, /*test_accept=*/false, /*client_maxfeerate=*/std::nullopt)};
 4273|      0|                LogDebug(BCLog::TXPACKAGES, "package evaluation for %s: %s\n", package_to_validate->ToString(),
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4274|      0|                         package_result.m_state.IsValid() ? "package accepted" : "package rejected");
 4275|      0|                ProcessPackageResult(package_to_validate.value(), package_result);
 4276|      0|            }
 4277|  1.36k|        }
 4278|       |
 4279|  1.65k|        return;
 4280|  1.66k|    }
 4281|       |
 4282|  2.15k|    if (msg_type == NetMsgType::CMPCTBLOCK)
  ------------------
  |  Branch (4282:9): [True: 411, False: 1.74k]
  ------------------
 4283|    411|    {
 4284|       |        // Ignore cmpctblock received while importing
 4285|    411|        if (m_chainman.m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (4285:13): [True: 0, False: 411]
  ------------------
 4286|      0|            LogDebug(BCLog::NET, "Unexpected cmpctblock message received from peer %d\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4287|      0|            return;
 4288|      0|        }
 4289|       |
 4290|    411|        CBlockHeaderAndShortTxIDs cmpctblock;
 4291|    411|        vRecv >> cmpctblock;
 4292|       |
 4293|    411|        bool received_new_header = false;
 4294|    411|        const auto blockhash = cmpctblock.header.GetHash();
 4295|       |
 4296|    411|        {
 4297|    411|        LOCK(cs_main);
  ------------------
  |  |  257|    411|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    411|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    411|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    411|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4298|       |
 4299|    411|        const CBlockIndex* prev_block = m_chainman.m_blockman.LookupBlockIndex(cmpctblock.header.hashPrevBlock);
 4300|    411|        if (!prev_block) {
  ------------------
  |  Branch (4300:13): [True: 10, False: 401]
  ------------------
 4301|       |            // Doesn't connect (or is genesis), instead of DoSing in AcceptBlockHeader, request deeper headers
 4302|     10|            if (!m_chainman.IsInitialBlockDownload()) {
  ------------------
  |  Branch (4302:17): [True: 4, False: 6]
  ------------------
 4303|      4|                MaybeSendGetHeaders(pfrom, GetLocator(m_chainman.m_best_header), *peer);
 4304|      4|            }
 4305|     10|            return;
 4306|    401|        } else if (prev_block->nChainWork + CalculateClaimedHeadersWork({{cmpctblock.header}}) < GetAntiDoSWorkThreshold()) {
  ------------------
  |  Branch (4306:20): [True: 7, False: 394]
  ------------------
 4307|       |            // If we get a low-work header in a compact block, we can ignore it.
 4308|      7|            LogDebug(BCLog::NET, "Ignoring low-work compact block from peer %d\n", pfrom.GetId());
  ------------------
  |  |  280|      7|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      7|    do {                                                  \
  |  |  |  |  274|      7|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4309|      7|            return;
 4310|      7|        }
 4311|       |
 4312|    394|        if (!m_chainman.m_blockman.LookupBlockIndex(blockhash)) {
  ------------------
  |  Branch (4312:13): [True: 164, False: 230]
  ------------------
 4313|    164|            received_new_header = true;
 4314|    164|        }
 4315|    394|        }
 4316|       |
 4317|      0|        const CBlockIndex *pindex = nullptr;
 4318|    394|        BlockValidationState state;
 4319|    394|        if (!m_chainman.ProcessNewBlockHeaders({{cmpctblock.header}}, /*min_pow_checked=*/true, state, &pindex)) {
  ------------------
  |  Branch (4319:13): [True: 120, False: 274]
  ------------------
 4320|    120|            if (state.IsInvalid()) {
  ------------------
  |  Branch (4320:17): [True: 120, False: 0]
  ------------------
 4321|    120|                MaybePunishNodeForBlock(pfrom.GetId(), state, /*via_compact_block=*/true, "invalid header via cmpctblock");
 4322|    120|                return;
 4323|    120|            }
 4324|    120|        }
 4325|       |
 4326|    274|        if (received_new_header) {
  ------------------
  |  Branch (4326:13): [True: 44, False: 230]
  ------------------
 4327|     44|            LogInfo("Saw new cmpctblock header hash=%s peer=%d\n",
  ------------------
  |  |  261|     44|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|     44|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 4328|     44|                blockhash.ToString(), pfrom.GetId());
 4329|     44|        }
 4330|       |
 4331|    274|        bool fProcessBLOCKTXN = false;
 4332|       |
 4333|       |        // If we end up treating this as a plain headers message, call that as well
 4334|       |        // without cs_main.
 4335|    274|        bool fRevertToHeaderProcessing = false;
 4336|       |
 4337|       |        // Keep a CBlock for "optimistic" compactblock reconstructions (see
 4338|       |        // below)
 4339|    274|        std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();
 4340|    274|        bool fBlockReconstructed = false;
 4341|       |
 4342|    274|        {
 4343|    274|        LOCK(cs_main);
  ------------------
  |  |  257|    274|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    274|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    274|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    274|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4344|       |        // If AcceptBlockHeader returned true, it set pindex
 4345|    274|        assert(pindex);
 4346|    187|        UpdateBlockAvailability(pfrom.GetId(), pindex->GetBlockHash());
 4347|       |
 4348|    187|        CNodeState *nodestate = State(pfrom.GetId());
 4349|       |
 4350|       |        // If this was a new header with more work than our tip, update the
 4351|       |        // peer's last block announcement time
 4352|    187|        if (received_new_header && pindex->nChainWork > m_chainman.ActiveChain().Tip()->nChainWork) {
  ------------------
  |  Branch (4352:13): [True: 44, False: 143]
  |  Branch (4352:36): [True: 26, False: 18]
  ------------------
 4353|     26|            nodestate->m_last_block_announcement = GetTime();
 4354|     26|        }
 4355|       |
 4356|    187|        if (pindex->nStatus & BLOCK_HAVE_DATA) // Nothing to do here
  ------------------
  |  Branch (4356:13): [True: 0, False: 187]
  ------------------
 4357|      0|            return;
 4358|       |
 4359|    187|        auto range_flight = mapBlocksInFlight.equal_range(pindex->GetBlockHash());
 4360|    187|        size_t already_in_flight = std::distance(range_flight.first, range_flight.second);
 4361|    187|        bool requested_block_from_this_peer{false};
 4362|       |
 4363|       |        // Multimap ensures ordering of outstanding requests. It's either empty or first in line.
 4364|    187|        bool first_in_flight = already_in_flight == 0 || (range_flight.first->second.first == pfrom.GetId());
  ------------------
  |  Branch (4364:32): [True: 187, False: 0]
  |  Branch (4364:58): [True: 0, False: 0]
  ------------------
 4365|       |
 4366|    187|        while (range_flight.first != range_flight.second) {
  ------------------
  |  Branch (4366:16): [True: 0, False: 187]
  ------------------
 4367|      0|            if (range_flight.first->second.first == pfrom.GetId()) {
  ------------------
  |  Branch (4367:17): [True: 0, False: 0]
  ------------------
 4368|      0|                requested_block_from_this_peer = true;
 4369|      0|                break;
 4370|      0|            }
 4371|      0|            range_flight.first++;
 4372|      0|        }
 4373|       |
 4374|    187|        if (pindex->nChainWork <= m_chainman.ActiveChain().Tip()->nChainWork || // We know something better
  ------------------
  |  Branch (4374:13): [True: 18, False: 169]
  ------------------
 4375|    187|                pindex->nTx != 0) { // We had this block at some point, but pruned it
  ------------------
  |  Branch (4375:17): [True: 0, False: 169]
  ------------------
 4376|     18|            if (requested_block_from_this_peer) {
  ------------------
  |  Branch (4376:17): [True: 0, False: 18]
  ------------------
 4377|       |                // We requested this block for some reason, but our mempool will probably be useless
 4378|       |                // so we just grab the block via normal getdata
 4379|      0|                std::vector<CInv> vInv(1);
 4380|      0|                vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(*peer), blockhash);
 4381|      0|                MakeAndPushMessage(pfrom, NetMsgType::GETDATA, vInv);
 4382|      0|            }
 4383|     18|            return;
 4384|     18|        }
 4385|       |
 4386|       |        // If we're not close to tip yet, give up and let parallel block fetch work its magic
 4387|    169|        if (!already_in_flight && !CanDirectFetch()) {
  ------------------
  |  Branch (4387:13): [True: 169, False: 0]
  |  Branch (4387:35): [True: 28, False: 141]
  ------------------
 4388|     28|            return;
 4389|     28|        }
 4390|       |
 4391|       |        // We want to be a bit conservative just to be extra careful about DoS
 4392|       |        // possibilities in compact block processing...
 4393|    141|        if (pindex->nHeight <= m_chainman.ActiveChain().Height() + 2) {
  ------------------
  |  Branch (4393:13): [True: 141, False: 0]
  ------------------
 4394|    141|            if ((already_in_flight < MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK && nodestate->vBlocksInFlight.size() < MAX_BLOCKS_IN_TRANSIT_PER_PEER) ||
  ------------------
  |  Branch (4394:18): [True: 141, False: 0]
  |  Branch (4394:76): [True: 141, False: 0]
  ------------------
 4395|    141|                 requested_block_from_this_peer) {
  ------------------
  |  Branch (4395:18): [True: 0, False: 0]
  ------------------
 4396|    141|                std::list<QueuedBlock>::iterator* queuedBlockIt = nullptr;
 4397|    141|                if (!BlockRequested(pfrom.GetId(), *pindex, &queuedBlockIt)) {
  ------------------
  |  Branch (4397:21): [True: 0, False: 141]
  ------------------
 4398|      0|                    if (!(*queuedBlockIt)->partialBlock)
  ------------------
  |  Branch (4398:25): [True: 0, False: 0]
  ------------------
 4399|      0|                        (*queuedBlockIt)->partialBlock.reset(new PartiallyDownloadedBlock(&m_mempool));
 4400|      0|                    else {
 4401|       |                        // The block was already in flight using compact blocks from the same peer
 4402|      0|                        LogDebug(BCLog::NET, "Peer sent us compact block we were already syncing!\n");
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4403|      0|                        return;
 4404|      0|                    }
 4405|      0|                }
 4406|       |
 4407|    141|                PartiallyDownloadedBlock& partialBlock = *(*queuedBlockIt)->partialBlock;
 4408|    141|                ReadStatus status = partialBlock.InitData(cmpctblock, vExtraTxnForCompact);
 4409|    141|                if (status == READ_STATUS_INVALID) {
  ------------------
  |  Branch (4409:21): [True: 3, False: 138]
  ------------------
 4410|      3|                    RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId()); // Reset in-flight state in case Misbehaving does not result in a disconnect
 4411|      3|                    Misbehaving(*peer, "invalid compact block");
 4412|      3|                    return;
 4413|    138|                } else if (status == READ_STATUS_FAILED) {
  ------------------
  |  Branch (4413:28): [True: 67, False: 71]
  ------------------
 4414|     67|                    if (first_in_flight)  {
  ------------------
  |  Branch (4414:25): [True: 67, False: 0]
  ------------------
 4415|       |                        // Duplicate txindexes, the block is now in-flight, so just request it
 4416|     67|                        std::vector<CInv> vInv(1);
 4417|     67|                        vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(*peer), blockhash);
 4418|     67|                        MakeAndPushMessage(pfrom, NetMsgType::GETDATA, vInv);
 4419|     67|                    } else {
 4420|       |                        // Give up for this peer and wait for other peer(s)
 4421|      0|                        RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId());
 4422|      0|                    }
 4423|     67|                    return;
 4424|     67|                }
 4425|       |
 4426|     71|                BlockTransactionsRequest req;
 4427|  1.01k|                for (size_t i = 0; i < cmpctblock.BlockTxCount(); i++) {
  ------------------
  |  Branch (4427:36): [True: 941, False: 71]
  ------------------
 4428|    941|                    if (!partialBlock.IsTxAvailable(i))
  ------------------
  |  Branch (4428:25): [True: 939, False: 2]
  ------------------
 4429|    939|                        req.indexes.push_back(i);
 4430|    941|                }
 4431|     71|                if (req.indexes.empty()) {
  ------------------
  |  Branch (4431:21): [True: 0, False: 71]
  ------------------
 4432|      0|                    fProcessBLOCKTXN = true;
 4433|     71|                } else if (first_in_flight) {
  ------------------
  |  Branch (4433:28): [True: 71, False: 0]
  ------------------
 4434|       |                    // We will try to round-trip any compact blocks we get on failure,
 4435|       |                    // as long as it's first...
 4436|     71|                    req.blockhash = pindex->GetBlockHash();
 4437|     71|                    MakeAndPushMessage(pfrom, NetMsgType::GETBLOCKTXN, req);
 4438|     71|                } else if (pfrom.m_bip152_highbandwidth_to &&
  ------------------
  |  Branch (4438:28): [True: 0, False: 0]
  ------------------
 4439|      0|                    (!pfrom.IsInboundConn() ||
  ------------------
  |  Branch (4439:22): [True: 0, False: 0]
  ------------------
 4440|      0|                    IsBlockRequestedFromOutbound(blockhash) ||
  ------------------
  |  Branch (4440:21): [True: 0, False: 0]
  ------------------
 4441|      0|                    already_in_flight < MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK - 1)) {
  ------------------
  |  Branch (4441:21): [True: 0, False: 0]
  ------------------
 4442|       |                    // ... or it's a hb relay peer and:
 4443|       |                    // - peer is outbound, or
 4444|       |                    // - we already have an outbound attempt in flight(so we'll take what we can get), or
 4445|       |                    // - it's not the final parallel download slot (which we may reserve for first outbound)
 4446|      0|                    req.blockhash = pindex->GetBlockHash();
 4447|      0|                    MakeAndPushMessage(pfrom, NetMsgType::GETBLOCKTXN, req);
 4448|      0|                } else {
 4449|       |                    // Give up for this peer and wait for other peer(s)
 4450|      0|                    RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId());
 4451|      0|                }
 4452|     71|            } else {
 4453|       |                // This block is either already in flight from a different
 4454|       |                // peer, or this peer has too many blocks outstanding to
 4455|       |                // download from.
 4456|       |                // Optimistically try to reconstruct anyway since we might be
 4457|       |                // able to without any round trips.
 4458|      0|                PartiallyDownloadedBlock tempBlock(&m_mempool);
 4459|      0|                ReadStatus status = tempBlock.InitData(cmpctblock, vExtraTxnForCompact);
 4460|      0|                if (status != READ_STATUS_OK) {
  ------------------
  |  Branch (4460:21): [True: 0, False: 0]
  ------------------
 4461|       |                    // TODO: don't ignore failures
 4462|      0|                    return;
 4463|      0|                }
 4464|      0|                std::vector<CTransactionRef> dummy;
 4465|      0|                status = tempBlock.FillBlock(*pblock, dummy);
 4466|      0|                if (status == READ_STATUS_OK) {
  ------------------
  |  Branch (4466:21): [True: 0, False: 0]
  ------------------
 4467|      0|                    fBlockReconstructed = true;
 4468|      0|                }
 4469|      0|            }
 4470|    141|        } else {
 4471|      0|            if (requested_block_from_this_peer) {
  ------------------
  |  Branch (4471:17): [True: 0, False: 0]
  ------------------
 4472|       |                // We requested this block, but its far into the future, so our
 4473|       |                // mempool will probably be useless - request the block normally
 4474|      0|                std::vector<CInv> vInv(1);
 4475|      0|                vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(*peer), blockhash);
 4476|      0|                MakeAndPushMessage(pfrom, NetMsgType::GETDATA, vInv);
 4477|      0|                return;
 4478|      0|            } else {
 4479|       |                // If this was an announce-cmpctblock, we want the same treatment as a header message
 4480|      0|                fRevertToHeaderProcessing = true;
 4481|      0|            }
 4482|      0|        }
 4483|    141|        } // cs_main
 4484|       |
 4485|     71|        if (fProcessBLOCKTXN) {
  ------------------
  |  Branch (4485:13): [True: 0, False: 71]
  ------------------
 4486|      0|            BlockTransactions txn;
 4487|      0|            txn.blockhash = blockhash;
 4488|      0|            return ProcessCompactBlockTxns(pfrom, *peer, txn);
 4489|      0|        }
 4490|       |
 4491|     71|        if (fRevertToHeaderProcessing) {
  ------------------
  |  Branch (4491:13): [True: 0, False: 71]
  ------------------
 4492|       |            // Headers received from HB compact block peers are permitted to be
 4493|       |            // relayed before full validation (see BIP 152), so we don't want to disconnect
 4494|       |            // the peer if the header turns out to be for an invalid block.
 4495|       |            // Note that if a peer tries to build on an invalid chain, that
 4496|       |            // will be detected and the peer will be disconnected/discouraged.
 4497|      0|            return ProcessHeadersMessage(pfrom, *peer, {cmpctblock.header}, /*via_compact_block=*/true);
 4498|      0|        }
 4499|       |
 4500|     71|        if (fBlockReconstructed) {
  ------------------
  |  Branch (4500:13): [True: 0, False: 71]
  ------------------
 4501|       |            // If we got here, we were able to optimistically reconstruct a
 4502|       |            // block that is in flight from some other peer.
 4503|      0|            {
 4504|      0|                LOCK(cs_main);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4505|      0|                mapBlockSource.emplace(pblock->GetHash(), std::make_pair(pfrom.GetId(), false));
 4506|      0|            }
 4507|       |            // Setting force_processing to true means that we bypass some of
 4508|       |            // our anti-DoS protections in AcceptBlock, which filters
 4509|       |            // unrequested blocks that might be trying to waste our resources
 4510|       |            // (eg disk space). Because we only try to reconstruct blocks when
 4511|       |            // we're close to caught up (via the CanDirectFetch() requirement
 4512|       |            // above, combined with the behavior of not requesting blocks until
 4513|       |            // we have a chain with at least the minimum chain work), and we ignore
 4514|       |            // compact blocks with less work than our tip, it is safe to treat
 4515|       |            // reconstructed compact blocks as having been requested.
 4516|      0|            ProcessBlock(pfrom, pblock, /*force_processing=*/true, /*min_pow_checked=*/true);
 4517|      0|            LOCK(cs_main); // hold cs_main for CBlockIndex::IsValid()
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4518|      0|            if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS)) {
  ------------------
  |  Branch (4518:17): [True: 0, False: 0]
  ------------------
 4519|       |                // Clear download state for this block, which is in
 4520|       |                // process from some other peer.  We do this after calling
 4521|       |                // ProcessNewBlock so that a malleated cmpctblock announcement
 4522|       |                // can't be used to interfere with block relay.
 4523|      0|                RemoveBlockRequest(pblock->GetHash(), std::nullopt);
 4524|      0|            }
 4525|      0|        }
 4526|     71|        return;
 4527|     71|    }
 4528|       |
 4529|  1.74k|    if (msg_type == NetMsgType::BLOCKTXN)
  ------------------
  |  Branch (4529:9): [True: 98, False: 1.64k]
  ------------------
 4530|     98|    {
 4531|       |        // Ignore blocktxn received while importing
 4532|     98|        if (m_chainman.m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (4532:13): [True: 0, False: 98]
  ------------------
 4533|      0|            LogDebug(BCLog::NET, "Unexpected blocktxn message received from peer %d\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4534|      0|            return;
 4535|      0|        }
 4536|       |
 4537|     98|        BlockTransactions resp;
 4538|     98|        vRecv >> resp;
 4539|       |
 4540|     98|        return ProcessCompactBlockTxns(pfrom, *peer, resp);
 4541|     98|    }
 4542|       |
 4543|  1.64k|    if (msg_type == NetMsgType::HEADERS)
  ------------------
  |  Branch (4543:9): [True: 498, False: 1.14k]
  ------------------
 4544|    498|    {
 4545|       |        // Ignore headers received while importing
 4546|    498|        if (m_chainman.m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (4546:13): [True: 0, False: 498]
  ------------------
 4547|      0|            LogDebug(BCLog::NET, "Unexpected headers message received from peer %d\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4548|      0|            return;
 4549|      0|        }
 4550|       |
 4551|    498|        std::vector<CBlockHeader> headers;
 4552|       |
 4553|       |        // Bypass the normal CBlock deserialization, as we don't want to risk deserializing 2000 full blocks.
 4554|    498|        unsigned int nCount = ReadCompactSize(vRecv);
 4555|    498|        if (nCount > m_opts.max_headers_result) {
  ------------------
  |  Branch (4555:13): [True: 10, False: 488]
  ------------------
 4556|     10|            Misbehaving(*peer, strprintf("headers message size = %u", nCount));
  ------------------
  |  | 1172|     10|#define strprintf tfm::format
  ------------------
 4557|     10|            return;
 4558|     10|        }
 4559|    488|        headers.resize(nCount);
 4560|  3.71k|        for (unsigned int n = 0; n < nCount; n++) {
  ------------------
  |  Branch (4560:34): [True: 3.22k, False: 488]
  ------------------
 4561|  3.22k|            vRecv >> headers[n];
 4562|  3.22k|            ReadCompactSize(vRecv); // ignore tx count; assume it is 0.
 4563|  3.22k|        }
 4564|       |
 4565|    488|        ProcessHeadersMessage(pfrom, *peer, std::move(headers), /*via_compact_block=*/false);
 4566|       |
 4567|       |        // Check if the headers presync progress needs to be reported to validation.
 4568|       |        // This needs to be done without holding the m_headers_presync_mutex lock.
 4569|    488|        if (m_headers_presync_should_signal.exchange(false)) {
  ------------------
  |  Branch (4569:13): [True: 0, False: 488]
  ------------------
 4570|      0|            HeadersPresyncStats stats;
 4571|      0|            {
 4572|      0|                LOCK(m_headers_presync_mutex);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4573|      0|                auto it = m_headers_presync_stats.find(m_headers_presync_bestpeer);
 4574|      0|                if (it != m_headers_presync_stats.end()) stats = it->second;
  ------------------
  |  Branch (4574:21): [True: 0, False: 0]
  ------------------
 4575|      0|            }
 4576|      0|            if (stats.second) {
  ------------------
  |  Branch (4576:17): [True: 0, False: 0]
  ------------------
 4577|      0|                m_chainman.ReportHeadersPresync(stats.first, stats.second->first, stats.second->second);
 4578|      0|            }
 4579|      0|        }
 4580|       |
 4581|    488|        return;
 4582|    498|    }
 4583|       |
 4584|  1.14k|    if (msg_type == NetMsgType::BLOCK)
  ------------------
  |  Branch (4584:9): [True: 192, False: 955]
  ------------------
 4585|    192|    {
 4586|       |        // Ignore block received while importing
 4587|    192|        if (m_chainman.m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (4587:13): [True: 0, False: 192]
  ------------------
 4588|      0|            LogDebug(BCLog::NET, "Unexpected block message received from peer %d\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4589|      0|            return;
 4590|      0|        }
 4591|       |
 4592|    192|        std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();
 4593|    192|        vRecv >> TX_WITH_WITNESS(*pblock);
 4594|       |
 4595|    192|        LogDebug(BCLog::NET, "received block %s peer=%d\n", pblock->GetHash().ToString(), pfrom.GetId());
  ------------------
  |  |  280|    192|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    192|    do {                                                  \
  |  |  |  |  274|    192|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 192]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    192|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4596|       |
 4597|    192|        const CBlockIndex* prev_block{WITH_LOCK(m_chainman.GetMutex(), return m_chainman.m_blockman.LookupBlockIndex(pblock->hashPrevBlock))};
  ------------------
  |  |  301|    192|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 4598|       |
 4599|       |        // Check for possible mutation if it connects to something we know so we can check for DEPLOYMENT_SEGWIT being active
 4600|    192|        if (prev_block && IsBlockMutated(/*block=*/*pblock,
  ------------------
  |  Branch (4600:13): [True: 46, False: 146]
  |  Branch (4600:27): [True: 22, False: 24]
  ------------------
 4601|     46|                           /*check_witness_root=*/DeploymentActiveAfter(prev_block, m_chainman, Consensus::DEPLOYMENT_SEGWIT))) {
 4602|     22|            LogDebug(BCLog::NET, "Received mutated block from peer=%d\n", peer->m_id);
  ------------------
  |  |  280|     22|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     22|    do {                                                  \
  |  |  |  |  274|     22|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4603|     22|            Misbehaving(*peer, "mutated block");
 4604|     22|            WITH_LOCK(cs_main, RemoveBlockRequest(pblock->GetHash(), peer->m_id));
  ------------------
  |  |  301|     22|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 4605|     22|            return;
 4606|     22|        }
 4607|       |
 4608|    170|        bool forceProcessing = false;
 4609|    170|        const uint256 hash(pblock->GetHash());
 4610|    170|        bool min_pow_checked = false;
 4611|    170|        {
 4612|    170|            LOCK(cs_main);
  ------------------
  |  |  257|    170|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    170|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    170|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    170|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4613|       |            // Always process the block if we requested it, since we may
 4614|       |            // need it even when it's not a candidate for a new best tip.
 4615|    170|            forceProcessing = IsBlockRequested(hash);
 4616|    170|            RemoveBlockRequest(hash, pfrom.GetId());
 4617|       |            // mapBlockSource is only used for punishing peers and setting
 4618|       |            // which peers send us compact blocks, so the race between here and
 4619|       |            // cs_main in ProcessNewBlock is fine.
 4620|    170|            mapBlockSource.emplace(hash, std::make_pair(pfrom.GetId(), true));
 4621|       |
 4622|       |            // Check claimed work on this block against our anti-dos thresholds.
 4623|    170|            if (prev_block && prev_block->nChainWork + CalculateClaimedHeadersWork({{pblock->GetBlockHeader()}}) >= GetAntiDoSWorkThreshold()) {
  ------------------
  |  Branch (4623:17): [True: 24, False: 146]
  |  Branch (4623:17): [True: 10, False: 160]
  |  Branch (4623:31): [True: 10, False: 14]
  ------------------
 4624|     10|                min_pow_checked = true;
 4625|     10|            }
 4626|    170|        }
 4627|    170|        ProcessBlock(pfrom, pblock, forceProcessing, min_pow_checked);
 4628|    170|        return;
 4629|    192|    }
 4630|       |
 4631|    955|    if (msg_type == NetMsgType::GETADDR) {
  ------------------
  |  Branch (4631:9): [True: 342, False: 613]
  ------------------
 4632|       |        // This asymmetric behavior for inbound and outbound connections was introduced
 4633|       |        // to prevent a fingerprinting attack: an attacker can send specific fake addresses
 4634|       |        // to users' AddrMan and later request them by sending getaddr messages.
 4635|       |        // Making nodes which are behind NAT and can only make outgoing connections ignore
 4636|       |        // the getaddr message mitigates the attack.
 4637|    342|        if (!pfrom.IsInboundConn()) {
  ------------------
  |  Branch (4637:13): [True: 3, False: 339]
  ------------------
 4638|      3|            LogDebug(BCLog::NET, "Ignoring \"getaddr\" from %s connection. peer=%d\n", pfrom.ConnectionTypeAsString(), pfrom.GetId());
  ------------------
  |  |  280|      3|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      3|    do {                                                  \
  |  |  |  |  274|      3|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4639|      3|            return;
 4640|      3|        }
 4641|       |
 4642|       |        // Since this must be an inbound connection, SetupAddressRelay will
 4643|       |        // never fail.
 4644|    339|        Assume(SetupAddressRelay(pfrom, *peer));
  ------------------
  |  |   97|    339|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 4645|       |
 4646|       |        // Only send one GetAddr response per connection to reduce resource waste
 4647|       |        // and discourage addr stamping of INV announcements.
 4648|    339|        if (peer->m_getaddr_recvd) {
  ------------------
  |  Branch (4648:13): [True: 0, False: 339]
  ------------------
 4649|      0|            LogDebug(BCLog::NET, "Ignoring repeated \"getaddr\". peer=%d\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4650|      0|            return;
 4651|      0|        }
 4652|    339|        peer->m_getaddr_recvd = true;
 4653|       |
 4654|    339|        peer->m_addrs_to_send.clear();
 4655|    339|        std::vector<CAddress> vAddr;
 4656|    339|        if (pfrom.HasPermission(NetPermissionFlags::Addr)) {
  ------------------
  |  Branch (4656:13): [True: 93, False: 246]
  ------------------
 4657|     93|            vAddr = m_connman.GetAddresses(MAX_ADDR_TO_SEND, MAX_PCT_ADDR_TO_SEND, /*network=*/std::nullopt);
 4658|    246|        } else {
 4659|    246|            vAddr = m_connman.GetAddresses(pfrom, MAX_ADDR_TO_SEND, MAX_PCT_ADDR_TO_SEND);
 4660|    246|        }
 4661|  12.4k|        for (const CAddress &addr : vAddr) {
  ------------------
  |  Branch (4661:35): [True: 12.4k, False: 339]
  ------------------
 4662|  12.4k|            PushAddress(*peer, addr);
 4663|  12.4k|        }
 4664|    339|        return;
 4665|    339|    }
 4666|       |
 4667|    613|    if (msg_type == NetMsgType::MEMPOOL) {
  ------------------
  |  Branch (4667:9): [True: 11, False: 602]
  ------------------
 4668|       |        // Only process received mempool messages if we advertise NODE_BLOOM
 4669|       |        // or if the peer has mempool permissions.
 4670|     11|        if (!(peer->m_our_services & NODE_BLOOM) && !pfrom.HasPermission(NetPermissionFlags::Mempool))
  ------------------
  |  Branch (4670:13): [True: 6, False: 5]
  |  Branch (4670:53): [True: 3, False: 3]
  ------------------
 4671|      3|        {
 4672|      3|            if (!pfrom.HasPermission(NetPermissionFlags::NoBan))
  ------------------
  |  Branch (4672:17): [True: 2, False: 1]
  ------------------
 4673|      2|            {
 4674|      2|                LogDebug(BCLog::NET, "mempool request with bloom filters disabled, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      2|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      2|    do {                                                  \
  |  |  |  |  274|      2|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4675|      2|                pfrom.fDisconnect = true;
 4676|      2|            }
 4677|      3|            return;
 4678|      3|        }
 4679|       |
 4680|      8|        if (m_connman.OutboundTargetReached(false) && !pfrom.HasPermission(NetPermissionFlags::Mempool))
  ------------------
  |  Branch (4680:13): [True: 0, False: 8]
  |  Branch (4680:55): [True: 0, False: 0]
  ------------------
 4681|      0|        {
 4682|      0|            if (!pfrom.HasPermission(NetPermissionFlags::NoBan))
  ------------------
  |  Branch (4682:17): [True: 0, False: 0]
  ------------------
 4683|      0|            {
 4684|      0|                LogDebug(BCLog::NET, "mempool request with bandwidth limit reached, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4685|      0|                pfrom.fDisconnect = true;
 4686|      0|            }
 4687|      0|            return;
 4688|      0|        }
 4689|       |
 4690|      8|        if (auto tx_relay = peer->GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (4690:49): [True: 5, False: 3]
  ------------------
 4691|      5|            LOCK(tx_relay->m_tx_inventory_mutex);
  ------------------
  |  |  257|      5|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      5|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      5|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      5|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4692|      5|            tx_relay->m_send_mempool = true;
 4693|      5|        }
 4694|      8|        return;
 4695|      8|    }
 4696|       |
 4697|    602|    if (msg_type == NetMsgType::PING) {
  ------------------
  |  Branch (4697:9): [True: 14, False: 588]
  ------------------
 4698|     14|        if (pfrom.GetCommonVersion() > BIP0031_VERSION) {
  ------------------
  |  Branch (4698:13): [True: 7, False: 7]
  ------------------
 4699|      7|            uint64_t nonce = 0;
 4700|      7|            vRecv >> nonce;
 4701|       |            // Echo the message back with the nonce. This allows for two useful features:
 4702|       |            //
 4703|       |            // 1) A remote node can quickly check if the connection is operational
 4704|       |            // 2) Remote nodes can measure the latency of the network thread. If this node
 4705|       |            //    is overloaded it won't respond to pings quickly and the remote node can
 4706|       |            //    avoid sending us more work, like chain download requests.
 4707|       |            //
 4708|       |            // The nonce stops the remote getting confused between different pings: without
 4709|       |            // it, if the remote node sends a ping once per second and this node takes 5
 4710|       |            // seconds to respond to each, the 5th ping the remote sends would appear to
 4711|       |            // return very quickly.
 4712|      7|            MakeAndPushMessage(pfrom, NetMsgType::PONG, nonce);
 4713|      7|        }
 4714|     14|        return;
 4715|     14|    }
 4716|       |
 4717|    588|    if (msg_type == NetMsgType::PONG) {
  ------------------
  |  Branch (4717:9): [True: 186, False: 402]
  ------------------
 4718|    186|        const auto ping_end = time_received;
 4719|    186|        uint64_t nonce = 0;
 4720|    186|        size_t nAvail = vRecv.in_avail();
 4721|    186|        bool bPingFinished = false;
 4722|    186|        std::string sProblem;
 4723|       |
 4724|    186|        if (nAvail >= sizeof(nonce)) {
  ------------------
  |  Branch (4724:13): [True: 176, False: 10]
  ------------------
 4725|    176|            vRecv >> nonce;
 4726|       |
 4727|       |            // Only process pong message if there is an outstanding ping (old ping without nonce should never pong)
 4728|    176|            if (peer->m_ping_nonce_sent != 0) {
  ------------------
  |  Branch (4728:17): [True: 175, False: 1]
  ------------------
 4729|    175|                if (nonce == peer->m_ping_nonce_sent) {
  ------------------
  |  Branch (4729:21): [True: 23, False: 152]
  ------------------
 4730|       |                    // Matching pong received, this ping is no longer outstanding
 4731|     23|                    bPingFinished = true;
 4732|     23|                    const auto ping_time = ping_end - peer->m_ping_start.load();
 4733|     23|                    if (ping_time.count() >= 0) {
  ------------------
  |  Branch (4733:25): [True: 17, False: 6]
  ------------------
 4734|       |                        // Let connman know about this successful ping-pong
 4735|     17|                        pfrom.PongReceived(ping_time);
 4736|     17|                    } else {
 4737|       |                        // This should never happen
 4738|      6|                        sProblem = "Timing mishap";
 4739|      6|                    }
 4740|    152|                } else {
 4741|       |                    // Nonce mismatches are normal when pings are overlapping
 4742|    152|                    sProblem = "Nonce mismatch";
 4743|    152|                    if (nonce == 0) {
  ------------------
  |  Branch (4743:25): [True: 2, False: 150]
  ------------------
 4744|       |                        // This is most likely a bug in another implementation somewhere; cancel this ping
 4745|      2|                        bPingFinished = true;
 4746|      2|                        sProblem = "Nonce zero";
 4747|      2|                    }
 4748|    152|                }
 4749|    175|            } else {
 4750|      1|                sProblem = "Unsolicited pong without ping";
 4751|      1|            }
 4752|    176|        } else {
 4753|       |            // This is most likely a bug in another implementation somewhere; cancel this ping
 4754|     10|            bPingFinished = true;
 4755|     10|            sProblem = "Short payload";
 4756|     10|        }
 4757|       |
 4758|    186|        if (!(sProblem.empty())) {
  ------------------
  |  Branch (4758:13): [True: 169, False: 17]
  ------------------
 4759|    169|            LogDebug(BCLog::NET, "pong peer=%d: %s, %x expected, %x received, %u bytes\n",
  ------------------
  |  |  280|    169|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    169|    do {                                                  \
  |  |  |  |  274|    169|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 169]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    169|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4760|    169|                pfrom.GetId(),
 4761|    169|                sProblem,
 4762|    169|                peer->m_ping_nonce_sent,
 4763|    169|                nonce,
 4764|    169|                nAvail);
 4765|    169|        }
 4766|    186|        if (bPingFinished) {
  ------------------
  |  Branch (4766:13): [True: 35, False: 151]
  ------------------
 4767|     35|            peer->m_ping_nonce_sent = 0;
 4768|     35|        }
 4769|    186|        return;
 4770|    186|    }
 4771|       |
 4772|    402|    if (msg_type == NetMsgType::FILTERLOAD) {
  ------------------
  |  Branch (4772:9): [True: 35, False: 367]
  ------------------
 4773|     35|        if (!(peer->m_our_services & NODE_BLOOM)) {
  ------------------
  |  Branch (4773:13): [True: 1, False: 34]
  ------------------
 4774|      1|            LogDebug(BCLog::NET, "filterload received despite not offering bloom services, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4775|      1|            pfrom.fDisconnect = true;
 4776|      1|            return;
 4777|      1|        }
 4778|     34|        CBloomFilter filter;
 4779|     34|        vRecv >> filter;
 4780|       |
 4781|     34|        if (!filter.IsWithinSizeConstraints())
  ------------------
  |  Branch (4781:13): [True: 17, False: 17]
  ------------------
 4782|     17|        {
 4783|       |            // There is no excuse for sending a too-large filter
 4784|     17|            Misbehaving(*peer, "too-large bloom filter");
 4785|     17|        } else if (auto tx_relay = peer->GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (4785:56): [True: 4, False: 13]
  ------------------
 4786|      4|            {
 4787|      4|                LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|      4|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      4|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      4|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      4|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4788|      4|                tx_relay->m_bloom_filter.reset(new CBloomFilter(filter));
 4789|      4|                tx_relay->m_relay_txs = true;
 4790|      4|            }
 4791|      4|            pfrom.m_bloom_filter_loaded = true;
 4792|      4|            pfrom.m_relays_txs = true;
 4793|      4|        }
 4794|     34|        return;
 4795|     35|    }
 4796|       |
 4797|    367|    if (msg_type == NetMsgType::FILTERADD) {
  ------------------
  |  Branch (4797:9): [True: 45, False: 322]
  ------------------
 4798|     45|        if (!(peer->m_our_services & NODE_BLOOM)) {
  ------------------
  |  Branch (4798:13): [True: 1, False: 44]
  ------------------
 4799|      1|            LogDebug(BCLog::NET, "filteradd received despite not offering bloom services, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4800|      1|            pfrom.fDisconnect = true;
 4801|      1|            return;
 4802|      1|        }
 4803|     44|        std::vector<unsigned char> vData;
 4804|     44|        vRecv >> vData;
 4805|       |
 4806|       |        // Nodes must NEVER send a data item > MAX_SCRIPT_ELEMENT_SIZE bytes (the max size for a script data object,
 4807|       |        // and thus, the maximum size any matched object can have) in a filteradd message
 4808|     44|        bool bad = false;
 4809|     44|        if (vData.size() > MAX_SCRIPT_ELEMENT_SIZE) {
  ------------------
  |  Branch (4809:13): [True: 1, False: 43]
  ------------------
 4810|      1|            bad = true;
 4811|     43|        } else if (auto tx_relay = peer->GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (4811:56): [True: 7, False: 36]
  ------------------
 4812|      7|            LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|      7|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      7|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      7|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      7|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4813|      7|            if (tx_relay->m_bloom_filter) {
  ------------------
  |  Branch (4813:17): [True: 0, False: 7]
  ------------------
 4814|      0|                tx_relay->m_bloom_filter->insert(vData);
 4815|      7|            } else {
 4816|      7|                bad = true;
 4817|      7|            }
 4818|      7|        }
 4819|     44|        if (bad) {
  ------------------
  |  Branch (4819:13): [True: 8, False: 36]
  ------------------
 4820|      8|            Misbehaving(*peer, "bad filteradd message");
 4821|      8|        }
 4822|     44|        return;
 4823|     45|    }
 4824|       |
 4825|    322|    if (msg_type == NetMsgType::FILTERCLEAR) {
  ------------------
  |  Branch (4825:9): [True: 4, False: 318]
  ------------------
 4826|      4|        if (!(peer->m_our_services & NODE_BLOOM)) {
  ------------------
  |  Branch (4826:13): [True: 1, False: 3]
  ------------------
 4827|      1|            LogDebug(BCLog::NET, "filterclear received despite not offering bloom services, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4828|      1|            pfrom.fDisconnect = true;
 4829|      1|            return;
 4830|      1|        }
 4831|      3|        auto tx_relay = peer->GetTxRelay();
 4832|      3|        if (!tx_relay) return;
  ------------------
  |  Branch (4832:13): [True: 1, False: 2]
  ------------------
 4833|       |
 4834|      2|        {
 4835|      2|            LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4836|      2|            tx_relay->m_bloom_filter = nullptr;
 4837|      2|            tx_relay->m_relay_txs = true;
 4838|      2|        }
 4839|      2|        pfrom.m_bloom_filter_loaded = false;
 4840|      2|        pfrom.m_relays_txs = true;
 4841|      2|        return;
 4842|      3|    }
 4843|       |
 4844|    318|    if (msg_type == NetMsgType::FEEFILTER) {
  ------------------
  |  Branch (4844:9): [True: 100, False: 218]
  ------------------
 4845|    100|        CAmount newFeeFilter = 0;
 4846|    100|        vRecv >> newFeeFilter;
 4847|    100|        if (MoneyRange(newFeeFilter)) {
  ------------------
  |  Branch (4847:13): [True: 20, False: 80]
  ------------------
 4848|     20|            if (auto tx_relay = peer->GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (4848:53): [True: 12, False: 8]
  ------------------
 4849|     12|                tx_relay->m_fee_filter_received = newFeeFilter;
 4850|     12|            }
 4851|     20|            LogDebug(BCLog::NET, "received: feefilter of %s from peer=%d\n", CFeeRate(newFeeFilter).ToString(), pfrom.GetId());
  ------------------
  |  |  280|     20|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     20|    do {                                                  \
  |  |  |  |  274|     20|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4852|     20|        }
 4853|    100|        return;
 4854|    100|    }
 4855|       |
 4856|    218|    if (msg_type == NetMsgType::GETCFILTERS) {
  ------------------
  |  Branch (4856:9): [True: 8, False: 210]
  ------------------
 4857|      8|        ProcessGetCFilters(pfrom, *peer, vRecv);
 4858|      8|        return;
 4859|      8|    }
 4860|       |
 4861|    210|    if (msg_type == NetMsgType::GETCFHEADERS) {
  ------------------
  |  Branch (4861:9): [True: 19, False: 191]
  ------------------
 4862|     19|        ProcessGetCFHeaders(pfrom, *peer, vRecv);
 4863|     19|        return;
 4864|     19|    }
 4865|       |
 4866|    191|    if (msg_type == NetMsgType::GETCFCHECKPT) {
  ------------------
  |  Branch (4866:9): [True: 10, False: 181]
  ------------------
 4867|     10|        ProcessGetCFCheckPt(pfrom, *peer, vRecv);
 4868|     10|        return;
 4869|     10|    }
 4870|       |
 4871|    181|    if (msg_type == NetMsgType::NOTFOUND) {
  ------------------
  |  Branch (4871:9): [True: 88, False: 93]
  ------------------
 4872|     88|        std::vector<CInv> vInv;
 4873|     88|        vRecv >> vInv;
 4874|     88|        std::vector<uint256> tx_invs;
 4875|     88|        if (vInv.size() <= node::MAX_PEER_TX_ANNOUNCEMENTS + MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
  ------------------
  |  Branch (4875:13): [True: 71, False: 17]
  ------------------
 4876|  1.59k|            for (CInv &inv : vInv) {
  ------------------
  |  Branch (4876:28): [True: 1.59k, False: 71]
  ------------------
 4877|  1.59k|                if (inv.IsGenTxMsg()) {
  ------------------
  |  Branch (4877:21): [True: 736, False: 863]
  ------------------
 4878|    736|                    tx_invs.emplace_back(inv.hash);
 4879|    736|                }
 4880|  1.59k|            }
 4881|     71|        }
 4882|     88|        LOCK(m_tx_download_mutex);
  ------------------
  |  |  257|     88|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     88|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     88|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     88|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4883|     88|        m_txdownloadman.ReceivedNotFound(pfrom.GetId(), tx_invs);
 4884|     88|        return;
 4885|     88|    }
 4886|       |
 4887|       |    // Ignore unknown commands for extensibility
 4888|     93|    LogDebug(BCLog::NET, "Unknown command \"%s\" from peer=%d\n", SanitizeString(msg_type), pfrom.GetId());
  ------------------
  |  |  280|     93|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     93|    do {                                                  \
  |  |  |  |  274|     93|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 93]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     93|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4889|     93|    return;
 4890|    181|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl15PushNodeVersionER5CNodeRKNS_4PeerE:
 1495|  8.47k|{
 1496|  8.47k|    uint64_t my_services{peer.m_our_services};
 1497|  8.47k|    const int64_t nTime{count_seconds(GetTime<std::chrono::seconds>())};
 1498|  8.47k|    uint64_t nonce = pnode.GetLocalNonce();
 1499|  8.47k|    const int nNodeStartingHeight{m_best_height};
 1500|  8.47k|    NodeId nodeid = pnode.GetId();
 1501|  8.47k|    CAddress addr = pnode.addr;
 1502|       |
 1503|  8.47k|    CService addr_you = addr.IsRoutable() && !IsProxy(addr) && addr.IsAddrV1Compatible() ? addr : CService();
  ------------------
  |  Branch (1503:25): [True: 5.65k, False: 2.82k]
  |  Branch (1503:46): [True: 5.65k, False: 0]
  |  Branch (1503:64): [True: 4.50k, False: 1.14k]
  ------------------
 1504|  8.47k|    uint64_t your_services{addr.nServices};
 1505|       |
 1506|  8.47k|    const bool tx_relay{!RejectIncomingTxs(pnode)};
 1507|  8.47k|    MakeAndPushMessage(pnode, NetMsgType::VERSION, PROTOCOL_VERSION, my_services, nTime,
 1508|  8.47k|            your_services, CNetAddr::V1(addr_you), // Together the pre-version-31402 serialization of CAddress "addrYou" (without nTime)
 1509|  8.47k|            my_services, CNetAddr::V1(CService{}), // Together the pre-version-31402 serialization of CAddress "addrMe" (without nTime)
 1510|  8.47k|            nonce, strSubVersion, nNodeStartingHeight, tx_relay);
 1511|       |
 1512|  8.47k|    if (fLogIPs) {
  ------------------
  |  Branch (1512:9): [True: 0, False: 8.47k]
  ------------------
 1513|      0|        LogDebug(BCLog::NET, "send version message: version %d, blocks=%d, them=%s, txrelay=%d, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addr_you.ToStringAddrPort(), tx_relay, nodeid);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1514|  8.47k|    } else {
 1515|  8.47k|        LogDebug(BCLog::NET, "send version message: version %d, blocks=%d, txrelay=%d, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, tx_relay, nodeid);
  ------------------
  |  |  280|  8.47k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  8.47k|    do {                                                  \
  |  |  |  |  274|  8.47k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8.47k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  8.47k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1516|  8.47k|    }
 1517|  8.47k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRKiRmRKlS4_13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceES4_SB_S4_RNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEES3_RKbEEEvR5CNodeSI_DpOT_:
  690|  8.47k|    {
  691|  8.47k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  8.47k|    }
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJEEEvR5CNodeNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEDpOT_:
  690|  26.3k|    {
  691|  26.3k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  26.3k|    }
net_processing.cpp:_ZN12_GLOBAL__N_14Peer10SetTxRelayEv:
  293|  5.86k|    {
  294|  5.86k|        LOCK(m_tx_relay_mutex);
  ------------------
  |  |  257|  5.86k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.86k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.86k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.86k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  295|  5.86k|        Assume(!m_tx_relay);
  ------------------
  |  |   97|  5.86k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  296|  5.86k|        m_tx_relay = std::make_unique<Peer::TxRelay>();
  297|  5.86k|        return m_tx_relay.get();
  298|  5.86k|    };
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRKjRKmEEEvR5CNodeNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEDpOT_:
  690|  3.77k|    {
  691|  3.77k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  3.77k|    }
net_processing.cpp:_ZN12_GLOBAL__N_114CanServeBlocksERKNS_4PeerE:
 1101|   850k|{
 1102|   850k|    return peer.m_their_services & (NODE_NETWORK|NODE_NETWORK_LIMITED);
 1103|   850k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl17SetupAddressRelayERK5CNodeRNS_4PeerE:
 5407|  4.48k|{
 5408|       |    // We don't participate in addr relay with outbound block-relay-only
 5409|       |    // connections to prevent providing adversaries with the additional
 5410|       |    // information of addr traffic to infer the link.
 5411|  4.48k|    if (node.IsBlockOnlyConn()) return false;
  ------------------
  |  Branch (5411:9): [True: 62, False: 4.42k]
  ------------------
 5412|       |
 5413|  4.42k|    if (!peer.m_addr_relay_enabled.exchange(true)) {
  ------------------
  |  Branch (5413:9): [True: 4.08k, False: 347]
  ------------------
 5414|       |        // During version message processing (non-block-relay-only outbound peers)
 5415|       |        // or on first addr-related message we have received (inbound peers), initialize
 5416|       |        // m_addr_known.
 5417|  4.08k|        peer.m_addr_known = std::make_unique<CRollingBloomFilter>(5000, 0.001);
 5418|  4.08k|    }
 5419|       |
 5420|  4.42k|    return true;
 5421|  4.48k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRKNSt3__15arrayISt4byteLm168EEEEEEvR5CNodeNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEDpOT_:
  690|  1.45k|    {
  691|  1.45k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  1.45k|    }
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl17RejectIncomingTxsERK5CNode:
 5397|  11.3k|{
 5398|       |    // block-relay-only peers may never send txs to us
 5399|  11.3k|    if (peer.IsBlockOnlyConn()) return true;
  ------------------
  |  Branch (5399:9): [True: 90, False: 11.3k]
  ------------------
 5400|  11.3k|    if (peer.IsFeelerConn()) return true;
  ------------------
  |  Branch (5400:9): [True: 57, False: 11.2k]
  ------------------
 5401|       |    // In -blocksonly mode, peers need the 'relay' permission to send txs to us
 5402|  11.2k|    if (m_opts.ignore_incoming_txs && !peer.HasPermission(NetPermissionFlags::Relay)) return true;
  ------------------
  |  Branch (5402:9): [True: 0, False: 11.2k]
  |  Branch (5402:39): [True: 0, False: 0]
  ------------------
 5403|  11.2k|    return false;
 5404|  11.2k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl15AddAddressKnownERNS_4PeerERK8CAddress:
 1070|  72.6k|{
 1071|  72.6k|    assert(peer.m_addr_known);
 1072|  72.6k|    peer.m_addr_known->insert(addr.GetKey());
 1073|  72.6k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl12RelayAddressElRK8CAddressb:
 2148|     75|{
 2149|       |    // We choose the same nodes within a given 24h window (if the list of connected
 2150|       |    // nodes does not change) and we don't relay to nodes that already know an
 2151|       |    // address. So within 24h we will likely relay a given address once. This is to
 2152|       |    // prevent a peer from unjustly giving their address better propagation by sending
 2153|       |    // it to us repeatedly.
 2154|       |
 2155|     75|    if (!fReachable && !addr.IsRelayable()) return;
  ------------------
  |  Branch (2155:9): [True: 0, False: 75]
  |  Branch (2155:24): [True: 0, False: 0]
  ------------------
 2156|       |
 2157|       |    // Relay to a limited number of other nodes
 2158|       |    // Use deterministic randomness to send to the same nodes for 24 hours
 2159|       |    // at a time so the m_addr_knowns of the chosen nodes prevent repeats
 2160|     75|    const uint64_t hash_addr{CServiceHash(0, 0)(addr)};
 2161|     75|    const auto current_time{GetTime<std::chrono::seconds>()};
 2162|       |    // Adding address hash makes exact rotation time different per address, while preserving periodicity.
 2163|     75|    const uint64_t time_addr{(static_cast<uint64_t>(count_seconds(current_time)) + hash_addr) / count_seconds(ROTATE_ADDR_RELAY_DEST_INTERVAL)};
 2164|     75|    const CSipHasher hasher{m_connman.GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY)
 2165|     75|                                .Write(hash_addr)
 2166|     75|                                .Write(time_addr)};
 2167|       |
 2168|       |    // Relay reachable addresses to 2 peers. Unreachable addresses are relayed randomly to 1 or 2 peers.
 2169|     75|    unsigned int nRelayNodes = (fReachable || (hasher.Finalize() & 1)) ? 2 : 1;
  ------------------
  |  Branch (2169:33): [True: 75, False: 0]
  |  Branch (2169:47): [True: 0, False: 0]
  ------------------
 2170|       |
 2171|     75|    std::array<std::pair<uint64_t, Peer*>, 2> best{{{0, nullptr}, {0, nullptr}}};
 2172|     75|    assert(nRelayNodes <= best.size());
 2173|       |
 2174|     75|    LOCK(m_peer_mutex);
  ------------------
  |  |  257|     75|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     75|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     75|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     75|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2175|       |
 2176|     75|    for (auto& [id, peer] : m_peer_map) {
  ------------------
  |  Branch (2176:27): [True: 75, False: 75]
  ------------------
 2177|     75|        if (peer->m_addr_relay_enabled && id != originator && IsAddrCompatible(*peer, addr)) {
  ------------------
  |  Branch (2177:13): [True: 75, False: 0]
  |  Branch (2177:43): [True: 0, False: 75]
  |  Branch (2177:63): [True: 0, False: 0]
  ------------------
 2178|      0|            uint64_t hashKey = CSipHasher(hasher).Write(id).Finalize();
 2179|      0|            for (unsigned int i = 0; i < nRelayNodes; i++) {
  ------------------
  |  Branch (2179:38): [True: 0, False: 0]
  ------------------
 2180|      0|                 if (hashKey > best[i].first) {
  ------------------
  |  Branch (2180:22): [True: 0, False: 0]
  ------------------
 2181|      0|                     std::copy(best.begin() + i, best.begin() + nRelayNodes - 1, best.begin() + i + 1);
 2182|      0|                     best[i] = std::make_pair(hashKey, peer.get());
 2183|      0|                     break;
 2184|      0|                 }
 2185|      0|            }
 2186|      0|        }
 2187|     75|    };
 2188|       |
 2189|     75|    for (unsigned int i = 0; i < nRelayNodes && best[i].first != 0; i++) {
  ------------------
  |  Branch (2189:30): [True: 75, False: 0]
  |  Branch (2189:49): [True: 0, False: 75]
  ------------------
 2190|      0|        PushAddress(*best[i].second, addr);
 2191|      0|    }
 2192|     75|}
net_processing.cpp:_ZN12_GLOBAL__N_116IsAddrCompatibleERKNS_4PeerERK8CAddress:
 1065|  12.4k|{
 1066|  12.4k|    return peer.m_wants_addrv2 || addr.IsAddrV1Compatible();
  ------------------
  |  Branch (1066:12): [True: 0, False: 12.4k]
  |  Branch (1066:35): [True: 11.6k, False: 750]
  ------------------
 1067|  12.4k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl16AlreadyHaveBlockERK7uint256:
 2112|  2.19k|{
 2113|  2.19k|    return m_chainman.m_blockman.LookupBlockIndex(block_hash) != nullptr;
 2114|  2.19k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl23UpdateBlockAvailabilityElRK7uint256:
 1323|  2.61k|void PeerManagerImpl::UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) {
 1324|  2.61k|    CNodeState *state = State(nodeid);
 1325|  2.61k|    assert(state != nullptr);
 1326|       |
 1327|  2.61k|    ProcessBlockAvailability(nodeid);
 1328|       |
 1329|  2.61k|    const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(hash);
 1330|  2.61k|    if (pindex && pindex->nChainWork > 0) {
  ------------------
  |  Branch (1330:9): [True: 701, False: 1.91k]
  |  Branch (1330:9): [True: 701, False: 1.91k]
  |  Branch (1330:19): [True: 701, False: 0]
  ------------------
 1331|       |        // An actually better block was announced.
 1332|    701|        if (state->pindexBestKnownBlock == nullptr || pindex->nChainWork >= state->pindexBestKnownBlock->nChainWork) {
  ------------------
  |  Branch (1332:13): [True: 453, False: 248]
  |  Branch (1332:55): [True: 133, False: 115]
  ------------------
 1333|    586|            state->pindexBestKnownBlock = pindex;
 1334|    586|        }
 1335|  1.91k|    } else {
 1336|       |        // An unknown block was announced; just assume that the latest one is the best one.
 1337|  1.91k|        state->hashLastUnknownBlock = hash;
 1338|  1.91k|    }
 1339|  2.61k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl16IsBlockRequestedERK7uint256:
 1132|  2.03k|{
 1133|  2.03k|    return mapBlocksInFlight.count(hash);
 1134|  2.03k|}
net_processing.cpp:_ZN12_GLOBAL__N_110AddKnownTxERNS_4PeerERK7uint256:
 1091|   910k|{
 1092|   910k|    auto tx_relay = peer.GetTxRelay();
 1093|   910k|    if (!tx_relay) return;
  ------------------
  |  Branch (1093:9): [True: 127k, False: 783k]
  ------------------
 1094|       |
 1095|   783k|    LOCK(tx_relay->m_tx_inventory_mutex);
  ------------------
  |  |  257|   783k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   783k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   783k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   783k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1096|   783k|    tx_relay->m_tx_inventory_known_filter.insert(hash);
 1097|   783k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl19MaybeSendGetHeadersER5CNodeRK13CBlockLocatorRNS_4PeerE:
 2682|  4.05k|{
 2683|  4.05k|    const auto current_time = NodeClock::now();
 2684|       |
 2685|       |    // Only allow a new getheaders message to go out if we don't have a recent
 2686|       |    // one already in-flight
 2687|  4.05k|    if (current_time - peer.m_last_getheaders_timestamp > HEADERS_RESPONSE_TIME) {
  ------------------
  |  Branch (2687:9): [True: 3.80k, False: 247]
  ------------------
 2688|  3.80k|        MakeAndPushMessage(pfrom, NetMsgType::GETHEADERS, locator, uint256());
 2689|  3.80k|        peer.m_last_getheaders_timestamp = current_time;
 2690|  3.80k|        return true;
 2691|  3.80k|    }
 2692|    247|    return false;
 2693|  4.05k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRK13CBlockLocator7uint256EEEvR5CNodeNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEDpOT_:
  690|  3.80k|    {
  691|  3.80k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  3.80k|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl14ProcessGetDataER5CNodeRNS_4PeerERKNSt3__16atomicIbEE:
 2384|   430k|{
 2385|   430k|    AssertLockNotHeld(cs_main);
  ------------------
  |  |  147|   430k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2386|       |
 2387|   430k|    auto tx_relay = peer.GetTxRelay();
 2388|       |
 2389|   430k|    std::deque<CInv>::iterator it = peer.m_getdata_requests.begin();
 2390|   430k|    std::vector<CInv> vNotFound;
 2391|       |
 2392|       |    // Process as many TX items from the front of the getdata queue as
 2393|       |    // possible, since they're common and it's efficient to batch process
 2394|       |    // them.
 2395|   475k|    while (it != peer.m_getdata_requests.end() && it->IsGenTxMsg()) {
  ------------------
  |  Branch (2395:12): [True: 475k, False: 47]
  |  Branch (2395:12): [True: 44.6k, False: 430k]
  |  Branch (2395:51): [True: 44.6k, False: 430k]
  ------------------
 2396|  44.6k|        if (interruptMsgProc) return;
  ------------------
  |  Branch (2396:13): [True: 0, False: 44.6k]
  ------------------
 2397|       |        // The send buffer provides backpressure. If there's no space in
 2398|       |        // the buffer, pause processing until the next call.
 2399|  44.6k|        if (pfrom.fPauseSend) break;
  ------------------
  |  Branch (2399:13): [True: 0, False: 44.6k]
  ------------------
 2400|       |
 2401|  44.6k|        const CInv &inv = *it++;
 2402|       |
 2403|  44.6k|        if (tx_relay == nullptr) {
  ------------------
  |  Branch (2403:13): [True: 477, False: 44.1k]
  ------------------
 2404|       |            // Ignore GETDATA requests for transactions from block-relay-only
 2405|       |            // peers and peers that asked us not to announce transactions.
 2406|    477|            continue;
 2407|    477|        }
 2408|       |
 2409|  44.1k|        CTransactionRef tx = FindTxForGetData(*tx_relay, ToGenTxid(inv));
 2410|  44.1k|        if (tx) {
  ------------------
  |  Branch (2410:13): [True: 0, False: 44.1k]
  ------------------
 2411|       |            // WTX and WITNESS_TX imply we serialize with witness
 2412|      0|            const auto maybe_with_witness = (inv.IsMsgTx() ? TX_NO_WITNESS : TX_WITH_WITNESS);
  ------------------
  |  Branch (2412:46): [True: 0, False: 0]
  ------------------
 2413|      0|            MakeAndPushMessage(pfrom, NetMsgType::TX, maybe_with_witness(*tx));
 2414|      0|            m_mempool.RemoveUnbroadcastTx(tx->GetHash());
 2415|  44.1k|        } else {
 2416|  44.1k|            vNotFound.push_back(inv);
 2417|  44.1k|        }
 2418|  44.1k|    }
 2419|       |
 2420|       |    // Only process one BLOCK item per call, since they're uncommon and can be
 2421|       |    // expensive to process.
 2422|   430k|    if (it != peer.m_getdata_requests.end() && !pfrom.fPauseSend) {
  ------------------
  |  Branch (2422:9): [True: 430k, False: 47]
  |  Branch (2422:9): [True: 430k, False: 47]
  |  Branch (2422:48): [True: 430k, False: 0]
  ------------------
 2423|   430k|        const CInv &inv = *it++;
 2424|   430k|        if (inv.IsGenBlkMsg()) {
  ------------------
  |  Branch (2424:13): [True: 8.87k, False: 421k]
  ------------------
 2425|  8.87k|            ProcessGetBlockData(pfrom, peer, inv);
 2426|  8.87k|        }
 2427|       |        // else: If the first item on the queue is an unknown type, we erase it
 2428|       |        // and continue processing the queue on the next call.
 2429|   430k|    }
 2430|       |
 2431|   430k|    peer.m_getdata_requests.erase(peer.m_getdata_requests.begin(), it);
 2432|       |
 2433|   430k|    if (!vNotFound.empty()) {
  ------------------
  |  Branch (2433:9): [True: 13.5k, False: 416k]
  ------------------
 2434|       |        // Let the peer know that we didn't find what it asked for, so it doesn't
 2435|       |        // have to wait around forever.
 2436|       |        // SPV clients care about this message: it's needed when they are
 2437|       |        // recursively walking the dependencies of relevant unconfirmed
 2438|       |        // transactions. SPV clients want to do that because they want to know
 2439|       |        // about (and store and rebroadcast and risk analyze) the dependencies
 2440|       |        // of transactions relevant to them, without having to download the
 2441|       |        // entire memory pool.
 2442|       |        // Also, other nodes can use these messages to automatically request a
 2443|       |        // transaction from some other peer that announced it, and stop
 2444|       |        // waiting for us to respond.
 2445|       |        // In normal operation, we often send NOTFOUND messages for parents of
 2446|       |        // transactions that we relay; if a peer is missing a parent, they may
 2447|       |        // assume we have them and request the parents from us.
 2448|  13.5k|        MakeAndPushMessage(pfrom, NetMsgType::NOTFOUND, vNotFound);
 2449|  13.5k|    }
 2450|   430k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl16FindTxForGetDataERKNS_4Peer7TxRelayERK7GenTxid:
 2364|  44.1k|{
 2365|       |    // If a tx was in the mempool prior to the last INV for this peer, permit the request.
 2366|  44.1k|    auto txinfo = m_mempool.info_for_relay(gtxid, tx_relay.m_last_inv_sequence);
 2367|  44.1k|    if (txinfo.tx) {
  ------------------
  |  Branch (2367:9): [True: 0, False: 44.1k]
  ------------------
 2368|      0|        return std::move(txinfo.tx);
 2369|      0|    }
 2370|       |
 2371|       |    // Or it might be from the most recent block
 2372|  44.1k|    {
 2373|  44.1k|        LOCK(m_most_recent_block_mutex);
  ------------------
  |  |  257|  44.1k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  44.1k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  44.1k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  44.1k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2374|  44.1k|        if (m_most_recent_block_txs != nullptr) {
  ------------------
  |  Branch (2374:13): [True: 0, False: 44.1k]
  ------------------
 2375|      0|            auto it = m_most_recent_block_txs->find(gtxid.GetHash());
 2376|      0|            if (it != m_most_recent_block_txs->end()) return it->second;
  ------------------
  |  Branch (2376:17): [True: 0, False: 0]
  ------------------
 2377|      0|        }
 2378|  44.1k|    }
 2379|       |
 2380|  44.1k|    return {};
 2381|  44.1k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl19ProcessGetBlockDataER5CNodeRNS_4PeerERK4CInv:
 2195|  8.87k|{
 2196|  8.87k|    std::shared_ptr<const CBlock> a_recent_block;
 2197|  8.87k|    std::shared_ptr<const CBlockHeaderAndShortTxIDs> a_recent_compact_block;
 2198|  8.87k|    {
 2199|  8.87k|        LOCK(m_most_recent_block_mutex);
  ------------------
  |  |  257|  8.87k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.87k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.87k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.87k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2200|  8.87k|        a_recent_block = m_most_recent_block;
 2201|  8.87k|        a_recent_compact_block = m_most_recent_compact_block;
 2202|  8.87k|    }
 2203|       |
 2204|  8.87k|    bool need_activate_chain = false;
 2205|  8.87k|    {
 2206|  8.87k|        LOCK(cs_main);
  ------------------
  |  |  257|  8.87k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.87k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.87k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.87k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2207|  8.87k|        const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(inv.hash);
 2208|  8.87k|        if (pindex) {
  ------------------
  |  Branch (2208:13): [True: 1.57k, False: 7.30k]
  ------------------
 2209|  1.57k|            if (pindex->HaveNumChainTxs() && !pindex->IsValid(BLOCK_VALID_SCRIPTS) &&
  ------------------
  |  Branch (2209:17): [True: 1.57k, False: 1]
  |  Branch (2209:46): [True: 1.50k, False: 73]
  ------------------
 2210|  1.57k|                    pindex->IsValid(BLOCK_VALID_TREE)) {
  ------------------
  |  Branch (2210:21): [True: 1.50k, False: 0]
  ------------------
 2211|       |                // If we have the block and all of its parents, but have not yet validated it,
 2212|       |                // we might be in the middle of connecting it (ie in the unlock of cs_main
 2213|       |                // before ActivateBestChain but after AcceptBlock).
 2214|       |                // In this case, we need to run ActivateBestChain prior to checking the relay
 2215|       |                // conditions below.
 2216|  1.50k|                need_activate_chain = true;
 2217|  1.50k|            }
 2218|  1.57k|        }
 2219|  8.87k|    } // release cs_main before calling ActivateBestChain
 2220|  8.87k|    if (need_activate_chain) {
  ------------------
  |  Branch (2220:9): [True: 1.50k, False: 7.37k]
  ------------------
 2221|  1.50k|        BlockValidationState state;
 2222|  1.50k|        if (!m_chainman.ActiveChainstate().ActivateBestChain(state, a_recent_block)) {
  ------------------
  |  Branch (2222:13): [True: 0, False: 1.50k]
  ------------------
 2223|      0|            LogDebug(BCLog::NET, "failed to activate chain (%s)\n", state.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2224|      0|        }
 2225|  1.50k|    }
 2226|       |
 2227|  8.87k|    const CBlockIndex* pindex{nullptr};
 2228|  8.87k|    const CBlockIndex* tip{nullptr};
 2229|  8.87k|    bool can_direct_fetch{false};
 2230|  8.87k|    FlatFilePos block_pos{};
 2231|  8.87k|    {
 2232|  8.87k|        LOCK(cs_main);
  ------------------
  |  |  257|  8.87k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.87k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.87k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.87k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|  8.87k|        pindex = m_chainman.m_blockman.LookupBlockIndex(inv.hash);
 2234|  8.87k|        if (!pindex) {
  ------------------
  |  Branch (2234:13): [True: 7.30k, False: 1.57k]
  ------------------
 2235|  7.30k|            return;
 2236|  7.30k|        }
 2237|  1.57k|        if (!BlockRequestAllowed(pindex)) {
  ------------------
  |  Branch (2237:13): [True: 1, False: 1.57k]
  ------------------
 2238|      1|            LogDebug(BCLog::NET, "%s: ignoring request from peer=%i for old block that isn't in the main chain\n", __func__, pfrom.GetId());
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|      1|            return;
 2240|      1|        }
 2241|       |        // disconnect node in case we have reached the outbound limit for serving historical blocks
 2242|  1.57k|        if (m_connman.OutboundTargetReached(true) &&
  ------------------
  |  Branch (2242:13): [True: 0, False: 1.57k]
  ------------------
 2243|  1.57k|            (((m_chainman.m_best_header != nullptr) && (m_chainman.m_best_header->GetBlockTime() - pindex->GetBlockTime() > HISTORICAL_BLOCK_AGE)) || inv.IsMsgFilteredBlk()) &&
  ------------------
  |  Branch (2243:15): [True: 0, False: 0]
  |  Branch (2243:56): [True: 0, False: 0]
  |  Branch (2243:151): [True: 0, False: 0]
  ------------------
 2244|  1.57k|            !pfrom.HasPermission(NetPermissionFlags::Download) // nodes with the download permission may exceed target
  ------------------
  |  Branch (2244:13): [True: 0, False: 0]
  ------------------
 2245|  1.57k|        ) {
 2246|      0|            LogDebug(BCLog::NET, "historical block serving limit reached, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2247|      0|            pfrom.fDisconnect = true;
 2248|      0|            return;
 2249|      0|        }
 2250|  1.57k|        tip = m_chainman.ActiveChain().Tip();
 2251|       |        // Avoid leaking prune-height by never sending blocks below the NODE_NETWORK_LIMITED threshold
 2252|  1.57k|        if (!pfrom.HasPermission(NetPermissionFlags::NoBan) && (
  ------------------
  |  Branch (2252:13): [True: 1.46k, False: 109]
  ------------------
 2253|  1.46k|                (((peer.m_our_services & NODE_NETWORK_LIMITED) == NODE_NETWORK_LIMITED) && ((peer.m_our_services & NODE_NETWORK) != NODE_NETWORK) && (tip->nHeight - pindex->nHeight > (int)NODE_NETWORK_LIMITED_MIN_BLOCKS + 2 /* add two blocks buffer extension for possible races */) )
  ------------------
  |  Branch (2253:18): [True: 1.27k, False: 198]
  |  Branch (2253:92): [True: 1.08k, False: 184]
  |  Branch (2253:150): [True: 0, False: 1.08k]
  ------------------
 2254|  1.46k|           )) {
 2255|      0|            LogDebug(BCLog::NET, "Ignore block request below NODE_NETWORK_LIMITED threshold, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2256|       |            //disconnect node and prevent it from stalling (would otherwise wait for the missing block)
 2257|      0|            pfrom.fDisconnect = true;
 2258|      0|            return;
 2259|      0|        }
 2260|       |        // Pruned nodes may have deleted the block, so check whether
 2261|       |        // it's available before trying to send.
 2262|  1.57k|        if (!(pindex->nStatus & BLOCK_HAVE_DATA)) {
  ------------------
  |  Branch (2262:13): [True: 0, False: 1.57k]
  ------------------
 2263|      0|            return;
 2264|      0|        }
 2265|  1.57k|        can_direct_fetch = CanDirectFetch();
 2266|  1.57k|        block_pos = pindex->GetBlockPos();
 2267|  1.57k|    }
 2268|       |
 2269|      0|    std::shared_ptr<const CBlock> pblock;
 2270|  1.57k|    if (a_recent_block && a_recent_block->GetHash() == pindex->GetBlockHash()) {
  ------------------
  |  Branch (2270:9): [True: 0, False: 1.57k]
  |  Branch (2270:9): [True: 0, False: 1.57k]
  |  Branch (2270:27): [True: 0, False: 0]
  ------------------
 2271|      0|        pblock = a_recent_block;
 2272|  1.57k|    } else if (inv.IsMsgWitnessBlk()) {
  ------------------
  |  Branch (2272:16): [True: 62, False: 1.51k]
  ------------------
 2273|       |        // Fast-path: in this case it is possible to serve the block directly from disk,
 2274|       |        // as the network format matches the format on disk
 2275|     62|        std::vector<uint8_t> block_data;
 2276|     62|        if (!m_chainman.m_blockman.ReadRawBlock(block_data, block_pos)) {
  ------------------
  |  Branch (2276:13): [True: 0, False: 62]
  ------------------
 2277|      0|            if (WITH_LOCK(m_chainman.GetMutex(), return m_chainman.m_blockman.IsBlockPruned(*pindex))) {
  ------------------
  |  |  301|      0|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  |  |  ------------------
  |  |  |  Branch (301:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2278|      0|                LogDebug(BCLog::NET, "Block was pruned before it could be read, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2279|      0|            } else {
 2280|      0|                LogError("Cannot load block from disk, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 2281|      0|            }
 2282|      0|            pfrom.fDisconnect = true;
 2283|      0|            return;
 2284|      0|        }
 2285|     62|        MakeAndPushMessage(pfrom, NetMsgType::BLOCK, Span{block_data});
 2286|       |        // Don't set pblock as we've sent the block
 2287|  1.51k|    } else {
 2288|       |        // Send block from disk
 2289|  1.51k|        std::shared_ptr<CBlock> pblockRead = std::make_shared<CBlock>();
 2290|  1.51k|        if (!m_chainman.m_blockman.ReadBlock(*pblockRead, block_pos)) {
  ------------------
  |  Branch (2290:13): [True: 0, False: 1.51k]
  ------------------
 2291|      0|            if (WITH_LOCK(m_chainman.GetMutex(), return m_chainman.m_blockman.IsBlockPruned(*pindex))) {
  ------------------
  |  |  301|      0|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  |  |  ------------------
  |  |  |  Branch (301:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2292|      0|                LogDebug(BCLog::NET, "Block was pruned before it could be read, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2293|      0|            } else {
 2294|      0|                LogError("Cannot load block from disk, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 2295|      0|            }
 2296|      0|            pfrom.fDisconnect = true;
 2297|      0|            return;
 2298|      0|        }
 2299|  1.51k|        pblock = pblockRead;
 2300|  1.51k|    }
 2301|  1.57k|    if (pblock) {
  ------------------
  |  Branch (2301:9): [True: 1.51k, False: 62]
  ------------------
 2302|  1.51k|        if (inv.IsMsgBlk()) {
  ------------------
  |  Branch (2302:13): [True: 1.43k, False: 83]
  ------------------
 2303|  1.43k|            MakeAndPushMessage(pfrom, NetMsgType::BLOCK, TX_NO_WITNESS(*pblock));
 2304|  1.43k|        } else if (inv.IsMsgWitnessBlk()) {
  ------------------
  |  Branch (2304:20): [True: 0, False: 83]
  ------------------
 2305|      0|            MakeAndPushMessage(pfrom, NetMsgType::BLOCK, TX_WITH_WITNESS(*pblock));
 2306|     83|        } else if (inv.IsMsgFilteredBlk()) {
  ------------------
  |  Branch (2306:20): [True: 27, False: 56]
  ------------------
 2307|     27|            bool sendMerkleBlock = false;
 2308|     27|            CMerkleBlock merkleBlock;
 2309|     27|            if (auto tx_relay = peer.GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (2309:52): [True: 13, False: 14]
  ------------------
 2310|     13|                LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|     13|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     13|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     13|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     13|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2311|     13|                if (tx_relay->m_bloom_filter) {
  ------------------
  |  Branch (2311:21): [True: 0, False: 13]
  ------------------
 2312|      0|                    sendMerkleBlock = true;
 2313|      0|                    merkleBlock = CMerkleBlock(*pblock, *tx_relay->m_bloom_filter);
 2314|      0|                }
 2315|     13|            }
 2316|     27|            if (sendMerkleBlock) {
  ------------------
  |  Branch (2316:17): [True: 0, False: 27]
  ------------------
 2317|      0|                MakeAndPushMessage(pfrom, NetMsgType::MERKLEBLOCK, merkleBlock);
 2318|       |                // CMerkleBlock just contains hashes, so also push any transactions in the block the client did not see
 2319|       |                // This avoids hurting performance by pointlessly requiring a round-trip
 2320|       |                // Note that there is currently no way for a node to request any single transactions we didn't send here -
 2321|       |                // they must either disconnect and retry or request the full block.
 2322|       |                // Thus, the protocol spec specified allows for us to provide duplicate txn here,
 2323|       |                // however we MUST always provide at least what the remote peer needs
 2324|      0|                typedef std::pair<unsigned int, uint256> PairType;
 2325|      0|                for (PairType& pair : merkleBlock.vMatchedTxn)
  ------------------
  |  Branch (2325:37): [True: 0, False: 0]
  ------------------
 2326|      0|                    MakeAndPushMessage(pfrom, NetMsgType::TX, TX_NO_WITNESS(*pblock->vtx[pair.first]));
 2327|      0|            }
 2328|       |            // else
 2329|       |            // no response
 2330|     56|        } else if (inv.IsMsgCmpctBlk()) {
  ------------------
  |  Branch (2330:20): [True: 56, False: 0]
  ------------------
 2331|       |            // If a peer is asking for old blocks, we're almost guaranteed
 2332|       |            // they won't have a useful mempool to match against a compact block,
 2333|       |            // and we don't feel like constructing the object for them, so
 2334|       |            // instead we respond with the full, non-compact block.
 2335|     56|            if (can_direct_fetch && pindex->nHeight >= tip->nHeight - MAX_CMPCTBLOCK_DEPTH) {
  ------------------
  |  Branch (2335:17): [True: 43, False: 13]
  |  Branch (2335:37): [True: 10, False: 33]
  ------------------
 2336|     10|                if (a_recent_compact_block && a_recent_compact_block->header.GetHash() == pindex->GetBlockHash()) {
  ------------------
  |  Branch (2336:21): [True: 0, False: 10]
  |  Branch (2336:21): [True: 0, False: 10]
  |  Branch (2336:47): [True: 0, False: 0]
  ------------------
 2337|      0|                    MakeAndPushMessage(pfrom, NetMsgType::CMPCTBLOCK, *a_recent_compact_block);
 2338|     10|                } else {
 2339|     10|                    CBlockHeaderAndShortTxIDs cmpctblock{*pblock, m_rng.rand64()};
 2340|     10|                    MakeAndPushMessage(pfrom, NetMsgType::CMPCTBLOCK, cmpctblock);
 2341|     10|                }
 2342|     46|            } else {
 2343|     46|                MakeAndPushMessage(pfrom, NetMsgType::BLOCK, TX_WITH_WITNESS(*pblock));
 2344|     46|            }
 2345|     56|        }
 2346|  1.51k|    }
 2347|       |
 2348|  1.57k|    {
 2349|  1.57k|        LOCK(peer.m_block_inv_mutex);
  ------------------
  |  |  257|  1.57k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.57k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.57k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.57k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2350|       |        // Trigger the peer node to send a getblocks request for the next batch of inventory
 2351|  1.57k|        if (inv.hash == peer.m_continuation_block) {
  ------------------
  |  Branch (2351:13): [True: 0, False: 1.57k]
  ------------------
 2352|       |            // Send immediately. This must send even if redundant,
 2353|       |            // and we want it right after the last block so they don't
 2354|       |            // wait for other stuff first.
 2355|      0|            std::vector<CInv> vInv;
 2356|      0|            vInv.emplace_back(MSG_BLOCK, tip->GetBlockHash());
 2357|      0|            MakeAndPushMessage(pfrom, NetMsgType::INV, vInv);
 2358|      0|            peer.m_continuation_block.SetNull();
 2359|      0|        }
 2360|  1.57k|    }
 2361|  1.57k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJ4SpanIhEEEEvR5CNodeNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
  690|     62|    {
  691|     62|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|     62|    }
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJ13ParamsWrapperI20TransactionSerParamsK6CBlockEEEEvR5CNodeNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEEDpOT_:
  690|  1.47k|    {
  691|  1.47k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  1.47k|    }
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJR25CBlockHeaderAndShortTxIDsEEEvR5CNodeNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
  690|     10|    {
  691|     10|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|     10|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl21SendBlockTransactionsER5CNodeRNS_4PeerERK6CBlockRK24BlockTransactionsRequest:
 2462|     15|{
 2463|     15|    BlockTransactions resp(req);
 2464|     19|    for (size_t i = 0; i < req.indexes.size(); i++) {
  ------------------
  |  Branch (2464:24): [True: 17, False: 2]
  ------------------
 2465|     17|        if (req.indexes[i] >= block.vtx.size()) {
  ------------------
  |  Branch (2465:13): [True: 13, False: 4]
  ------------------
 2466|     13|            Misbehaving(peer, "getblocktxn with out-of-bounds tx indices");
 2467|     13|            return;
 2468|     13|        }
 2469|      4|        resp.txn[i] = block.vtx[req.indexes[i]];
 2470|      4|    }
 2471|       |
 2472|      2|    MakeAndPushMessage(pfrom, NetMsgType::BLOCKTXN, resp);
 2473|      2|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJR17BlockTransactionsEEEvR5CNodeNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
  690|      2|    {
  691|      2|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|      2|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl19BlockRequestAllowedEPK11CBlockIndex:
 1835|  1.59k|{
 1836|  1.59k|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|  1.59k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1837|  1.59k|    if (m_chainman.ActiveChain().Contains(pindex)) return true;
  ------------------
  |  Branch (1837:9): [True: 1.59k, False: 1]
  ------------------
 1838|      1|    return pindex->IsValid(BLOCK_VALID_SCRIPTS) && (m_chainman.m_best_header != nullptr) &&
  ------------------
  |  Branch (1838:12): [True: 0, False: 1]
  |  Branch (1838:52): [True: 0, False: 0]
  ------------------
 1839|      1|           (m_chainman.m_best_header->GetBlockTime() - pindex->GetBlockTime() < STALE_RELAY_AGE_LIMIT) &&
  ------------------
  |  Branch (1839:12): [True: 0, False: 0]
  ------------------
 1840|      1|           (GetBlockProofEquivalentTime(*m_chainman.m_best_header, *pindex, *m_chainman.m_best_header, m_chainparams.GetConsensus()) < STALE_RELAY_AGE_LIMIT);
  ------------------
  |  Branch (1840:12): [True: 0, False: 0]
  ------------------
 1841|  1.59k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJ13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS4_9allocatorIS6_EEEEEEEEvR5CNodeNS4_12basic_stringIcNS4_11char_traitsIcEENS7_IcEEEEDpOT_:
  690|     45|    {
  691|     45|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|     45|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl29AddToCompactExtraTransactionsERKNSt3__110shared_ptrIK12CTransactionEE:
 1740|  1.32k|{
 1741|  1.32k|    if (m_opts.max_extra_txs <= 0)
  ------------------
  |  Branch (1741:9): [True: 0, False: 1.32k]
  ------------------
 1742|      0|        return;
 1743|  1.32k|    if (!vExtraTxnForCompact.size())
  ------------------
  |  Branch (1743:9): [True: 1, False: 1.32k]
  ------------------
 1744|      1|        vExtraTxnForCompact.resize(m_opts.max_extra_txs);
 1745|  1.32k|    vExtraTxnForCompact[vExtraTxnForCompactIt] = tx;
 1746|  1.32k|    vExtraTxnForCompactIt = (vExtraTxnForCompactIt + 1) % m_opts.max_extra_txs;
 1747|  1.32k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl16ProcessInvalidTxElRKNSt3__110shared_ptrIK12CTransactionEERK17TxValidationStateb:
 2968|  1.36k|{
 2969|  1.36k|    AssertLockNotHeld(m_peer_mutex);
  ------------------
  |  |  147|  1.36k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2970|  1.36k|    AssertLockHeld(g_msgproc_mutex);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2971|  1.36k|    AssertLockHeld(m_tx_download_mutex);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2972|       |
 2973|  1.36k|    PeerRef peer{GetPeerRef(nodeid)};
 2974|       |
 2975|  1.36k|    LogDebug(BCLog::MEMPOOLREJ, "%s (wtxid=%s) from peer=%d was not accepted: %s\n",
  ------------------
  |  |  280|  1.36k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  1.36k|    do {                                                  \
  |  |  |  |  274|  1.36k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1.36k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  1.36k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2976|  1.36k|        ptx->GetHash().ToString(),
 2977|  1.36k|        ptx->GetWitnessHash().ToString(),
 2978|  1.36k|        nodeid,
 2979|  1.36k|        state.ToString());
 2980|       |
 2981|  1.36k|    const auto& [add_extra_compact_tx, unique_parents, package_to_validate] = m_txdownloadman.MempoolRejectedTx(ptx, state, nodeid, first_time_failure);
 2982|       |
 2983|  1.36k|    if (add_extra_compact_tx && RecursiveDynamicUsage(*ptx) < 100000) {
  ------------------
  |  Branch (2983:9): [True: 1.36k, False: 0]
  |  Branch (2983:33): [True: 1.32k, False: 33]
  ------------------
 2984|  1.32k|        AddToCompactExtraTransactions(ptx);
 2985|  1.32k|    }
 2986|  2.83k|    for (const Txid& parent_txid : unique_parents) {
  ------------------
  |  Branch (2986:34): [True: 2.83k, False: 1.36k]
  ------------------
 2987|  2.83k|        if (peer) AddKnownTx(*peer, parent_txid);
  ------------------
  |  Branch (2987:13): [True: 2.83k, False: 0]
  ------------------
 2988|  2.83k|    }
 2989|       |
 2990|  1.36k|    MaybePunishNodeForTx(nodeid, state);
 2991|       |
 2992|  1.36k|    return package_to_validate;
 2993|  1.36k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl20MaybePunishNodeForTxElRK17TxValidationState:
 1809|  1.36k|{
 1810|  1.36k|    PeerRef peer{GetPeerRef(nodeid)};
 1811|  1.36k|    switch (state.GetResult()) {
  ------------------
  |  Branch (1811:13): [True: 0, False: 1.36k]
  ------------------
 1812|      0|    case TxValidationResult::TX_RESULT_UNSET:
  ------------------
  |  Branch (1812:5): [True: 0, False: 1.36k]
  ------------------
 1813|      0|        break;
 1814|       |    // The node is providing invalid data:
 1815|    266|    case TxValidationResult::TX_CONSENSUS:
  ------------------
  |  Branch (1815:5): [True: 266, False: 1.09k]
  ------------------
 1816|    266|        if (peer) Misbehaving(*peer, "");
  ------------------
  |  Branch (1816:13): [True: 266, False: 0]
  ------------------
 1817|    266|        return;
 1818|       |    // Conflicting (but not necessarily invalid) data or different policy:
 1819|     23|    case TxValidationResult::TX_INPUTS_NOT_STANDARD:
  ------------------
  |  Branch (1819:5): [True: 23, False: 1.33k]
  ------------------
 1820|    459|    case TxValidationResult::TX_NOT_STANDARD:
  ------------------
  |  Branch (1820:5): [True: 436, False: 925]
  ------------------
 1821|  1.01k|    case TxValidationResult::TX_MISSING_INPUTS:
  ------------------
  |  Branch (1821:5): [True: 552, False: 809]
  ------------------
 1822|  1.09k|    case TxValidationResult::TX_PREMATURE_SPEND:
  ------------------
  |  Branch (1822:5): [True: 84, False: 1.27k]
  ------------------
 1823|  1.09k|    case TxValidationResult::TX_WITNESS_MUTATED:
  ------------------
  |  Branch (1823:5): [True: 0, False: 1.36k]
  ------------------
 1824|  1.09k|    case TxValidationResult::TX_WITNESS_STRIPPED:
  ------------------
  |  Branch (1824:5): [True: 0, False: 1.36k]
  ------------------
 1825|  1.09k|    case TxValidationResult::TX_CONFLICT:
  ------------------
  |  Branch (1825:5): [True: 0, False: 1.36k]
  ------------------
 1826|  1.09k|    case TxValidationResult::TX_MEMPOOL_POLICY:
  ------------------
  |  Branch (1826:5): [True: 0, False: 1.36k]
  ------------------
 1827|  1.09k|    case TxValidationResult::TX_NO_MEMPOOL:
  ------------------
  |  Branch (1827:5): [True: 0, False: 1.36k]
  ------------------
 1828|  1.09k|    case TxValidationResult::TX_RECONSIDERABLE:
  ------------------
  |  Branch (1828:5): [True: 0, False: 1.36k]
  ------------------
 1829|  1.09k|    case TxValidationResult::TX_UNKNOWN:
  ------------------
  |  Branch (1829:5): [True: 0, False: 1.36k]
  ------------------
 1830|  1.09k|        break;
 1831|  1.36k|    }
 1832|  1.36k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl23GetAntiDoSWorkThresholdEv:
 2492|    616|{
 2493|    616|    arith_uint256 near_chaintip_work = 0;
 2494|    616|    LOCK(cs_main);
  ------------------
  |  |  257|    616|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    616|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    616|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    616|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2495|    616|    if (m_chainman.ActiveChain().Tip() != nullptr) {
  ------------------
  |  Branch (2495:9): [True: 616, False: 0]
  ------------------
 2496|    616|        const CBlockIndex *tip = m_chainman.ActiveChain().Tip();
 2497|       |        // Use a 144 block buffer, so that we'll accept headers that fork from
 2498|       |        // near our tip.
 2499|    616|        near_chaintip_work = tip->nChainWork - std::min<arith_uint256>(144*GetBlockProof(*tip), tip->nChainWork);
 2500|    616|    }
 2501|    616|    return std::max(near_chaintip_work, m_chainman.MinimumChainWork());
 2502|    616|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl13GetFetchFlagsERKNS_4PeerE:
 2453|   841k|{
 2454|   841k|    uint32_t nFetchFlags = 0;
 2455|   841k|    if (CanServeWitnesses(peer)) {
  ------------------
  |  Branch (2455:9): [True: 23.4k, False: 818k]
  ------------------
 2456|  23.4k|        nFetchFlags |= MSG_WITNESS_FLAG;
 2457|  23.4k|    }
 2458|   841k|    return nFetchFlags;
 2459|   841k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJR24BlockTransactionsRequestEEEvR5CNodeNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
  690|     71|    {
  691|     71|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|     71|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl23ProcessCompactBlockTxnsER5CNodeRNS_4PeerERK17BlockTransactions:
 3289|      7|{
 3290|      7|    std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();
 3291|      7|    bool fBlockRead{false};
 3292|      7|    {
 3293|      7|        LOCK(cs_main);
  ------------------
  |  |  257|      7|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      7|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      7|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      7|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3294|       |
 3295|      7|        auto range_flight = mapBlocksInFlight.equal_range(block_transactions.blockhash);
 3296|      7|        size_t already_in_flight = std::distance(range_flight.first, range_flight.second);
 3297|      7|        bool requested_block_from_this_peer{false};
 3298|       |
 3299|       |        // Multimap ensures ordering of outstanding requests. It's either empty or first in line.
 3300|      7|        bool first_in_flight = already_in_flight == 0 || (range_flight.first->second.first == pfrom.GetId());
  ------------------
  |  Branch (3300:32): [True: 7, False: 0]
  |  Branch (3300:58): [True: 0, False: 0]
  ------------------
 3301|       |
 3302|      7|        while (range_flight.first != range_flight.second) {
  ------------------
  |  Branch (3302:16): [True: 0, False: 7]
  ------------------
 3303|      0|            auto [node_id, block_it] = range_flight.first->second;
 3304|      0|            if (node_id == pfrom.GetId() && block_it->partialBlock) {
  ------------------
  |  Branch (3304:17): [True: 0, False: 0]
  |  Branch (3304:45): [True: 0, False: 0]
  ------------------
 3305|      0|                requested_block_from_this_peer = true;
 3306|      0|                break;
 3307|      0|            }
 3308|      0|            range_flight.first++;
 3309|      0|        }
 3310|       |
 3311|      7|        if (!requested_block_from_this_peer) {
  ------------------
  |  Branch (3311:13): [True: 7, False: 0]
  ------------------
 3312|      7|            LogDebug(BCLog::NET, "Peer %d sent us block transactions for block we weren't expecting\n", pfrom.GetId());
  ------------------
  |  |  280|      7|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      7|    do {                                                  \
  |  |  |  |  274|      7|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3313|      7|            return;
 3314|      7|        }
 3315|       |
 3316|      0|        PartiallyDownloadedBlock& partialBlock = *range_flight.first->second.second->partialBlock;
 3317|      0|        ReadStatus status = partialBlock.FillBlock(*pblock, block_transactions.txn);
 3318|      0|        if (status == READ_STATUS_INVALID) {
  ------------------
  |  Branch (3318:13): [True: 0, False: 0]
  ------------------
 3319|      0|            RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId()); // Reset in-flight state in case Misbehaving does not result in a disconnect
 3320|      0|            Misbehaving(peer, "invalid compact block/non-matching block transactions");
 3321|      0|            return;
 3322|      0|        } else if (status == READ_STATUS_FAILED) {
  ------------------
  |  Branch (3322:20): [True: 0, False: 0]
  ------------------
 3323|      0|            if (first_in_flight) {
  ------------------
  |  Branch (3323:17): [True: 0, False: 0]
  ------------------
 3324|       |                // Might have collided, fall back to getdata now :(
 3325|      0|                std::vector<CInv> invs;
 3326|      0|                invs.emplace_back(MSG_BLOCK | GetFetchFlags(peer), block_transactions.blockhash);
 3327|      0|                MakeAndPushMessage(pfrom, NetMsgType::GETDATA, invs);
 3328|      0|            } else {
 3329|      0|                RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId());
 3330|      0|                LogDebug(BCLog::NET, "Peer %d sent us a compact block but it failed to reconstruct, waiting on first download to complete\n", pfrom.GetId());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3331|      0|                return;
 3332|      0|            }
 3333|      0|        } else {
 3334|       |            // Block is either okay, or possibly we received
 3335|       |            // READ_STATUS_CHECKBLOCK_FAILED.
 3336|       |            // Note that CheckBlock can only fail for one of a few reasons:
 3337|       |            // 1. bad-proof-of-work (impossible here, because we've already
 3338|       |            //    accepted the header)
 3339|       |            // 2. merkleroot doesn't match the transactions given (already
 3340|       |            //    caught in FillBlock with READ_STATUS_FAILED, so
 3341|       |            //    impossible here)
 3342|       |            // 3. the block is otherwise invalid (eg invalid coinbase,
 3343|       |            //    block is too big, too many legacy sigops, etc).
 3344|       |            // So if CheckBlock failed, #3 is the only possibility.
 3345|       |            // Under BIP 152, we don't discourage the peer unless proof of work is
 3346|       |            // invalid (we don't require all the stateless checks to have
 3347|       |            // been run).  This is handled below, so just treat this as
 3348|       |            // though the block was successfully read, and rely on the
 3349|       |            // handling in ProcessNewBlock to ensure the block index is
 3350|       |            // updated, etc.
 3351|      0|            RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId()); // it is now an empty pointer
 3352|      0|            fBlockRead = true;
 3353|       |            // mapBlockSource is used for potentially punishing peers and
 3354|       |            // updating which peers send us compact blocks, so the race
 3355|       |            // between here and cs_main in ProcessNewBlock is fine.
 3356|       |            // BIP 152 permits peers to relay compact blocks after validating
 3357|       |            // the header only; we should not punish peers if the block turns
 3358|       |            // out to be invalid.
 3359|      0|            mapBlockSource.emplace(block_transactions.blockhash, std::make_pair(pfrom.GetId(), false));
 3360|      0|        }
 3361|      0|    } // Don't hold cs_main when we call into ProcessNewBlock
 3362|      0|    if (fBlockRead) {
  ------------------
  |  Branch (3362:9): [True: 0, False: 0]
  ------------------
 3363|       |        // Since we requested this block (it was in mapBlocksInFlight), force it to be processed,
 3364|       |        // even if it would not be a candidate for new tip (missing previous block, chain not long enough, etc)
 3365|       |        // This bypasses some anti-DoS logic in AcceptBlock (eg to prevent
 3366|       |        // disk-space attacks), but this should be safe due to the
 3367|       |        // protections in the compact block handler -- see related comment
 3368|       |        // in compact block optimistic reconstruction handling.
 3369|      0|        ProcessBlock(pfrom, pblock, /*force_processing=*/true, /*min_pow_checked=*/true);
 3370|      0|    }
 3371|      0|    return;
 3372|      0|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl21ProcessHeadersMessageER5CNodeRNS_4PeerEONSt3__16vectorI12CBlockHeaderNS5_9allocatorIS7_EEEEb:
 2819|    403|{
 2820|    403|    size_t nCount = headers.size();
 2821|       |
 2822|    403|    if (nCount == 0) {
  ------------------
  |  Branch (2822:9): [True: 3, False: 400]
  ------------------
 2823|       |        // Nothing interesting. Stop asking this peers for more headers.
 2824|       |        // If we were in the middle of headers sync, receiving an empty headers
 2825|       |        // message suggests that the peer suddenly has nothing to give us
 2826|       |        // (perhaps it reorged to our chain). Clear download state for this peer.
 2827|      3|        LOCK(peer.m_headers_sync_mutex);
  ------------------
  |  |  257|      3|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      3|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      3|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      3|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2828|      3|        if (peer.m_headers_sync) {
  ------------------
  |  Branch (2828:13): [True: 0, False: 3]
  ------------------
 2829|      0|            peer.m_headers_sync.reset(nullptr);
 2830|      0|            LOCK(m_headers_presync_mutex);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2831|      0|            m_headers_presync_stats.erase(pfrom.GetId());
 2832|      0|        }
 2833|       |        // A headers message with no headers cannot be an announcement, so assume
 2834|       |        // it is a response to our last getheaders request, if there is one.
 2835|      3|        peer.m_last_getheaders_timestamp = {};
 2836|      3|        return;
 2837|      3|    }
 2838|       |
 2839|       |    // Before we do any processing, make sure these pass basic sanity checks.
 2840|       |    // We'll rely on headers having valid proof-of-work further down, as an
 2841|       |    // anti-DoS criteria (note: this check is required before passing any
 2842|       |    // headers into HeadersSyncState).
 2843|    400|    if (!CheckHeadersPoW(headers, m_chainparams.GetConsensus(), peer)) {
  ------------------
  |  Branch (2843:9): [True: 28, False: 372]
  ------------------
 2844|       |        // Misbehaving() calls are handled within CheckHeadersPoW(), so we can
 2845|       |        // just return. (Note that even if a header is announced via compact
 2846|       |        // block, the header itself should be valid, so this type of error can
 2847|       |        // always be punished.)
 2848|     28|        return;
 2849|     28|    }
 2850|       |
 2851|    372|    const CBlockIndex *pindexLast = nullptr;
 2852|       |
 2853|       |    // We'll set already_validated_work to true if these headers are
 2854|       |    // successfully processed as part of a low-work headers sync in progress
 2855|       |    // (either in PRESYNC or REDOWNLOAD phase).
 2856|       |    // If true, this will mean that any headers returned to us (ie during
 2857|       |    // REDOWNLOAD) can be validated without further anti-DoS checks.
 2858|    372|    bool already_validated_work = false;
 2859|       |
 2860|       |    // If we're in the middle of headers sync, let it do its magic.
 2861|    372|    bool have_headers_sync = false;
 2862|    372|    {
 2863|    372|        LOCK(peer.m_headers_sync_mutex);
  ------------------
  |  |  257|    372|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    372|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    372|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    372|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2864|       |
 2865|    372|        already_validated_work = IsContinuationOfLowWorkHeadersSync(peer, pfrom, headers);
 2866|       |
 2867|       |        // The headers we passed in may have been:
 2868|       |        // - untouched, perhaps if no headers-sync was in progress, or some
 2869|       |        //   failure occurred
 2870|       |        // - erased, such as if the headers were successfully processed and no
 2871|       |        //   additional headers processing needs to take place (such as if we
 2872|       |        //   are still in PRESYNC)
 2873|       |        // - replaced with headers that are now ready for validation, such as
 2874|       |        //   during the REDOWNLOAD phase of a low-work headers sync.
 2875|       |        // So just check whether we still have headers that we need to process,
 2876|       |        // or not.
 2877|    372|        if (headers.empty()) {
  ------------------
  |  Branch (2877:13): [True: 0, False: 372]
  ------------------
 2878|      0|            return;
 2879|      0|        }
 2880|       |
 2881|    372|        have_headers_sync = !!peer.m_headers_sync;
 2882|    372|    }
 2883|       |
 2884|       |    // Do these headers connect to something in our block index?
 2885|    372|    const CBlockIndex *chain_start_header{WITH_LOCK(::cs_main, return m_chainman.m_blockman.LookupBlockIndex(headers[0].hashPrevBlock))};
  ------------------
  |  |  301|    372|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 2886|    372|    bool headers_connect_blockindex{chain_start_header != nullptr};
 2887|       |
 2888|    372|    if (!headers_connect_blockindex) {
  ------------------
  |  Branch (2888:9): [True: 12, False: 360]
  ------------------
 2889|       |        // This could be a BIP 130 block announcement, use
 2890|       |        // special logic for handling headers that don't connect, as this
 2891|       |        // could be benign.
 2892|     12|        HandleUnconnectingHeaders(pfrom, peer, headers);
 2893|     12|        return;
 2894|     12|    }
 2895|       |
 2896|       |    // If headers connect, assume that this is in response to any outstanding getheaders
 2897|       |    // request we may have sent, and clear out the time of our last request. Non-connecting
 2898|       |    // headers cannot be a response to a getheaders request.
 2899|    360|    peer.m_last_getheaders_timestamp = {};
 2900|       |
 2901|       |    // If the headers we received are already in memory and an ancestor of
 2902|       |    // m_best_header or our tip, skip anti-DoS checks. These headers will not
 2903|       |    // use any more memory (and we are not leaking information that could be
 2904|       |    // used to fingerprint us).
 2905|    360|    const CBlockIndex *last_received_header{nullptr};
 2906|    360|    {
 2907|    360|        LOCK(cs_main);
  ------------------
  |  |  257|    360|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    360|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    360|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    360|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2908|    360|        last_received_header = m_chainman.m_blockman.LookupBlockIndex(headers.back().GetHash());
 2909|    360|        if (IsAncestorOfBestHeaderOrTip(last_received_header)) {
  ------------------
  |  Branch (2909:13): [True: 0, False: 360]
  ------------------
 2910|      0|            already_validated_work = true;
 2911|      0|        }
 2912|    360|    }
 2913|       |
 2914|       |    // If our peer has NetPermissionFlags::NoBan privileges, then bypass our
 2915|       |    // anti-DoS logic (this saves bandwidth when we connect to a trusted peer
 2916|       |    // on startup).
 2917|    360|    if (pfrom.HasPermission(NetPermissionFlags::NoBan)) {
  ------------------
  |  Branch (2917:9): [True: 82, False: 278]
  ------------------
 2918|     82|        already_validated_work = true;
 2919|     82|    }
 2920|       |
 2921|       |    // At this point, the headers connect to something in our block index.
 2922|       |    // Do anti-DoS checks to determine if we should process or store for later
 2923|       |    // processing.
 2924|    360|    if (!already_validated_work && TryLowWorkHeadersSync(peer, pfrom,
  ------------------
  |  Branch (2924:9): [True: 278, False: 82]
  |  Branch (2924:36): [True: 6, False: 272]
  ------------------
 2925|    278|                chain_start_header, headers)) {
 2926|       |        // If we successfully started a low-work headers sync, then there
 2927|       |        // should be no headers to process any further.
 2928|      6|        Assume(headers.empty());
  ------------------
  |  |   97|      6|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 2929|      6|        return;
 2930|      6|    }
 2931|       |
 2932|       |    // At this point, we have a set of headers with sufficient work on them
 2933|       |    // which can be processed.
 2934|       |
 2935|       |    // If we don't have the last header, then this peer will have given us
 2936|       |    // something new (if these headers are valid).
 2937|    354|    bool received_new_header{last_received_header == nullptr};
 2938|       |
 2939|       |    // Now process all the headers.
 2940|    354|    BlockValidationState state;
 2941|    354|    if (!m_chainman.ProcessNewBlockHeaders(headers, /*min_pow_checked=*/true, state, &pindexLast)) {
  ------------------
  |  Branch (2941:9): [True: 133, False: 221]
  ------------------
 2942|    133|        if (state.IsInvalid()) {
  ------------------
  |  Branch (2942:13): [True: 133, False: 0]
  ------------------
 2943|    133|            MaybePunishNodeForBlock(pfrom.GetId(), state, via_compact_block, "invalid header received");
 2944|    133|            return;
 2945|    133|        }
 2946|    133|    }
 2947|    221|    assert(pindexLast);
 2948|       |
 2949|       |    // Consider fetching more headers if we are not using our headers-sync mechanism.
 2950|    221|    if (nCount == m_opts.max_headers_result && !have_headers_sync) {
  ------------------
  |  Branch (2950:9): [True: 0, False: 221]
  |  Branch (2950:48): [True: 0, False: 0]
  ------------------
 2951|       |        // Headers message had its maximum size; the peer may have more headers.
 2952|      0|        if (MaybeSendGetHeaders(pfrom, GetLocator(pindexLast), peer)) {
  ------------------
  |  Branch (2952:13): [True: 0, False: 0]
  ------------------
 2953|      0|            LogDebug(BCLog::NET, "more getheaders (%d) to end to peer=%d (startheight:%d)\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2954|      0|                    pindexLast->nHeight, pfrom.GetId(), peer.m_starting_height);
 2955|      0|        }
 2956|      0|    }
 2957|       |
 2958|    221|    UpdatePeerStateForReceivedHeaders(pfrom, peer, *pindexLast, received_new_header, nCount == m_opts.max_headers_result);
 2959|       |
 2960|       |    // Consider immediately downloading blocks.
 2961|    221|    HeadersDirectFetchBlocks(pfrom, peer, *pindexLast);
 2962|       |
 2963|    221|    return;
 2964|    221|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl15CheckHeadersPoWERKNSt3__16vectorI12CBlockHeaderNS1_9allocatorIS3_EEEERKN9Consensus6ParamsERNS_4PeerE:
 2476|    400|{
 2477|       |    // Do these headers have proof-of-work matching what's claimed?
 2478|    400|    if (!HasValidProofOfWork(headers, consensusParams)) {
  ------------------
  |  Branch (2478:9): [True: 9, False: 391]
  ------------------
 2479|      9|        Misbehaving(peer, "header with invalid proof of work");
 2480|      9|        return false;
 2481|      9|    }
 2482|       |
 2483|       |    // Are these headers connected to each other?
 2484|    391|    if (!CheckHeadersAreContinuous(headers)) {
  ------------------
  |  Branch (2484:9): [True: 19, False: 372]
  ------------------
 2485|     19|        Misbehaving(peer, "non-continuous headers sequence");
 2486|     19|        return false;
 2487|     19|    }
 2488|    372|    return true;
 2489|    391|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl25CheckHeadersAreContinuousERKNSt3__16vectorI12CBlockHeaderNS1_9allocatorIS3_EEEE:
 2530|    391|{
 2531|    391|    uint256 hashLastBlock;
 2532|    436|    for (const CBlockHeader& header : headers) {
  ------------------
  |  Branch (2532:37): [True: 436, False: 372]
  ------------------
 2533|    436|        if (!hashLastBlock.IsNull() && header.hashPrevBlock != hashLastBlock) {
  ------------------
  |  Branch (2533:13): [True: 45, False: 391]
  |  Branch (2533:40): [True: 19, False: 26]
  ------------------
 2534|     19|            return false;
 2535|     19|        }
 2536|    417|        hashLastBlock = header.GetHash();
 2537|    417|    }
 2538|    372|    return true;
 2539|    391|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl34IsContinuationOfLowWorkHeadersSyncERNS_4PeerER5CNodeRNSt3__16vectorI12CBlockHeaderNS5_9allocatorIS7_EEEE:
 2542|    372|{
 2543|    372|    if (peer.m_headers_sync) {
  ------------------
  |  Branch (2543:9): [True: 0, False: 372]
  ------------------
 2544|      0|        auto result = peer.m_headers_sync->ProcessNextHeaders(headers, headers.size() == m_opts.max_headers_result);
 2545|       |        // If it is a valid continuation, we should treat the existing getheaders request as responded to.
 2546|      0|        if (result.success) peer.m_last_getheaders_timestamp = {};
  ------------------
  |  Branch (2546:13): [True: 0, False: 0]
  ------------------
 2547|      0|        if (result.request_more) {
  ------------------
  |  Branch (2547:13): [True: 0, False: 0]
  ------------------
 2548|      0|            auto locator = peer.m_headers_sync->NextHeadersRequestLocator();
 2549|       |            // If we were instructed to ask for a locator, it should not be empty.
 2550|      0|            Assume(!locator.vHave.empty());
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 2551|       |            // We can only be instructed to request more if processing was successful.
 2552|      0|            Assume(result.success);
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 2553|      0|            if (!locator.vHave.empty()) {
  ------------------
  |  Branch (2553:17): [True: 0, False: 0]
  ------------------
 2554|       |                // It should be impossible for the getheaders request to fail,
 2555|       |                // because we just cleared the last getheaders timestamp.
 2556|      0|                bool sent_getheaders = MaybeSendGetHeaders(pfrom, locator, peer);
 2557|      0|                Assume(sent_getheaders);
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 2558|      0|                LogDebug(BCLog::NET, "more getheaders (from %s) to peer=%d\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2559|      0|                    locator.vHave.front().ToString(), pfrom.GetId());
 2560|      0|            }
 2561|      0|        }
 2562|       |
 2563|      0|        if (peer.m_headers_sync->GetState() == HeadersSyncState::State::FINAL) {
  ------------------
  |  Branch (2563:13): [True: 0, False: 0]
  ------------------
 2564|      0|            peer.m_headers_sync.reset(nullptr);
 2565|       |
 2566|       |            // Delete this peer's entry in m_headers_presync_stats.
 2567|       |            // If this is m_headers_presync_bestpeer, it will be replaced later
 2568|       |            // by the next peer that triggers the else{} branch below.
 2569|      0|            LOCK(m_headers_presync_mutex);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2570|      0|            m_headers_presync_stats.erase(pfrom.GetId());
 2571|      0|        } else {
 2572|       |            // Build statistics for this peer's sync.
 2573|      0|            HeadersPresyncStats stats;
 2574|      0|            stats.first = peer.m_headers_sync->GetPresyncWork();
 2575|      0|            if (peer.m_headers_sync->GetState() == HeadersSyncState::State::PRESYNC) {
  ------------------
  |  Branch (2575:17): [True: 0, False: 0]
  ------------------
 2576|      0|                stats.second = {peer.m_headers_sync->GetPresyncHeight(),
 2577|      0|                                peer.m_headers_sync->GetPresyncTime()};
 2578|      0|            }
 2579|       |
 2580|       |            // Update statistics in stats.
 2581|      0|            LOCK(m_headers_presync_mutex);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2582|      0|            m_headers_presync_stats[pfrom.GetId()] = stats;
 2583|      0|            auto best_it = m_headers_presync_stats.find(m_headers_presync_bestpeer);
 2584|      0|            bool best_updated = false;
 2585|      0|            if (best_it == m_headers_presync_stats.end()) {
  ------------------
  |  Branch (2585:17): [True: 0, False: 0]
  ------------------
 2586|       |                // If the cached best peer is outdated, iterate over all remaining ones (including
 2587|       |                // newly updated one) to find the best one.
 2588|      0|                NodeId peer_best{-1};
 2589|      0|                const HeadersPresyncStats* stat_best{nullptr};
 2590|      0|                for (const auto& [peer, stat] : m_headers_presync_stats) {
  ------------------
  |  Branch (2590:47): [True: 0, False: 0]
  ------------------
 2591|      0|                    if (!stat_best || stat > *stat_best) {
  ------------------
  |  Branch (2591:25): [True: 0, False: 0]
  |  Branch (2591:39): [True: 0, False: 0]
  ------------------
 2592|      0|                        peer_best = peer;
 2593|      0|                        stat_best = &stat;
 2594|      0|                    }
 2595|      0|                }
 2596|      0|                m_headers_presync_bestpeer = peer_best;
 2597|      0|                best_updated = (peer_best == pfrom.GetId());
 2598|      0|            } else if (best_it->first == pfrom.GetId() || stats > best_it->second) {
  ------------------
  |  Branch (2598:24): [True: 0, False: 0]
  |  Branch (2598:59): [True: 0, False: 0]
  ------------------
 2599|       |                // pfrom was and remains the best peer, or pfrom just became best.
 2600|      0|                m_headers_presync_bestpeer = pfrom.GetId();
 2601|      0|                best_updated = true;
 2602|      0|            }
 2603|      0|            if (best_updated && stats.second.has_value()) {
  ------------------
  |  Branch (2603:17): [True: 0, False: 0]
  |  Branch (2603:33): [True: 0, False: 0]
  ------------------
 2604|       |                // If the best peer updated, and it is in its first phase, signal.
 2605|      0|                m_headers_presync_should_signal = true;
 2606|      0|            }
 2607|      0|        }
 2608|       |
 2609|      0|        if (result.success) {
  ------------------
  |  Branch (2609:13): [True: 0, False: 0]
  ------------------
 2610|       |            // We only overwrite the headers passed in if processing was
 2611|       |            // successful.
 2612|      0|            headers.swap(result.pow_validated_headers);
 2613|      0|        }
 2614|       |
 2615|      0|        return result.success;
 2616|      0|    }
 2617|       |    // Either we didn't have a sync in progress, or something went wrong
 2618|       |    // processing these headers, or we are returning headers to the caller to
 2619|       |    // process.
 2620|    372|    return false;
 2621|    372|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl25HandleUnconnectingHeadersER5CNodeRNS_4PeerERKNSt3__16vectorI12CBlockHeaderNS5_9allocatorIS7_EEEE:
 2512|     12|{
 2513|       |    // Try to fill in the missing headers.
 2514|     12|    const CBlockIndex* best_header{WITH_LOCK(cs_main, return m_chainman.m_best_header)};
  ------------------
  |  |  301|     12|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 2515|     12|    if (MaybeSendGetHeaders(pfrom, GetLocator(best_header), peer)) {
  ------------------
  |  Branch (2515:9): [True: 6, False: 6]
  ------------------
 2516|      6|        LogDebug(BCLog::NET, "received header %s: missing prev block %s, sending getheaders (%d) to end (peer=%d)\n",
  ------------------
  |  |  280|      6|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      6|    do {                                                  \
  |  |  |  |  274|      6|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2517|      6|            headers[0].GetHash().ToString(),
 2518|      6|            headers[0].hashPrevBlock.ToString(),
 2519|      6|            best_header->nHeight,
 2520|      6|            pfrom.GetId());
 2521|      6|    }
 2522|       |
 2523|       |    // Set hashLastUnknownBlock for this peer, so that if we
 2524|       |    // eventually get the headers - even from a different peer -
 2525|       |    // we can use this peer to download.
 2526|     12|    WITH_LOCK(cs_main, UpdateBlockAvailability(pfrom.GetId(), headers.back().GetHash()));
  ------------------
  |  |  301|     12|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 2527|     12|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl27IsAncestorOfBestHeaderOrTipEPK11CBlockIndex:
 2670|    360|{
 2671|    360|    if (header == nullptr) {
  ------------------
  |  Branch (2671:9): [True: 348, False: 12]
  ------------------
 2672|    348|        return false;
 2673|    348|    } else if (m_chainman.m_best_header != nullptr && header == m_chainman.m_best_header->GetAncestor(header->nHeight)) {
  ------------------
  |  Branch (2673:16): [True: 12, False: 0]
  |  Branch (2673:55): [True: 0, False: 12]
  ------------------
 2674|      0|        return true;
 2675|     12|    } else if (m_chainman.ActiveChain().Contains(header)) {
  ------------------
  |  Branch (2675:16): [True: 0, False: 12]
  ------------------
 2676|      0|        return true;
 2677|      0|    }
 2678|     12|    return false;
 2679|    360|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl21TryLowWorkHeadersSyncERNS_4PeerER5CNodePK11CBlockIndexRNSt3__16vectorI12CBlockHeaderNS8_9allocatorISA_EEEE:
 2624|    278|{
 2625|       |    // Calculate the claimed total work on this chain.
 2626|    278|    arith_uint256 total_work = chain_start_header->nChainWork + CalculateClaimedHeadersWork(headers);
 2627|       |
 2628|       |    // Our dynamic anti-DoS threshold (minimum work required on a headers chain
 2629|       |    // before we'll store it)
 2630|    278|    arith_uint256 minimum_chain_work = GetAntiDoSWorkThreshold();
 2631|       |
 2632|       |    // Avoid DoS via low-difficulty-headers by only processing if the headers
 2633|       |    // are part of a chain with sufficient work.
 2634|    278|    if (total_work < minimum_chain_work) {
  ------------------
  |  Branch (2634:9): [True: 6, False: 272]
  ------------------
 2635|       |        // Only try to sync with this peer if their headers message was full;
 2636|       |        // otherwise they don't have more headers after this so no point in
 2637|       |        // trying to sync their too-little-work chain.
 2638|      6|        if (headers.size() == m_opts.max_headers_result) {
  ------------------
  |  Branch (2638:13): [True: 0, False: 6]
  ------------------
 2639|       |            // Note: we could advance to the last header in this set that is
 2640|       |            // known to us, rather than starting at the first header (which we
 2641|       |            // may already have); however this is unlikely to matter much since
 2642|       |            // ProcessHeadersMessage() already handles the case where all
 2643|       |            // headers in a received message are already known and are
 2644|       |            // ancestors of m_best_header or chainActive.Tip(), by skipping
 2645|       |            // this logic in that case. So even if the first header in this set
 2646|       |            // of headers is known, some header in this set must be new, so
 2647|       |            // advancing to the first unknown header would be a small effect.
 2648|      0|            LOCK(peer.m_headers_sync_mutex);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2649|      0|            peer.m_headers_sync.reset(new HeadersSyncState(peer.m_id, m_chainparams.GetConsensus(),
 2650|      0|                chain_start_header, minimum_chain_work));
 2651|       |
 2652|       |            // Now a HeadersSyncState object for tracking this synchronization
 2653|       |            // is created, process the headers using it as normal. Failures are
 2654|       |            // handled inside of IsContinuationOfLowWorkHeadersSync.
 2655|      0|            (void)IsContinuationOfLowWorkHeadersSync(peer, pfrom, headers);
 2656|      6|        } else {
 2657|      6|            LogDebug(BCLog::NET, "Ignoring low-work chain (height=%u) from peer=%d\n", chain_start_header->nHeight + headers.size(), pfrom.GetId());
  ------------------
  |  |  280|      6|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      6|    do {                                                  \
  |  |  |  |  274|      6|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2658|      6|        }
 2659|       |
 2660|       |        // The peer has not yet given us a chain that meets our work threshold,
 2661|       |        // so we want to prevent further processing of the headers in any case.
 2662|      6|        headers = {};
 2663|      6|        return true;
 2664|      6|    }
 2665|       |
 2666|    272|    return false;
 2667|    278|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl33UpdatePeerStateForReceivedHeadersER5CNodeRNS_4PeerERK11CBlockIndexbb:
 2767|    221|{
 2768|    221|    LOCK(cs_main);
  ------------------
  |  |  257|    221|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    221|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    221|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    221|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2769|    221|    CNodeState *nodestate = State(pfrom.GetId());
 2770|       |
 2771|    221|    UpdateBlockAvailability(pfrom.GetId(), last_header.GetBlockHash());
 2772|       |
 2773|       |    // From here, pindexBestKnownBlock should be guaranteed to be non-null,
 2774|       |    // because it is set in UpdateBlockAvailability. Some nullptr checks
 2775|       |    // are still present, however, as belt-and-suspenders.
 2776|       |
 2777|    221|    if (received_new_header && last_header.nChainWork > m_chainman.ActiveChain().Tip()->nChainWork) {
  ------------------
  |  Branch (2777:9): [True: 209, False: 12]
  |  Branch (2777:32): [True: 11, False: 198]
  ------------------
 2778|     11|        nodestate->m_last_block_announcement = GetTime();
 2779|     11|    }
 2780|       |
 2781|       |    // If we're in IBD, we want outbound peers that will serve us a useful
 2782|       |    // chain. Disconnect peers that are on chains with insufficient work.
 2783|    221|    if (m_chainman.IsInitialBlockDownload() && !may_have_more_headers) {
  ------------------
  |  Branch (2783:9): [True: 217, False: 4]
  |  Branch (2783:48): [True: 217, False: 0]
  ------------------
 2784|       |        // If the peer has no more headers to give us, then we know we have
 2785|       |        // their tip.
 2786|    217|        if (nodestate->pindexBestKnownBlock && nodestate->pindexBestKnownBlock->nChainWork < m_chainman.MinimumChainWork()) {
  ------------------
  |  Branch (2786:13): [True: 217, False: 0]
  |  Branch (2786:48): [True: 0, False: 217]
  ------------------
 2787|       |            // This peer has too little work on their headers chain to help
 2788|       |            // us sync -- disconnect if it is an outbound disconnection
 2789|       |            // candidate.
 2790|       |            // Note: We compare their tip to the minimum chain work (rather than
 2791|       |            // m_chainman.ActiveChain().Tip()) because we won't start block download
 2792|       |            // until we have a headers chain that has at least
 2793|       |            // the minimum chain work, even if a peer has a chain past our tip,
 2794|       |            // as an anti-DoS measure.
 2795|      0|            if (pfrom.IsOutboundOrBlockRelayConn()) {
  ------------------
  |  Branch (2795:17): [True: 0, False: 0]
  ------------------
 2796|      0|                LogInfo("outbound peer headers chain has insufficient work, %s\n", pfrom.DisconnectMsg(fLogIPs));
  ------------------
  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 2797|      0|                pfrom.fDisconnect = true;
 2798|      0|            }
 2799|      0|        }
 2800|    217|    }
 2801|       |
 2802|       |    // If this is an outbound full-relay peer, check to see if we should protect
 2803|       |    // it from the bad/lagging chain logic.
 2804|       |    // Note that outbound block-relay peers are excluded from this protection, and
 2805|       |    // thus always subject to eviction under the bad/lagging chain logic.
 2806|       |    // See ChainSyncTimeoutState.
 2807|    221|    if (!pfrom.fDisconnect && pfrom.IsFullOutboundConn() && nodestate->pindexBestKnownBlock != nullptr) {
  ------------------
  |  Branch (2807:9): [True: 221, False: 0]
  |  Branch (2807:31): [True: 17, False: 204]
  |  Branch (2807:61): [True: 17, False: 0]
  ------------------
 2808|     17|        if (m_outbound_peers_with_protect_from_disconnect < MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT && nodestate->pindexBestKnownBlock->nChainWork >= m_chainman.ActiveChain().Tip()->nChainWork && !nodestate->m_chain_sync.m_protect) {
  ------------------
  |  Branch (2808:13): [True: 17, False: 0]
  |  Branch (2808:110): [True: 3, False: 14]
  |  Branch (2808:203): [True: 3, False: 0]
  ------------------
 2809|      3|            LogDebug(BCLog::NET, "Protecting outbound peer=%d from eviction\n", pfrom.GetId());
  ------------------
  |  |  280|      3|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      3|    do {                                                  \
  |  |  |  |  274|      3|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2810|      3|            nodestate->m_chain_sync.m_protect = true;
 2811|      3|            ++m_outbound_peers_with_protect_from_disconnect;
 2812|      3|        }
 2813|     17|    }
 2814|    221|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl24HeadersDirectFetchBlocksER5CNodeRKNS_4PeerERK11CBlockIndex:
 2701|    221|{
 2702|    221|    LOCK(cs_main);
  ------------------
  |  |  257|    221|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    221|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    221|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    221|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2703|    221|    CNodeState *nodestate = State(pfrom.GetId());
 2704|       |
 2705|    221|    if (CanDirectFetch() && last_header.IsValid(BLOCK_VALID_TREE) && m_chainman.ActiveChain().Tip()->nChainWork <= last_header.nChainWork) {
  ------------------
  |  Branch (2705:9): [True: 4, False: 217]
  |  Branch (2705:29): [True: 4, False: 0]
  |  Branch (2705:70): [True: 3, False: 1]
  ------------------
 2706|      3|        std::vector<const CBlockIndex*> vToFetch;
 2707|      3|        const CBlockIndex* pindexWalk{&last_header};
 2708|       |        // Calculate all the blocks we'd need to switch to last_header, up to a limit.
 2709|      8|        while (pindexWalk && !m_chainman.ActiveChain().Contains(pindexWalk) && vToFetch.size() <= MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
  ------------------
  |  Branch (2709:16): [True: 8, False: 0]
  |  Branch (2709:30): [True: 5, False: 3]
  |  Branch (2709:80): [True: 5, False: 0]
  ------------------
 2710|      5|            if (!(pindexWalk->nStatus & BLOCK_HAVE_DATA) &&
  ------------------
  |  Branch (2710:17): [True: 5, False: 0]
  |  Branch (2710:17): [True: 3, False: 2]
  ------------------
 2711|      5|                    !IsBlockRequested(pindexWalk->GetBlockHash()) &&
  ------------------
  |  Branch (2711:21): [True: 5, False: 0]
  ------------------
 2712|      5|                    (!DeploymentActiveAt(*pindexWalk, m_chainman, Consensus::DEPLOYMENT_SEGWIT) || CanServeWitnesses(peer))) {
  ------------------
  |  Branch (2712:22): [True: 0, False: 5]
  |  Branch (2712:100): [True: 3, False: 2]
  ------------------
 2713|       |                // We don't have this block, and it's not yet in flight.
 2714|      3|                vToFetch.push_back(pindexWalk);
 2715|      3|            }
 2716|      5|            pindexWalk = pindexWalk->pprev;
 2717|      5|        }
 2718|       |        // If pindexWalk still isn't on our main chain, we're looking at a
 2719|       |        // very large reorg at a time we think we're close to caught up to
 2720|       |        // the main chain -- this shouldn't really happen.  Bail out on the
 2721|       |        // direct fetch and rely on parallel download instead.
 2722|      3|        if (!m_chainman.ActiveChain().Contains(pindexWalk)) {
  ------------------
  |  Branch (2722:13): [True: 0, False: 3]
  ------------------
 2723|      0|            LogDebug(BCLog::NET, "Large reorg, won't direct fetch to %s (%d)\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2724|      0|                     last_header.GetBlockHash().ToString(),
 2725|      0|                     last_header.nHeight);
 2726|      3|        } else {
 2727|      3|            std::vector<CInv> vGetData;
 2728|       |            // Download as much as possible, from earliest to latest.
 2729|      3|            for (const CBlockIndex* pindex : vToFetch | std::views::reverse) {
  ------------------
  |  Branch (2729:44): [True: 3, False: 3]
  ------------------
 2730|      3|                if (nodestate->vBlocksInFlight.size() >= MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
  ------------------
  |  Branch (2730:21): [True: 0, False: 3]
  ------------------
 2731|       |                    // Can't download any more from this peer
 2732|      0|                    break;
 2733|      0|                }
 2734|      3|                uint32_t nFetchFlags = GetFetchFlags(peer);
 2735|      3|                vGetData.emplace_back(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash());
 2736|      3|                BlockRequested(pfrom.GetId(), *pindex);
 2737|      3|                LogDebug(BCLog::NET, "Requesting block %s from  peer=%d\n",
  ------------------
  |  |  280|      3|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      3|    do {                                                  \
  |  |  |  |  274|      3|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|      3|                        pindex->GetBlockHash().ToString(), pfrom.GetId());
 2739|      3|            }
 2740|      3|            if (vGetData.size() > 1) {
  ------------------
  |  Branch (2740:17): [True: 1, False: 2]
  ------------------
 2741|      1|                LogDebug(BCLog::NET, "Downloading blocks toward %s (%d) via headers direct fetch\n",
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2742|      1|                         last_header.GetBlockHash().ToString(),
 2743|      1|                         last_header.nHeight);
 2744|      1|            }
 2745|      3|            if (vGetData.size() > 0) {
  ------------------
  |  Branch (2745:17): [True: 2, False: 1]
  ------------------
 2746|      2|                if (!m_opts.ignore_incoming_txs &&
  ------------------
  |  Branch (2746:21): [True: 2, False: 0]
  ------------------
 2747|      2|                        nodestate->m_provides_cmpctblocks &&
  ------------------
  |  Branch (2747:25): [True: 0, False: 2]
  ------------------
 2748|      2|                        vGetData.size() == 1 &&
  ------------------
  |  Branch (2748:25): [True: 0, False: 0]
  ------------------
 2749|      2|                        mapBlocksInFlight.size() == 1 &&
  ------------------
  |  Branch (2749:25): [True: 0, False: 0]
  ------------------
 2750|      2|                        last_header.pprev->IsValid(BLOCK_VALID_CHAIN)) {
  ------------------
  |  Branch (2750:25): [True: 0, False: 0]
  ------------------
 2751|       |                    // In any case, we want to download using a compact block, not a regular one
 2752|      0|                    vGetData[0] = CInv(MSG_CMPCT_BLOCK, vGetData[0].hash);
 2753|      0|                }
 2754|      2|                MakeAndPushMessage(pfrom, NetMsgType::GETDATA, vGetData);
 2755|      2|            }
 2756|      3|        }
 2757|      3|    }
 2758|    221|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl12ProcessBlockER5CNodeRKNSt3__110shared_ptrIK6CBlockEEbb:
 3272|    116|{
 3273|    116|    bool new_block{false};
 3274|    116|    m_chainman.ProcessNewBlock(block, force_processing, min_pow_checked, &new_block);
 3275|    116|    if (new_block) {
  ------------------
  |  Branch (3275:9): [True: 0, False: 116]
  ------------------
 3276|      0|        node.m_last_block_time = GetTime<std::chrono::seconds>();
 3277|       |        // In case this block came from a different peer than we requested
 3278|       |        // from, we can erase the block request now anyway (as we just stored
 3279|       |        // this block to disk).
 3280|      0|        LOCK(cs_main);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3281|      0|        RemoveBlockRequest(block->GetHash(), std::nullopt);
 3282|    116|    } else {
 3283|    116|        LOCK(cs_main);
  ------------------
  |  |  257|    116|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    116|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    116|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    116|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3284|    116|        mapBlockSource.erase(block->GetHash());
 3285|    116|    }
 3286|    116|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl11PushAddressERNS_4PeerERK8CAddress:
 1076|  12.4k|{
 1077|       |    // Known checking here is only to save space from duplicates.
 1078|       |    // Before sending, we'll filter it again for known addresses that were
 1079|       |    // added after addresses were pushed.
 1080|  12.4k|    assert(peer.m_addr_known);
 1081|  12.4k|    if (addr.IsValid() && !peer.m_addr_known->contains(addr.GetKey()) && IsAddrCompatible(peer, addr)) {
  ------------------
  |  Branch (1081:9): [True: 12.4k, False: 0]
  |  Branch (1081:9): [True: 11.6k, False: 750]
  |  Branch (1081:27): [True: 12.4k, False: 0]
  |  Branch (1081:74): [True: 11.6k, False: 750]
  ------------------
 1082|  11.6k|        if (peer.m_addrs_to_send.size() >= MAX_ADDR_TO_SEND) {
  ------------------
  |  Branch (1082:13): [True: 0, False: 11.6k]
  ------------------
 1083|      0|            peer.m_addrs_to_send[m_rng.randrange(peer.m_addrs_to_send.size())] = addr;
 1084|  11.6k|        } else {
 1085|  11.6k|            peer.m_addrs_to_send.push_back(addr);
 1086|  11.6k|        }
 1087|  11.6k|    }
 1088|  12.4k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRmEEEvR5CNodeNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEDpOT_:
  690|  6.76k|    {
  691|  6.76k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  6.76k|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl18ProcessGetCFiltersER5CNodeRNS_4PeerER10DataStream:
 3163|      8|{
 3164|      8|    uint8_t filter_type_ser;
 3165|      8|    uint32_t start_height;
 3166|      8|    uint256 stop_hash;
 3167|       |
 3168|      8|    vRecv >> filter_type_ser >> start_height >> stop_hash;
 3169|       |
 3170|      8|    const BlockFilterType filter_type = static_cast<BlockFilterType>(filter_type_ser);
 3171|       |
 3172|      8|    const CBlockIndex* stop_index;
 3173|      8|    BlockFilterIndex* filter_index;
 3174|      8|    if (!PrepareBlockFilterRequest(node, peer, filter_type, start_height, stop_hash,
  ------------------
  |  Branch (3174:9): [True: 7, False: 1]
  ------------------
 3175|      8|                                   MAX_GETCFILTERS_SIZE, stop_index, filter_index)) {
 3176|      7|        return;
 3177|      7|    }
 3178|       |
 3179|      1|    std::vector<BlockFilter> filters;
 3180|      1|    if (!filter_index->LookupFilterRange(start_height, stop_index, filters)) {
  ------------------
  |  Branch (3180:9): [True: 0, False: 1]
  ------------------
 3181|      0|        LogDebug(BCLog::NET, "Failed to find block filter in index: filter_type=%s, start_height=%d, stop_hash=%s\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3182|      0|                     BlockFilterTypeName(filter_type), start_height, stop_hash.ToString());
 3183|      0|        return;
 3184|      0|    }
 3185|       |
 3186|      1|    for (const auto& filter : filters) {
  ------------------
  |  Branch (3186:29): [True: 0, False: 1]
  ------------------
 3187|      0|        MakeAndPushMessage(node, NetMsgType::CFILTER, filter);
 3188|      0|    }
 3189|      1|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl25PrepareBlockFilterRequestER5CNodeRNS_4PeerE15BlockFilterTypejRK7uint256jRPK11CBlockIndexRP16BlockFilterIndex:
 3114|     29|{
 3115|     29|    const bool supported_filter_type =
 3116|     29|        (filter_type == BlockFilterType::BASIC &&
  ------------------
  |  Branch (3116:10): [True: 24, False: 5]
  ------------------
 3117|     29|         (peer.m_our_services & NODE_COMPACT_FILTERS));
  ------------------
  |  Branch (3117:10): [True: 23, False: 1]
  ------------------
 3118|     29|    if (!supported_filter_type) {
  ------------------
  |  Branch (3118:9): [True: 6, False: 23]
  ------------------
 3119|      6|        LogDebug(BCLog::NET, "peer requested unsupported block filter type: %d, %s\n",
  ------------------
  |  |  280|      6|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      6|    do {                                                  \
  |  |  |  |  274|      6|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3120|      6|                 static_cast<uint8_t>(filter_type), node.DisconnectMsg(fLogIPs));
 3121|      6|        node.fDisconnect = true;
 3122|      6|        return false;
 3123|      6|    }
 3124|       |
 3125|     23|    {
 3126|     23|        LOCK(cs_main);
  ------------------
  |  |  257|     23|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     23|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     23|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     23|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3127|     23|        stop_index = m_chainman.m_blockman.LookupBlockIndex(stop_hash);
 3128|       |
 3129|       |        // Check that the stop block exists and the peer would be allowed to fetch it.
 3130|     23|        if (!stop_index || !BlockRequestAllowed(stop_index)) {
  ------------------
  |  Branch (3130:13): [True: 8, False: 15]
  |  Branch (3130:28): [True: 0, False: 15]
  ------------------
 3131|      8|            LogDebug(BCLog::NET, "peer requested invalid block hash: %s, %s\n",
  ------------------
  |  |  280|      8|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      8|    do {                                                  \
  |  |  |  |  274|      8|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      8|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3132|      8|                     stop_hash.ToString(), node.DisconnectMsg(fLogIPs));
 3133|      8|            node.fDisconnect = true;
 3134|      8|            return false;
 3135|      8|        }
 3136|     23|    }
 3137|       |
 3138|     15|    uint32_t stop_height = stop_index->nHeight;
 3139|     15|    if (start_height > stop_height) {
  ------------------
  |  Branch (3139:9): [True: 14, False: 1]
  ------------------
 3140|     14|        LogDebug(BCLog::NET, "peer sent invalid getcfilters/getcfheaders with "
  ------------------
  |  |  280|     14|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     14|    do {                                                  \
  |  |  |  |  274|     14|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 14]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     14|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3141|     14|                 "start height %d and stop height %d, %s\n",
 3142|     14|                 start_height, stop_height, node.DisconnectMsg(fLogIPs));
 3143|     14|        node.fDisconnect = true;
 3144|     14|        return false;
 3145|     14|    }
 3146|      1|    if (stop_height - start_height >= max_height_diff) {
  ------------------
  |  Branch (3146:9): [True: 0, False: 1]
  ------------------
 3147|      0|        LogDebug(BCLog::NET, "peer requested too many cfilters/cfheaders: %d / %d, %s\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3148|      0|                 stop_height - start_height + 1, max_height_diff, node.DisconnectMsg(fLogIPs));
 3149|      0|        node.fDisconnect = true;
 3150|      0|        return false;
 3151|      0|    }
 3152|       |
 3153|      1|    filter_index = GetBlockFilterIndex(filter_type);
 3154|      1|    if (!filter_index) {
  ------------------
  |  Branch (3154:9): [True: 1, False: 0]
  ------------------
 3155|      1|        LogDebug(BCLog::NET, "Filter index for supported type %s not found\n", BlockFilterTypeName(filter_type));
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3156|      1|        return false;
 3157|      1|    }
 3158|       |
 3159|      0|    return true;
 3160|      1|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl19ProcessGetCFHeadersER5CNodeRNS_4PeerER10DataStream:
 3192|     19|{
 3193|     19|    uint8_t filter_type_ser;
 3194|     19|    uint32_t start_height;
 3195|     19|    uint256 stop_hash;
 3196|       |
 3197|     19|    vRecv >> filter_type_ser >> start_height >> stop_hash;
 3198|       |
 3199|     19|    const BlockFilterType filter_type = static_cast<BlockFilterType>(filter_type_ser);
 3200|       |
 3201|     19|    const CBlockIndex* stop_index;
 3202|     19|    BlockFilterIndex* filter_index;
 3203|     19|    if (!PrepareBlockFilterRequest(node, peer, filter_type, start_height, stop_hash,
  ------------------
  |  Branch (3203:9): [True: 15, False: 4]
  ------------------
 3204|     19|                                   MAX_GETCFHEADERS_SIZE, stop_index, filter_index)) {
 3205|     15|        return;
 3206|     15|    }
 3207|       |
 3208|      4|    uint256 prev_header;
 3209|      4|    if (start_height > 0) {
  ------------------
  |  Branch (3209:9): [True: 0, False: 4]
  ------------------
 3210|      0|        const CBlockIndex* const prev_block =
 3211|      0|            stop_index->GetAncestor(static_cast<int>(start_height - 1));
 3212|      0|        if (!filter_index->LookupFilterHeader(prev_block, prev_header)) {
  ------------------
  |  Branch (3212:13): [True: 0, False: 0]
  ------------------
 3213|      0|            LogDebug(BCLog::NET, "Failed to find block filter header in index: filter_type=%s, block_hash=%s\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3214|      0|                         BlockFilterTypeName(filter_type), prev_block->GetBlockHash().ToString());
 3215|      0|            return;
 3216|      0|        }
 3217|      0|    }
 3218|       |
 3219|      4|    std::vector<uint256> filter_hashes;
 3220|      4|    if (!filter_index->LookupFilterHashRange(start_height, stop_index, filter_hashes)) {
  ------------------
  |  Branch (3220:9): [True: 0, False: 4]
  ------------------
 3221|      0|        LogDebug(BCLog::NET, "Failed to find block filter hashes in index: filter_type=%s, start_height=%d, stop_hash=%s\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3222|      0|                     BlockFilterTypeName(filter_type), start_height, stop_hash.ToString());
 3223|      0|        return;
 3224|      0|    }
 3225|       |
 3226|      4|    MakeAndPushMessage(node, NetMsgType::CFHEADERS,
 3227|      4|              filter_type_ser,
 3228|      4|              stop_index->GetBlockHash(),
 3229|      4|              prev_header,
 3230|      4|              filter_hashes);
 3231|      4|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl19ProcessGetCFCheckPtER5CNodeRNS_4PeerER10DataStream:
 3234|     10|{
 3235|     10|    uint8_t filter_type_ser;
 3236|     10|    uint256 stop_hash;
 3237|       |
 3238|     10|    vRecv >> filter_type_ser >> stop_hash;
 3239|       |
 3240|     10|    const BlockFilterType filter_type = static_cast<BlockFilterType>(filter_type_ser);
 3241|       |
 3242|     10|    const CBlockIndex* stop_index;
 3243|     10|    BlockFilterIndex* filter_index;
 3244|     10|    if (!PrepareBlockFilterRequest(node, peer, filter_type, /*start_height=*/0, stop_hash,
  ------------------
  |  Branch (3244:9): [True: 7, False: 3]
  ------------------
 3245|     10|                                   /*max_height_diff=*/std::numeric_limits<uint32_t>::max(),
 3246|     10|                                   stop_index, filter_index)) {
 3247|      7|        return;
 3248|      7|    }
 3249|       |
 3250|      3|    std::vector<uint256> headers(stop_index->nHeight / CFCHECKPT_INTERVAL);
 3251|       |
 3252|       |    // Populate headers.
 3253|      3|    const CBlockIndex* block_index = stop_index;
 3254|      3|    for (int i = headers.size() - 1; i >= 0; i--) {
  ------------------
  |  Branch (3254:38): [True: 0, False: 3]
  ------------------
 3255|      0|        int height = (i + 1) * CFCHECKPT_INTERVAL;
 3256|      0|        block_index = block_index->GetAncestor(height);
 3257|       |
 3258|      0|        if (!filter_index->LookupFilterHeader(block_index, headers[i])) {
  ------------------
  |  Branch (3258:13): [True: 0, False: 0]
  ------------------
 3259|      0|            LogDebug(BCLog::NET, "Failed to find block filter header in index: filter_type=%s, block_hash=%s\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3260|      0|                         BlockFilterTypeName(filter_type), block_index->GetBlockHash().ToString());
 3261|      0|            return;
 3262|      0|        }
 3263|      0|    }
 3264|       |
 3265|      3|    MakeAndPushMessage(node, NetMsgType::CFCHECKPT,
 3266|      3|              filter_type_ser,
 3267|      3|              stop_index->GetBlockHash(),
 3268|      3|              headers);
 3269|      3|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl24GetDesirableServiceFlagsE12ServiceFlags:
 1643|  47.6k|{
 1644|  47.6k|    if (services & NODE_NETWORK_LIMITED) {
  ------------------
  |  Branch (1644:9): [True: 2.27k, False: 45.3k]
  ------------------
 1645|       |        // Limited peers are desirable when we are close to the tip.
 1646|  2.27k|        if (ApproximateBestBlockDepth() < NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS) {
  ------------------
  |  Branch (1646:13): [True: 0, False: 2.27k]
  ------------------
 1647|      0|            return ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS);
 1648|      0|        }
 1649|  2.27k|    }
 1650|  47.6k|    return ServiceFlags(NODE_NETWORK | NODE_WITNESS);
 1651|  47.6k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl25ApproximateBestBlockDepthEv:
 1290|  2.27k|{
 1291|  2.27k|    return (GetTime<std::chrono::seconds>() - m_best_block_time.load()).count() / m_chainparams.GetConsensus().nPowTargetSpacing;
 1292|  2.27k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl14InitializeNodeERK5CNode12ServiceFlags:
 1527|  8.47k|{
 1528|  8.47k|    NodeId nodeid = node.GetId();
 1529|  8.47k|    {
 1530|  8.47k|        LOCK(cs_main); // For m_node_states
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1531|  8.47k|        m_node_states.try_emplace(m_node_states.end(), nodeid);
 1532|  8.47k|    }
 1533|  8.47k|    WITH_LOCK(m_tx_download_mutex, m_txdownloadman.CheckIsEmpty(nodeid));
  ------------------
  |  |  301|  8.47k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 1534|       |
 1535|  8.47k|    if (NetPermissions::HasFlag(node.m_permission_flags, NetPermissionFlags::BloomFilter)) {
  ------------------
  |  Branch (1535:9): [True: 2.48k, False: 5.98k]
  ------------------
 1536|  2.48k|        our_services = static_cast<ServiceFlags>(our_services | NODE_BLOOM);
 1537|  2.48k|    }
 1538|       |
 1539|  8.47k|    PeerRef peer = std::make_shared<Peer>(nodeid, our_services, node.IsInboundConn());
 1540|  8.47k|    {
 1541|  8.47k|        LOCK(m_peer_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1542|  8.47k|        m_peer_map.emplace_hint(m_peer_map.end(), nodeid, peer);
 1543|  8.47k|    }
 1544|  8.47k|}
net_processing.cpp:_ZN12_GLOBAL__N_14PeerC2El12ServiceFlagsb:
  386|  8.47k|        : m_id{id}
  387|  8.47k|        , m_our_services{our_services}
  388|  8.47k|        , m_is_inbound{is_inbound}
  389|  8.47k|    {}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl12FinalizeNodeERK5CNode:
 1567|  8.47k|{
 1568|  8.47k|    NodeId nodeid = node.GetId();
 1569|  8.47k|    {
 1570|  8.47k|    LOCK(cs_main);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1571|  8.47k|    {
 1572|       |        // We remove the PeerRef from g_peer_map here, but we don't always
 1573|       |        // destruct the Peer. Sometimes another thread is still holding a
 1574|       |        // PeerRef, so the refcount is >= 1. Be careful not to do any
 1575|       |        // processing here that assumes Peer won't be changed before it's
 1576|       |        // destructed.
 1577|  8.47k|        PeerRef peer = RemovePeer(nodeid);
 1578|  8.47k|        assert(peer != nullptr);
 1579|  8.47k|        m_wtxid_relay_peers -= peer->m_wtxid_relay;
 1580|  8.47k|        assert(m_wtxid_relay_peers >= 0);
 1581|  8.47k|    }
 1582|  8.47k|    CNodeState *state = State(nodeid);
 1583|  8.47k|    assert(state != nullptr);
 1584|       |
 1585|  8.47k|    if (state->fSyncStarted)
  ------------------
  |  Branch (1585:9): [True: 3.73k, False: 4.73k]
  ------------------
 1586|  3.73k|        nSyncStarted--;
 1587|       |
 1588|  8.47k|    for (const QueuedBlock& entry : state->vBlocksInFlight) {
  ------------------
  |  Branch (1588:35): [True: 150, False: 8.47k]
  ------------------
 1589|    150|        auto range = mapBlocksInFlight.equal_range(entry.pindex->GetBlockHash());
 1590|    300|        while (range.first != range.second) {
  ------------------
  |  Branch (1590:16): [True: 150, False: 150]
  ------------------
 1591|    150|            auto [node_id, list_it] = range.first->second;
 1592|    150|            if (node_id != nodeid) {
  ------------------
  |  Branch (1592:17): [True: 0, False: 150]
  ------------------
 1593|      0|                range.first++;
 1594|    150|            } else {
 1595|    150|                range.first = mapBlocksInFlight.erase(range.first);
 1596|    150|            }
 1597|    150|        }
 1598|    150|    }
 1599|  8.47k|    {
 1600|  8.47k|        LOCK(m_tx_download_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1601|  8.47k|        m_txdownloadman.DisconnectedPeer(nodeid);
 1602|  8.47k|    }
 1603|  8.47k|    if (m_txreconciliation) m_txreconciliation->ForgetPeer(nodeid);
  ------------------
  |  Branch (1603:9): [True: 8.47k, False: 0]
  ------------------
 1604|  8.47k|    m_num_preferred_download_peers -= state->fPreferredDownload;
 1605|  8.47k|    m_peers_downloading_from -= (!state->vBlocksInFlight.empty());
 1606|  8.47k|    assert(m_peers_downloading_from >= 0);
 1607|  8.47k|    m_outbound_peers_with_protect_from_disconnect -= state->m_chain_sync.m_protect;
 1608|  8.47k|    assert(m_outbound_peers_with_protect_from_disconnect >= 0);
 1609|       |
 1610|  8.47k|    m_node_states.erase(nodeid);
 1611|       |
 1612|  8.47k|    if (m_node_states.empty()) {
  ------------------
  |  Branch (1612:9): [True: 8.47k, False: 0]
  ------------------
 1613|       |        // Do a consistency check after the last peer is removed.
 1614|  8.47k|        assert(mapBlocksInFlight.empty());
 1615|  8.47k|        assert(m_num_preferred_download_peers == 0);
 1616|  8.47k|        assert(m_peers_downloading_from == 0);
 1617|  8.47k|        assert(m_outbound_peers_with_protect_from_disconnect == 0);
 1618|  8.47k|        assert(m_wtxid_relay_peers == 0);
 1619|  8.47k|        WITH_LOCK(m_tx_download_mutex, m_txdownloadman.CheckIsEmpty());
  ------------------
  |  |  301|  8.47k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 1620|  8.47k|    }
 1621|  8.47k|    } // cs_main
 1622|  8.47k|    if (node.fSuccessfullyConnected &&
  ------------------
  |  Branch (1622:9): [True: 7.59k, False: 880]
  ------------------
 1623|  8.47k|        !node.IsBlockOnlyConn() && !node.IsInboundConn()) {
  ------------------
  |  Branch (1623:9): [True: 7.53k, False: 58]
  |  Branch (1623:36): [True: 3.02k, False: 4.51k]
  ------------------
 1624|       |        // Only change visible addrman state for full outbound peers.  We don't
 1625|       |        // call Connected() for feeler connections since they don't have
 1626|       |        // fSuccessfullyConnected set.
 1627|  3.02k|        m_addrman.Connected(node.addr);
 1628|  3.02k|    }
 1629|  8.47k|    {
 1630|  8.47k|        LOCK(m_headers_presync_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1631|  8.47k|        m_headers_presync_stats.erase(nodeid);
 1632|  8.47k|    }
 1633|  8.47k|    LogDebug(BCLog::NET, "Cleared nodestate for peer=%d\n", nodeid);
  ------------------
  |  |  280|  8.47k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  8.47k|    do {                                                  \
  |  |  |  |  274|  8.47k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 8.47k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  8.47k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1634|  8.47k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl10RemovePeerEl:
 1661|  8.47k|{
 1662|  8.47k|    PeerRef ret;
 1663|  8.47k|    LOCK(m_peer_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1664|  8.47k|    auto it = m_peer_map.find(id);
 1665|  8.47k|    if (it != m_peer_map.end()) {
  ------------------
  |  Branch (1665:9): [True: 8.47k, False: 0]
  ------------------
 1666|  8.47k|        ret = std::move(it->second);
 1667|  8.47k|        m_peer_map.erase(it);
 1668|  8.47k|    }
 1669|  8.47k|    return ret;
 1670|  8.47k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl27HasAllDesirableServiceFlagsE12ServiceFlags:
 1637|  47.6k|{
 1638|       |    // Shortcut for (services & GetDesirableServiceFlags(services)) == GetDesirableServiceFlags(services)
 1639|  47.6k|    return !(GetDesirableServiceFlags(services) & (~services));
 1640|  47.6k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl15ProcessMessagesEP5CNodeRNSt3__16atomicIbEE:
 4932|   454k|{
 4933|   454k|    AssertLockNotHeld(m_tx_download_mutex);
  ------------------
  |  |  147|   454k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4934|   454k|    AssertLockHeld(g_msgproc_mutex);
  ------------------
  |  |  142|   454k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4935|       |
 4936|   454k|    PeerRef peer = GetPeerRef(pfrom->GetId());
 4937|   454k|    if (peer == nullptr) return false;
  ------------------
  |  Branch (4937:9): [True: 0, False: 454k]
  ------------------
 4938|       |
 4939|       |    // For outbound connections, ensure that the initial VERSION message
 4940|       |    // has been sent first before processing any incoming messages
 4941|   454k|    if (!pfrom->IsInboundConn() && !peer->m_outbound_version_message_sent) return false;
  ------------------
  |  Branch (4941:9): [True: 181k, False: 273k]
  |  Branch (4941:36): [True: 0, False: 181k]
  ------------------
 4942|       |
 4943|   454k|    {
 4944|   454k|        LOCK(peer->m_getdata_requests_mutex);
  ------------------
  |  |  257|   454k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   454k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   454k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   454k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4945|   454k|        if (!peer->m_getdata_requests.empty()) {
  ------------------
  |  Branch (4945:13): [True: 429k, False: 24.5k]
  ------------------
 4946|   429k|            ProcessGetData(*pfrom, *peer, interruptMsgProc);
 4947|   429k|        }
 4948|   454k|    }
 4949|       |
 4950|   454k|    const bool processed_orphan = ProcessOrphanTx(*peer);
 4951|       |
 4952|   454k|    if (pfrom->fDisconnect)
  ------------------
  |  Branch (4952:9): [True: 906, False: 453k]
  ------------------
 4953|    906|        return false;
 4954|       |
 4955|   453k|    if (processed_orphan) return true;
  ------------------
  |  Branch (4955:9): [True: 0, False: 453k]
  ------------------
 4956|       |
 4957|       |    // this maintains the order of responses
 4958|       |    // and prevents m_getdata_requests to grow unbounded
 4959|   453k|    {
 4960|   453k|        LOCK(peer->m_getdata_requests_mutex);
  ------------------
  |  |  257|   453k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   453k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   453k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   453k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4961|   453k|        if (!peer->m_getdata_requests.empty()) return true;
  ------------------
  |  Branch (4961:13): [True: 429k, False: 24.1k]
  ------------------
 4962|   453k|    }
 4963|       |
 4964|       |    // Don't bother if send buffer is too full to respond anyway
 4965|  24.1k|    if (pfrom->fPauseSend) return false;
  ------------------
  |  Branch (4965:9): [True: 58, False: 24.0k]
  ------------------
 4966|       |
 4967|  24.0k|    auto poll_result{pfrom->PollMessage()};
 4968|  24.0k|    if (!poll_result) {
  ------------------
  |  Branch (4968:9): [True: 465, False: 23.6k]
  ------------------
 4969|       |        // No message to process
 4970|    465|        return false;
 4971|    465|    }
 4972|       |
 4973|  23.6k|    CNetMessage& msg{poll_result->first};
 4974|  23.6k|    bool fMoreWork = poll_result->second;
 4975|       |
 4976|  23.6k|    TRACEPOINT(net, inbound_message,
 4977|  23.6k|        pfrom->GetId(),
 4978|  23.6k|        pfrom->m_addr_name.c_str(),
 4979|  23.6k|        pfrom->ConnectionTypeAsString().c_str(),
 4980|  23.6k|        msg.m_type.c_str(),
 4981|  23.6k|        msg.m_recv.size(),
 4982|  23.6k|        msg.m_recv.data()
 4983|  23.6k|    );
 4984|       |
 4985|  23.6k|    if (m_opts.capture_messages) {
  ------------------
  |  Branch (4985:9): [True: 0, False: 23.6k]
  ------------------
 4986|      0|        CaptureMessage(pfrom->addr, msg.m_type, MakeUCharSpan(msg.m_recv), /*is_incoming=*/true);
 4987|      0|    }
 4988|       |
 4989|  23.6k|    try {
 4990|  23.6k|        ProcessMessage(*pfrom, msg.m_type, msg.m_recv, msg.m_time, interruptMsgProc);
 4991|  23.6k|        if (interruptMsgProc) return false;
  ------------------
  |  Branch (4991:13): [True: 0, False: 23.6k]
  ------------------
 4992|  23.6k|        {
 4993|  23.6k|            LOCK(peer->m_getdata_requests_mutex);
  ------------------
  |  |  257|  23.6k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  23.6k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  23.6k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  23.6k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4994|  23.6k|            if (!peer->m_getdata_requests.empty()) fMoreWork = true;
  ------------------
  |  Branch (4994:17): [True: 520, False: 23.0k]
  ------------------
 4995|  23.6k|        }
 4996|       |        // Does this peer has an orphan ready to reconsider?
 4997|       |        // (Note: we may have provided a parent for an orphan provided
 4998|       |        //  by another peer that was already processed; in that case,
 4999|       |        //  the extra work may not be noticed, possibly resulting in an
 5000|       |        //  unnecessary 100ms delay)
 5001|  23.6k|        LOCK(m_tx_download_mutex);
  ------------------
  |  |  257|  23.6k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  23.6k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  23.6k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  23.6k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5002|  23.6k|        if (m_txdownloadman.HaveMoreWork(peer->m_id)) fMoreWork = true;
  ------------------
  |  Branch (5002:13): [True: 0, False: 23.6k]
  ------------------
 5003|  23.6k|    } catch (const std::exception& e) {
 5004|  1.40k|        LogDebug(BCLog::NET, "%s(%s, %u bytes): Exception '%s' (%s) caught\n", __func__, SanitizeString(msg.m_type), msg.m_message_size, e.what(), typeid(e).name());
  ------------------
  |  |  280|  1.40k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  1.40k|    do {                                                  \
  |  |  |  |  274|  1.40k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1.40k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  1.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5005|  1.40k|    } catch (...) {
 5006|      0|        LogDebug(BCLog::NET, "%s(%s, %u bytes): Unknown exception caught\n", __func__, SanitizeString(msg.m_type), msg.m_message_size);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5007|      0|    }
 5008|       |
 5009|  23.6k|    return fMoreWork;
 5010|  23.6k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl15ProcessOrphanTxERNS_4PeerE:
 3073|   454k|{
 3074|   454k|    AssertLockHeld(g_msgproc_mutex);
  ------------------
  |  |  142|   454k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3075|   454k|    LOCK2(::cs_main, m_tx_download_mutex);
  ------------------
  |  |  259|   454k|    UniqueLock criticalblock1(MaybeCheckNotHeld(cs1), #cs1, __FILE__, __LINE__); \
  |  |  260|   454k|    UniqueLock criticalblock2(MaybeCheckNotHeld(cs2), #cs2, __FILE__, __LINE__)
  ------------------
 3076|       |
 3077|   454k|    CTransactionRef porphanTx = nullptr;
 3078|       |
 3079|   454k|    while (CTransactionRef porphanTx = m_txdownloadman.GetTxToReconsider(peer.m_id)) {
  ------------------
  |  Branch (3079:28): [True: 0, False: 454k]
  ------------------
 3080|      0|        const MempoolAcceptResult result = m_chainman.ProcessTransaction(porphanTx);
 3081|      0|        const TxValidationState& state = result.m_state;
 3082|      0|        const Txid& orphanHash = porphanTx->GetHash();
 3083|      0|        const Wtxid& orphan_wtxid = porphanTx->GetWitnessHash();
 3084|       |
 3085|      0|        if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
  ------------------
  |  Branch (3085:13): [True: 0, False: 0]
  ------------------
 3086|      0|            LogDebug(BCLog::TXPACKAGES, "   accepted orphan tx %s (wtxid=%s)\n", orphanHash.ToString(), orphan_wtxid.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3087|      0|            ProcessValidTx(peer.m_id, porphanTx, result.m_replaced_transactions);
 3088|      0|            return true;
 3089|      0|        } else if (state.GetResult() != TxValidationResult::TX_MISSING_INPUTS) {
  ------------------
  |  Branch (3089:20): [True: 0, False: 0]
  ------------------
 3090|      0|            LogDebug(BCLog::TXPACKAGES, "   invalid orphan tx %s (wtxid=%s) from peer=%d. %s\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3091|      0|                orphanHash.ToString(),
 3092|      0|                orphan_wtxid.ToString(),
 3093|      0|                peer.m_id,
 3094|      0|                state.ToString());
 3095|       |
 3096|      0|            if (Assume(state.IsInvalid() &&
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  |  |  ------------------
  |  |  |  Branch (97:21): [True: 0, False: 0]
  |  |  |  Branch (97:51): [True: 0, False: 0]
  |  |  |  Branch (97:51): [True: 0, False: 0]
  |  |  |  Branch (97:51): [True: 0, False: 0]
  |  |  |  Branch (97:51): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3097|      0|                       state.GetResult() != TxValidationResult::TX_UNKNOWN &&
 3098|      0|                       state.GetResult() != TxValidationResult::TX_NO_MEMPOOL &&
 3099|      0|                       state.GetResult() != TxValidationResult::TX_RESULT_UNSET)) {
 3100|      0|                ProcessInvalidTx(peer.m_id, porphanTx, state, /*first_time_failure=*/false);
 3101|      0|            }
 3102|      0|            return true;
 3103|      0|        }
 3104|      0|    }
 3105|       |
 3106|   454k|    return false;
 3107|   454k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl12SendMessagesEP5CNode:
 5424|   462k|{
 5425|   462k|    AssertLockNotHeld(m_tx_download_mutex);
  ------------------
  |  |  147|   462k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 5426|   462k|    AssertLockHeld(g_msgproc_mutex);
  ------------------
  |  |  142|   462k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 5427|       |
 5428|   462k|    PeerRef peer = GetPeerRef(pto->GetId());
 5429|   462k|    if (!peer) return false;
  ------------------
  |  Branch (5429:9): [True: 0, False: 462k]
  ------------------
 5430|   462k|    const Consensus::Params& consensusParams = m_chainparams.GetConsensus();
 5431|       |
 5432|       |    // We must call MaybeDiscourageAndDisconnect first, to ensure that we'll
 5433|       |    // disconnect misbehaving peers even before the version handshake is complete.
 5434|   462k|    if (MaybeDiscourageAndDisconnect(*pto, *peer)) return true;
  ------------------
  |  Branch (5434:9): [True: 310, False: 462k]
  ------------------
 5435|       |
 5436|       |    // Initiate version handshake for outbound connections
 5437|   462k|    if (!pto->IsInboundConn() && !peer->m_outbound_version_message_sent) {
  ------------------
  |  Branch (5437:9): [True: 184k, False: 277k]
  |  Branch (5437:34): [True: 3.31k, False: 181k]
  ------------------
 5438|  3.31k|        PushNodeVersion(*pto, *peer);
 5439|  3.31k|        peer->m_outbound_version_message_sent = true;
 5440|  3.31k|    }
 5441|       |
 5442|       |    // Don't send anything until the version handshake is complete
 5443|   462k|    if (!pto->fSuccessfullyConnected || pto->fDisconnect)
  ------------------
  |  Branch (5443:9): [True: 17.8k, False: 444k]
  |  Branch (5443:41): [True: 459, False: 444k]
  ------------------
 5444|  18.2k|        return true;
 5445|       |
 5446|   444k|    const auto current_time{GetTime<std::chrono::microseconds>()};
 5447|       |
 5448|   444k|    if (pto->IsAddrFetchConn() && current_time - pto->m_connected > 10 * AVG_ADDRESS_BROADCAST_INTERVAL) {
  ------------------
  |  Branch (5448:9): [True: 1.13k, False: 443k]
  |  Branch (5448:9): [True: 55, False: 444k]
  |  Branch (5448:35): [True: 55, False: 1.08k]
  ------------------
 5449|     55|        LogDebug(BCLog::NET, "addrfetch connection timeout, %s\n", pto->DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|     55|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     55|    do {                                                  \
  |  |  |  |  274|     55|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 55]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     55|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5450|     55|        pto->fDisconnect = true;
 5451|     55|        return true;
 5452|     55|    }
 5453|       |
 5454|   444k|    MaybeSendPing(*pto, *peer, current_time);
 5455|       |
 5456|       |    // MaybeSendPing may have marked peer for disconnection
 5457|   444k|    if (pto->fDisconnect) return true;
  ------------------
  |  Branch (5457:9): [True: 2.23k, False: 442k]
  ------------------
 5458|       |
 5459|   442k|    MaybeSendAddr(*pto, *peer, current_time);
 5460|       |
 5461|   442k|    MaybeSendSendHeaders(*pto, *peer);
 5462|       |
 5463|   442k|    {
 5464|   442k|        LOCK(cs_main);
  ------------------
  |  |  257|   442k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   442k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   442k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   442k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5465|       |
 5466|   442k|        CNodeState &state = *State(pto->GetId());
 5467|       |
 5468|       |        // Start block sync
 5469|   442k|        if (m_chainman.m_best_header == nullptr) {
  ------------------
  |  Branch (5469:13): [True: 0, False: 442k]
  ------------------
 5470|      0|            m_chainman.m_best_header = m_chainman.ActiveChain().Tip();
 5471|      0|        }
 5472|       |
 5473|       |        // Determine whether we might try initial headers sync or parallel
 5474|       |        // block download from this peer -- this mostly affects behavior while
 5475|       |        // in IBD (once out of IBD, we sync from all peers).
 5476|   442k|        bool sync_blocks_and_headers_from_peer = false;
 5477|   442k|        if (state.fPreferredDownload) {
  ------------------
  |  Branch (5477:13): [True: 173k, False: 268k]
  ------------------
 5478|   173k|            sync_blocks_and_headers_from_peer = true;
 5479|   268k|        } else if (CanServeBlocks(*peer) && !pto->IsAddrFetchConn()) {
  ------------------
  |  Branch (5479:20): [True: 137k, False: 131k]
  |  Branch (5479:45): [True: 136k, False: 1.08k]
  ------------------
 5480|       |            // Typically this is an inbound peer. If we don't have any outbound
 5481|       |            // peers, or if we aren't downloading any blocks from such peers,
 5482|       |            // then allow block downloads from this peer, too.
 5483|       |            // We prefer downloading blocks from outbound peers to avoid
 5484|       |            // putting undue load on (say) some home user who is just making
 5485|       |            // outbound connections to the network, but if our only source of
 5486|       |            // the latest blocks is from an inbound peer, we have to be sure to
 5487|       |            // eventually download it (and not just wait indefinitely for an
 5488|       |            // outbound peer to have it).
 5489|   136k|            if (m_num_preferred_download_peers == 0 || mapBlocksInFlight.empty()) {
  ------------------
  |  Branch (5489:17): [True: 136k, False: 0]
  |  Branch (5489:56): [True: 0, False: 0]
  ------------------
 5490|   136k|                sync_blocks_and_headers_from_peer = true;
 5491|   136k|            }
 5492|   136k|        }
 5493|       |
 5494|   442k|        if (!state.fSyncStarted && CanServeBlocks(*peer) && !m_chainman.m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (5494:13): [True: 135k, False: 306k]
  |  Branch (5494:36): [True: 3.85k, False: 131k]
  |  Branch (5494:61): [True: 3.85k, False: 0]
  ------------------
 5495|       |            // Only actively request headers from a single peer, unless we're close to today.
 5496|  3.85k|            if ((nSyncStarted == 0 && sync_blocks_and_headers_from_peer) || m_chainman.m_best_header->Time() > NodeClock::now() - 24h) {
  ------------------
  |  Branch (5496:17): [True: 3.73k, False: 121]
  |  Branch (5496:18): [True: 3.85k, False: 0]
  |  Branch (5496:39): [True: 3.59k, False: 260]
  |  Branch (5496:77): [True: 139, False: 121]
  ------------------
 5497|  3.73k|                const CBlockIndex* pindexStart = m_chainman.m_best_header;
 5498|       |                /* If possible, start at the block preceding the currently
 5499|       |                   best known header.  This ensures that we always get a
 5500|       |                   non-empty list of headers back as long as the peer
 5501|       |                   is up-to-date.  With a non-empty response, we can initialise
 5502|       |                   the peer's known best block.  This wouldn't be possible
 5503|       |                   if we requested starting at m_chainman.m_best_header and
 5504|       |                   got back an empty response.  */
 5505|  3.73k|                if (pindexStart->pprev)
  ------------------
  |  Branch (5505:21): [True: 3.73k, False: 0]
  ------------------
 5506|  3.73k|                    pindexStart = pindexStart->pprev;
 5507|  3.73k|                if (MaybeSendGetHeaders(*pto, GetLocator(pindexStart), *peer)) {
  ------------------
  |  Branch (5507:21): [True: 3.73k, False: 0]
  ------------------
 5508|  3.73k|                    LogDebug(BCLog::NET, "initial getheaders (%d) to peer=%d (startheight:%d)\n", pindexStart->nHeight, pto->GetId(), peer->m_starting_height);
  ------------------
  |  |  280|  3.73k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  3.73k|    do {                                                  \
  |  |  |  |  274|  3.73k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3.73k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  3.73k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5509|       |
 5510|  3.73k|                    state.fSyncStarted = true;
 5511|  3.73k|                    peer->m_headers_sync_timeout = current_time + HEADERS_DOWNLOAD_TIMEOUT_BASE +
 5512|  3.73k|                        (
 5513|       |                         // Convert HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER to microseconds before scaling
 5514|       |                         // to maintain precision
 5515|  3.73k|                         std::chrono::microseconds{HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER} *
 5516|  3.73k|                         Ticks<std::chrono::seconds>(NodeClock::now() - m_chainman.m_best_header->Time()) / consensusParams.nPowTargetSpacing
 5517|  3.73k|                        );
 5518|  3.73k|                    nSyncStarted++;
 5519|  3.73k|                }
 5520|  3.73k|            }
 5521|  3.85k|        }
 5522|       |
 5523|       |        //
 5524|       |        // Try sending block announcements via headers
 5525|       |        //
 5526|   442k|        {
 5527|       |            // If we have no more than MAX_BLOCKS_TO_ANNOUNCE in our
 5528|       |            // list of block hashes we're relaying, and our peer wants
 5529|       |            // headers announcements, then find the first header
 5530|       |            // not yet known to our peer but would connect, and send.
 5531|       |            // If no header would connect, or if we have too many
 5532|       |            // blocks, or if the peer doesn't want headers, just
 5533|       |            // add all to the inv queue.
 5534|   442k|            LOCK(peer->m_block_inv_mutex);
  ------------------
  |  |  257|   442k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   442k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   442k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   442k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5535|   442k|            std::vector<CBlock> vHeaders;
 5536|   442k|            bool fRevertToInv = ((!peer->m_prefers_headers &&
  ------------------
  |  Branch (5536:35): [True: 442k, False: 3]
  ------------------
 5537|   442k|                                 (!state.m_requested_hb_cmpctblocks || peer->m_blocks_for_headers_relay.size() > 1)) ||
  ------------------
  |  Branch (5537:35): [True: 442k, False: 1]
  |  Branch (5537:72): [True: 0, False: 1]
  ------------------
 5538|   442k|                                 peer->m_blocks_for_headers_relay.size() > MAX_BLOCKS_TO_ANNOUNCE);
  ------------------
  |  Branch (5538:34): [True: 0, False: 4]
  ------------------
 5539|   442k|            const CBlockIndex *pBestIndex = nullptr; // last header queued for delivery
 5540|   442k|            ProcessBlockAvailability(pto->GetId()); // ensure pindexBestKnownBlock is up-to-date
 5541|       |
 5542|   442k|            if (!fRevertToInv) {
  ------------------
  |  Branch (5542:17): [True: 4, False: 442k]
  ------------------
 5543|      4|                bool fFoundStartingHeader = false;
 5544|       |                // Try to find first header that our peer doesn't have, and
 5545|       |                // then send all headers past that one.  If we come across any
 5546|       |                // headers that aren't on m_chainman.ActiveChain(), give up.
 5547|      4|                for (const uint256& hash : peer->m_blocks_for_headers_relay) {
  ------------------
  |  Branch (5547:42): [True: 0, False: 4]
  ------------------
 5548|      0|                    const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(hash);
 5549|      0|                    assert(pindex);
 5550|      0|                    if (m_chainman.ActiveChain()[pindex->nHeight] != pindex) {
  ------------------
  |  Branch (5550:25): [True: 0, False: 0]
  ------------------
 5551|       |                        // Bail out if we reorged away from this block
 5552|      0|                        fRevertToInv = true;
 5553|      0|                        break;
 5554|      0|                    }
 5555|      0|                    if (pBestIndex != nullptr && pindex->pprev != pBestIndex) {
  ------------------
  |  Branch (5555:25): [True: 0, False: 0]
  |  Branch (5555:50): [True: 0, False: 0]
  ------------------
 5556|       |                        // This means that the list of blocks to announce don't
 5557|       |                        // connect to each other.
 5558|       |                        // This shouldn't really be possible to hit during
 5559|       |                        // regular operation (because reorgs should take us to
 5560|       |                        // a chain that has some block not on the prior chain,
 5561|       |                        // which should be caught by the prior check), but one
 5562|       |                        // way this could happen is by using invalidateblock /
 5563|       |                        // reconsiderblock repeatedly on the tip, causing it to
 5564|       |                        // be added multiple times to m_blocks_for_headers_relay.
 5565|       |                        // Robustly deal with this rare situation by reverting
 5566|       |                        // to an inv.
 5567|      0|                        fRevertToInv = true;
 5568|      0|                        break;
 5569|      0|                    }
 5570|      0|                    pBestIndex = pindex;
 5571|      0|                    if (fFoundStartingHeader) {
  ------------------
  |  Branch (5571:25): [True: 0, False: 0]
  ------------------
 5572|       |                        // add this to the headers message
 5573|      0|                        vHeaders.emplace_back(pindex->GetBlockHeader());
 5574|      0|                    } else if (PeerHasHeader(&state, pindex)) {
  ------------------
  |  Branch (5574:32): [True: 0, False: 0]
  ------------------
 5575|      0|                        continue; // keep looking for the first new block
 5576|      0|                    } else if (pindex->pprev == nullptr || PeerHasHeader(&state, pindex->pprev)) {
  ------------------
  |  Branch (5576:32): [True: 0, False: 0]
  |  Branch (5576:60): [True: 0, False: 0]
  ------------------
 5577|       |                        // Peer doesn't have this header but they do have the prior one.
 5578|       |                        // Start sending headers.
 5579|      0|                        fFoundStartingHeader = true;
 5580|      0|                        vHeaders.emplace_back(pindex->GetBlockHeader());
 5581|      0|                    } else {
 5582|       |                        // Peer doesn't have this header or the prior one -- nothing will
 5583|       |                        // connect, so bail out.
 5584|      0|                        fRevertToInv = true;
 5585|      0|                        break;
 5586|      0|                    }
 5587|      0|                }
 5588|      4|            }
 5589|   442k|            if (!fRevertToInv && !vHeaders.empty()) {
  ------------------
  |  Branch (5589:17): [True: 4, False: 442k]
  |  Branch (5589:34): [True: 0, False: 4]
  ------------------
 5590|      0|                if (vHeaders.size() == 1 && state.m_requested_hb_cmpctblocks) {
  ------------------
  |  Branch (5590:21): [True: 0, False: 0]
  |  Branch (5590:45): [True: 0, False: 0]
  ------------------
 5591|       |                    // We only send up to 1 block as header-and-ids, as otherwise
 5592|       |                    // probably means we're doing an initial-ish-sync or they're slow
 5593|      0|                    LogDebug(BCLog::NET, "%s sending header-and-ids %s to peer=%d\n", __func__,
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5594|      0|                            vHeaders.front().GetHash().ToString(), pto->GetId());
 5595|       |
 5596|      0|                    std::optional<CSerializedNetMsg> cached_cmpctblock_msg;
 5597|      0|                    {
 5598|      0|                        LOCK(m_most_recent_block_mutex);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5599|      0|                        if (m_most_recent_block_hash == pBestIndex->GetBlockHash()) {
  ------------------
  |  Branch (5599:29): [True: 0, False: 0]
  ------------------
 5600|      0|                            cached_cmpctblock_msg = NetMsg::Make(NetMsgType::CMPCTBLOCK, *m_most_recent_compact_block);
 5601|      0|                        }
 5602|      0|                    }
 5603|      0|                    if (cached_cmpctblock_msg.has_value()) {
  ------------------
  |  Branch (5603:25): [True: 0, False: 0]
  ------------------
 5604|      0|                        PushMessage(*pto, std::move(cached_cmpctblock_msg.value()));
 5605|      0|                    } else {
 5606|      0|                        CBlock block;
 5607|      0|                        const bool ret{m_chainman.m_blockman.ReadBlock(block, *pBestIndex)};
 5608|      0|                        assert(ret);
 5609|      0|                        CBlockHeaderAndShortTxIDs cmpctblock{block, m_rng.rand64()};
 5610|      0|                        MakeAndPushMessage(*pto, NetMsgType::CMPCTBLOCK, cmpctblock);
 5611|      0|                    }
 5612|      0|                    state.pindexBestHeaderSent = pBestIndex;
 5613|      0|                } else if (peer->m_prefers_headers) {
  ------------------
  |  Branch (5613:28): [True: 0, False: 0]
  ------------------
 5614|      0|                    if (vHeaders.size() > 1) {
  ------------------
  |  Branch (5614:25): [True: 0, False: 0]
  ------------------
 5615|      0|                        LogDebug(BCLog::NET, "%s: %u headers, range (%s, %s), to peer=%d\n", __func__,
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5616|      0|                                vHeaders.size(),
 5617|      0|                                vHeaders.front().GetHash().ToString(),
 5618|      0|                                vHeaders.back().GetHash().ToString(), pto->GetId());
 5619|      0|                    } else {
 5620|      0|                        LogDebug(BCLog::NET, "%s: sending header %s to peer=%d\n", __func__,
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5621|      0|                                vHeaders.front().GetHash().ToString(), pto->GetId());
 5622|      0|                    }
 5623|      0|                    MakeAndPushMessage(*pto, NetMsgType::HEADERS, TX_WITH_WITNESS(vHeaders));
 5624|      0|                    state.pindexBestHeaderSent = pBestIndex;
 5625|      0|                } else
 5626|      0|                    fRevertToInv = true;
 5627|      0|            }
 5628|   442k|            if (fRevertToInv) {
  ------------------
  |  Branch (5628:17): [True: 442k, False: 4]
  ------------------
 5629|       |                // If falling back to using an inv, just try to inv the tip.
 5630|       |                // The last entry in m_blocks_for_headers_relay was our tip at some point
 5631|       |                // in the past.
 5632|   442k|                if (!peer->m_blocks_for_headers_relay.empty()) {
  ------------------
  |  Branch (5632:21): [True: 0, False: 442k]
  ------------------
 5633|      0|                    const uint256& hashToAnnounce = peer->m_blocks_for_headers_relay.back();
 5634|      0|                    const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(hashToAnnounce);
 5635|      0|                    assert(pindex);
 5636|       |
 5637|       |                    // Warn if we're announcing a block that is not on the main chain.
 5638|       |                    // This should be very rare and could be optimized out.
 5639|       |                    // Just log for now.
 5640|      0|                    if (m_chainman.ActiveChain()[pindex->nHeight] != pindex) {
  ------------------
  |  Branch (5640:25): [True: 0, False: 0]
  ------------------
 5641|      0|                        LogDebug(BCLog::NET, "Announcing block %s not on main chain (tip=%s)\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5642|      0|                            hashToAnnounce.ToString(), m_chainman.ActiveChain().Tip()->GetBlockHash().ToString());
 5643|      0|                    }
 5644|       |
 5645|       |                    // If the peer's chain has this block, don't inv it back.
 5646|      0|                    if (!PeerHasHeader(&state, pindex)) {
  ------------------
  |  Branch (5646:25): [True: 0, False: 0]
  ------------------
 5647|      0|                        peer->m_blocks_for_inv_relay.push_back(hashToAnnounce);
 5648|      0|                        LogDebug(BCLog::NET, "%s: sending inv peer=%d hash=%s\n", __func__,
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5649|      0|                            pto->GetId(), hashToAnnounce.ToString());
 5650|      0|                    }
 5651|      0|                }
 5652|   442k|            }
 5653|   442k|            peer->m_blocks_for_headers_relay.clear();
 5654|   442k|        }
 5655|       |
 5656|       |        //
 5657|       |        // Message: inventory
 5658|       |        //
 5659|      0|        std::vector<CInv> vInv;
 5660|   442k|        {
 5661|   442k|            LOCK(peer->m_block_inv_mutex);
  ------------------
  |  |  257|   442k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   442k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   442k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   442k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5662|   442k|            vInv.reserve(std::max<size_t>(peer->m_blocks_for_inv_relay.size(), INVENTORY_BROADCAST_TARGET));
 5663|       |
 5664|       |            // Add blocks
 5665|   442k|            for (const uint256& hash : peer->m_blocks_for_inv_relay) {
  ------------------
  |  Branch (5665:38): [True: 3.95k, False: 442k]
  ------------------
 5666|  3.95k|                vInv.emplace_back(MSG_BLOCK, hash);
 5667|  3.95k|                if (vInv.size() == MAX_INV_SZ) {
  ------------------
  |  Branch (5667:21): [True: 0, False: 3.95k]
  ------------------
 5668|      0|                    MakeAndPushMessage(*pto, NetMsgType::INV, vInv);
 5669|      0|                    vInv.clear();
 5670|      0|                }
 5671|  3.95k|            }
 5672|   442k|            peer->m_blocks_for_inv_relay.clear();
 5673|   442k|        }
 5674|       |
 5675|   442k|        if (auto tx_relay = peer->GetTxRelay(); tx_relay != nullptr) {
  ------------------
  |  Branch (5675:49): [True: 433k, False: 8.72k]
  ------------------
 5676|   433k|                LOCK(tx_relay->m_tx_inventory_mutex);
  ------------------
  |  |  257|   433k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   433k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   433k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   433k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5677|       |                // Check whether periodic sends should happen
 5678|   433k|                bool fSendTrickle = pto->HasPermission(NetPermissionFlags::NoBan);
 5679|   433k|                if (tx_relay->m_next_inv_send_time < current_time) {
  ------------------
  |  Branch (5679:21): [True: 5.75k, False: 427k]
  ------------------
 5680|  5.75k|                    fSendTrickle = true;
 5681|  5.75k|                    if (pto->IsInboundConn()) {
  ------------------
  |  Branch (5681:25): [True: 3.38k, False: 2.36k]
  ------------------
 5682|  3.38k|                        tx_relay->m_next_inv_send_time = NextInvToInbounds(current_time, INBOUND_INVENTORY_BROADCAST_INTERVAL);
 5683|  3.38k|                    } else {
 5684|  2.36k|                        tx_relay->m_next_inv_send_time = current_time + m_rng.rand_exp_duration(OUTBOUND_INVENTORY_BROADCAST_INTERVAL);
 5685|  2.36k|                    }
 5686|  5.75k|                }
 5687|       |
 5688|       |                // Time to send but the peer has requested we not relay transactions.
 5689|   433k|                if (fSendTrickle) {
  ------------------
  |  Branch (5689:21): [True: 26.3k, False: 406k]
  ------------------
 5690|  26.3k|                    LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|  26.3k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  26.3k|#define 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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5691|  26.3k|                    if (!tx_relay->m_relay_txs) tx_relay->m_tx_inventory_to_send.clear();
  ------------------
  |  Branch (5691:25): [True: 18.4k, False: 7.91k]
  ------------------
 5692|  26.3k|                }
 5693|       |
 5694|       |                // Respond to BIP35 mempool requests
 5695|   433k|                if (fSendTrickle && tx_relay->m_send_mempool) {
  ------------------
  |  Branch (5695:21): [True: 26.3k, False: 406k]
  |  Branch (5695:37): [True: 3, False: 26.3k]
  ------------------
 5696|      3|                    auto vtxinfo = m_mempool.infoAll();
 5697|      3|                    tx_relay->m_send_mempool = false;
 5698|      3|                    const CFeeRate filterrate{tx_relay->m_fee_filter_received.load()};
 5699|       |
 5700|      3|                    LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|      3|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      3|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      3|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      3|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5701|       |
 5702|      3|                    for (const auto& txinfo : vtxinfo) {
  ------------------
  |  Branch (5702:45): [True: 0, False: 3]
  ------------------
 5703|      0|                        CInv inv{
 5704|      0|                            peer->m_wtxid_relay ? MSG_WTX : MSG_TX,
  ------------------
  |  Branch (5704:29): [True: 0, False: 0]
  ------------------
 5705|      0|                            peer->m_wtxid_relay ?
  ------------------
  |  Branch (5705:29): [True: 0, False: 0]
  ------------------
 5706|      0|                                txinfo.tx->GetWitnessHash().ToUint256() :
 5707|      0|                                txinfo.tx->GetHash().ToUint256(),
 5708|      0|                        };
 5709|      0|                        tx_relay->m_tx_inventory_to_send.erase(inv.hash);
 5710|       |
 5711|       |                        // Don't send transactions that peers will not put into their mempool
 5712|      0|                        if (txinfo.fee < filterrate.GetFee(txinfo.vsize)) {
  ------------------
  |  Branch (5712:29): [True: 0, False: 0]
  ------------------
 5713|      0|                            continue;
 5714|      0|                        }
 5715|      0|                        if (tx_relay->m_bloom_filter) {
  ------------------
  |  Branch (5715:29): [True: 0, False: 0]
  ------------------
 5716|      0|                            if (!tx_relay->m_bloom_filter->IsRelevantAndUpdate(*txinfo.tx)) continue;
  ------------------
  |  Branch (5716:33): [True: 0, False: 0]
  ------------------
 5717|      0|                        }
 5718|      0|                        tx_relay->m_tx_inventory_known_filter.insert(inv.hash);
 5719|      0|                        vInv.push_back(inv);
 5720|      0|                        if (vInv.size() == MAX_INV_SZ) {
  ------------------
  |  Branch (5720:29): [True: 0, False: 0]
  ------------------
 5721|      0|                            MakeAndPushMessage(*pto, NetMsgType::INV, vInv);
 5722|      0|                            vInv.clear();
 5723|      0|                        }
 5724|      0|                    }
 5725|      3|                }
 5726|       |
 5727|       |                // Determine transactions to relay
 5728|   433k|                if (fSendTrickle) {
  ------------------
  |  Branch (5728:21): [True: 26.3k, False: 406k]
  ------------------
 5729|       |                    // Produce a vector with all candidates for sending
 5730|  26.3k|                    std::vector<std::set<uint256>::iterator> vInvTx;
 5731|  26.3k|                    vInvTx.reserve(tx_relay->m_tx_inventory_to_send.size());
 5732|  26.3k|                    for (std::set<uint256>::iterator it = tx_relay->m_tx_inventory_to_send.begin(); it != tx_relay->m_tx_inventory_to_send.end(); it++) {
  ------------------
  |  Branch (5732:101): [True: 0, False: 26.3k]
  ------------------
 5733|      0|                        vInvTx.push_back(it);
 5734|      0|                    }
 5735|  26.3k|                    const CFeeRate filterrate{tx_relay->m_fee_filter_received.load()};
 5736|       |                    // Topologically and fee-rate sort the inventory we send for privacy and priority reasons.
 5737|       |                    // A heap is used so that not all items need sorting if only a few are being sent.
 5738|  26.3k|                    CompareInvMempoolOrder compareInvMempoolOrder(&m_mempool, peer->m_wtxid_relay);
 5739|  26.3k|                    std::make_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder);
 5740|       |                    // No reason to drain out at many times the network's capacity,
 5741|       |                    // especially since we have many peers and some will draw much shorter delays.
 5742|  26.3k|                    unsigned int nRelayedTransactions = 0;
 5743|  26.3k|                    LOCK(tx_relay->m_bloom_filter_mutex);
  ------------------
  |  |  257|  26.3k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  26.3k|#define 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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5744|  26.3k|                    size_t broadcast_max{INVENTORY_BROADCAST_TARGET + (tx_relay->m_tx_inventory_to_send.size()/1000)*5};
 5745|  26.3k|                    broadcast_max = std::min<size_t>(INVENTORY_BROADCAST_MAX, broadcast_max);
 5746|  26.3k|                    while (!vInvTx.empty() && nRelayedTransactions < broadcast_max) {
  ------------------
  |  Branch (5746:28): [True: 0, False: 26.3k]
  |  Branch (5746:47): [True: 0, False: 0]
  ------------------
 5747|       |                        // Fetch the top element from the heap
 5748|      0|                        std::pop_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder);
 5749|      0|                        std::set<uint256>::iterator it = vInvTx.back();
 5750|      0|                        vInvTx.pop_back();
 5751|      0|                        uint256 hash = *it;
 5752|      0|                        CInv inv(peer->m_wtxid_relay ? MSG_WTX : MSG_TX, hash);
  ------------------
  |  Branch (5752:34): [True: 0, False: 0]
  ------------------
 5753|       |                        // Remove it from the to-be-sent set
 5754|      0|                        tx_relay->m_tx_inventory_to_send.erase(it);
 5755|       |                        // Check if not in the filter already
 5756|      0|                        if (tx_relay->m_tx_inventory_known_filter.contains(hash)) {
  ------------------
  |  Branch (5756:29): [True: 0, False: 0]
  ------------------
 5757|      0|                            continue;
 5758|      0|                        }
 5759|       |                        // Not in the mempool anymore? don't bother sending it.
 5760|      0|                        auto txinfo = m_mempool.info(ToGenTxid(inv));
 5761|      0|                        if (!txinfo.tx) {
  ------------------
  |  Branch (5761:29): [True: 0, False: 0]
  ------------------
 5762|      0|                            continue;
 5763|      0|                        }
 5764|       |                        // Peer told you to not send transactions at that feerate? Don't bother sending it.
 5765|      0|                        if (txinfo.fee < filterrate.GetFee(txinfo.vsize)) {
  ------------------
  |  Branch (5765:29): [True: 0, False: 0]
  ------------------
 5766|      0|                            continue;
 5767|      0|                        }
 5768|      0|                        if (tx_relay->m_bloom_filter && !tx_relay->m_bloom_filter->IsRelevantAndUpdate(*txinfo.tx)) continue;
  ------------------
  |  Branch (5768:29): [True: 0, False: 0]
  |  Branch (5768:57): [True: 0, False: 0]
  ------------------
 5769|       |                        // Send
 5770|      0|                        vInv.push_back(inv);
 5771|      0|                        nRelayedTransactions++;
 5772|      0|                        if (vInv.size() == MAX_INV_SZ) {
  ------------------
  |  Branch (5772:29): [True: 0, False: 0]
  ------------------
 5773|      0|                            MakeAndPushMessage(*pto, NetMsgType::INV, vInv);
 5774|      0|                            vInv.clear();
 5775|      0|                        }
 5776|      0|                        tx_relay->m_tx_inventory_known_filter.insert(hash);
 5777|      0|                    }
 5778|       |
 5779|       |                    // Ensure we'll respond to GETDATA requests for anything we've just announced
 5780|  26.3k|                    LOCK(m_mempool.cs);
  ------------------
  |  |  257|  26.3k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  26.3k|#define 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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5781|  26.3k|                    tx_relay->m_last_inv_sequence = m_mempool.GetSequence();
 5782|  26.3k|                }
 5783|   433k|        }
 5784|   442k|        if (!vInv.empty())
  ------------------
  |  Branch (5784:13): [True: 39, False: 441k]
  ------------------
 5785|     39|            MakeAndPushMessage(*pto, NetMsgType::INV, vInv);
 5786|       |
 5787|       |        // Detect whether we're stalling
 5788|   442k|        auto stalling_timeout = m_block_stalling_timeout.load();
 5789|   442k|        if (state.m_stalling_since.count() && state.m_stalling_since < current_time - stalling_timeout) {
  ------------------
  |  Branch (5789:13): [True: 0, False: 442k]
  |  Branch (5789:13): [True: 0, False: 442k]
  |  Branch (5789:47): [True: 0, False: 0]
  ------------------
 5790|       |            // Stalling only triggers when the block download window cannot move. During normal steady state,
 5791|       |            // the download window should be much larger than the to-be-downloaded set of blocks, so disconnection
 5792|       |            // should only happen during initial block download.
 5793|      0|            LogInfo("Peer is stalling block download, %s\n", pto->DisconnectMsg(fLogIPs));
  ------------------
  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 5794|      0|            pto->fDisconnect = true;
 5795|       |            // Increase timeout for the next peer so that we don't disconnect multiple peers if our own
 5796|       |            // bandwidth is insufficient.
 5797|      0|            const auto new_timeout = std::min(2 * stalling_timeout, BLOCK_STALLING_TIMEOUT_MAX);
 5798|      0|            if (stalling_timeout != new_timeout && m_block_stalling_timeout.compare_exchange_strong(stalling_timeout, new_timeout)) {
  ------------------
  |  Branch (5798:17): [True: 0, False: 0]
  |  Branch (5798:52): [True: 0, False: 0]
  ------------------
 5799|      0|                LogDebug(BCLog::NET, "Increased stalling timeout temporarily to %d seconds\n", count_seconds(new_timeout));
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5800|      0|            }
 5801|      0|            return true;
 5802|      0|        }
 5803|       |        // In case there is a block that has been in flight from this peer for block_interval * (1 + 0.5 * N)
 5804|       |        // (with N the number of peers from which we're downloading validated blocks), disconnect due to timeout.
 5805|       |        // We compensate for other peers to prevent killing off peers due to our own downstream link
 5806|       |        // being saturated. We only count validated in-flight blocks so peers can't advertise non-existing block hashes
 5807|       |        // to unreasonably increase our timeout.
 5808|   442k|        if (state.vBlocksInFlight.size() > 0) {
  ------------------
  |  Branch (5808:13): [True: 11, False: 441k]
  ------------------
 5809|     11|            QueuedBlock &queuedBlock = state.vBlocksInFlight.front();
 5810|     11|            int nOtherPeersWithValidatedDownloads = m_peers_downloading_from - 1;
 5811|     11|            if (current_time > state.m_downloading_since + std::chrono::seconds{consensusParams.nPowTargetSpacing} * (BLOCK_DOWNLOAD_TIMEOUT_BASE + BLOCK_DOWNLOAD_TIMEOUT_PER_PEER * nOtherPeersWithValidatedDownloads)) {
  ------------------
  |  Branch (5811:17): [True: 0, False: 11]
  ------------------
 5812|      0|                LogInfo("Timeout downloading block %s, %s\n", queuedBlock.pindex->GetBlockHash().ToString(), pto->DisconnectMsg(fLogIPs));
  ------------------
  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 5813|      0|                pto->fDisconnect = true;
 5814|      0|                return true;
 5815|      0|            }
 5816|     11|        }
 5817|       |        // Check for headers sync timeouts
 5818|   442k|        if (state.fSyncStarted && peer->m_headers_sync_timeout < std::chrono::microseconds::max()) {
  ------------------
  |  Branch (5818:13): [True: 310k, False: 131k]
  |  Branch (5818:13): [True: 4.13k, False: 437k]
  |  Branch (5818:35): [True: 4.13k, False: 306k]
  ------------------
 5819|       |            // Detect whether this is a stalling initial-headers-sync peer
 5820|  4.13k|            if (m_chainman.m_best_header->Time() <= NodeClock::now() - 24h) {
  ------------------
  |  Branch (5820:17): [True: 747, False: 3.39k]
  ------------------
 5821|    747|                if (current_time > peer->m_headers_sync_timeout && nSyncStarted == 1 && (m_num_preferred_download_peers - state.fPreferredDownload >= 1)) {
  ------------------
  |  Branch (5821:21): [True: 14, False: 733]
  |  Branch (5821:68): [True: 14, False: 0]
  |  Branch (5821:89): [True: 0, False: 14]
  ------------------
 5822|       |                    // Disconnect a peer (without NetPermissionFlags::NoBan permission) if it is our only sync peer,
 5823|       |                    // and we have others we could be using instead.
 5824|       |                    // Note: If all our peers are inbound, then we won't
 5825|       |                    // disconnect our sync peer for stalling; we have bigger
 5826|       |                    // problems if we can't get any outbound peers.
 5827|      0|                    if (!pto->HasPermission(NetPermissionFlags::NoBan)) {
  ------------------
  |  Branch (5827:25): [True: 0, False: 0]
  ------------------
 5828|      0|                        LogInfo("Timeout downloading headers, %s\n", pto->DisconnectMsg(fLogIPs));
  ------------------
  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 5829|      0|                        pto->fDisconnect = true;
 5830|      0|                        return true;
 5831|      0|                    } else {
 5832|      0|                        LogInfo("Timeout downloading headers from noban peer, not %s\n", pto->DisconnectMsg(fLogIPs));
  ------------------
  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 5833|       |                        // Reset the headers sync state so that we have a
 5834|       |                        // chance to try downloading from a different peer.
 5835|       |                        // Note: this will also result in at least one more
 5836|       |                        // getheaders message to be sent to
 5837|       |                        // this peer (eventually).
 5838|      0|                        state.fSyncStarted = false;
 5839|      0|                        nSyncStarted--;
 5840|      0|                        peer->m_headers_sync_timeout = 0us;
 5841|      0|                    }
 5842|      0|                }
 5843|  3.39k|            } else {
 5844|       |                // After we've caught up once, reset the timeout so we can't trigger
 5845|       |                // disconnect later.
 5846|  3.39k|                peer->m_headers_sync_timeout = std::chrono::microseconds::max();
 5847|  3.39k|            }
 5848|  4.13k|        }
 5849|       |
 5850|       |        // Check that outbound peers have reasonable chains
 5851|       |        // GetTime() is used by this anti-DoS logic so we can test this using mocktime
 5852|   442k|        ConsiderEviction(*pto, *peer, GetTime<std::chrono::seconds>());
 5853|       |
 5854|       |        //
 5855|       |        // Message: getdata (blocks)
 5856|       |        //
 5857|   442k|        std::vector<CInv> vGetData;
 5858|   442k|        if (CanServeBlocks(*peer) && ((sync_blocks_and_headers_from_peer && !IsLimitedPeer(*peer)) || !m_chainman.IsInitialBlockDownload()) && state.vBlocksInFlight.size() < MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
  ------------------
  |  Branch (5858:13): [True: 310k, False: 131k]
  |  Branch (5858:40): [True: 309k, False: 1.08k]
  |  Branch (5858:77): [True: 271k, False: 38.2k]
  |  Branch (5858:103): [True: 17.2k, False: 22.1k]
  |  Branch (5858:144): [True: 288k, False: 0]
  ------------------
 5859|   288k|            std::vector<const CBlockIndex*> vToDownload;
 5860|   288k|            NodeId staller = -1;
 5861|   288k|            auto get_inflight_budget = [&state]() {
 5862|   288k|                return std::max(0, MAX_BLOCKS_IN_TRANSIT_PER_PEER - static_cast<int>(state.vBlocksInFlight.size()));
 5863|   288k|            };
 5864|       |
 5865|       |            // If a snapshot chainstate is in use, we want to find its next blocks
 5866|       |            // before the background chainstate to prioritize getting to network tip.
 5867|   288k|            FindNextBlocksToDownload(*peer, get_inflight_budget(), vToDownload, staller);
 5868|   288k|            if (m_chainman.BackgroundSyncInProgress() && !IsLimitedPeer(*peer)) {
  ------------------
  |  Branch (5868:17): [True: 0, False: 288k]
  |  Branch (5868:58): [True: 0, False: 0]
  ------------------
 5869|       |                // If the background tip is not an ancestor of the snapshot block,
 5870|       |                // we need to start requesting blocks from their last common ancestor.
 5871|      0|                const CBlockIndex *from_tip = LastCommonAncestor(m_chainman.GetBackgroundSyncTip(), m_chainman.GetSnapshotBaseBlock());
 5872|      0|                TryDownloadingHistoricalBlocks(
 5873|      0|                    *peer,
 5874|      0|                    get_inflight_budget(),
 5875|      0|                    vToDownload, from_tip,
 5876|      0|                    Assert(m_chainman.GetSnapshotBaseBlock()));
  ------------------
  |  |   85|      0|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 5877|      0|            }
 5878|   288k|            for (const CBlockIndex *pindex : vToDownload) {
  ------------------
  |  Branch (5878:44): [True: 9, False: 288k]
  ------------------
 5879|      9|                uint32_t nFetchFlags = GetFetchFlags(*peer);
 5880|      9|                vGetData.emplace_back(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash());
 5881|      9|                BlockRequested(pto->GetId(), *pindex);
 5882|      9|                LogDebug(BCLog::NET, "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(),
  ------------------
  |  |  280|      9|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      9|    do {                                                  \
  |  |  |  |  274|      9|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      9|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5883|      9|                    pindex->nHeight, pto->GetId());
 5884|      9|            }
 5885|   288k|            if (state.vBlocksInFlight.empty() && staller != -1) {
  ------------------
  |  Branch (5885:17): [True: 288k, False: 17]
  |  Branch (5885:50): [True: 0, False: 288k]
  ------------------
 5886|      0|                if (State(staller)->m_stalling_since == 0us) {
  ------------------
  |  Branch (5886:21): [True: 0, False: 0]
  ------------------
 5887|      0|                    State(staller)->m_stalling_since = current_time;
 5888|      0|                    LogDebug(BCLog::NET, "Stall started peer=%d\n", staller);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5889|      0|                }
 5890|      0|            }
 5891|   288k|        }
 5892|       |
 5893|       |        //
 5894|       |        // Message: getdata (transactions)
 5895|       |        //
 5896|   442k|        {
 5897|   442k|            LOCK(m_tx_download_mutex);
  ------------------
  |  |  257|   442k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   442k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   442k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   442k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5898|   841k|            for (const GenTxid& gtxid : m_txdownloadman.GetRequestsToSend(pto->GetId(), current_time)) {
  ------------------
  |  Branch (5898:39): [True: 841k, False: 442k]
  ------------------
 5899|   841k|                vGetData.emplace_back(gtxid.IsWtxid() ? MSG_WTX : (MSG_TX | GetFetchFlags(*peer)), gtxid.GetHash());
  ------------------
  |  Branch (5899:39): [True: 0, False: 841k]
  ------------------
 5900|   841k|                if (vGetData.size() >= MAX_GETDATA_SZ) {
  ------------------
  |  Branch (5900:21): [True: 632, False: 840k]
  ------------------
 5901|    632|                    MakeAndPushMessage(*pto, NetMsgType::GETDATA, vGetData);
 5902|    632|                    vGetData.clear();
 5903|    632|                }
 5904|   841k|            }
 5905|   442k|        }
 5906|       |
 5907|   442k|        if (!vGetData.empty())
  ------------------
  |  Branch (5907:13): [True: 1.21k, False: 440k]
  ------------------
 5908|  1.21k|            MakeAndPushMessage(*pto, NetMsgType::GETDATA, vGetData);
 5909|   442k|    } // release cs_main
 5910|      0|    MaybeSendFeefilter(*pto, *peer, current_time);
 5911|   442k|    return true;
 5912|   442k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl28MaybeDiscourageAndDisconnectER5CNodeRNS_4PeerE:
 4893|   462k|{
 4894|   462k|    {
 4895|   462k|        LOCK(peer.m_misbehavior_mutex);
  ------------------
  |  |  257|   462k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   462k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   462k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   462k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4896|       |
 4897|       |        // There's nothing to do if the m_should_discourage flag isn't set
 4898|   462k|        if (!peer.m_should_discourage) return false;
  ------------------
  |  Branch (4898:13): [True: 462k, False: 554]
  ------------------
 4899|       |
 4900|    554|        peer.m_should_discourage = false;
 4901|    554|    } // peer.m_misbehavior_mutex
 4902|       |
 4903|    554|    if (pnode.HasPermission(NetPermissionFlags::NoBan)) {
  ------------------
  |  Branch (4903:9): [True: 120, False: 434]
  ------------------
 4904|       |        // We never disconnect or discourage peers for bad behavior if they have NetPermissionFlags::NoBan permission
 4905|    120|        LogPrintf("Warning: not punishing noban peer %d!\n", peer.m_id);
  ------------------
  |  |  266|    120|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|    120|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|    120|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4906|    120|        return false;
 4907|    120|    }
 4908|       |
 4909|    434|    if (pnode.IsManualConn()) {
  ------------------
  |  Branch (4909:9): [True: 124, False: 310]
  ------------------
 4910|       |        // We never disconnect or discourage manual peers for bad behavior
 4911|    124|        LogPrintf("Warning: not punishing manually connected peer %d!\n", peer.m_id);
  ------------------
  |  |  266|    124|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|    124|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|    124|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4912|    124|        return false;
 4913|    124|    }
 4914|       |
 4915|    310|    if (pnode.addr.IsLocal()) {
  ------------------
  |  Branch (4915:9): [True: 85, False: 225]
  ------------------
 4916|       |        // We disconnect local peers for bad behavior but don't discourage (since that would discourage
 4917|       |        // all peers on the same local address)
 4918|     85|        LogDebug(BCLog::NET, "Warning: disconnecting but not discouraging %s peer %d!\n",
  ------------------
  |  |  280|     85|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     85|    do {                                                  \
  |  |  |  |  274|     85|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 85]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     85|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4919|     85|                 pnode.m_inbound_onion ? "inbound onion" : "local", peer.m_id);
 4920|     85|        pnode.fDisconnect = true;
 4921|     85|        return true;
 4922|     85|    }
 4923|       |
 4924|       |    // Normal case: Disconnect the peer and discourage all nodes sharing the address
 4925|    225|    LogDebug(BCLog::NET, "Disconnecting and discouraging peer %d!\n", peer.m_id);
  ------------------
  |  |  280|    225|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    225|    do {                                                  \
  |  |  |  |  274|    225|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 225]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    225|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4926|    225|    if (m_banman) m_banman->Discourage(pnode.addr);
  ------------------
  |  Branch (4926:9): [True: 225, False: 0]
  ------------------
 4927|    225|    m_connman.DisconnectNode(pnode.addr);
 4928|    225|    return true;
 4929|    310|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl13MaybeSendPingER5CNodeRNS_4PeerENSt3__16chrono8durationIxNS5_5ratioILl1ELl1000000EEEEE:
 5208|   444k|{
 5209|   444k|    if (m_connman.ShouldRunInactivityChecks(node_to, std::chrono::duration_cast<std::chrono::seconds>(now)) &&
  ------------------
  |  Branch (5209:9): [True: 5.67k, False: 438k]
  |  Branch (5209:9): [True: 2.05k, False: 442k]
  ------------------
 5210|   444k|        peer.m_ping_nonce_sent &&
  ------------------
  |  Branch (5210:9): [True: 2.90k, False: 2.76k]
  ------------------
 5211|   444k|        now > peer.m_ping_start.load() + TIMEOUT_INTERVAL)
  ------------------
  |  Branch (5211:9): [True: 2.05k, False: 859]
  ------------------
 5212|  2.05k|    {
 5213|       |        // The ping timeout is using mocktime. To disable the check during
 5214|       |        // testing, increase -peertimeout.
 5215|  2.05k|        LogDebug(BCLog::NET, "ping timeout: %fs, %s", 0.000001 * count_microseconds(now - peer.m_ping_start.load()), node_to.DisconnectMsg(fLogIPs));
  ------------------
  |  |  280|  2.05k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  2.05k|    do {                                                  \
  |  |  |  |  274|  2.05k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 2.05k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  2.05k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5216|  2.05k|        node_to.fDisconnect = true;
 5217|  2.05k|        return;
 5218|  2.05k|    }
 5219|       |
 5220|   442k|    bool pingSend = false;
 5221|       |
 5222|   442k|    if (peer.m_ping_queued) {
  ------------------
  |  Branch (5222:9): [True: 0, False: 442k]
  ------------------
 5223|       |        // RPC ping request by user
 5224|      0|        pingSend = true;
 5225|      0|    }
 5226|       |
 5227|   442k|    if (peer.m_ping_nonce_sent == 0 && now > peer.m_ping_start.load() + PING_INTERVAL) {
  ------------------
  |  Branch (5227:9): [True: 15.6k, False: 426k]
  |  Branch (5227:9): [True: 7.84k, False: 434k]
  |  Branch (5227:40): [True: 7.84k, False: 7.85k]
  ------------------
 5228|       |        // Ping automatically sent as a latency probe & keepalive.
 5229|  7.84k|        pingSend = true;
 5230|  7.84k|    }
 5231|       |
 5232|   442k|    if (pingSend) {
  ------------------
  |  Branch (5232:9): [True: 7.84k, False: 434k]
  ------------------
 5233|  7.84k|        uint64_t nonce;
 5234|  7.84k|        do {
 5235|  7.84k|            nonce = FastRandomContext().rand64();
 5236|  7.84k|        } while (nonce == 0);
  ------------------
  |  Branch (5236:18): [True: 0, False: 7.84k]
  ------------------
 5237|  7.84k|        peer.m_ping_queued = false;
 5238|  7.84k|        peer.m_ping_start = now;
 5239|  7.84k|        if (node_to.GetCommonVersion() > BIP0031_VERSION) {
  ------------------
  |  Branch (5239:13): [True: 6.76k, False: 1.08k]
  ------------------
 5240|  6.76k|            peer.m_ping_nonce_sent = nonce;
 5241|  6.76k|            MakeAndPushMessage(node_to, NetMsgType::PING, nonce);
 5242|  6.76k|        } else {
 5243|       |            // Peer is too old to support ping command with nonce, pong will never arrive.
 5244|  1.08k|            peer.m_ping_nonce_sent = 0;
 5245|  1.08k|            MakeAndPushMessage(node_to, NetMsgType::PING);
 5246|  1.08k|        }
 5247|  7.84k|    }
 5248|   442k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl13MaybeSendAddrER5CNodeRNS_4PeerENSt3__16chrono8durationIxNS5_5ratioILl1ELl1000000EEEEE:
 5251|   442k|{
 5252|       |    // Nothing to do for non-address-relay peers
 5253|   442k|    if (!peer.m_addr_relay_enabled) return;
  ------------------
  |  Branch (5253:9): [True: 267k, False: 174k]
  ------------------
 5254|       |
 5255|   174k|    LOCK(peer.m_addr_send_times_mutex);
  ------------------
  |  |  257|   174k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   174k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   174k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   174k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5256|       |    // Periodically advertise our local address to the peer.
 5257|   174k|    if (fListen && !m_chainman.IsInitialBlockDownload() &&
  ------------------
  |  Branch (5257:9): [True: 174k, False: 0]
  |  Branch (5257:20): [True: 63.4k, False: 111k]
  ------------------
 5258|   174k|        peer.m_next_local_addr_send < current_time) {
  ------------------
  |  Branch (5258:9): [True: 1.95k, False: 61.4k]
  ------------------
 5259|       |        // If we've sent before, clear the bloom filter for the peer, so that our
 5260|       |        // self-announcement will actually go out.
 5261|       |        // This might be unnecessary if the bloom filter has already rolled
 5262|       |        // over since our last self-announcement, but there is only a small
 5263|       |        // bandwidth cost that we can incur by doing this (which happens
 5264|       |        // once a day on average).
 5265|  1.95k|        if (peer.m_next_local_addr_send != 0us) {
  ------------------
  |  Branch (5265:13): [True: 0, False: 1.95k]
  ------------------
 5266|      0|            peer.m_addr_known->reset();
 5267|      0|        }
 5268|  1.95k|        if (std::optional<CService> local_service = GetLocalAddrForPeer(node)) {
  ------------------
  |  Branch (5268:37): [True: 0, False: 1.95k]
  ------------------
 5269|      0|            CAddress local_addr{*local_service, peer.m_our_services, Now<NodeSeconds>()};
 5270|      0|            PushAddress(peer, local_addr);
 5271|      0|        }
 5272|  1.95k|        peer.m_next_local_addr_send = current_time + m_rng.rand_exp_duration(AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
 5273|  1.95k|    }
 5274|       |
 5275|       |    // We sent an `addr` message to this peer recently. Nothing more to do.
 5276|   174k|    if (current_time <= peer.m_next_addr_send) return;
  ------------------
  |  Branch (5276:9): [True: 171k, False: 3.42k]
  ------------------
 5277|       |
 5278|  3.42k|    peer.m_next_addr_send = current_time + m_rng.rand_exp_duration(AVG_ADDRESS_BROADCAST_INTERVAL);
 5279|       |
 5280|  3.42k|    if (!Assume(peer.m_addrs_to_send.size() <= MAX_ADDR_TO_SEND)) {
  ------------------
  |  |   97|  3.42k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (5280:9): [True: 0, False: 3.42k]
  ------------------
 5281|       |        // Should be impossible since we always check size before adding to
 5282|       |        // m_addrs_to_send. Recover by trimming the vector.
 5283|      0|        peer.m_addrs_to_send.resize(MAX_ADDR_TO_SEND);
 5284|      0|    }
 5285|       |
 5286|       |    // Remove addr records that the peer already knows about, and add new
 5287|       |    // addrs to the m_addr_known filter on the same pass.
 5288|  3.42k|    auto addr_already_known = [&peer](const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex) {
 5289|  3.42k|        bool ret = peer.m_addr_known->contains(addr.GetKey());
 5290|  3.42k|        if (!ret) peer.m_addr_known->insert(addr.GetKey());
 5291|  3.42k|        return ret;
 5292|  3.42k|    };
 5293|  3.42k|    peer.m_addrs_to_send.erase(std::remove_if(peer.m_addrs_to_send.begin(), peer.m_addrs_to_send.end(), addr_already_known),
 5294|  3.42k|                           peer.m_addrs_to_send.end());
 5295|       |
 5296|       |    // No addr messages to send
 5297|  3.42k|    if (peer.m_addrs_to_send.empty()) return;
  ------------------
  |  Branch (5297:9): [True: 3.29k, False: 129]
  ------------------
 5298|       |
 5299|    129|    if (peer.m_wants_addrv2) {
  ------------------
  |  Branch (5299:9): [True: 0, False: 129]
  ------------------
 5300|      0|        MakeAndPushMessage(node, NetMsgType::ADDRV2, CAddress::V2_NETWORK(peer.m_addrs_to_send));
 5301|    129|    } else {
 5302|    129|        MakeAndPushMessage(node, NetMsgType::ADDR, CAddress::V1_NETWORK(peer.m_addrs_to_send));
 5303|    129|    }
 5304|    129|    peer.m_addrs_to_send.clear();
 5305|       |
 5306|       |    // we only send the big addr message once
 5307|    129|    if (peer.m_addrs_to_send.capacity() > 40) {
  ------------------
  |  Branch (5307:9): [True: 26, False: 103]
  ------------------
 5308|     26|        peer.m_addrs_to_send.shrink_to_fit();
 5309|     26|    }
 5310|    129|}
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl13MaybeSendAddrER5CNodeRNS_4PeerENSt3__16chrono8durationIxNS5_5ratioILl1ELl1000000EEEEEENK3$_0clERK8CAddress:
 5288|  5.29k|    auto addr_already_known = [&peer](const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex) {
 5289|  5.29k|        bool ret = peer.m_addr_known->contains(addr.GetKey());
 5290|  5.29k|        if (!ret) peer.m_addr_known->insert(addr.GetKey());
  ------------------
  |  Branch (5290:13): [True: 5.29k, False: 0]
  ------------------
 5291|  5.29k|        return ret;
 5292|  5.29k|    };
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJ13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS3_NS5_9allocatorIS3_EEEEEEEEvR5CNodeNS5_12basic_stringIcNS5_11char_traitsIcEENS7_IcEEEEDpOT_:
  690|    129|    {
  691|    129|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|    129|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl20MaybeSendSendHeadersER5CNodeRNS_4PeerE:
 5313|   442k|{
 5314|       |    // Delay sending SENDHEADERS (BIP 130) until we're done with an
 5315|       |    // initial-headers-sync with this peer. Receiving headers announcements for
 5316|       |    // new blocks while trying to sync their headers chain is problematic,
 5317|       |    // because of the state tracking done.
 5318|   442k|    if (!peer.m_sent_sendheaders && node.GetCommonVersion() >= SENDHEADERS_VERSION) {
  ------------------
  |  Branch (5318:9): [True: 442k, False: 0]
  |  Branch (5318:37): [True: 433k, False: 8.93k]
  ------------------
 5319|   433k|        LOCK(cs_main);
  ------------------
  |  |  257|   433k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   433k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   433k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   433k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5320|   433k|        CNodeState &state = *State(node.GetId());
 5321|   433k|        if (state.pindexBestKnownBlock != nullptr &&
  ------------------
  |  Branch (5321:13): [True: 49, False: 433k]
  ------------------
 5322|   433k|                state.pindexBestKnownBlock->nChainWork > m_chainman.MinimumChainWork()) {
  ------------------
  |  Branch (5322:17): [True: 49, False: 0]
  ------------------
 5323|       |            // Tell our peer we prefer to receive headers rather than inv's
 5324|       |            // We send this to non-NODE NETWORK peers as well, because even
 5325|       |            // non-NODE NETWORK peers can announce blocks (such as pruning
 5326|       |            // nodes)
 5327|     49|            MakeAndPushMessage(node, NetMsgType::SENDHEADERS);
 5328|     49|            peer.m_sent_sendheaders = true;
 5329|     49|        }
 5330|   433k|    }
 5331|   442k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl17NextInvToInboundsENSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEENS3_IxNS4_ILl1ELl1EEEEE:
 1121|  3.38k|{
 1122|  3.38k|    if (m_next_inv_to_inbounds.load() < now) {
  ------------------
  |  Branch (1122:9): [True: 4, False: 3.37k]
  ------------------
 1123|       |        // If this function were called from multiple threads simultaneously
 1124|       |        // it would possible that both update the next send variable, and return a different result to their caller.
 1125|       |        // This is not possible in practice as only the net processing thread invokes this function.
 1126|      4|        m_next_inv_to_inbounds = now + m_rng.rand_exp_duration(average_interval);
 1127|      4|    }
 1128|  3.38k|    return m_next_inv_to_inbounds;
 1129|  3.38k|}
net_processing.cpp:_ZN12_GLOBAL__N_122CompareInvMempoolOrderC2EP10CTxMemPoolb:
 5382|  26.3k|    {
 5383|  26.3k|        mp = _mempool;
 5384|  26.3k|        m_wtxid_relay = use_wtxid;
 5385|  26.3k|    }
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl16ConsiderEvictionER5CNodeRNS_4PeerENSt3__16chrono8durationIxNS5_5ratioILl1ELl1EEEEE:
 5013|   442k|{
 5014|   442k|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|   442k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 5015|       |
 5016|   442k|    CNodeState &state = *State(pto.GetId());
 5017|       |
 5018|   442k|    if (!state.m_chain_sync.m_protect && pto.IsOutboundOrBlockRelayConn() && state.fSyncStarted) {
  ------------------
  |  Branch (5018:9): [True: 442k, False: 2]
  |  Branch (5018:42): [True: 133k, False: 308k]
  |  Branch (5018:78): [True: 133k, False: 0]
  ------------------
 5019|       |        // This is an outbound peer subject to disconnection if they don't
 5020|       |        // announce a block with as much work as the current tip within
 5021|       |        // CHAIN_SYNC_TIMEOUT + HEADERS_RESPONSE_TIME seconds (note: if
 5022|       |        // their chain has more work than ours, we should sync to it,
 5023|       |        // unless it's invalid, in which case we should find that out and
 5024|       |        // disconnect from them elsewhere).
 5025|   133k|        if (state.pindexBestKnownBlock != nullptr && state.pindexBestKnownBlock->nChainWork >= m_chainman.ActiveChain().Tip()->nChainWork) {
  ------------------
  |  Branch (5025:13): [True: 5, False: 133k]
  |  Branch (5025:54): [True: 3, False: 2]
  ------------------
 5026|       |            // The outbound peer has sent us a block with at least as much work as our current tip, so reset the timeout if it was set
 5027|      3|            if (state.m_chain_sync.m_timeout != 0s) {
  ------------------
  |  Branch (5027:17): [True: 3, False: 0]
  ------------------
 5028|      3|                state.m_chain_sync.m_timeout = 0s;
 5029|      3|                state.m_chain_sync.m_work_header = nullptr;
 5030|      3|                state.m_chain_sync.m_sent_getheaders = false;
 5031|      3|            }
 5032|   133k|        } else if (state.m_chain_sync.m_timeout == 0s || (state.m_chain_sync.m_work_header != nullptr && state.pindexBestKnownBlock != nullptr && state.pindexBestKnownBlock->nChainWork >= state.m_chain_sync.m_work_header->nChainWork)) {
  ------------------
  |  Branch (5032:20): [True: 373, False: 133k]
  |  Branch (5032:20): [True: 373, False: 133k]
  |  Branch (5032:59): [True: 133k, False: 0]
  |  Branch (5032:106): [True: 2, False: 133k]
  |  Branch (5032:147): [True: 0, False: 2]
  ------------------
 5033|       |            // At this point we know that the outbound peer has either never sent us a block/header or they have, but its tip is behind ours
 5034|       |            // AND
 5035|       |            // we are noticing this for the first time (m_timeout is 0)
 5036|       |            // OR we noticed this at some point within the last CHAIN_SYNC_TIMEOUT + HEADERS_RESPONSE_TIME seconds and set a timeout
 5037|       |            // for them, they caught up to our tip at the time of setting the timer but not to our current one (we've also advanced).
 5038|       |            // Either way, set a new timeout based on our current tip.
 5039|    373|            state.m_chain_sync.m_timeout = time_in_seconds + CHAIN_SYNC_TIMEOUT;
 5040|    373|            state.m_chain_sync.m_work_header = m_chainman.ActiveChain().Tip();
 5041|    373|            state.m_chain_sync.m_sent_getheaders = false;
 5042|   133k|        } else if (state.m_chain_sync.m_timeout > 0s && time_in_seconds > state.m_chain_sync.m_timeout) {
  ------------------
  |  Branch (5042:20): [True: 133k, False: 0]
  |  Branch (5042:20): [True: 25, False: 133k]
  |  Branch (5042:57): [True: 25, False: 133k]
  ------------------
 5043|       |            // No evidence yet that our peer has synced to a chain with work equal to that
 5044|       |            // of our tip, when we first detected it was behind. Send a single getheaders
 5045|       |            // message to give the peer a chance to update us.
 5046|     25|            if (state.m_chain_sync.m_sent_getheaders) {
  ------------------
  |  Branch (5046:17): [True: 0, False: 25]
  ------------------
 5047|       |                // They've run out of time to catch up!
 5048|      0|                LogInfo("Outbound peer has old chain, best known block = %s, %s\n", state.pindexBestKnownBlock != nullptr ? state.pindexBestKnownBlock->GetBlockHash().ToString() : "<none>", pto.DisconnectMsg(fLogIPs));
  ------------------
  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5049|      0|                pto.fDisconnect = true;
 5050|     25|            } else {
 5051|     25|                assert(state.m_chain_sync.m_work_header);
 5052|       |                // Here, we assume that the getheaders message goes out,
 5053|       |                // because it'll either go out or be skipped because of a
 5054|       |                // getheaders in-flight already, in which case the peer should
 5055|       |                // still respond to us with a sufficiently high work chain tip.
 5056|     25|                MaybeSendGetHeaders(pto,
 5057|     25|                        GetLocator(state.m_chain_sync.m_work_header->pprev),
 5058|     25|                        peer);
 5059|     25|                LogDebug(BCLog::NET, "sending getheaders to outbound peer=%d to verify chain work (current best known block:%s, benchmark blockhash: %s)\n", pto.GetId(), state.pindexBestKnownBlock != nullptr ? state.pindexBestKnownBlock->GetBlockHash().ToString() : "<none>", state.m_chain_sync.m_work_header->GetBlockHash().ToString());
  ------------------
  |  |  280|     25|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     25|    do {                                                  \
  |  |  |  |  274|     25|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 25]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     25|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5060|     25|                state.m_chain_sync.m_sent_getheaders = true;
 5061|       |                // Bump the timeout to allow a response, which could clear the timeout
 5062|       |                // (if the response shows the peer has synced), reset the timeout (if
 5063|       |                // the peer syncs to the required work but not to our tip), or result
 5064|       |                // in disconnect (if we advance to the timeout and pindexBestKnownBlock
 5065|       |                // has not sufficiently progressed)
 5066|     25|                state.m_chain_sync.m_timeout = time_in_seconds + HEADERS_RESPONSE_TIME;
 5067|     25|            }
 5068|     25|        }
 5069|   133k|    }
 5070|   442k|}
net_processing.cpp:_ZN12_GLOBAL__N_113IsLimitedPeerERKNS_4PeerE:
 1108|   309k|{
 1109|   309k|    return (!(peer.m_their_services & NODE_NETWORK) &&
  ------------------
  |  Branch (1109:13): [True: 38.2k, False: 271k]
  ------------------
 1110|   309k|             (peer.m_their_services & NODE_NETWORK_LIMITED));
  ------------------
  |  Branch (1110:14): [True: 38.2k, False: 0]
  ------------------
 1111|   309k|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl24FindNextBlocksToDownloadERKNS_4PeerEjRNSt3__16vectorIPK11CBlockIndexNS4_9allocatorIS8_EEEERl:
 1343|   288k|{
 1344|   288k|    if (count == 0)
  ------------------
  |  Branch (1344:9): [True: 0, False: 288k]
  ------------------
 1345|      0|        return;
 1346|       |
 1347|   288k|    vBlocks.reserve(vBlocks.size() + count);
 1348|   288k|    CNodeState *state = State(peer.m_id);
 1349|   288k|    assert(state != nullptr);
 1350|       |
 1351|       |    // Make sure pindexBestKnownBlock is up to date, we'll need it.
 1352|   288k|    ProcessBlockAvailability(peer.m_id);
 1353|       |
 1354|   288k|    if (state->pindexBestKnownBlock == nullptr || state->pindexBestKnownBlock->nChainWork < m_chainman.ActiveChain().Tip()->nChainWork || state->pindexBestKnownBlock->nChainWork < m_chainman.MinimumChainWork()) {
  ------------------
  |  Branch (1354:9): [True: 288k, False: 60]
  |  Branch (1354:51): [True: 39, False: 21]
  |  Branch (1354:139): [True: 0, False: 21]
  ------------------
 1355|       |        // This peer has nothing interesting.
 1356|   288k|        return;
 1357|   288k|    }
 1358|       |
 1359|       |    // When we sync with AssumeUtxo and discover the snapshot is not in the peer's best chain, abort:
 1360|       |    // We can't reorg to this chain due to missing undo data until the background sync has finished,
 1361|       |    // so downloading blocks from it would be futile.
 1362|     21|    const CBlockIndex* snap_base{m_chainman.GetSnapshotBaseBlock()};
 1363|     21|    if (snap_base && state->pindexBestKnownBlock->GetAncestor(snap_base->nHeight) != snap_base) {
  ------------------
  |  Branch (1363:9): [True: 0, False: 21]
  |  Branch (1363:22): [True: 0, False: 0]
  ------------------
 1364|      0|        LogDebug(BCLog::NET, "Not downloading blocks from peer=%d, which doesn't have the snapshot block in its best chain.\n", peer.m_id);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1365|      0|        return;
 1366|      0|    }
 1367|       |
 1368|       |    // Bootstrap quickly by guessing a parent of our best tip is the forking point.
 1369|       |    // Guessing wrong in either direction is not a problem.
 1370|       |    // Also reset pindexLastCommonBlock after a snapshot was loaded, so that blocks after the snapshot will be prioritised for download.
 1371|     21|    if (state->pindexLastCommonBlock == nullptr ||
  ------------------
  |  Branch (1371:9): [True: 21, False: 0]
  ------------------
 1372|     21|        (snap_base && state->pindexLastCommonBlock->nHeight < snap_base->nHeight)) {
  ------------------
  |  Branch (1372:10): [True: 0, False: 0]
  |  Branch (1372:23): [True: 0, False: 0]
  ------------------
 1373|     21|        state->pindexLastCommonBlock = m_chainman.ActiveChain()[std::min(state->pindexBestKnownBlock->nHeight, m_chainman.ActiveChain().Height())];
 1374|     21|    }
 1375|       |
 1376|       |    // If the peer reorganized, our previous pindexLastCommonBlock may not be an ancestor
 1377|       |    // of its current tip anymore. Go back enough to fix that.
 1378|     21|    state->pindexLastCommonBlock = LastCommonAncestor(state->pindexLastCommonBlock, state->pindexBestKnownBlock);
 1379|     21|    if (state->pindexLastCommonBlock == state->pindexBestKnownBlock)
  ------------------
  |  Branch (1379:9): [True: 3, False: 18]
  ------------------
 1380|      3|        return;
 1381|       |
 1382|     18|    const CBlockIndex *pindexWalk = state->pindexLastCommonBlock;
 1383|       |    // Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond the last
 1384|       |    // linked block we have in common with this peer. The +1 is so we can detect stalling, namely if we would be able to
 1385|       |    // download that next block if the window were 1 larger.
 1386|     18|    int nWindowEnd = state->pindexLastCommonBlock->nHeight + BLOCK_DOWNLOAD_WINDOW;
 1387|       |
 1388|     18|    FindNextBlocks(vBlocks, peer, state, pindexWalk, count, nWindowEnd, &m_chainman.ActiveChain(), &nodeStaller);
 1389|     18|}
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl14FindNextBlocksERNSt3__16vectorIPK11CBlockIndexNS1_9allocatorIS5_EEEERKNS_4PeerEPNS_10CNodeStateES5_jiPK6CChainPl:
 1421|     18|{
 1422|     18|    std::vector<const CBlockIndex*> vToFetch;
 1423|     18|    int nMaxHeight = std::min<int>(state->pindexBestKnownBlock->nHeight, nWindowEnd + 1);
 1424|     18|    bool is_limited_peer = IsLimitedPeer(peer);
 1425|     18|    NodeId waitingfor = -1;
 1426|     28|    while (pindexWalk->nHeight < nMaxHeight) {
  ------------------
  |  Branch (1426:12): [True: 18, False: 10]
  ------------------
 1427|       |        // Read up to 128 (or more, if more blocks than that are needed) successors of pindexWalk (towards
 1428|       |        // pindexBestKnownBlock) into vToFetch. We fetch 128, because CBlockIndex::GetAncestor may be as expensive
 1429|       |        // as iterating over ~100 CBlockIndex* entries anyway.
 1430|     18|        int nToFetch = std::min(nMaxHeight - pindexWalk->nHeight, std::max<int>(count - vBlocks.size(), 128));
 1431|     18|        vToFetch.resize(nToFetch);
 1432|     18|        pindexWalk = state->pindexBestKnownBlock->GetAncestor(pindexWalk->nHeight + nToFetch);
 1433|     18|        vToFetch[nToFetch - 1] = pindexWalk;
 1434|     22|        for (unsigned int i = nToFetch - 1; i > 0; i--) {
  ------------------
  |  Branch (1434:45): [True: 4, False: 18]
  ------------------
 1435|      4|            vToFetch[i - 1] = vToFetch[i]->pprev;
 1436|      4|        }
 1437|       |
 1438|       |        // Iterate over those blocks in vToFetch (in forward direction), adding the ones that
 1439|       |        // are not yet downloaded and not in flight to vBlocks. In the meantime, update
 1440|       |        // pindexLastCommonBlock as long as all ancestors are already downloaded, or if it's
 1441|       |        // already part of our chain (and therefore don't need it even if pruned).
 1442|     22|        for (const CBlockIndex* pindex : vToFetch) {
  ------------------
  |  Branch (1442:40): [True: 22, False: 10]
  ------------------
 1443|     22|            if (!pindex->IsValid(BLOCK_VALID_TREE)) {
  ------------------
  |  Branch (1443:17): [True: 0, False: 22]
  ------------------
 1444|       |                // We consider the chain that this peer is on invalid.
 1445|      0|                return;
 1446|      0|            }
 1447|       |
 1448|     22|            if (!CanServeWitnesses(peer) && DeploymentActiveAt(*pindex, m_chainman, Consensus::DEPLOYMENT_SEGWIT)) {
  ------------------
  |  Branch (1448:17): [True: 8, False: 14]
  |  Branch (1448:45): [True: 8, False: 0]
  ------------------
 1449|       |                // We wouldn't download this block or its descendants from this peer.
 1450|      8|                return;
 1451|      8|            }
 1452|       |
 1453|     14|            if (pindex->nStatus & BLOCK_HAVE_DATA || (activeChain && activeChain->Contains(pindex))) {
  ------------------
  |  Branch (1453:17): [True: 0, False: 14]
  |  Branch (1453:55): [True: 14, False: 0]
  |  Branch (1453:70): [True: 0, False: 14]
  ------------------
 1454|      0|                if (activeChain && pindex->HaveNumChainTxs()) {
  ------------------
  |  Branch (1454:21): [True: 0, False: 0]
  |  Branch (1454:36): [True: 0, False: 0]
  ------------------
 1455|      0|                    state->pindexLastCommonBlock = pindex;
 1456|      0|                }
 1457|      0|                continue;
 1458|      0|            }
 1459|       |
 1460|       |            // Is block in-flight?
 1461|     14|            if (IsBlockRequested(pindex->GetBlockHash())) {
  ------------------
  |  Branch (1461:17): [True: 5, False: 9]
  ------------------
 1462|      5|                if (waitingfor == -1) {
  ------------------
  |  Branch (1462:21): [True: 4, False: 1]
  ------------------
 1463|       |                    // This is the first already-in-flight block.
 1464|      4|                    waitingfor = mapBlocksInFlight.lower_bound(pindex->GetBlockHash())->second.first;
 1465|      4|                }
 1466|      5|                continue;
 1467|      5|            }
 1468|       |
 1469|       |            // The block is not already downloaded, and not yet in flight.
 1470|      9|            if (pindex->nHeight > nWindowEnd) {
  ------------------
  |  Branch (1470:17): [True: 0, False: 9]
  ------------------
 1471|       |                // We reached the end of the window.
 1472|      0|                if (vBlocks.size() == 0 && waitingfor != peer.m_id) {
  ------------------
  |  Branch (1472:21): [True: 0, False: 0]
  |  Branch (1472:44): [True: 0, False: 0]
  ------------------
 1473|       |                    // We aren't able to fetch anything, but we would be if the download window was one larger.
 1474|      0|                    if (nodeStaller) *nodeStaller = waitingfor;
  ------------------
  |  Branch (1474:25): [True: 0, False: 0]
  ------------------
 1475|      0|                }
 1476|      0|                return;
 1477|      0|            }
 1478|       |
 1479|       |            // Don't request blocks that go further than what limited peers can provide
 1480|      9|            if (is_limited_peer && (state->pindexBestKnownBlock->nHeight - pindex->nHeight >= static_cast<int>(NODE_NETWORK_LIMITED_MIN_BLOCKS) - 2 /* two blocks buffer for possible races */)) {
  ------------------
  |  Branch (1480:17): [True: 0, False: 9]
  |  Branch (1480:36): [True: 0, False: 0]
  ------------------
 1481|      0|                continue;
 1482|      0|            }
 1483|       |
 1484|      9|            vBlocks.push_back(pindex);
 1485|      9|            if (vBlocks.size() == count) {
  ------------------
  |  Branch (1485:17): [True: 0, False: 9]
  ------------------
 1486|      0|                return;
 1487|      0|            }
 1488|      9|        }
 1489|     18|    }
 1490|     18|}
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl12SendMessagesEP5CNodeENK3$_0clEv:
 5861|   288k|            auto get_inflight_budget = [&state]() {
 5862|   288k|                return std::max(0, MAX_BLOCKS_IN_TRANSIT_PER_PEER - static_cast<int>(state.vBlocksInFlight.size()));
 5863|   288k|            };
net_processing.cpp:_ZN12_GLOBAL__N_115PeerManagerImpl18MaybeSendFeefilterER5CNodeRNS_4PeerENSt3__16chrono8durationIxNS5_5ratioILl1ELl1000000EEEEE:
 5334|   442k|{
 5335|   442k|    if (m_opts.ignore_incoming_txs) return;
  ------------------
  |  Branch (5335:9): [True: 0, False: 442k]
  ------------------
 5336|   442k|    if (pto.GetCommonVersion() < FEEFILTER_VERSION) return;
  ------------------
  |  Branch (5336:9): [True: 8.93k, False: 433k]
  ------------------
 5337|       |    // peers with the forcerelay permission should not filter txs to us
 5338|   433k|    if (pto.HasPermission(NetPermissionFlags::ForceRelay)) return;
  ------------------
  |  Branch (5338:9): [True: 21.9k, False: 411k]
  ------------------
 5339|       |    // Don't send feefilter messages to outbound block-relay-only peers since they should never announce
 5340|       |    // transactions to us, regardless of feefilter state.
 5341|   411k|    if (pto.IsBlockOnlyConn()) return;
  ------------------
  |  Branch (5341:9): [True: 2.54k, False: 408k]
  ------------------
 5342|       |
 5343|   408k|    CAmount currentFilter = m_mempool.GetMinFee().GetFeePerK();
 5344|       |
 5345|   408k|    if (m_chainman.IsInitialBlockDownload()) {
  ------------------
  |  Branch (5345:9): [True: 359k, False: 48.7k]
  ------------------
 5346|       |        // Received tx-inv messages are discarded when the active
 5347|       |        // chainstate is in IBD, so tell the peer to not send them.
 5348|   359k|        currentFilter = MAX_MONEY;
 5349|   359k|    } else {
 5350|  48.7k|        static const CAmount MAX_FILTER{m_fee_filter_rounder.round(MAX_MONEY)};
 5351|  48.7k|        if (peer.m_fee_filter_sent == MAX_FILTER) {
  ------------------
  |  Branch (5351:13): [True: 2.31k, False: 46.4k]
  ------------------
 5352|       |            // Send the current filter if we sent MAX_FILTER previously
 5353|       |            // and made it out of IBD.
 5354|  2.31k|            peer.m_next_send_feefilter = 0us;
 5355|  2.31k|        }
 5356|  48.7k|    }
 5357|   408k|    if (current_time > peer.m_next_send_feefilter) {
  ------------------
  |  Branch (5357:9): [True: 7.26k, False: 401k]
  ------------------
 5358|  7.26k|        CAmount filterToSend = m_fee_filter_rounder.round(currentFilter);
 5359|       |        // We always have a fee filter of at least the min relay fee
 5360|  7.26k|        filterToSend = std::max(filterToSend, m_mempool.m_opts.min_relay_feerate.GetFeePerK());
 5361|  7.26k|        if (filterToSend != peer.m_fee_filter_sent) {
  ------------------
  |  Branch (5361:13): [True: 7.24k, False: 24]
  ------------------
 5362|  7.24k|            MakeAndPushMessage(pto, NetMsgType::FEEFILTER, filterToSend);
 5363|  7.24k|            peer.m_fee_filter_sent = filterToSend;
 5364|  7.24k|        }
 5365|  7.26k|        peer.m_next_send_feefilter = current_time + m_rng.rand_exp_duration(AVG_FEEFILTER_BROADCAST_INTERVAL);
 5366|  7.26k|    }
 5367|       |    // If the fee filter has changed substantially and it's still more than MAX_FEEFILTER_CHANGE_DELAY
 5368|       |    // until scheduled broadcast, then move the broadcast to within MAX_FEEFILTER_CHANGE_DELAY.
 5369|   401k|    else if (current_time + MAX_FEEFILTER_CHANGE_DELAY < peer.m_next_send_feefilter &&
  ------------------
  |  Branch (5369:14): [True: 554, False: 400k]
  |  Branch (5369:14): [True: 554, False: 400k]
  ------------------
 5370|   401k|                (currentFilter < 3 * peer.m_fee_filter_sent / 4 || currentFilter > 4 * peer.m_fee_filter_sent / 3)) {
  ------------------
  |  Branch (5370:18): [True: 83, False: 471]
  |  Branch (5370:68): [True: 471, False: 0]
  ------------------
 5371|    554|        peer.m_next_send_feefilter = current_time + m_rng.randrange<std::chrono::microseconds>(MAX_FEEFILTER_CHANGE_DELAY);
 5372|    554|    }
 5373|   408k|}
net_processing.cpp:_ZNK12_GLOBAL__N_115PeerManagerImpl18MakeAndPushMessageIJRlEEEvR5CNodeNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEDpOT_:
  690|  7.24k|    {
  691|  7.24k|        m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
  692|  7.24k|    }

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

_ZN8CNetAddr23SetNetFromBIP155NetworkEhm:
   49|   211k|{
   50|   211k|    switch (possible_bip155_net) {
  ------------------
  |  Branch (50:13): [True: 179k, False: 31.6k]
  ------------------
   51|  14.1k|    case BIP155Network::IPV4:
  ------------------
  |  Branch (51:5): [True: 14.1k, False: 196k]
  ------------------
   52|  14.1k|        if (address_size == ADDR_IPV4_SIZE) {
  ------------------
  |  Branch (52:13): [True: 14.1k, False: 4]
  ------------------
   53|  14.1k|            m_net = NET_IPV4;
   54|  14.1k|            return true;
   55|  14.1k|        }
   56|      4|        throw std::ios_base::failure(
   57|      4|            strprintf("BIP155 IPv4 address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      4|#define strprintf tfm::format
  ------------------
   58|      4|                      ADDR_IPV4_SIZE));
   59|  12.0k|    case BIP155Network::IPV6:
  ------------------
  |  Branch (59:5): [True: 12.0k, False: 199k]
  ------------------
   60|  12.0k|        if (address_size == ADDR_IPV6_SIZE) {
  ------------------
  |  Branch (60:13): [True: 12.0k, False: 4]
  ------------------
   61|  12.0k|            m_net = NET_IPV6;
   62|  12.0k|            return true;
   63|  12.0k|        }
   64|      4|        throw std::ios_base::failure(
   65|      4|            strprintf("BIP155 IPv6 address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      4|#define strprintf tfm::format
  ------------------
   66|      4|                      ADDR_IPV6_SIZE));
   67|    912|    case BIP155Network::TORV3:
  ------------------
  |  Branch (67:5): [True: 912, False: 210k]
  ------------------
   68|    912|        if (address_size == ADDR_TORV3_SIZE) {
  ------------------
  |  Branch (68:13): [True: 907, False: 5]
  ------------------
   69|    907|            m_net = NET_ONION;
   70|    907|            return true;
   71|    907|        }
   72|      5|        throw std::ios_base::failure(
   73|      5|            strprintf("BIP155 TORv3 address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
   74|      5|                      ADDR_TORV3_SIZE));
   75|  3.38k|    case BIP155Network::I2P:
  ------------------
  |  Branch (75:5): [True: 3.38k, False: 207k]
  ------------------
   76|  3.38k|        if (address_size == ADDR_I2P_SIZE) {
  ------------------
  |  Branch (76:13): [True: 3.38k, False: 4]
  ------------------
   77|  3.38k|            m_net = NET_I2P;
   78|  3.38k|            return true;
   79|  3.38k|        }
   80|      4|        throw std::ios_base::failure(
   81|      4|            strprintf("BIP155 I2P address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      4|#define strprintf tfm::format
  ------------------
   82|      4|                      ADDR_I2P_SIZE));
   83|  1.16k|    case BIP155Network::CJDNS:
  ------------------
  |  Branch (83:5): [True: 1.16k, False: 209k]
  ------------------
   84|  1.16k|        if (address_size == ADDR_CJDNS_SIZE) {
  ------------------
  |  Branch (84:13): [True: 1.16k, False: 3]
  ------------------
   85|  1.16k|            m_net = NET_CJDNS;
   86|  1.16k|            return true;
   87|  1.16k|        }
   88|      3|        throw std::ios_base::failure(
   89|      3|            strprintf("BIP155 CJDNS address with length %u (should be %u)", address_size,
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
   90|      3|                      ADDR_CJDNS_SIZE));
   91|   211k|    }
   92|       |
   93|       |    // Don't throw on addresses with unknown network ids (maybe from the future).
   94|       |    // Instead silently drop them and have the unserialization code consume
   95|       |    // subsequent ones which may be known to us.
   96|   179k|    return false;
   97|   211k|}
_ZN8CNetAddrC2Ev:
  104|   442k|CNetAddr::CNetAddr() = default;
_ZN8CNetAddr13SetLegacyIPv6E4SpanIKhE:
  138|   113k|{
  139|   113k|    assert(ipv6.size() == ADDR_IPV6_SIZE);
  140|       |
  141|   113k|    size_t skip{0};
  142|       |
  143|   113k|    if (HasPrefix(ipv6, IPV4_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (143:9): [True: 835, False: 112k]
  ------------------
  144|       |        // IPv4-in-IPv6
  145|    835|        m_net = NET_IPV4;
  146|    835|        skip = sizeof(IPV4_IN_IPV6_PREFIX);
  147|   112k|    } else if (HasPrefix(ipv6, TORV2_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (147:16): [True: 118, False: 112k]
  ------------------
  148|       |        // TORv2-in-IPv6 (unsupported). Unserialize as !IsValid(), thus ignoring them.
  149|       |        // Mimic a default-constructed CNetAddr object which is !IsValid() and thus
  150|       |        // will not be gossiped, but continue reading next addresses from the stream.
  151|    118|        m_net = NET_IPV6;
  152|    118|        m_addr.assign(ADDR_IPV6_SIZE, 0x0);
  153|    118|        return;
  154|   112k|    } else if (HasPrefix(ipv6, INTERNAL_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (154:16): [True: 170, False: 112k]
  ------------------
  155|       |        // Internal-in-IPv6
  156|    170|        m_net = NET_INTERNAL;
  157|    170|        skip = sizeof(INTERNAL_IN_IPV6_PREFIX);
  158|   112k|    } else {
  159|       |        // IPv6
  160|   112k|        m_net = NET_IPV6;
  161|   112k|    }
  162|       |
  163|   113k|    m_addr.assign(ipv6.begin() + skip, ipv6.end());
  164|   113k|}
_ZN8CNetAddr11SetInternalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  173|    463|{
  174|    463|    if (name.empty()) {
  ------------------
  |  Branch (174:9): [True: 4, False: 459]
  ------------------
  175|      4|        return false;
  176|      4|    }
  177|    459|    m_net = NET_INTERNAL;
  178|    459|    unsigned char hash[32] = {};
  179|    459|    CSHA256().Write((const unsigned char*)name.data(), name.size()).Finalize(hash);
  180|    459|    m_addr.assign(hash, hash + ADDR_INTERNAL_SIZE);
  181|    459|    return true;
  182|    463|}
_ZNK8CNetAddr9IsRFC1918Ev:
  316|   779k|{
  317|   779k|    return IsIPv4() && (
  ------------------
  |  Branch (317:12): [True: 71.1k, False: 708k]
  ------------------
  318|  71.1k|        m_addr[0] == 10 ||
  ------------------
  |  Branch (318:9): [True: 2.63k, False: 68.4k]
  ------------------
  319|  71.1k|        (m_addr[0] == 192 && m_addr[1] == 168) ||
  ------------------
  |  Branch (319:10): [True: 3.27k, False: 65.2k]
  |  Branch (319:30): [True: 593, False: 2.68k]
  ------------------
  320|  71.1k|        (m_addr[0] == 172 && m_addr[1] >= 16 && m_addr[1] <= 31));
  ------------------
  |  Branch (320:10): [True: 1.05k, False: 66.8k]
  |  Branch (320:30): [True: 704, False: 353]
  |  Branch (320:49): [True: 328, False: 376]
  ------------------
  321|   779k|}
_ZNK8CNetAddr9IsRFC2544Ev:
  324|   776k|{
  325|   776k|    return IsIPv4() && m_addr[0] == 198 && (m_addr[1] == 18 || m_addr[1] == 19);
  ------------------
  |  Branch (325:12): [True: 67.5k, False: 708k]
  |  Branch (325:24): [True: 9.01k, False: 58.5k]
  |  Branch (325:45): [True: 775, False: 8.24k]
  |  Branch (325:64): [True: 1.66k, False: 6.57k]
  ------------------
  326|   776k|}
_ZNK8CNetAddr9IsRFC3927Ev:
  329|   773k|{
  330|   773k|    return IsIPv4() && HasPrefix(m_addr, std::array<uint8_t, 2>{169, 254});
  ------------------
  |  Branch (330:12): [True: 65.1k, False: 708k]
  |  Branch (330:24): [True: 816, False: 64.3k]
  ------------------
  331|   773k|}
_ZNK8CNetAddr9IsRFC6598Ev:
  334|   771k|{
  335|   771k|    return IsIPv4() && m_addr[0] == 100 && m_addr[1] >= 64 && m_addr[1] <= 127;
  ------------------
  |  Branch (335:12): [True: 64.3k, False: 707k]
  |  Branch (335:24): [True: 4.95k, False: 59.3k]
  |  Branch (335:44): [True: 2.72k, False: 2.23k]
  |  Branch (335:63): [True: 2.30k, False: 414]
  ------------------
  336|   771k|}
_ZNK8CNetAddr9IsRFC5737Ev:
  339|   769k|{
  340|   769k|    return IsIPv4() && (HasPrefix(m_addr, std::array<uint8_t, 3>{192, 0, 2}) ||
  ------------------
  |  Branch (340:12): [True: 62.0k, False: 707k]
  |  Branch (340:25): [True: 1.02k, False: 60.9k]
  ------------------
  341|  62.0k|                        HasPrefix(m_addr, std::array<uint8_t, 3>{198, 51, 100}) ||
  ------------------
  |  Branch (341:25): [True: 1.83k, False: 59.1k]
  ------------------
  342|  62.0k|                        HasPrefix(m_addr, std::array<uint8_t, 3>{203, 0, 113}));
  ------------------
  |  Branch (342:25): [True: 1.75k, False: 57.3k]
  ------------------
  343|   769k|}
_ZNK8CNetAddr9IsRFC3849Ev:
  346|   802k|{
  347|   802k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 4>{0x20, 0x01, 0x0D, 0xB8});
  ------------------
  |  Branch (347:12): [True: 605k, False: 196k]
  |  Branch (347:24): [True: 1.42k, False: 603k]
  ------------------
  348|   802k|}
_ZNK8CNetAddr9IsRFC3964Ev:
  351|   243k|{
  352|   243k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 2>{0x20, 0x02});
  ------------------
  |  Branch (352:12): [True: 189k, False: 53.8k]
  |  Branch (352:24): [True: 1.65k, False: 187k]
  ------------------
  353|   243k|}
_ZNK8CNetAddr9IsRFC6052Ev:
  356|   254k|{
  357|   254k|    return IsIPv6() &&
  ------------------
  |  Branch (357:12): [True: 200k, False: 53.8k]
  ------------------
  358|   254k|           HasPrefix(m_addr, std::array<uint8_t, 12>{0x00, 0x64, 0xFF, 0x9B, 0x00, 0x00,
  ------------------
  |  Branch (358:12): [True: 9.83k, False: 190k]
  ------------------
  359|   200k|                                                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00});
  360|   254k|}
_ZNK8CNetAddr9IsRFC4380Ev:
  363|   241k|{
  364|   241k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 4>{0x20, 0x01, 0x00, 0x00});
  ------------------
  |  Branch (364:12): [True: 187k, False: 53.8k]
  |  Branch (364:24): [True: 3.87k, False: 183k]
  ------------------
  365|   241k|}
_ZNK8CNetAddr9IsRFC4862Ev:
  368|   772k|{
  369|   772k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 8>{0xFE, 0x80, 0x00, 0x00,
  ------------------
  |  Branch (369:12): [True: 593k, False: 179k]
  |  Branch (369:24): [True: 775, False: 592k]
  ------------------
  370|   593k|                                                                0x00, 0x00, 0x00, 0x00});
  371|   772k|}
_ZNK8CNetAddr9IsRFC4193Ev:
  374|   765k|{
  375|   765k|    return IsIPv6() && (m_addr[0] & 0xFE) == 0xFC;
  ------------------
  |  Branch (375:12): [True: 592k, False: 172k]
  |  Branch (375:24): [True: 2.06k, False: 590k]
  ------------------
  376|   765k|}
_ZNK8CNetAddr9IsRFC6145Ev:
  379|   256k|{
  380|   256k|    return IsIPv6() &&
  ------------------
  |  Branch (380:12): [True: 202k, False: 53.8k]
  ------------------
  381|   256k|           HasPrefix(m_addr, std::array<uint8_t, 12>{0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  ------------------
  |  Branch (381:12): [True: 5.34k, False: 196k]
  ------------------
  382|   202k|                                                     0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00});
  383|   256k|}
_ZNK8CNetAddr9IsRFC4843Ev:
  386|   763k|{
  387|   763k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 3>{0x20, 0x01, 0x00}) &&
  ------------------
  |  Branch (387:12): [True: 590k, False: 172k]
  |  Branch (387:24): [True: 9.28k, False: 581k]
  ------------------
  388|   763k|           (m_addr[3] & 0xF0) == 0x10;
  ------------------
  |  Branch (388:12): [True: 526, False: 8.75k]
  ------------------
  389|   763k|}
_ZNK8CNetAddr9IsRFC7343Ev:
  392|   762k|{
  393|   762k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 3>{0x20, 0x01, 0x00}) &&
  ------------------
  |  Branch (393:12): [True: 589k, False: 172k]
  |  Branch (393:24): [True: 8.75k, False: 581k]
  ------------------
  394|   762k|           (m_addr[3] & 0xF0) == 0x20;
  ------------------
  |  Branch (394:12): [True: 329, False: 8.42k]
  ------------------
  395|   762k|}
_ZNK8CNetAddr7IsHeNetEv:
  398|  49.9k|{
  399|  49.9k|    return IsIPv6() && HasPrefix(m_addr, std::array<uint8_t, 4>{0x20, 0x01, 0x04, 0x70});
  ------------------
  |  Branch (399:12): [True: 49.9k, False: 0]
  |  Branch (399:24): [True: 284, False: 49.6k]
  ------------------
  400|  49.9k|}
_ZNK8CNetAddr7IsLocalEv:
  403|   855k|{
  404|       |    // IPv4 loopback (127.0.0.0/8 or 0.0.0.0/8)
  405|   855k|    if (IsIPv4() && (m_addr[0] == 127 || m_addr[0] == 0)) {
  ------------------
  |  Branch (405:9): [True: 74.4k, False: 781k]
  |  Branch (405:22): [True: 528, False: 73.9k]
  |  Branch (405:42): [True: 27.0k, False: 46.9k]
  ------------------
  406|  27.5k|        return true;
  407|  27.5k|    }
  408|       |
  409|       |    // IPv6 loopback (::1/128)
  410|   828k|    static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
  411|   828k|    if (IsIPv6() && memcmp(m_addr.data(), pchLocal, sizeof(pchLocal)) == 0) {
  ------------------
  |  Branch (411:9): [True: 646k, False: 182k]
  |  Branch (411:21): [True: 1.72k, False: 644k]
  ------------------
  412|  1.72k|        return true;
  413|  1.72k|    }
  414|       |
  415|   826k|    return false;
  416|   828k|}
_ZNK8CNetAddr7IsValidEv:
  429|   823k|{
  430|       |    // unspecified IPv6 address (::/128)
  431|   823k|    unsigned char ipNone6[16] = {};
  432|   823k|    if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) {
  ------------------
  |  Branch (432:9): [True: 626k, False: 197k]
  |  Branch (432:21): [True: 21.1k, False: 605k]
  ------------------
  433|  21.1k|        return false;
  434|  21.1k|    }
  435|       |
  436|   802k|    if (IsCJDNS() && !HasCJDNSPrefix()) {
  ------------------
  |  Branch (436:9): [True: 47.9k, False: 754k]
  |  Branch (436:22): [True: 154, False: 47.7k]
  ------------------
  437|    154|        return false;
  438|    154|    }
  439|       |
  440|       |    // documentation IPv6 address
  441|   802k|    if (IsRFC3849())
  ------------------
  |  Branch (441:9): [True: 1.42k, False: 800k]
  ------------------
  442|  1.42k|        return false;
  443|       |
  444|   800k|    if (IsInternal())
  ------------------
  |  Branch (444:9): [True: 373, False: 800k]
  ------------------
  445|    373|        return false;
  446|       |
  447|   800k|    if (IsIPv4()) {
  ------------------
  |  Branch (447:9): [True: 80.5k, False: 719k]
  ------------------
  448|  80.5k|        const uint32_t addr = ReadBE32(m_addr.data());
  449|  80.5k|        if (addr == INADDR_ANY || addr == INADDR_NONE) {
  ------------------
  |  Branch (449:13): [True: 6.93k, False: 73.6k]
  |  Branch (449:35): [True: 1.23k, False: 72.4k]
  ------------------
  450|  8.17k|            return false;
  451|  8.17k|        }
  452|  80.5k|    }
  453|       |
  454|   792k|    return true;
  455|   800k|}
_ZNK8CNetAddr10IsRoutableEv:
  467|   802k|{
  468|   802k|    return IsValid() && !(IsRFC1918() || IsRFC2544() || IsRFC3927() || IsRFC4862() || IsRFC6598() || IsRFC5737() || IsRFC4193() || IsRFC4843() || IsRFC7343() || IsLocal() || IsInternal());
  ------------------
  |  Branch (468:12): [True: 779k, False: 22.8k]
  |  Branch (468:27): [True: 3.55k, False: 776k]
  |  Branch (468:42): [True: 2.44k, False: 773k]
  |  Branch (468:57): [True: 816, False: 772k]
  |  Branch (468:72): [True: 775, False: 771k]
  |  Branch (468:87): [True: 2.30k, False: 769k]
  |  Branch (468:102): [True: 4.61k, False: 765k]
  |  Branch (468:117): [True: 2.06k, False: 763k]
  |  Branch (468:132): [True: 526, False: 762k]
  |  Branch (468:147): [True: 329, False: 762k]
  |  Branch (468:162): [True: 19.0k, False: 743k]
  |  Branch (468:175): [True: 0, False: 743k]
  ------------------
  469|   802k|}
_ZNK8CNetAddr10IsInternalEv:
  477|  1.99M|{
  478|  1.99M|   return m_net == NET_INTERNAL;
  479|  1.99M|}
_ZNK8CNetAddr18IsAddrV1CompatibleEv:
  482|   320k|{
  483|   320k|    switch (m_net) {
  ------------------
  |  Branch (483:13): [True: 0, False: 320k]
  ------------------
  484|  26.7k|    case NET_IPV4:
  ------------------
  |  Branch (484:5): [True: 26.7k, False: 293k]
  ------------------
  485|   291k|    case NET_IPV6:
  ------------------
  |  Branch (485:5): [True: 264k, False: 55.7k]
  ------------------
  486|   294k|    case NET_INTERNAL:
  ------------------
  |  Branch (486:5): [True: 2.93k, False: 317k]
  ------------------
  487|   294k|        return true;
  488|  2.20k|    case NET_ONION:
  ------------------
  |  Branch (488:5): [True: 2.20k, False: 318k]
  ------------------
  489|  17.3k|    case NET_I2P:
  ------------------
  |  Branch (489:5): [True: 15.1k, False: 305k]
  ------------------
  490|  25.9k|    case NET_CJDNS:
  ------------------
  |  Branch (490:5): [True: 8.66k, False: 311k]
  ------------------
  491|  25.9k|        return false;
  492|      0|    case NET_UNROUTABLE: // m_net is never and should not be set to NET_UNROUTABLE
  ------------------
  |  Branch (492:5): [True: 0, False: 320k]
  ------------------
  493|      0|    case NET_MAX:        // m_net is never and should not be set to NET_MAX
  ------------------
  |  Branch (493:5): [True: 0, False: 320k]
  ------------------
  494|      0|        assert(false);
  495|   320k|    } // no default case, so the compiler can warn about missing cases
  496|       |
  497|      0|    assert(false);
  498|      0|}
_ZNK8CNetAddr10GetNetworkEv:
  501|   135k|{
  502|   135k|    if (IsInternal())
  ------------------
  |  Branch (502:9): [True: 208, False: 135k]
  ------------------
  503|    208|        return NET_INTERNAL;
  504|       |
  505|   135k|    if (!IsRoutable())
  ------------------
  |  Branch (505:9): [True: 3.96k, False: 131k]
  ------------------
  506|  3.96k|        return NET_UNROUTABLE;
  507|       |
  508|   131k|    return m_net;
  509|   135k|}
_Z13OnionToString4SpanIKhE:
  574|     48|{
  575|     48|    uint8_t checksum[torv3::CHECKSUM_LEN];
  576|     48|    torv3::Checksum(addr, checksum);
  577|       |    // TORv3 onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"
  578|     48|    prevector<torv3::TOTAL_LEN, uint8_t> address{addr.begin(), addr.end()};
  579|     48|    address.insert(address.end(), checksum, checksum + torv3::CHECKSUM_LEN);
  580|     48|    address.insert(address.end(), torv3::VERSION, torv3::VERSION + sizeof(torv3::VERSION));
  581|     48|    return EncodeBase32(address) + ".onion";
  582|     48|}
_ZNK8CNetAddr12ToStringAddrEv:
  585|  2.65k|{
  586|  2.65k|    switch (m_net) {
  ------------------
  |  Branch (586:13): [True: 0, False: 2.65k]
  ------------------
  587|  2.19k|    case NET_IPV4:
  ------------------
  |  Branch (587:5): [True: 2.19k, False: 461]
  ------------------
  588|  2.19k|        return IPv4ToString(m_addr);
  589|    276|    case NET_IPV6:
  ------------------
  |  Branch (589:5): [True: 276, False: 2.37k]
  ------------------
  590|    276|        return IPv6ToString(m_addr, m_scope_id);
  591|     48|    case NET_ONION:
  ------------------
  |  Branch (591:5): [True: 48, False: 2.60k]
  ------------------
  592|     48|        return OnionToString(m_addr);
  593|     36|    case NET_I2P:
  ------------------
  |  Branch (593:5): [True: 36, False: 2.61k]
  ------------------
  594|     36|        return EncodeBase32(m_addr, false /* don't pad with = */) + ".b32.i2p";
  595|     51|    case NET_CJDNS:
  ------------------
  |  Branch (595:5): [True: 51, False: 2.60k]
  ------------------
  596|     51|        return IPv6ToString(m_addr, 0);
  597|     50|    case NET_INTERNAL:
  ------------------
  |  Branch (597:5): [True: 50, False: 2.60k]
  ------------------
  598|     50|        return EncodeBase32(m_addr) + ".internal";
  599|      0|    case NET_UNROUTABLE: // m_net is never and should not be set to NET_UNROUTABLE
  ------------------
  |  Branch (599:5): [True: 0, False: 2.65k]
  ------------------
  600|      0|    case NET_MAX:        // m_net is never and should not be set to NET_MAX
  ------------------
  |  Branch (600:5): [True: 0, False: 2.65k]
  ------------------
  601|      0|        assert(false);
  602|  2.65k|    } // no default case, so the compiler can warn about missing cases
  603|       |
  604|      0|    assert(false);
  605|      0|}
_ZeqRK8CNetAddrS1_:
  608|   160k|{
  609|   160k|    return a.m_net == b.m_net && a.m_addr == b.m_addr;
  ------------------
  |  Branch (609:12): [True: 76.3k, False: 84.6k]
  |  Branch (609:34): [True: 52.2k, False: 24.1k]
  ------------------
  610|   160k|}
_ZNK8CNetAddr13HasLinkedIPv4Ev:
  657|   267k|{
  658|   267k|    return IsRoutable() && (IsIPv4() || IsRFC6145() || IsRFC6052() || IsRFC3964() || IsRFC4380());
  ------------------
  |  Branch (658:12): [True: 267k, False: 0]
  |  Branch (658:29): [True: 14.4k, False: 253k]
  |  Branch (658:41): [True: 4.01k, False: 249k]
  |  Branch (658:56): [True: 7.39k, False: 241k]
  |  Branch (658:71): [True: 1.24k, False: 240k]
  |  Branch (658:86): [True: 2.91k, False: 237k]
  ------------------
  659|   267k|}
_ZNK8CNetAddr13GetLinkedIPv4Ev:
  662|  7.98k|{
  663|  7.98k|    if (IsIPv4()) {
  ------------------
  |  Branch (663:9): [True: 2.86k, False: 5.12k]
  ------------------
  664|  2.86k|        return ReadBE32(m_addr.data());
  665|  5.12k|    } else if (IsRFC6052() || IsRFC6145()) {
  ------------------
  |  Branch (665:16): [True: 2.44k, False: 2.68k]
  |  Branch (665:31): [True: 1.32k, False: 1.36k]
  ------------------
  666|       |        // mapped IPv4, SIIT translated IPv4: the IPv4 address is the last 4 bytes of the address
  667|  3.76k|        return ReadBE32(Span{m_addr}.last(ADDR_IPV4_SIZE).data());
  668|  3.76k|    } else if (IsRFC3964()) {
  ------------------
  |  Branch (668:16): [True: 406, False: 956]
  ------------------
  669|       |        // 6to4 tunneled IPv4: the IPv4 address is in bytes 2-6
  670|    406|        return ReadBE32(Span{m_addr}.subspan(2, ADDR_IPV4_SIZE).data());
  671|    956|    } else if (IsRFC4380()) {
  ------------------
  |  Branch (671:16): [True: 956, False: 0]
  ------------------
  672|       |        // Teredo tunneled IPv4: the IPv4 address is in the last 4 bytes of the address, but bitflipped
  673|    956|        return ~ReadBE32(Span{m_addr}.last(ADDR_IPV4_SIZE).data());
  674|    956|    }
  675|      0|    assert(false);
  676|      0|}
_ZNK8CNetAddr11GetNetClassEv:
  679|   233k|{
  680|       |    // Make sure that if we return NET_IPV6, then IsIPv6() is true. The callers expect that.
  681|       |
  682|       |    // Check for "internal" first because such addresses are also !IsRoutable()
  683|       |    // and we don't want to return NET_UNROUTABLE in that case.
  684|   233k|    if (IsInternal()) {
  ------------------
  |  Branch (684:9): [True: 5.57k, False: 227k]
  ------------------
  685|  5.57k|        return NET_INTERNAL;
  686|  5.57k|    }
  687|   227k|    if (!IsRoutable()) {
  ------------------
  |  Branch (687:9): [True: 34.8k, False: 192k]
  ------------------
  688|  34.8k|        return NET_UNROUTABLE;
  689|  34.8k|    }
  690|   192k|    if (HasLinkedIPv4()) {
  ------------------
  |  Branch (690:9): [True: 22.0k, False: 170k]
  ------------------
  691|  22.0k|        return NET_IPV4;
  692|  22.0k|    }
  693|   170k|    return m_net;
  694|   192k|}
_ZNK8CNetAddr12GetAddrBytesEv:
  697|   302k|{
  698|   302k|    if (IsAddrV1Compatible()) {
  ------------------
  |  Branch (698:9): [True: 278k, False: 24.0k]
  ------------------
  699|   278k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  700|   278k|        SerializeV1Array(serialized);
  701|   278k|        return {std::begin(serialized), std::end(serialized)};
  702|   278k|    }
  703|  24.0k|    return std::vector<unsigned char>(m_addr.begin(), m_addr.end());
  704|   302k|}
_ZN8CServiceC2Ev:
  784|   384k|CService::CService() : port(0)
  785|   384k|{
  786|   384k|}
_ZN8CServiceC2ERK8CNetAddrt:
  788|  18.9k|CService::CService(const CNetAddr& cip, uint16_t portIn) : CNetAddr(cip), port(portIn)
  789|  18.9k|{
  790|  18.9k|}
_ZNK8CService7GetPortEv:
  840|    246|{
  841|    246|    return port;
  842|    246|}
_ZeqRK8CServiceS1_:
  845|  51.9k|{
  846|  51.9k|    return static_cast<CNetAddr>(a) == static_cast<CNetAddr>(b) && a.port == b.port;
  ------------------
  |  Branch (846:12): [True: 51.9k, False: 0]
  |  Branch (846:68): [True: 51.9k, False: 0]
  ------------------
  847|  51.9k|}
_ZNK8CService6GetKeyEv:
  900|   143k|{
  901|   143k|    auto key = GetAddrBytes();
  902|   143k|    key.push_back(port / 0x100); // most significant byte of our port
  903|   143k|    key.push_back(port & 0x0FF); // least significant byte of our port
  904|   143k|    return key;
  905|   143k|}
_ZNK8CService16ToStringAddrPortEv:
  908|  2.65k|{
  909|  2.65k|    const auto port_str = strprintf("%u", port);
  ------------------
  |  | 1172|  2.65k|#define strprintf tfm::format
  ------------------
  910|       |
  911|  2.65k|    if (IsIPv4() || IsTor() || IsI2P() || IsInternal()) {
  ------------------
  |  Branch (911:9): [True: 2.19k, False: 461]
  |  Branch (911:21): [True: 48, False: 413]
  |  Branch (911:32): [True: 36, False: 377]
  |  Branch (911:43): [True: 50, False: 327]
  ------------------
  912|  2.32k|        return ToStringAddr() + ":" + port_str;
  913|  2.32k|    } else {
  914|    327|        return "[" + ToStringAddr() + "]:" + port_str;
  915|    327|    }
  916|  2.65k|}
_ZN7CSubNetC2Ev:
  919|    225|    valid(false)
  920|    225|{
  921|    225|    memset(netmask, 0, sizeof(netmask));
  922|    225|}
_ZN7CSubNetC2ERK8CNetAddr:
  996|    225|CSubNet::CSubNet(const CNetAddr& addr) : CSubNet()
  997|    225|{
  998|    225|    switch (addr.m_net) {
  ------------------
  |  Branch (998:13): [True: 0, False: 225]
  ------------------
  999|    183|    case NET_IPV4:
  ------------------
  |  Branch (999:5): [True: 183, False: 42]
  ------------------
 1000|    191|    case NET_IPV6:
  ------------------
  |  Branch (1000:5): [True: 8, False: 217]
  ------------------
 1001|    191|        valid = true;
 1002|    191|        assert(addr.m_addr.size() <= sizeof(netmask));
 1003|    191|        memset(netmask, 0xFF, addr.m_addr.size());
 1004|    191|        break;
 1005|      6|    case NET_ONION:
  ------------------
  |  Branch (1005:5): [True: 6, False: 219]
  ------------------
 1006|     17|    case NET_I2P:
  ------------------
  |  Branch (1006:5): [True: 11, False: 214]
  ------------------
 1007|     29|    case NET_CJDNS:
  ------------------
  |  Branch (1007:5): [True: 12, False: 213]
  ------------------
 1008|     29|        valid = true;
 1009|     29|        break;
 1010|      5|    case NET_INTERNAL:
  ------------------
  |  Branch (1010:5): [True: 5, False: 220]
  ------------------
 1011|      5|    case NET_UNROUTABLE:
  ------------------
  |  Branch (1011:5): [True: 0, False: 225]
  ------------------
 1012|      5|    case NET_MAX:
  ------------------
  |  Branch (1012:5): [True: 0, False: 225]
  ------------------
 1013|      5|        return;
 1014|    225|    }
 1015|       |
 1016|    220|    network = addr;
 1017|    220|}
_ZNK7CSubNet5MatchERK8CNetAddr:
 1024|    225|{
 1025|    225|    if (!valid || !addr.IsValid() || network.m_net != addr.m_net)
  ------------------
  |  Branch (1025:9): [True: 5, False: 220]
  |  Branch (1025:19): [True: 6, False: 214]
  |  Branch (1025:38): [True: 0, False: 214]
  ------------------
 1026|     11|        return false;
 1027|       |
 1028|    214|    switch (network.m_net) {
  ------------------
  |  Branch (1028:13): [True: 0, False: 214]
  ------------------
 1029|    177|    case NET_IPV4:
  ------------------
  |  Branch (1029:5): [True: 177, False: 37]
  ------------------
 1030|    185|    case NET_IPV6:
  ------------------
  |  Branch (1030:5): [True: 8, False: 206]
  ------------------
 1031|    185|        break;
 1032|      6|    case NET_ONION:
  ------------------
  |  Branch (1032:5): [True: 6, False: 208]
  ------------------
 1033|     17|    case NET_I2P:
  ------------------
  |  Branch (1033:5): [True: 11, False: 203]
  ------------------
 1034|     29|    case NET_CJDNS:
  ------------------
  |  Branch (1034:5): [True: 12, False: 202]
  ------------------
 1035|     29|    case NET_INTERNAL:
  ------------------
  |  Branch (1035:5): [True: 0, False: 214]
  ------------------
 1036|     29|        return addr == network;
 1037|      0|    case NET_UNROUTABLE:
  ------------------
  |  Branch (1037:5): [True: 0, False: 214]
  ------------------
 1038|      0|    case NET_MAX:
  ------------------
  |  Branch (1038:5): [True: 0, False: 214]
  ------------------
 1039|      0|        return false;
 1040|    214|    }
 1041|       |
 1042|    185|    assert(network.m_addr.size() == addr.m_addr.size());
 1043|  1.02k|    for (size_t x = 0; x < addr.m_addr.size(); ++x) {
  ------------------
  |  Branch (1043:24): [True: 836, False: 185]
  ------------------
 1044|    836|        if ((addr.m_addr[x] & netmask[x]) != network.m_addr[x]) {
  ------------------
  |  Branch (1044:13): [True: 0, False: 836]
  ------------------
 1045|      0|            return false;
 1046|      0|        }
 1047|    836|    }
 1048|    185|    return true;
 1049|    185|}
netaddress.cpp:_ZN5torv3L8ChecksumE4SpanIKhERA2_h:
  191|     48|{
  192|       |    // TORv3 CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]
  193|     48|    static const unsigned char prefix[] = ".onion checksum";
  194|     48|    static constexpr size_t prefix_len = 15;
  195|       |
  196|     48|    SHA3_256 hasher;
  197|       |
  198|     48|    hasher.Write(Span{prefix}.first(prefix_len));
  199|     48|    hasher.Write(addr_pubkey);
  200|     48|    hasher.Write(VERSION);
  201|       |
  202|     48|    uint8_t checksum_full[SHA3_256::OUTPUT_SIZE];
  203|       |
  204|     48|    hasher.Finalize(checksum_full);
  205|       |
  206|     48|    memcpy(checksum, checksum_full, sizeof(checksum));
  207|     48|}
netaddress.cpp:_ZL12IPv4ToString4SpanIKhE:
  512|  2.19k|{
  513|  2.19k|    return strprintf("%u.%u.%u.%u", a[0], a[1], a[2], a[3]);
  ------------------
  |  | 1172|  2.19k|#define strprintf tfm::format
  ------------------
  514|  2.19k|}
netaddress.cpp:_ZL12IPv6ToString4SpanIKhEj:
  519|    327|{
  520|    327|    assert(a.size() == ADDR_IPV6_SIZE);
  521|    327|    const std::array groups{
  522|    327|        ReadBE16(&a[0]),
  523|    327|        ReadBE16(&a[2]),
  524|    327|        ReadBE16(&a[4]),
  525|    327|        ReadBE16(&a[6]),
  526|    327|        ReadBE16(&a[8]),
  527|    327|        ReadBE16(&a[10]),
  528|    327|        ReadBE16(&a[12]),
  529|    327|        ReadBE16(&a[14]),
  530|    327|    };
  531|       |
  532|       |    // The zero compression implementation is inspired by Rust's std::net::Ipv6Addr, see
  533|       |    // https://github.com/rust-lang/rust/blob/cc4103089f40a163f6d143f06359cba7043da29b/library/std/src/net/ip.rs#L1635-L1683
  534|    327|    struct ZeroSpan {
  535|    327|        size_t start_index{0};
  536|    327|        size_t len{0};
  537|    327|    };
  538|       |
  539|       |    // Find longest sequence of consecutive all-zero fields. Use first zero sequence if two or more
  540|       |    // zero sequences of equal length are found.
  541|    327|    ZeroSpan longest, current;
  542|  2.94k|    for (size_t i{0}; i < groups.size(); ++i) {
  ------------------
  |  Branch (542:23): [True: 2.61k, False: 327]
  ------------------
  543|  2.61k|        if (groups[i] != 0) {
  ------------------
  |  Branch (543:13): [True: 1.38k, False: 1.22k]
  ------------------
  544|  1.38k|            current = {i + 1, 0};
  545|  1.38k|            continue;
  546|  1.38k|        }
  547|  1.22k|        current.len += 1;
  548|  1.22k|        if (current.len > longest.len) {
  ------------------
  |  Branch (548:13): [True: 1.13k, False: 96]
  ------------------
  549|  1.13k|            longest = current;
  550|  1.13k|        }
  551|  1.22k|    }
  552|       |
  553|    327|    std::string r;
  554|    327|    r.reserve(39);
  555|  2.94k|    for (size_t i{0}; i < groups.size(); ++i) {
  ------------------
  |  Branch (555:23): [True: 2.61k, False: 327]
  ------------------
  556|       |        // Replace the longest sequence of consecutive all-zero fields with two colons ("::").
  557|  2.61k|        if (longest.len >= 2 && i >= longest.start_index && i < longest.start_index + longest.len) {
  ------------------
  |  Branch (557:13): [True: 1.65k, False: 960]
  |  Branch (557:33): [True: 1.37k, False: 281]
  |  Branch (557:61): [True: 1.09k, False: 285]
  ------------------
  558|  1.09k|            if (i == longest.start_index) {
  ------------------
  |  Branch (558:17): [True: 207, False: 883]
  ------------------
  559|    207|                r += "::";
  560|    207|            }
  561|  1.09k|            continue;
  562|  1.09k|        }
  563|  1.52k|        r += strprintf("%s%x", ((!r.empty() && r.back() != ':') ? ":" : ""), groups[i]);
  ------------------
  |  | 1172|  1.52k|#define strprintf tfm::format
  ------------------
  |  Branch (563:34): [True: 1.25k, False: 269]
  |  Branch (563:48): [True: 1.16k, False: 96]
  ------------------
  564|  1.52k|    }
  565|       |
  566|    327|    if (scope_id != 0) {
  ------------------
  |  Branch (566:9): [True: 0, False: 327]
  ------------------
  567|      0|        r += strprintf("%%%u", scope_id);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  568|      0|    }
  569|       |
  570|    327|    return r;
  571|    327|}

_ZNK8CNetAddr6IsIPv4Ev:
  157|  5.80M|    [[nodiscard]] bool IsIPv4() const { return m_net == NET_IPV4; } // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0)
_ZNK8CNetAddr6IsIPv6Ev:
  158|  6.56M|    [[nodiscard]] bool IsIPv6() const { return m_net == NET_IPV6; } // IPv6 address (not mapped IPv4, not Tor)
_ZNK8CNetAddr5IsTorEv:
  174|  67.6k|    [[nodiscard]] bool IsTor() const { return m_net == NET_ONION; }
_ZNK8CNetAddr5IsI2PEv:
  175|  66.5k|    [[nodiscard]] bool IsI2P() const { return m_net == NET_I2P; }
_ZNK8CNetAddr7IsCJDNSEv:
  176|   860k|    [[nodiscard]] bool IsCJDNS() const { return m_net == NET_CJDNS; }
_ZNK8CNetAddr14HasCJDNSPrefixEv:
  177|  47.9k|    [[nodiscard]] bool HasCJDNSPrefix() const { return m_addr[0] == CJDNS_PREFIX; }
_ZNK8CNetAddr16SerializeV1ArrayERA16_h:
  325|   317k|    {
  326|   317k|        size_t prefix_size;
  327|       |
  328|   317k|        switch (m_net) {
  ------------------
  |  Branch (328:17): [True: 0, False: 317k]
  ------------------
  329|   288k|        case NET_IPV6:
  ------------------
  |  Branch (329:9): [True: 288k, False: 29.1k]
  ------------------
  330|   288k|            assert(m_addr.size() == sizeof(arr));
  331|   288k|            memcpy(arr, m_addr.data(), m_addr.size());
  332|   288k|            return;
  333|  26.1k|        case NET_IPV4:
  ------------------
  |  Branch (333:9): [True: 26.1k, False: 291k]
  ------------------
  334|  26.1k|            prefix_size = sizeof(IPV4_IN_IPV6_PREFIX);
  335|  26.1k|            assert(prefix_size + m_addr.size() == sizeof(arr));
  336|  26.1k|            memcpy(arr, IPV4_IN_IPV6_PREFIX.data(), prefix_size);
  337|  26.1k|            memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
  338|  26.1k|            return;
  339|  2.93k|        case NET_INTERNAL:
  ------------------
  |  Branch (339:9): [True: 2.93k, False: 314k]
  ------------------
  340|  2.93k|            prefix_size = sizeof(INTERNAL_IN_IPV6_PREFIX);
  341|  2.93k|            assert(prefix_size + m_addr.size() == sizeof(arr));
  342|  2.93k|            memcpy(arr, INTERNAL_IN_IPV6_PREFIX.data(), prefix_size);
  343|  2.93k|            memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
  344|  2.93k|            return;
  345|      0|        case NET_ONION:
  ------------------
  |  Branch (345:9): [True: 0, False: 317k]
  ------------------
  346|      0|        case NET_I2P:
  ------------------
  |  Branch (346:9): [True: 0, False: 317k]
  ------------------
  347|      0|        case NET_CJDNS:
  ------------------
  |  Branch (347:9): [True: 0, False: 317k]
  ------------------
  348|      0|            break;
  349|      0|        case NET_UNROUTABLE:
  ------------------
  |  Branch (349:9): [True: 0, False: 317k]
  ------------------
  350|      0|        case NET_MAX:
  ------------------
  |  Branch (350:9): [True: 0, False: 317k]
  ------------------
  351|      0|            assert(false);
  352|   317k|        } // 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|    }
_ZN8CNetAddr18UnserializeV1ArrayERA16_h:
  400|   113k|    {
  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|   113k|        SetLegacyIPv6(arr);
  404|   113k|    }
_ZN12CServiceHashC2Emm:
  582|     75|    CServiceHash(uint64_t salt_k0, uint64_t salt_k1) : m_salt_k0{salt_k0}, m_salt_k1{salt_k1} {}
_ZNK12CServiceHashclERK8CService:
  585|   138k|    {
  586|   138k|        CSipHasher hasher(m_salt_k0, m_salt_k1);
  587|   138k|        hasher.Write(a.m_net);
  588|   138k|        hasher.Write(a.port);
  589|   138k|        hasher.Write(a.m_addr);
  590|   138k|        return static_cast<size_t>(hasher.Finalize());
  591|   138k|    }
_ZN8CService16SerializationOpsI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_:
  565|   299k|    {
  566|   299k|        READWRITE(AsBase<CNetAddr>(obj), Using<BigEndianFormatter<2>>(obj.port));
  ------------------
  |  |  156|   299k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  567|   299k|    }
_ZN8CNetAddr11UnserializeI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  252|   299k|    {
  253|   299k|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (253:13): [True: 194k, False: 105k]
  ------------------
  254|   194k|            UnserializeV2Stream(s);
  255|   194k|        } else {
  256|   105k|            UnserializeV1Stream(s);
  257|   105k|        }
  258|   299k|    }
_ZN8CNetAddr19UnserializeV2StreamI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  424|   194k|    {
  425|   194k|        uint8_t bip155_net;
  426|   194k|        s >> bip155_net;
  427|       |
  428|   194k|        size_t address_size;
  429|   194k|        s >> COMPACTSIZE(address_size);
  ------------------
  |  |  501|   194k|#define COMPACTSIZE(obj) Using<CompactSizeFormatter<true>>(obj)
  ------------------
  430|       |
  431|   194k|        if (address_size > MAX_ADDRV2_SIZE) {
  ------------------
  |  Branch (431:13): [True: 22, False: 194k]
  ------------------
  432|     22|            throw std::ios_base::failure(strprintf(
  ------------------
  |  | 1172|     22|#define strprintf tfm::format
  ------------------
  433|     22|                "Address too long: %u > %u", address_size, MAX_ADDRV2_SIZE));
  434|     22|        }
  435|       |
  436|   194k|        m_scope_id = 0;
  437|       |
  438|   194k|        if (SetNetFromBIP155Network(bip155_net, address_size)) {
  ------------------
  |  Branch (438:13): [True: 15.1k, False: 179k]
  ------------------
  439|  15.1k|            m_addr.resize(address_size);
  440|  15.1k|            s >> Span{m_addr};
  441|       |
  442|  15.1k|            if (m_net != NET_IPV6) {
  ------------------
  |  Branch (442:17): [True: 4.45k, False: 10.7k]
  ------------------
  443|  4.45k|                return;
  444|  4.45k|            }
  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|  10.7k|            if (util::HasPrefix(m_addr, INTERNAL_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (451:17): [True: 561, False: 10.1k]
  ------------------
  452|    561|                m_net = NET_INTERNAL;
  453|    561|                memmove(m_addr.data(), m_addr.data() + INTERNAL_IN_IPV6_PREFIX.size(),
  454|    561|                        ADDR_INTERNAL_SIZE);
  455|    561|                m_addr.resize(ADDR_INTERNAL_SIZE);
  456|    561|                return;
  457|    561|            }
  458|       |
  459|  10.1k|            if (!util::HasPrefix(m_addr, IPV4_IN_IPV6_PREFIX) &&
  ------------------
  |  Branch (459:17): [True: 10.0k, False: 85]
  ------------------
  460|  10.1k|                !util::HasPrefix(m_addr, TORV2_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (460:17): [True: 9.90k, False: 154]
  ------------------
  461|  9.90k|                return;
  462|  9.90k|            }
  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|   179k|        } else {
  467|       |            // If we receive an unknown BIP155 network id (from the future?) then
  468|       |            // ignore the address - unserialize as !IsValid().
  469|   179k|            s.ignore(address_size);
  470|   179k|        }
  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|   179k|        m_net = NET_IPV6;
  475|   179k|        m_addr.assign(ADDR_IPV6_SIZE, 0x0);
  476|   179k|    }
_ZN8CNetAddr19UnserializeV1StreamI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  411|   105k|    {
  412|   105k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  413|       |
  414|   105k|        s >> serialized;
  415|       |
  416|   105k|        UnserializeV1Array(serialized);
  417|   105k|    }
_ZN8CNetAddr11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  252|  16.4k|    {
  253|  16.4k|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (253:13): [True: 16.4k, False: 0]
  ------------------
  254|  16.4k|            UnserializeV2Stream(s);
  255|  16.4k|        } else {
  256|      0|            UnserializeV1Stream(s);
  257|      0|        }
  258|  16.4k|    }
_ZN8CNetAddr19UnserializeV2StreamI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  424|  16.4k|    {
  425|  16.4k|        uint8_t bip155_net;
  426|  16.4k|        s >> bip155_net;
  427|       |
  428|  16.4k|        size_t address_size;
  429|  16.4k|        s >> COMPACTSIZE(address_size);
  ------------------
  |  |  501|  16.4k|#define COMPACTSIZE(obj) Using<CompactSizeFormatter<true>>(obj)
  ------------------
  430|       |
  431|  16.4k|        if (address_size > MAX_ADDRV2_SIZE) {
  ------------------
  |  Branch (431:13): [True: 0, False: 16.4k]
  ------------------
  432|      0|            throw std::ios_base::failure(strprintf(
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  433|      0|                "Address too long: %u > %u", address_size, MAX_ADDRV2_SIZE));
  434|      0|        }
  435|       |
  436|  16.4k|        m_scope_id = 0;
  437|       |
  438|  16.4k|        if (SetNetFromBIP155Network(bip155_net, address_size)) {
  ------------------
  |  Branch (438:13): [True: 16.4k, False: 0]
  ------------------
  439|  16.4k|            m_addr.resize(address_size);
  440|  16.4k|            s >> Span{m_addr};
  441|       |
  442|  16.4k|            if (m_net != NET_IPV6) {
  ------------------
  |  Branch (442:17): [True: 15.1k, False: 1.33k]
  ------------------
  443|  15.1k|                return;
  444|  15.1k|            }
  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|  1.33k|            if (util::HasPrefix(m_addr, INTERNAL_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (451:17): [True: 8, False: 1.32k]
  ------------------
  452|      8|                m_net = NET_INTERNAL;
  453|      8|                memmove(m_addr.data(), m_addr.data() + INTERNAL_IN_IPV6_PREFIX.size(),
  454|      8|                        ADDR_INTERNAL_SIZE);
  455|      8|                m_addr.resize(ADDR_INTERNAL_SIZE);
  456|      8|                return;
  457|      8|            }
  458|       |
  459|  1.32k|            if (!util::HasPrefix(m_addr, IPV4_IN_IPV6_PREFIX) &&
  ------------------
  |  Branch (459:17): [True: 1.32k, False: 3]
  ------------------
  460|  1.32k|                !util::HasPrefix(m_addr, TORV2_IN_IPV6_PREFIX)) {
  ------------------
  |  Branch (460:17): [True: 1.32k, False: 3]
  ------------------
  461|  1.32k|                return;
  462|  1.32k|            }
  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|  1.32k|        } else {
  467|       |            // If we receive an unknown BIP155 network id (from the future?) then
  468|       |            // ignore the address - unserialize as !IsValid().
  469|      0|            s.ignore(address_size);
  470|      0|        }
  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|      6|        m_net = NET_IPV6;
  475|      6|        m_addr.assign(ADDR_IPV6_SIZE, 0x0);
  476|      6|    }
_ZN8CNetAddr11UnserializeI12ParamsStreamIR10DataStreamNS_9SerParamsEEEEvRT_:
  252|  8.40k|    {
  253|  8.40k|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (253:13): [True: 0, False: 8.40k]
  ------------------
  254|      0|            UnserializeV2Stream(s);
  255|  8.40k|        } else {
  256|  8.40k|            UnserializeV1Stream(s);
  257|  8.40k|        }
  258|  8.40k|    }
_ZN8CNetAddr19UnserializeV1StreamI12ParamsStreamIR10DataStreamNS_9SerParamsEEEEvRT_:
  411|  8.40k|    {
  412|  8.40k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  413|       |
  414|  8.40k|        s >> serialized;
  415|       |
  416|  8.40k|        UnserializeV1Array(serialized);
  417|  8.40k|    }
_ZN8CService16SerializationOpsI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_:
  565|  8.40k|    {
  566|  8.40k|        READWRITE(AsBase<CNetAddr>(obj), Using<BigEndianFormatter<2>>(obj.port));
  ------------------
  |  |  156|  8.40k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  567|  8.40k|    }
_ZN8CService16SerializationOpsI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEKS_15ActionSerializeEEvRT0_RT_T1_:
  565|  33.8k|    {
  566|  33.8k|        READWRITE(AsBase<CNetAddr>(obj), Using<BigEndianFormatter<2>>(obj.port));
  ------------------
  |  |  156|  33.8k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  567|  33.8k|    }
_ZNK8CNetAddr9SerializeI12ParamsStreamIR12VectorWriterNS_9SerParamsEEEEvRT_:
  239|  33.8k|    {
  240|  33.8k|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (240:13): [True: 0, False: 33.8k]
  ------------------
  241|      0|            SerializeV2Stream(s);
  242|  33.8k|        } else {
  243|  33.8k|            SerializeV1Stream(s);
  244|  33.8k|        }
  245|  33.8k|    }
_ZNK8CNetAddr17SerializeV1StreamI12ParamsStreamIR12VectorWriterNS_9SerParamsEEEEvRT_:
  363|  33.8k|    {
  364|  33.8k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  365|       |
  366|  33.8k|        SerializeV1Array(serialized);
  367|       |
  368|  33.8k|        s << serialized;
  369|  33.8k|    }
_ZN8CService16SerializationOpsI12ParamsStreamIRS1_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEKS_15ActionSerializeEEvRT0_RT_T1_:
  565|  5.29k|    {
  566|  5.29k|        READWRITE(AsBase<CNetAddr>(obj), Using<BigEndianFormatter<2>>(obj.port));
  ------------------
  |  |  156|  5.29k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  567|  5.29k|    }
_ZNK8CNetAddr9SerializeI12ParamsStreamIRS1_IR12VectorWriterN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  239|  5.29k|    {
  240|  5.29k|        if (s.template GetParams<SerParams>().enc == Encoding::V2) {
  ------------------
  |  Branch (240:13): [True: 0, False: 5.29k]
  ------------------
  241|      0|            SerializeV2Stream(s);
  242|  5.29k|        } else {
  243|  5.29k|            SerializeV1Stream(s);
  244|  5.29k|        }
  245|  5.29k|    }
_ZNK8CNetAddr17SerializeV1StreamI12ParamsStreamIRS1_IR12VectorWriterN8CAddress9SerParamsEENS_9SerParamsEEEEvRT_:
  363|  5.29k|    {
  364|  5.29k|        uint8_t serialized[V1_SERIALIZATION_SIZE];
  365|       |
  366|  5.29k|        SerializeV1Array(serialized);
  367|       |
  368|  5.29k|        s << serialized;
  369|  5.29k|    }

_Z7IsProxyRK8CNetAddr:
  719|  5.65k|bool IsProxy(const CNetAddr &addr) {
  720|  5.65k|    LOCK(g_proxyinfo_mutex);
  ------------------
  |  |  257|  5.65k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.65k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.65k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.65k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  721|  45.2k|    for (int i = 0; i < NET_MAX; i++) {
  ------------------
  |  Branch (721:21): [True: 39.5k, False: 5.65k]
  ------------------
  722|  39.5k|        if (addr == static_cast<CNetAddr>(proxyInfo[i].proxy))
  ------------------
  |  Branch (722:13): [True: 0, False: 39.5k]
  ------------------
  723|      0|            return true;
  724|  39.5k|    }
  725|  5.65k|    return false;
  726|  5.65k|}

_ZNK13ReachableNets8ContainsE7Network:
  125|  72.6k|    {
  126|  72.6k|        AssertLockNotHeld(m_mutex);
  ------------------
  |  |  147|  72.6k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  127|  72.6k|        LOCK(m_mutex);
  ------------------
  |  |  257|  72.6k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  72.6k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  72.6k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  72.6k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|  72.6k|        return m_reachable.count(net) > 0;
  129|  72.6k|    }
_ZNK13ReachableNets8ContainsERK8CNetAddr:
  132|  72.6k|    {
  133|  72.6k|        AssertLockNotHeld(m_mutex);
  ------------------
  |  |  147|  72.6k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  134|  72.6k|        return Contains(addr.GetNetwork());
  135|  72.6k|    }

_ZNK15NetGroupManager8GetGroupERK8CNetAddr:
   19|  93.4k|{
   20|  93.4k|    std::vector<unsigned char> vchRet;
   21|       |    // If non-empty asmap is supplied and the address is IPv4/IPv6,
   22|       |    // return ASN to be used for bucketing.
   23|  93.4k|    uint32_t asn = GetMappedAS(address);
   24|  93.4k|    if (asn != 0) { // Either asmap was empty, or address has non-asmappable net class (e.g. TOR).
  ------------------
  |  Branch (24:9): [True: 0, False: 93.4k]
  ------------------
   25|      0|        vchRet.push_back(NET_IPV6); // IPv4 and IPv6 with same ASN should be in the same bucket
   26|      0|        for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (26:25): [True: 0, False: 0]
  ------------------
   27|      0|            vchRet.push_back((asn >> (8 * i)) & 0xFF);
   28|      0|        }
   29|      0|        return vchRet;
   30|      0|    }
   31|       |
   32|  93.4k|    vchRet.push_back(address.GetNetClass());
   33|  93.4k|    int nStartByte{0};
   34|  93.4k|    int nBits{0};
   35|       |
   36|  93.4k|    if (address.IsLocal()) {
  ------------------
  |  Branch (36:9): [True: 10.1k, False: 83.3k]
  ------------------
   37|       |        // all local addresses belong to the same group
   38|  83.3k|    } else if (address.IsInternal()) {
  ------------------
  |  Branch (38:16): [True: 2.64k, False: 80.6k]
  ------------------
   39|       |        // All internal-usage addresses get their own group.
   40|       |        // Skip over the INTERNAL_IN_IPV6_PREFIX returned by CAddress::GetAddrBytes().
   41|  2.64k|        nStartByte = INTERNAL_IN_IPV6_PREFIX.size();
   42|  2.64k|        nBits = ADDR_INTERNAL_SIZE * 8;
   43|  80.6k|    } else if (!address.IsRoutable()) {
  ------------------
  |  Branch (43:16): [True: 5.49k, False: 75.1k]
  ------------------
   44|       |        // all other unroutable addresses belong to the same group
   45|  75.1k|    } else if (address.HasLinkedIPv4()) {
  ------------------
  |  Branch (45:16): [True: 7.98k, False: 67.1k]
  ------------------
   46|       |        // IPv4 addresses (and mapped IPv4 addresses) use /16 groups
   47|  7.98k|        uint32_t ipv4 = address.GetLinkedIPv4();
   48|  7.98k|        vchRet.push_back((ipv4 >> 24) & 0xFF);
   49|  7.98k|        vchRet.push_back((ipv4 >> 16) & 0xFF);
   50|  7.98k|        return vchRet;
   51|  67.1k|    } else if (address.IsTor() || address.IsI2P()) {
  ------------------
  |  Branch (51:16): [True: 1.04k, False: 66.1k]
  |  Branch (51:35): [True: 8.47k, False: 57.6k]
  ------------------
   52|  9.51k|        nBits = 4;
   53|  57.6k|    } else if (address.IsCJDNS()) {
  ------------------
  |  Branch (53:16): [True: 7.70k, False: 49.9k]
  ------------------
   54|       |        // Treat in the same way as Tor and I2P because the address in all of
   55|       |        // them is "random" bytes (derived from a public key). However in CJDNS
   56|       |        // the first byte is a constant (see CJDNS_PREFIX), so the random bytes
   57|       |        // come after it. Thus skip the constant 8 bits at the start.
   58|  7.70k|        nBits = 12;
   59|  49.9k|    } else if (address.IsHeNet()) {
  ------------------
  |  Branch (59:16): [True: 284, False: 49.6k]
  ------------------
   60|       |        // for he.net, use /36 groups
   61|    284|        nBits = 36;
   62|  49.6k|    } else {
   63|       |        // for the rest of the IPv6 network, use /32 groups
   64|  49.6k|        nBits = 32;
   65|  49.6k|    }
   66|       |
   67|       |    // Push our address onto vchRet.
   68|  85.4k|    auto addr_bytes = address.GetAddrBytes();
   69|  85.4k|    const size_t num_bytes = nBits / 8;
   70|  85.4k|    vchRet.insert(vchRet.end(), addr_bytes.begin() + nStartByte, addr_bytes.begin() + nStartByte + num_bytes);
   71|  85.4k|    nBits %= 8;
   72|       |    // ...for the last byte, push nBits and for the rest of the byte push 1's
   73|  85.4k|    if (nBits > 0) {
  ------------------
  |  Branch (73:9): [True: 17.5k, False: 67.9k]
  ------------------
   74|  17.5k|        assert(num_bytes < addr_bytes.size());
   75|  17.5k|        vchRet.push_back(addr_bytes[num_bytes + nStartByte] | ((1 << (8 - nBits)) - 1));
   76|  17.5k|    }
   77|       |
   78|  85.4k|    return vchRet;
   79|  85.4k|}
_ZNK15NetGroupManager11GetMappedASERK8CNetAddr:
   82|   139k|{
   83|   139k|    uint32_t net_class = address.GetNetClass();
   84|   139k|    if (m_asmap.size() == 0 || (net_class != NET_IPV4 && net_class != NET_IPV6)) {
  ------------------
  |  Branch (84:9): [True: 139k, False: 0]
  |  Branch (84:33): [True: 0, False: 0]
  |  Branch (84:58): [True: 0, False: 0]
  ------------------
   85|   139k|        return 0; // Indicates not found, safe because AS0 is reserved per RFC7607.
   86|   139k|    }
   87|      0|    std::vector<bool> ip_bits(128);
   88|      0|    if (address.HasLinkedIPv4()) {
  ------------------
  |  Branch (88:9): [True: 0, False: 0]
  ------------------
   89|       |        // For lookup, treat as if it was just an IPv4 address (IPV4_IN_IPV6_PREFIX + IPv4 bits)
   90|      0|        for (int8_t byte_i = 0; byte_i < 12; ++byte_i) {
  ------------------
  |  Branch (90:33): [True: 0, False: 0]
  ------------------
   91|      0|            for (uint8_t bit_i = 0; bit_i < 8; ++bit_i) {
  ------------------
  |  Branch (91:37): [True: 0, False: 0]
  ------------------
   92|      0|                ip_bits[byte_i * 8 + bit_i] = (IPV4_IN_IPV6_PREFIX[byte_i] >> (7 - bit_i)) & 1;
   93|      0|            }
   94|      0|        }
   95|      0|        uint32_t ipv4 = address.GetLinkedIPv4();
   96|      0|        for (int i = 0; i < 32; ++i) {
  ------------------
  |  Branch (96:25): [True: 0, False: 0]
  ------------------
   97|      0|            ip_bits[96 + i] = (ipv4 >> (31 - i)) & 1;
   98|      0|        }
   99|      0|    } else {
  100|       |        // Use all 128 bits of the IPv6 address otherwise
  101|      0|        assert(address.IsIPv6());
  102|      0|        auto addr_bytes = address.GetAddrBytes();
  103|      0|        for (int8_t byte_i = 0; byte_i < 16; ++byte_i) {
  ------------------
  |  Branch (103:33): [True: 0, False: 0]
  ------------------
  104|      0|            uint8_t cur_byte = addr_bytes[byte_i];
  105|      0|            for (uint8_t bit_i = 0; bit_i < 8; ++bit_i) {
  ------------------
  |  Branch (105:37): [True: 0, False: 0]
  ------------------
  106|      0|                ip_bits[byte_i * 8 + bit_i] = (cur_byte >> (7 - bit_i)) & 1;
  107|      0|            }
  108|      0|        }
  109|      0|    }
  110|      0|    uint32_t mapped_as = Interpret(m_asmap, ip_bits);
  111|      0|    return mapped_as;
  112|      0|}

_ZN6NetMsg4MakeIJ13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEEEEE17CSerializedNetMsgNS3_12basic_stringIcNS3_11char_traitsIcEENS6_IcEEEEDpOT_:
   15|     45|    {
   16|     45|        CSerializedNetMsg msg;
   17|     45|        msg.m_type = std::move(msg_type);
   18|     45|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|     45|        return msg;
   20|     45|    }
_ZN6NetMsg4MakeIJRi7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEll13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceElSC_mNSt3__112basic_stringIcNSD_11char_traitsIcEENSD_9allocatorIcEEEEiRbEEE17CSerializedNetMsgSJ_DpOT_:
   15|  8.47k|    {
   16|  8.47k|        CSerializedNetMsg msg;
   17|  8.47k|        msg.m_type = std::move(msg_type);
   18|  8.47k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  8.47k|        return msg;
   20|  8.47k|    }
_ZN6NetMsg4MakeIJEEE17CSerializedNetMsgNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEDpOT_:
   15|  33.9k|    {
   16|  33.9k|        CSerializedNetMsg msg;
   17|  33.9k|        msg.m_type = std::move(msg_type);
   18|  33.9k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  33.9k|        return msg;
   20|  33.9k|    }
_ZN6NetMsg4MakeIJbRKmEEE17CSerializedNetMsgNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEDpOT_:
   15|  6.69k|    {
   16|  6.69k|        CSerializedNetMsg msg;
   17|  6.69k|        msg.m_type = std::move(msg_type);
   18|  6.69k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  6.69k|        return msg;
   20|  6.69k|    }
_ZN6NetMsg4MakeIJRNSt3__16vectorI4CInvNS1_9allocatorIS3_EEEEEEE17CSerializedNetMsgNS1_12basic_stringIcNS1_11char_traitsIcEENS4_IcEEEEDpOT_:
   15|  15.5k|    {
   16|  15.5k|        CSerializedNetMsg msg;
   17|  15.5k|        msg.m_type = std::move(msg_type);
   18|  15.5k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  15.5k|        return msg;
   20|  15.5k|    }
_ZN6NetMsg4MakeIJRKiRmRKlS3_13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceES3_SA_S3_RNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEES2_RKbEEE17CSerializedNetMsgSH_DpOT_:
   15|  8.47k|    {
   16|  8.47k|        CSerializedNetMsg msg;
   17|  8.47k|        msg.m_type = std::move(msg_type);
   18|  8.47k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  8.47k|        return msg;
   20|  8.47k|    }
_ZN6NetMsg4MakeIJRKjRKmEEE17CSerializedNetMsgNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
   15|  3.77k|    {
   16|  3.77k|        CSerializedNetMsg msg;
   17|  3.77k|        msg.m_type = std::move(msg_type);
   18|  3.77k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  3.77k|        return msg;
   20|  3.77k|    }
_ZN6NetMsg4MakeIJRKNSt3__15arrayISt4byteLm168EEEEEE17CSerializedNetMsgNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEDpOT_:
   15|  1.45k|    {
   16|  1.45k|        CSerializedNetMsg msg;
   17|  1.45k|        msg.m_type = std::move(msg_type);
   18|  1.45k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  1.45k|        return msg;
   20|  1.45k|    }
_ZN6NetMsg4MakeIJRK13CBlockLocator7uint256EEE17CSerializedNetMsgNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEDpOT_:
   15|  3.80k|    {
   16|  3.80k|        CSerializedNetMsg msg;
   17|  3.80k|        msg.m_type = std::move(msg_type);
   18|  3.80k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  3.80k|        return msg;
   20|  3.80k|    }
_ZN6NetMsg4MakeIJ4SpanIhEEEE17CSerializedNetMsgNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEDpOT_:
   15|     62|    {
   16|     62|        CSerializedNetMsg msg;
   17|     62|        msg.m_type = std::move(msg_type);
   18|     62|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|     62|        return msg;
   20|     62|    }
_ZN6NetMsg4MakeIJ13ParamsWrapperI20TransactionSerParamsK6CBlockEEEE17CSerializedNetMsgNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEDpOT_:
   15|  1.47k|    {
   16|  1.47k|        CSerializedNetMsg msg;
   17|  1.47k|        msg.m_type = std::move(msg_type);
   18|  1.47k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  1.47k|        return msg;
   20|  1.47k|    }
_ZN6NetMsg4MakeIJR25CBlockHeaderAndShortTxIDsEEE17CSerializedNetMsgNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEDpOT_:
   15|     10|    {
   16|     10|        CSerializedNetMsg msg;
   17|     10|        msg.m_type = std::move(msg_type);
   18|     10|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|     10|        return msg;
   20|     10|    }
_ZN6NetMsg4MakeIJR17BlockTransactionsEEE17CSerializedNetMsgNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEDpOT_:
   15|      2|    {
   16|      2|        CSerializedNetMsg msg;
   17|      2|        msg.m_type = std::move(msg_type);
   18|      2|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|      2|        return msg;
   20|      2|    }
_ZN6NetMsg4MakeIJR24BlockTransactionsRequestEEE17CSerializedNetMsgNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEDpOT_:
   15|     71|    {
   16|     71|        CSerializedNetMsg msg;
   17|     71|        msg.m_type = std::move(msg_type);
   18|     71|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|     71|        return msg;
   20|     71|    }
_ZN6NetMsg4MakeIJRmEEE17CSerializedNetMsgNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEDpOT_:
   15|  6.76k|    {
   16|  6.76k|        CSerializedNetMsg msg;
   17|  6.76k|        msg.m_type = std::move(msg_type);
   18|  6.76k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  6.76k|        return msg;
   20|  6.76k|    }
_ZN6NetMsg4MakeIJ13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS2_NS4_9allocatorIS2_EEEEEEEE17CSerializedNetMsgNS4_12basic_stringIcNS4_11char_traitsIcEENS6_IcEEEEDpOT_:
   15|    129|    {
   16|    129|        CSerializedNetMsg msg;
   17|    129|        msg.m_type = std::move(msg_type);
   18|    129|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|    129|        return msg;
   20|    129|    }
_ZN6NetMsg4MakeIJRlEEE17CSerializedNetMsgNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEDpOT_:
   15|  7.24k|    {
   16|  7.24k|        CSerializedNetMsg msg;
   17|  7.24k|        msg.m_type = std::move(msg_type);
   18|  7.24k|        VectorWriter{msg.data, 0, std::forward<Args>(args)...};
   19|  7.24k|        return msg;
   20|  7.24k|    }

_ZNK4node25CBlockIndexWorkComparatorclEPK11CBlockIndexS3_:
  157|   562k|{
  158|       |    // First sort by most total work, ...
  159|   562k|    if (pa->nChainWork > pb->nChainWork) return false;
  ------------------
  |  Branch (159:9): [True: 30.7k, False: 531k]
  ------------------
  160|   531k|    if (pa->nChainWork < pb->nChainWork) return true;
  ------------------
  |  Branch (160:9): [True: 516k, False: 15.2k]
  ------------------
  161|       |
  162|       |    // ... then by earliest time received, ...
  163|  15.2k|    if (pa->nSequenceId < pb->nSequenceId) return false;
  ------------------
  |  Branch (163:9): [True: 8.68k, False: 6.53k]
  ------------------
  164|  6.53k|    if (pa->nSequenceId > pb->nSequenceId) return true;
  ------------------
  |  Branch (164:9): [True: 4.34k, False: 2.19k]
  ------------------
  165|       |
  166|       |    // Use pointer address as tie breaker (should only happen with blocks
  167|       |    // loaded from disk, as those all have id 0).
  168|  2.19k|    if (pa < pb) return false;
  ------------------
  |  Branch (168:9): [True: 0, False: 2.19k]
  ------------------
  169|  2.19k|    if (pa > pb) return true;
  ------------------
  |  Branch (169:9): [True: 0, False: 2.19k]
  ------------------
  170|       |
  171|       |    // Identical blocks.
  172|  2.19k|    return false;
  173|  2.19k|}
_ZN4node12BlockManager16LookupBlockIndexERK7uint256:
  192|  27.3k|{
  193|  27.3k|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|  27.3k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  194|  27.3k|    BlockMap::iterator it = m_block_index.find(hash);
  195|  27.3k|    return it == m_block_index.end() ? nullptr : &it->second;
  ------------------
  |  Branch (195:12): [True: 21.7k, False: 5.57k]
  ------------------
  196|  27.3k|}
_ZN4node12BlockManager15AddToBlockIndexERK12CBlockHeaderRP11CBlockIndex:
  206|    258|{
  207|    258|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|    258|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  208|       |
  209|    258|    auto [mi, inserted] = m_block_index.try_emplace(block.GetHash(), block);
  210|    258|    if (!inserted) {
  ------------------
  |  Branch (210:9): [True: 0, False: 258]
  ------------------
  211|      0|        return &mi->second;
  212|      0|    }
  213|    258|    CBlockIndex* pindexNew = &(*mi).second;
  214|       |
  215|       |    // We assign the sequence id to blocks only when the full data is available,
  216|       |    // to avoid miners withholding blocks but broadcasting headers, to get a
  217|       |    // competitive advantage.
  218|    258|    pindexNew->nSequenceId = 0;
  219|       |
  220|    258|    pindexNew->phashBlock = &((*mi).first);
  221|    258|    BlockMap::iterator miPrev = m_block_index.find(block.hashPrevBlock);
  222|    258|    if (miPrev != m_block_index.end()) {
  ------------------
  |  Branch (222:9): [True: 258, False: 0]
  ------------------
  223|    258|        pindexNew->pprev = &(*miPrev).second;
  224|    258|        pindexNew->nHeight = pindexNew->pprev->nHeight + 1;
  225|    258|        pindexNew->BuildSkip();
  226|    258|    }
  227|    258|    pindexNew->nTimeMax = (pindexNew->pprev ? std::max(pindexNew->pprev->nTimeMax, pindexNew->nTime) : pindexNew->nTime);
  ------------------
  |  Branch (227:28): [True: 258, False: 0]
  ------------------
  228|    258|    pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + GetBlockProof(*pindexNew);
  ------------------
  |  Branch (228:30): [True: 258, False: 0]
  ------------------
  229|    258|    pindexNew->RaiseValidity(BLOCK_VALID_TREE);
  230|    258|    if (best_header == nullptr || best_header->nChainWork < pindexNew->nChainWork) {
  ------------------
  |  Branch (230:9): [True: 0, False: 258]
  |  Branch (230:35): [True: 1, False: 257]
  ------------------
  231|      1|        best_header = pindexNew;
  232|      1|    }
  233|       |
  234|    258|    m_dirty_blockindex.insert(pindexNew);
  235|       |
  236|    258|    return pindexNew;
  237|    258|}
_ZN4node12BlockManager17GetLastCheckpointERK15CCheckpointData:
  580|    357|{
  581|    357|    const MapCheckpoints& checkpoints = data.mapCheckpoints;
  582|       |
  583|    357|    for (const MapCheckpoints::value_type& i : checkpoints | std::views::reverse) {
  ------------------
  |  Branch (583:46): [True: 357, False: 0]
  ------------------
  584|    357|        const uint256& hash = i.second;
  585|    357|        const CBlockIndex* pindex = LookupBlockIndex(hash);
  586|    357|        if (pindex) {
  ------------------
  |  Branch (586:13): [True: 357, False: 0]
  ------------------
  587|    357|            return pindex;
  588|    357|        }
  589|    357|    }
  590|      0|    return nullptr;
  591|    357|}
_ZNK4node12BlockManager13OpenBlockFileERK11FlatFilePosb:
  791|  1.59k|{
  792|  1.59k|    return AutoFile{m_block_file_seq.Open(pos, fReadOnly), m_xor_key};
  793|  1.59k|}
_ZNK4node12BlockManager9ReadBlockER6CBlockRK11FlatFilePos:
 1000|  1.53k|{
 1001|  1.53k|    block.SetNull();
 1002|       |
 1003|       |    // Open history file to read
 1004|  1.53k|    AutoFile filein{OpenBlockFile(pos, true)};
 1005|  1.53k|    if (filein.IsNull()) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 1.53k]
  ------------------
 1006|      0|        LogError("%s: OpenBlockFile failed for %s\n", __func__, pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1007|      0|        return false;
 1008|      0|    }
 1009|       |
 1010|       |    // Read block
 1011|  1.53k|    try {
 1012|  1.53k|        filein >> TX_WITH_WITNESS(block);
 1013|  1.53k|    } catch (const std::exception& e) {
 1014|      0|        LogError("%s: Deserialize or I/O error - %s at %s\n", __func__, e.what(), pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1015|      0|        return false;
 1016|      0|    }
 1017|       |
 1018|       |    // Check the header
 1019|  1.53k|    if (!CheckProofOfWork(block.GetHash(), block.nBits, GetConsensus())) {
  ------------------
  |  Branch (1019:9): [True: 0, False: 1.53k]
  ------------------
 1020|      0|        LogError("%s: Errors in block header at %s\n", __func__, pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1021|      0|        return false;
 1022|      0|    }
 1023|       |
 1024|       |    // Signet only: check block solution
 1025|  1.53k|    if (GetConsensus().signet_blocks && !CheckSignetBlockSolution(block, GetConsensus())) {
  ------------------
  |  Branch (1025:9): [True: 0, False: 1.53k]
  |  Branch (1025:41): [True: 0, False: 0]
  ------------------
 1026|      0|        LogError("%s: Errors in block solution at %s\n", __func__, pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1027|      0|        return false;
 1028|      0|    }
 1029|       |
 1030|  1.53k|    return true;
 1031|  1.53k|}
_ZNK4node12BlockManager12ReadRawBlockERNSt3__16vectorIhNS1_9allocatorIhEEEERK11FlatFilePos:
 1048|     62|{
 1049|     62|    FlatFilePos hpos = pos;
 1050|       |    // If nPos is less than 8 the pos is null and we don't have the block data
 1051|       |    // Return early to prevent undefined behavior of unsigned int underflow
 1052|     62|    if (hpos.nPos < 8) {
  ------------------
  |  Branch (1052:9): [True: 0, False: 62]
  ------------------
 1053|      0|        LogError("%s: OpenBlockFile failed for %s\n", __func__, pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1054|      0|        return false;
 1055|      0|    }
 1056|     62|    hpos.nPos -= 8; // Seek back 8 bytes for meta header
 1057|     62|    AutoFile filein{OpenBlockFile(hpos, true)};
 1058|     62|    if (filein.IsNull()) {
  ------------------
  |  Branch (1058:9): [True: 0, False: 62]
  ------------------
 1059|      0|        LogError("%s: OpenBlockFile failed for %s\n", __func__, pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1060|      0|        return false;
 1061|      0|    }
 1062|       |
 1063|     62|    try {
 1064|     62|        MessageStartChars blk_start;
 1065|     62|        unsigned int blk_size;
 1066|       |
 1067|     62|        filein >> blk_start >> blk_size;
 1068|       |
 1069|     62|        if (blk_start != GetParams().MessageStart()) {
  ------------------
  |  Branch (1069:13): [True: 0, False: 62]
  ------------------
 1070|      0|            LogError("%s: Block magic mismatch for %s: %s versus expected %s\n", __func__, pos.ToString(),
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1071|      0|                         HexStr(blk_start),
 1072|      0|                         HexStr(GetParams().MessageStart()));
 1073|      0|            return false;
 1074|      0|        }
 1075|       |
 1076|     62|        if (blk_size > MAX_SIZE) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 62]
  ------------------
 1077|      0|            LogError("%s: Block data is larger than maximum deserialization size for %s: %s versus %s\n", __func__, pos.ToString(),
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1078|      0|                         blk_size, MAX_SIZE);
 1079|      0|            return false;
 1080|      0|        }
 1081|       |
 1082|     62|        block.resize(blk_size); // Zeroing of memory is intentional here
 1083|     62|        filein.read(MakeWritableByteSpan(block));
 1084|     62|    } catch (const std::exception& e) {
 1085|      0|        LogError("%s: Read from block file failed: %s for %s\n", __func__, e.what(), pos.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 1086|      0|        return false;
 1087|      0|    }
 1088|       |
 1089|     62|    return true;
 1090|     62|}

_ZNK4node12BlockManager9GetParamsEv:
  144|     62|    const CChainParams& GetParams() const { return m_opts.chainparams; }
_ZNK4node12BlockManager12GetConsensusEv:
  145|  3.06k|    const Consensus::Params& GetConsensus() const { return m_opts.chainparams.GetConsensus(); }
_ZNK4node12BlockManager11IsPruneModeEv:
  349|  5.74k|    [[nodiscard]] bool IsPruneMode() const { return m_prune_mode; }
_ZNK4node12BlockManager13LoadingBlocksEv:
  355|   514k|    [[nodiscard]] bool LoadingBlocks() const { return m_importing || !m_blockfiles_indexed; }
  ------------------
  |  Branch (355:55): [True: 0, False: 514k]
  |  Branch (355:70): [True: 0, False: 514k]
  ------------------

_Z22ConnectionTypeAsString14ConnectionType:
    9|  3.07k|{
   10|  3.07k|    switch (conn_type) {
  ------------------
  |  Branch (10:13): [True: 0, False: 3.07k]
  ------------------
   11|      0|    case ConnectionType::INBOUND:
  ------------------
  |  Branch (11:5): [True: 0, False: 3.07k]
  ------------------
   12|      0|        return "inbound";
   13|  2.50k|    case ConnectionType::MANUAL:
  ------------------
  |  Branch (13:5): [True: 2.50k, False: 578]
  ------------------
   14|  2.50k|        return "manual";
   15|      0|    case ConnectionType::FEELER:
  ------------------
  |  Branch (15:5): [True: 0, False: 3.07k]
  ------------------
   16|      0|        return "feeler";
   17|    316|    case ConnectionType::OUTBOUND_FULL_RELAY:
  ------------------
  |  Branch (17:5): [True: 316, False: 2.76k]
  ------------------
   18|    316|        return "outbound-full-relay";
   19|     58|    case ConnectionType::BLOCK_RELAY:
  ------------------
  |  Branch (19:5): [True: 58, False: 3.02k]
  ------------------
   20|     58|        return "block-relay-only";
   21|    204|    case ConnectionType::ADDR_FETCH:
  ------------------
  |  Branch (21:5): [True: 204, False: 2.87k]
  ------------------
   22|    204|        return "addr-fetch";
   23|  3.07k|    } // no default case, so the compiler can warn about missing cases
   24|       |
   25|      0|    assert(false);
   26|      0|}
_Z21TransportTypeAsString21TransportProtocolType:
   29|  3.07k|{
   30|  3.07k|    switch (transport_type) {
  ------------------
  |  Branch (30:13): [True: 0, False: 3.07k]
  ------------------
   31|      0|    case TransportProtocolType::DETECTING:
  ------------------
  |  Branch (31:5): [True: 0, False: 3.07k]
  ------------------
   32|      0|        return "detecting";
   33|  3.07k|    case TransportProtocolType::V1:
  ------------------
  |  Branch (33:5): [True: 3.07k, False: 0]
  ------------------
   34|  3.07k|        return "v1";
   35|      0|    case TransportProtocolType::V2:
  ------------------
  |  Branch (35:5): [True: 0, False: 3.07k]
  ------------------
   36|      0|        return "v2";
   37|  3.07k|    } // no default case, so the compiler can warn about missing cases
   38|       |
   39|      0|    assert(false);
   40|      0|}

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

_ZN18CClientUIInterface18NotifyAlertChangedEv:
   56|      1|void CClientUIInterface::NotifyAlertChanged() { return g_ui_signals.NotifyAlertChanged(); }
_ZN18CClientUIInterface15NotifyHeaderTipE20SynchronizationStatellb:
   59|      1|void CClientUIInterface::NotifyHeaderTip(SynchronizationState s, int64_t height, int64_t timestamp, bool presync) { return g_ui_signals.NotifyHeaderTip(s, height, timestamp, presync); }

_ZN4node19KernelNotifications9headerTipE20SynchronizationStatellb:
   71|      1|{
   72|      1|    uiInterface.NotifyHeaderTip(state, height, timestamp, presync);
   73|      1|}

_ZN11TimeOffsets3AddENSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEE:
   23|  3.19k|{
   24|  3.19k|    LOCK(m_mutex);
  ------------------
  |  |  257|  3.19k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.19k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.19k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.19k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   25|       |
   26|  3.19k|    if (m_offsets.size() >= MAX_SIZE) {
  ------------------
  |  Branch (26:9): [True: 3.14k, False: 50]
  ------------------
   27|  3.14k|        m_offsets.pop_front();
   28|  3.14k|    }
   29|  3.19k|    m_offsets.push_back(offset);
   30|  3.19k|    LogDebug(BCLog::NET, "Added time offset %+ds, total samples %d\n",
  ------------------
  |  |  280|  3.19k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  3.19k|    do {                                                  \
  |  |  |  |  274|  3.19k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 3.19k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  3.19k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   31|  3.19k|             Ticks<std::chrono::seconds>(offset), m_offsets.size());
   32|  3.19k|}
_ZNK11TimeOffsets6MedianEv:
   35|  3.19k|{
   36|  3.19k|    LOCK(m_mutex);
  ------------------
  |  |  257|  3.19k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.19k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.19k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.19k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   37|       |
   38|       |    // Only calculate the median if we have 5 or more offsets
   39|  3.19k|    if (m_offsets.size() < 5) return 0s;
  ------------------
  |  Branch (39:9): [True: 4, False: 3.18k]
  ------------------
   40|       |
   41|  3.18k|    auto sorted_copy = m_offsets;
   42|  3.18k|    std::sort(sorted_copy.begin(), sorted_copy.end());
   43|  3.18k|    return sorted_copy[sorted_copy.size() / 2];  // approximate median is good enough, keep it simple
   44|  3.19k|}
_ZNK11TimeOffsets15WarnIfOutOfSyncEv:
   47|  3.19k|{
   48|       |    // when median == std::numeric_limits<int64_t>::min(), calling std::chrono::abs is UB
   49|  3.19k|    auto median{std::max(Median(), std::chrono::seconds(std::numeric_limits<int64_t>::min() + 1))};
   50|  3.19k|    if (std::chrono::abs(median) <= WARN_THRESHOLD) {
  ------------------
  |  Branch (50:9): [True: 4, False: 3.18k]
  ------------------
   51|      4|        m_warnings.Unset(node::Warning::CLOCK_OUT_OF_SYNC);
   52|      4|        return false;
   53|      4|    }
   54|       |
   55|  3.18k|    bilingual_str msg{strprintf(_(
  ------------------
  |  | 1172|  3.18k|#define strprintf tfm::format
  ------------------
   56|  3.18k|        "Your computer's date and time appear to be more than %d minutes out of sync with the network, "
   57|  3.18k|        "this may lead to consensus failure. After you've confirmed your computer's clock, this message "
   58|  3.18k|        "should no longer appear when you restart your node. Without a restart, it should stop showing "
   59|  3.18k|        "automatically after you've connected to a sufficient number of new outbound peers, which may "
   60|  3.18k|        "take some time. You can inspect the `timeoffset` field of the `getpeerinfo` and `getnetworkinfo` "
   61|  3.18k|        "RPC methods to get more info."
   62|  3.18k|    ), Ticks<std::chrono::minutes>(WARN_THRESHOLD))};
   63|  3.18k|    LogWarning("%s\n", msg.original);
  ------------------
  |  |  262|  3.18k|#define LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Warning, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|  3.18k|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
   64|  3.18k|    m_warnings.Set(node::Warning::CLOCK_OUT_OF_SYNC, msg);
   65|  3.18k|    return true;
   66|  3.19k|}

_ZN4node17TxDownloadManagerD2Ev:
   20|      2|TxDownloadManager::~TxDownloadManager() = default;
_ZN4node17TxDownloadManager13ConnectedPeerElRKNS_24TxDownloadConnectionInfoE:
   35|  7.59k|{
   36|  7.59k|    m_impl->ConnectedPeer(nodeid, info);
   37|  7.59k|}
_ZN4node17TxDownloadManager16DisconnectedPeerEl:
   39|  8.47k|{
   40|  8.47k|    m_impl->DisconnectedPeer(nodeid);
   41|  8.47k|}
_ZN4node17TxDownloadManager17AddTxAnnouncementElRK7GenTxidNSt3__16chrono8durationIxNS4_5ratioILl1ELl1000000EEEEE:
   43|   906k|{
   44|   906k|    return m_impl->AddTxAnnouncement(peer, gtxid, now);
   45|   906k|}
_ZN4node17TxDownloadManager17GetRequestsToSendElNSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEE:
   47|   442k|{
   48|   442k|    return m_impl->GetRequestsToSend(nodeid, current_time);
   49|   442k|}
_ZN4node17TxDownloadManager16ReceivedNotFoundElRKNSt3__16vectorI7uint256NS1_9allocatorIS3_EEEE:
   51|     72|{
   52|     72|    m_impl->ReceivedNotFound(nodeid, txhashes);
   53|     72|}
_ZN4node17TxDownloadManager17MempoolRejectedTxERKNSt3__110shared_ptrIK12CTransactionEERK17TxValidationStatelb:
   59|  1.36k|{
   60|  1.36k|    return m_impl->MempoolRejectedTx(ptx, state, nodeid, first_time_failure);
   61|  1.36k|}
_ZN4node17TxDownloadManager10ReceivedTxElRKNSt3__110shared_ptrIK12CTransactionEE:
   67|  1.37k|{
   68|  1.37k|    return m_impl->ReceivedTx(nodeid, ptx);
   69|  1.37k|}
_ZNK4node17TxDownloadManager12HaveMoreWorkEl:
   71|  22.2k|{
   72|  22.2k|    return m_impl->HaveMoreWork(nodeid);
   73|  22.2k|}
_ZN4node17TxDownloadManager17GetTxToReconsiderEl:
   75|   454k|{
   76|   454k|    return m_impl->GetTxToReconsider(nodeid);
   77|   454k|}
_ZNK4node17TxDownloadManager12CheckIsEmptyEv:
   79|  8.47k|{
   80|  8.47k|    m_impl->CheckIsEmpty();
   81|  8.47k|}
_ZNK4node17TxDownloadManager12CheckIsEmptyEl:
   83|  8.47k|{
   84|  8.47k|    m_impl->CheckIsEmpty(nodeid);
   85|  8.47k|}
_ZN4node21TxDownloadManagerImpl13AlreadyHaveTxERK7GenTxidb:
  126|  1.75M|{
  127|  1.75M|    const uint256& hash = gtxid.GetHash();
  128|       |
  129|  1.75M|    if (gtxid.IsWtxid()) {
  ------------------
  |  Branch (129:9): [True: 1.37k, False: 1.75M]
  ------------------
  130|       |        // Normal query by wtxid.
  131|  1.37k|        if (m_orphanage.HaveTx(Wtxid::FromUint256(hash))) return true;
  ------------------
  |  Branch (131:13): [True: 0, False: 1.37k]
  ------------------
  132|  1.75M|    } else {
  133|       |        // Never query by txid: it is possible that the transaction in the orphanage has the same
  134|       |        // txid but a different witness, which would give us a false positive result. If we decided
  135|       |        // not to request the transaction based on this result, an attacker could prevent us from
  136|       |        // downloading a transaction by intentionally creating a malleated version of it.  While
  137|       |        // only one (or none!) of these transactions can ultimately be confirmed, we have no way of
  138|       |        // discerning which one that is, so the orphanage can store multiple transactions with the
  139|       |        // same txid.
  140|       |        //
  141|       |        // While we won't query by txid, we can try to "guess" what the wtxid is based on the txid.
  142|       |        // A non-segwit transaction's txid == wtxid. Query this txid "casted" to a wtxid. This will
  143|       |        // help us find non-segwit transactions, saving bandwidth, and should have no false positives.
  144|  1.75M|        if (m_orphanage.HaveTx(Wtxid::FromUint256(hash))) return true;
  ------------------
  |  Branch (144:13): [True: 0, False: 1.75M]
  ------------------
  145|  1.75M|    }
  146|       |
  147|  1.75M|    if (include_reconsiderable && RecentRejectsReconsiderableFilter().contains(hash)) return true;
  ------------------
  |  Branch (147:9): [True: 906k, False: 845k]
  |  Branch (147:35): [True: 0, False: 906k]
  ------------------
  148|       |
  149|  1.75M|    if (RecentConfirmedTransactionsFilter().contains(hash)) return true;
  ------------------
  |  Branch (149:9): [True: 0, False: 1.75M]
  ------------------
  150|       |
  151|  1.75M|    return RecentRejectsFilter().contains(hash) || m_opts.m_mempool.exists(gtxid);
  ------------------
  |  Branch (151:12): [True: 9, False: 1.75M]
  |  Branch (151:52): [True: 0, False: 1.75M]
  ------------------
  152|  1.75M|}
_ZN4node21TxDownloadManagerImpl13ConnectedPeerElRKNS_24TxDownloadConnectionInfoE:
  155|  7.59k|{
  156|       |    // If already connected (shouldn't happen in practice), exit early.
  157|  7.59k|    if (m_peer_info.contains(nodeid)) return;
  ------------------
  |  Branch (157:9): [True: 0, False: 7.59k]
  ------------------
  158|       |
  159|  7.59k|    m_peer_info.try_emplace(nodeid, info);
  160|  7.59k|    if (info.m_wtxid_relay) m_num_wtxid_peers += 1;
  ------------------
  |  Branch (160:9): [True: 0, False: 7.59k]
  ------------------
  161|  7.59k|}
_ZN4node21TxDownloadManagerImpl16DisconnectedPeerEl:
  164|  8.47k|{
  165|  8.47k|    m_orphanage.EraseForPeer(nodeid);
  166|  8.47k|    m_txrequest.DisconnectedPeer(nodeid);
  167|       |
  168|  8.47k|    if (auto it = m_peer_info.find(nodeid); it != m_peer_info.end()) {
  ------------------
  |  Branch (168:45): [True: 7.59k, False: 880]
  ------------------
  169|  7.59k|        if (it->second.m_connection_info.m_wtxid_relay) m_num_wtxid_peers -= 1;
  ------------------
  |  Branch (169:13): [True: 0, False: 7.59k]
  ------------------
  170|  7.59k|        m_peer_info.erase(it);
  171|  7.59k|    }
  172|       |
  173|  8.47k|}
_ZN4node21TxDownloadManagerImpl17AddTxAnnouncementElRK7GenTxidNSt3__16chrono8durationIxNS4_5ratioILl1ELl1000000EEEEE:
  176|   906k|{
  177|       |    // If this is an orphan we are trying to resolve, consider this peer as a orphan resolution candidate instead.
  178|       |    // - is wtxid matching something in orphanage
  179|       |    // - exists in orphanage
  180|       |    // - peer can be an orphan resolution candidate
  181|   906k|    if (gtxid.IsWtxid()) {
  ------------------
  |  Branch (181:9): [True: 0, False: 906k]
  ------------------
  182|      0|        const auto wtxid{Wtxid::FromUint256(gtxid.GetHash())};
  183|      0|        if (auto orphan_tx{m_orphanage.GetTx(wtxid)}) {
  ------------------
  |  Branch (183:18): [True: 0, False: 0]
  ------------------
  184|      0|            auto unique_parents{GetUniqueParents(*orphan_tx)};
  185|      0|            std::erase_if(unique_parents, [&](const auto& txid){
  186|      0|                return AlreadyHaveTx(GenTxid::Txid(txid), /*include_reconsiderable=*/false);
  187|      0|            });
  188|       |
  189|       |            // The missing parents may have all been rejected or accepted since the orphan was added to the orphanage.
  190|       |            // Do not delete from the orphanage, as it may be queued for processing.
  191|      0|            if (unique_parents.empty()) {
  ------------------
  |  Branch (191:17): [True: 0, False: 0]
  ------------------
  192|      0|                return true;
  193|      0|            }
  194|       |
  195|      0|            if (MaybeAddOrphanResolutionCandidate(unique_parents, wtxid, peer, now)) {
  ------------------
  |  Branch (195:17): [True: 0, False: 0]
  ------------------
  196|      0|                m_orphanage.AddAnnouncer(orphan_tx->GetWitnessHash(), peer);
  197|      0|            }
  198|       |
  199|       |            // Return even if the peer isn't an orphan resolution candidate. This would be caught by AlreadyHaveTx.
  200|      0|            return true;
  201|      0|        }
  202|      0|    }
  203|       |
  204|       |    // If this is an inv received from a peer and we already have it, we can drop it.
  205|   906k|    if (AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true)) return true;
  ------------------
  |  Branch (205:9): [True: 0, False: 906k]
  ------------------
  206|       |
  207|   906k|    auto it = m_peer_info.find(peer);
  208|   906k|    if (it == m_peer_info.end()) return false;
  ------------------
  |  Branch (208:9): [True: 0, False: 906k]
  ------------------
  209|   906k|    const auto& info = it->second.m_connection_info;
  210|   906k|    if (!info.m_relay_permissions && m_txrequest.Count(peer) >= MAX_PEER_TX_ANNOUNCEMENTS) {
  ------------------
  |  Branch (210:9): [True: 149k, False: 756k]
  |  Branch (210:38): [True: 1.84k, False: 147k]
  ------------------
  211|       |        // Too many queued announcements for this peer
  212|  1.84k|        return false;
  213|  1.84k|    }
  214|       |    // Decide the TxRequestTracker parameters for this announcement:
  215|       |    // - "preferred": if fPreferredDownload is set (= outbound, or NetPermissionFlags::NoBan permission)
  216|       |    // - "reqtime": current time plus delays for:
  217|       |    //   - NONPREF_PEER_TX_DELAY for announcements from non-preferred connections
  218|       |    //   - TXID_RELAY_DELAY for txid announcements while wtxid peers are available
  219|       |    //   - OVERLOADED_PEER_TX_DELAY for announcements from peers which have at least
  220|       |    //     MAX_PEER_TX_REQUEST_IN_FLIGHT requests in flight (and don't have NetPermissionFlags::Relay).
  221|   904k|    auto delay{0us};
  222|   904k|    if (!info.m_preferred) delay += NONPREF_PEER_TX_DELAY;
  ------------------
  |  Branch (222:9): [True: 46.4k, False: 857k]
  ------------------
  223|   904k|    if (!gtxid.IsWtxid() && m_num_wtxid_peers > 0) delay += TXID_RELAY_DELAY;
  ------------------
  |  Branch (223:9): [True: 904k, False: 0]
  |  Branch (223:29): [True: 0, False: 904k]
  ------------------
  224|   904k|    const bool overloaded = !info.m_relay_permissions && m_txrequest.CountInFlight(peer) >= MAX_PEER_TX_REQUEST_IN_FLIGHT;
  ------------------
  |  Branch (224:29): [True: 147k, False: 756k]
  |  Branch (224:58): [True: 0, False: 147k]
  ------------------
  225|   904k|    if (overloaded) delay += OVERLOADED_PEER_TX_DELAY;
  ------------------
  |  Branch (225:9): [True: 0, False: 904k]
  ------------------
  226|       |
  227|   904k|    m_txrequest.ReceivedInv(peer, gtxid, info.m_preferred, now + delay);
  228|       |
  229|   904k|    return false;
  230|   906k|}
_ZN4node21TxDownloadManagerImpl33MaybeAddOrphanResolutionCandidateERKNSt3__16vectorI22transaction_identifierILb0EENS1_9allocatorIS4_EEEERKS3_ILb1EElNS1_6chrono8durationIxNS1_5ratioILl1ELl1000000EEEEE:
  233|    552|{
  234|    552|    auto it_peer = m_peer_info.find(nodeid);
  235|    552|    if (it_peer == m_peer_info.end()) return false;
  ------------------
  |  Branch (235:9): [True: 0, False: 552]
  ------------------
  236|    552|    if (m_orphanage.HaveTxFromPeer(wtxid, nodeid)) return false;
  ------------------
  |  Branch (236:9): [True: 0, False: 552]
  ------------------
  237|       |
  238|    552|    const auto& peer_entry = m_peer_info.at(nodeid);
  239|    552|    const auto& info = peer_entry.m_connection_info;
  240|       |
  241|       |    // TODO: add delays and limits based on the amount of orphan resolution we are already doing
  242|       |    // with this peer, how much they are using the orphanage, etc.
  243|    552|    if (!info.m_relay_permissions) {
  ------------------
  |  Branch (243:9): [True: 446, False: 106]
  ------------------
  244|       |        // This mirrors the delaying and dropping behavior in AddTxAnnouncement in order to preserve
  245|       |        // existing behavior: drop if we are tracking too many invs for this peer already. Each
  246|       |        // orphan resolution involves at least 1 transaction request which may or may not be
  247|       |        // currently tracked in m_txrequest, so we include that in the count.
  248|    446|        if (m_txrequest.Count(nodeid) + unique_parents.size() > MAX_PEER_TX_ANNOUNCEMENTS) return false;
  ------------------
  |  Branch (248:13): [True: 0, False: 446]
  ------------------
  249|    446|    }
  250|       |
  251|    552|    std::chrono::seconds delay{0s};
  252|    552|    if (!info.m_preferred) delay += NONPREF_PEER_TX_DELAY;
  ------------------
  |  Branch (252:9): [True: 339, False: 213]
  ------------------
  253|       |    // The orphan wtxid is used, but resolution entails requesting the parents by txid. Sometimes
  254|       |    // parent and child are announced and thus requested around the same time, and we happen to
  255|       |    // receive child sooner. Waiting a few seconds may allow us to cancel the orphan resolution
  256|       |    // request if the parent arrives in that time.
  257|    552|    if (m_num_wtxid_peers > 0) delay += TXID_RELAY_DELAY;
  ------------------
  |  Branch (257:9): [True: 0, False: 552]
  ------------------
  258|    552|    const bool overloaded = !info.m_relay_permissions && m_txrequest.CountInFlight(nodeid) >= MAX_PEER_TX_REQUEST_IN_FLIGHT;
  ------------------
  |  Branch (258:29): [True: 446, False: 106]
  |  Branch (258:58): [True: 0, False: 446]
  ------------------
  259|    552|    if (overloaded) delay += OVERLOADED_PEER_TX_DELAY;
  ------------------
  |  Branch (259:9): [True: 0, False: 552]
  ------------------
  260|       |
  261|       |    // Treat finding orphan resolution candidate as equivalent to the peer announcing all missing parents.
  262|       |    // In the future, orphan resolution may include more explicit steps
  263|  2.83k|    for (const auto& parent_txid : unique_parents) {
  ------------------
  |  Branch (263:34): [True: 2.83k, False: 552]
  ------------------
  264|  2.83k|        m_txrequest.ReceivedInv(nodeid, GenTxid::Txid(parent_txid), info.m_preferred, now + delay);
  265|  2.83k|    }
  266|    552|    LogDebug(BCLog::TXPACKAGES, "added peer=%d as a candidate for resolving orphan %s\n", nodeid, wtxid.ToString());
  ------------------
  |  |  280|    552|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    552|    do {                                                  \
  |  |  |  |  274|    552|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 552]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    552|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|    552|    return true;
  268|    552|}
_ZN4node21TxDownloadManagerImpl17GetRequestsToSendElNSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEE:
  271|   442k|{
  272|   442k|    std::vector<GenTxid> requests;
  273|   442k|    std::vector<std::pair<NodeId, GenTxid>> expired;
  274|   442k|    auto requestable = m_txrequest.GetRequestable(nodeid, current_time, &expired);
  275|   442k|    for (const auto& entry : expired) {
  ------------------
  |  Branch (275:28): [True: 0, False: 442k]
  ------------------
  276|      0|        LogDebug(BCLog::NET, "timeout of inflight %s %s from peer=%d\n", entry.second.IsWtxid() ? "wtx" : "tx",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|      0|            entry.second.GetHash().ToString(), entry.first);
  278|      0|    }
  279|   841k|    for (const GenTxid& gtxid : requestable) {
  ------------------
  |  Branch (279:31): [True: 841k, False: 442k]
  ------------------
  280|   841k|        if (!AlreadyHaveTx(gtxid, /*include_reconsiderable=*/false)) {
  ------------------
  |  Branch (280:13): [True: 841k, False: 0]
  ------------------
  281|   841k|            LogDebug(BCLog::NET, "Requesting %s %s peer=%d\n", gtxid.IsWtxid() ? "wtx" : "tx",
  ------------------
  |  |  280|   841k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|   841k|    do {                                                  \
  |  |  |  |  274|   841k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 841k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (255:116): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|   841k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|   841k|                gtxid.GetHash().ToString(), nodeid);
  283|   841k|            requests.emplace_back(gtxid);
  284|   841k|            m_txrequest.RequestedTx(nodeid, gtxid.GetHash(), current_time + GETDATA_TX_INTERVAL);
  285|   841k|        } else {
  286|       |            // We have already seen this transaction, no need to download. This is just a belt-and-suspenders, as
  287|       |            // this should already be called whenever a transaction becomes AlreadyHaveTx().
  288|      0|            m_txrequest.ForgetTxHash(gtxid.GetHash());
  289|      0|        }
  290|   841k|    }
  291|   442k|    return requests;
  292|   442k|}
_ZN4node21TxDownloadManagerImpl16ReceivedNotFoundElRKNSt3__16vectorI7uint256NS1_9allocatorIS3_EEEE:
  295|     72|{
  296|    736|    for (const auto& txhash : txhashes) {
  ------------------
  |  Branch (296:29): [True: 736, False: 72]
  ------------------
  297|       |        // If we receive a NOTFOUND message for a tx we requested, mark the announcement for it as
  298|       |        // completed in TxRequestTracker.
  299|    736|        m_txrequest.ReceivedResponse(nodeid, txhash);
  300|    736|    }
  301|     72|}
_ZN4node21TxDownloadManagerImpl16GetUniqueParentsERK12CTransaction:
  342|    552|{
  343|    552|    std::vector<Txid> unique_parents;
  344|    552|    unique_parents.reserve(tx.vin.size());
  345|  3.08k|    for (const CTxIn& txin : tx.vin) {
  ------------------
  |  Branch (345:28): [True: 3.08k, False: 552]
  ------------------
  346|       |        // We start with all parents, and then remove duplicates below.
  347|  3.08k|        unique_parents.push_back(txin.prevout.hash);
  348|  3.08k|    }
  349|       |
  350|    552|    std::sort(unique_parents.begin(), unique_parents.end());
  351|    552|    unique_parents.erase(std::unique(unique_parents.begin(), unique_parents.end()), unique_parents.end());
  352|       |
  353|    552|    return unique_parents;
  354|    552|}
_ZN4node21TxDownloadManagerImpl17MempoolRejectedTxERKNSt3__110shared_ptrIK12CTransactionEERK17TxValidationStatelb:
  357|  1.36k|{
  358|  1.36k|    const CTransaction& tx{*ptx};
  359|       |    // Results returned to caller
  360|       |    // Whether we should call AddToCompactExtraTransactions at the end
  361|  1.36k|    bool add_extra_compact_tx{first_time_failure};
  362|       |    // Hashes to pass to AddKnownTx later
  363|  1.36k|    std::vector<Txid> unique_parents;
  364|       |    // Populated if failure is reconsiderable and eligible package is found.
  365|  1.36k|    std::optional<node::PackageToValidate> package_to_validate;
  366|       |
  367|  1.36k|    if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
  ------------------
  |  Branch (367:9): [True: 552, False: 809]
  ------------------
  368|       |        // Only process a new orphan if this is a first time failure, as otherwise it must be either
  369|       |        // already in orphanage or from 1p1c processing.
  370|    552|        if (first_time_failure && !RecentRejectsFilter().contains(ptx->GetWitnessHash().ToUint256())) {
  ------------------
  |  Branch (370:13): [True: 552, False: 0]
  |  Branch (370:35): [True: 552, False: 0]
  ------------------
  371|    552|            bool fRejectedParents = false; // It may be the case that the orphans parents have all been rejected
  372|       |
  373|       |            // Deduplicate parent txids, so that we don't have to loop over
  374|       |            // the same parent txid more than once down below.
  375|    552|            unique_parents = GetUniqueParents(tx);
  376|       |
  377|       |            // Distinguish between parents in m_lazy_recent_rejects and m_lazy_recent_rejects_reconsiderable.
  378|       |            // We can tolerate having up to 1 parent in m_lazy_recent_rejects_reconsiderable since we
  379|       |            // submit 1p1c packages. However, fail immediately if any are in m_lazy_recent_rejects.
  380|    552|            std::optional<uint256> rejected_parent_reconsiderable;
  381|  2.83k|            for (const uint256& parent_txid : unique_parents) {
  ------------------
  |  Branch (381:45): [True: 2.83k, False: 552]
  ------------------
  382|  2.83k|                if (RecentRejectsFilter().contains(parent_txid)) {
  ------------------
  |  Branch (382:21): [True: 0, False: 2.83k]
  ------------------
  383|      0|                    fRejectedParents = true;
  384|      0|                    break;
  385|  2.83k|                } else if (RecentRejectsReconsiderableFilter().contains(parent_txid) &&
  ------------------
  |  Branch (385:28): [True: 0, False: 2.83k]
  |  Branch (385:28): [True: 0, False: 2.83k]
  ------------------
  386|  2.83k|                           !m_opts.m_mempool.exists(GenTxid::Txid(parent_txid))) {
  ------------------
  |  Branch (386:28): [True: 0, False: 0]
  ------------------
  387|       |                    // More than 1 parent in m_lazy_recent_rejects_reconsiderable: 1p1c will not be
  388|       |                    // sufficient to accept this package, so just give up here.
  389|      0|                    if (rejected_parent_reconsiderable.has_value()) {
  ------------------
  |  Branch (389:25): [True: 0, False: 0]
  ------------------
  390|      0|                        fRejectedParents = true;
  391|      0|                        break;
  392|      0|                    }
  393|      0|                    rejected_parent_reconsiderable = parent_txid;
  394|      0|                }
  395|  2.83k|            }
  396|    552|            if (!fRejectedParents) {
  ------------------
  |  Branch (396:17): [True: 552, False: 0]
  ------------------
  397|       |                // Filter parents that we already have.
  398|       |                // Exclude m_lazy_recent_rejects_reconsiderable: the missing parent may have been
  399|       |                // previously rejected for being too low feerate. This orphan might CPFP it.
  400|    552|                std::erase_if(unique_parents, [&](const auto& txid){
  401|    552|                    return AlreadyHaveTx(GenTxid::Txid(txid), /*include_reconsiderable=*/false);
  402|    552|                });
  403|    552|                const auto now{GetTime<std::chrono::microseconds>()};
  404|    552|                const auto& wtxid = ptx->GetWitnessHash();
  405|       |                // Potentially flip add_extra_compact_tx to false if tx is already in orphanage, which
  406|       |                // means it was already added to vExtraTxnForCompact.
  407|    552|                add_extra_compact_tx &= !m_orphanage.HaveTx(wtxid);
  408|       |
  409|       |                // If there is no candidate for orphan resolution, AddTx will not be called. This means
  410|       |                // that if a peer is overloading us with invs and orphans, they will eventually not be
  411|       |                // able to add any more transactions to the orphanage.
  412|       |                //
  413|       |                // Search by txid and, if the tx has a witness, wtxid
  414|    552|                std::vector<NodeId> orphan_resolution_candidates{nodeid};
  415|    552|                m_txrequest.GetCandidatePeers(ptx->GetHash().ToUint256(), orphan_resolution_candidates);
  416|    552|                if (ptx->HasWitness()) m_txrequest.GetCandidatePeers(ptx->GetWitnessHash().ToUint256(), orphan_resolution_candidates);
  ------------------
  |  Branch (416:21): [True: 135, False: 417]
  ------------------
  417|       |
  418|    552|                for (const auto& nodeid : orphan_resolution_candidates) {
  ------------------
  |  Branch (418:41): [True: 552, False: 552]
  ------------------
  419|    552|                    if (MaybeAddOrphanResolutionCandidate(unique_parents, ptx->GetWitnessHash(), nodeid, now)) {
  ------------------
  |  Branch (419:25): [True: 552, False: 0]
  ------------------
  420|    552|                        m_orphanage.AddTx(ptx, nodeid);
  421|    552|                    }
  422|    552|                }
  423|       |
  424|       |                // Once added to the orphan pool, a tx is considered AlreadyHave, and we shouldn't request it anymore.
  425|    552|                m_txrequest.ForgetTxHash(tx.GetHash());
  426|    552|                m_txrequest.ForgetTxHash(tx.GetWitnessHash());
  427|       |
  428|       |                // DoS prevention: do not allow m_orphanage to grow unbounded (see CVE-2012-3789)
  429|       |                // Note that, if the orphanage reaches capacity, it's possible that we immediately evict
  430|       |                // the transaction we just added.
  431|    552|                m_orphanage.LimitOrphans(m_opts.m_max_orphan_txs, m_opts.m_rng);
  432|    552|            } else {
  433|      0|                unique_parents.clear();
  434|      0|                LogDebug(BCLog::MEMPOOL, "not keeping orphan with rejected parents %s (wtxid=%s)\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|      0|                         tx.GetHash().ToString(),
  436|      0|                         tx.GetWitnessHash().ToString());
  437|       |                // We will continue to reject this tx since it has rejected
  438|       |                // parents so avoid re-requesting it from other peers.
  439|       |                // Here we add both the txid and the wtxid, as we know that
  440|       |                // regardless of what witness is provided, we will not accept
  441|       |                // this, so we don't need to allow for redownload of this txid
  442|       |                // from any of our non-wtxidrelay peers.
  443|      0|                RecentRejectsFilter().insert(tx.GetHash().ToUint256());
  444|      0|                RecentRejectsFilter().insert(tx.GetWitnessHash().ToUint256());
  445|      0|                m_txrequest.ForgetTxHash(tx.GetHash());
  446|      0|                m_txrequest.ForgetTxHash(tx.GetWitnessHash());
  447|      0|            }
  448|    552|        }
  449|    809|    } else if (state.GetResult() == TxValidationResult::TX_WITNESS_STRIPPED) {
  ------------------
  |  Branch (449:16): [True: 0, False: 809]
  ------------------
  450|      0|        add_extra_compact_tx = false;
  451|    809|    } else {
  452|       |        // We can add the wtxid of this transaction to our reject filter.
  453|       |        // Do not add txids of witness transactions or witness-stripped
  454|       |        // transactions to the filter, as they can have been malleated;
  455|       |        // adding such txids to the reject filter would potentially
  456|       |        // interfere with relay of valid transactions from peers that
  457|       |        // do not support wtxid-based relay. See
  458|       |        // https://github.com/bitcoin/bitcoin/issues/8279 for details.
  459|       |        // We can remove this restriction (and always add wtxids to
  460|       |        // the filter even for witness stripped transactions) once
  461|       |        // wtxid-based relay is broadly deployed.
  462|       |        // See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
  463|       |        // for concerns around weakening security of unupgraded nodes
  464|       |        // if we start doing this too early.
  465|    809|        if (state.GetResult() == TxValidationResult::TX_RECONSIDERABLE) {
  ------------------
  |  Branch (465:13): [True: 0, False: 809]
  ------------------
  466|       |            // If the result is TX_RECONSIDERABLE, add it to m_lazy_recent_rejects_reconsiderable
  467|       |            // because we should not download or submit this transaction by itself again, but may
  468|       |            // submit it as part of a package later.
  469|      0|            RecentRejectsReconsiderableFilter().insert(ptx->GetWitnessHash().ToUint256());
  470|       |
  471|      0|            if (first_time_failure) {
  ------------------
  |  Branch (471:17): [True: 0, False: 0]
  ------------------
  472|       |                // When a transaction fails for TX_RECONSIDERABLE, look for a matching child in the
  473|       |                // orphanage, as it is possible that they succeed as a package.
  474|      0|                LogDebug(BCLog::TXPACKAGES, "tx %s (wtxid=%s) failed but reconsiderable, looking for child in orphanage\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|      0|                         ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString());
  476|      0|                package_to_validate = Find1P1CPackage(ptx, nodeid);
  477|      0|            }
  478|    809|        } else {
  479|    809|            RecentRejectsFilter().insert(ptx->GetWitnessHash().ToUint256());
  480|    809|        }
  481|    809|        m_txrequest.ForgetTxHash(ptx->GetWitnessHash());
  482|       |        // If the transaction failed for TX_INPUTS_NOT_STANDARD,
  483|       |        // then we know that the witness was irrelevant to the policy
  484|       |        // failure, since this check depends only on the txid
  485|       |        // (the scriptPubKey being spent is covered by the txid).
  486|       |        // Add the txid to the reject filter to prevent repeated
  487|       |        // processing of this transaction in the event that child
  488|       |        // transactions are later received (resulting in
  489|       |        // parent-fetching by txid via the orphan-handling logic).
  490|       |        // We only add the txid if it differs from the wtxid, to avoid wasting entries in the
  491|       |        // rolling bloom filter.
  492|    809|        if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && ptx->HasWitness()) {
  ------------------
  |  Branch (492:13): [True: 23, False: 786]
  |  Branch (492:80): [True: 0, False: 23]
  ------------------
  493|      0|            RecentRejectsFilter().insert(ptx->GetHash().ToUint256());
  494|      0|            m_txrequest.ForgetTxHash(ptx->GetHash());
  495|      0|        }
  496|    809|    }
  497|       |
  498|       |    // If the tx failed in ProcessOrphanTx, it should be removed from the orphanage unless the
  499|       |    // tx was still missing inputs. If the tx was not in the orphanage, EraseTx does nothing and returns 0.
  500|  1.36k|    if (state.GetResult() != TxValidationResult::TX_MISSING_INPUTS && m_orphanage.EraseTx(ptx->GetWitnessHash()) > 0) {
  ------------------
  |  Branch (500:9): [True: 809, False: 552]
  |  Branch (500:71): [True: 0, False: 809]
  ------------------
  501|      0|        LogDebug(BCLog::TXPACKAGES, "   removed orphan tx %s (wtxid=%s)\n", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  502|      0|    }
  503|       |
  504|  1.36k|    return RejectedTxTodo{
  505|  1.36k|        .m_should_add_extra_compact_tx = add_extra_compact_tx,
  506|  1.36k|        .m_unique_parents = std::move(unique_parents),
  507|  1.36k|        .m_package_to_validate = std::move(package_to_validate)
  508|  1.36k|    };
  509|  1.36k|}
_ZN4node21TxDownloadManagerImpl10ReceivedTxElRKNSt3__110shared_ptrIK12CTransactionEE:
  517|  1.37k|{
  518|  1.37k|    const uint256& txid = ptx->GetHash();
  519|  1.37k|    const uint256& wtxid = ptx->GetWitnessHash();
  520|       |
  521|       |    // Mark that we have received a response
  522|  1.37k|    m_txrequest.ReceivedResponse(nodeid, txid);
  523|  1.37k|    if (ptx->HasWitness()) m_txrequest.ReceivedResponse(nodeid, wtxid);
  ------------------
  |  Branch (523:9): [True: 301, False: 1.06k]
  ------------------
  524|       |
  525|       |    // First check if we should drop this tx.
  526|       |    // We do the AlreadyHaveTx() check using wtxid, rather than txid - in the
  527|       |    // absence of witness malleation, this is strictly better, because the
  528|       |    // recent rejects filter may contain the wtxid but rarely contains
  529|       |    // the txid of a segwit transaction that has been rejected.
  530|       |    // In the presence of witness malleation, it's possible that by only
  531|       |    // doing the check with wtxid, we could overlook a transaction which
  532|       |    // was confirmed with a different witness, or exists in our mempool
  533|       |    // with a different witness, but this has limited downside:
  534|       |    // mempool validation does its own lookup of whether we have the txid
  535|       |    // already; and an adversary can already relay us old transactions
  536|       |    // (older than our recency filter) if trying to DoS us, without any need
  537|       |    // for witness malleation.
  538|  1.37k|    if (AlreadyHaveTx(GenTxid::Wtxid(wtxid), /*include_reconsiderable=*/false)) {
  ------------------
  |  Branch (538:9): [True: 9, False: 1.36k]
  ------------------
  539|       |        // If a tx is detected by m_lazy_recent_rejects it is ignored. Because we haven't
  540|       |        // submitted the tx to our mempool, we won't have computed a DoS
  541|       |        // score for it or determined exactly why we consider it invalid.
  542|       |        //
  543|       |        // This means we won't penalize any peer subsequently relaying a DoSy
  544|       |        // tx (even if we penalized the first peer who gave it to us) because
  545|       |        // we have to account for m_lazy_recent_rejects showing false positives. In
  546|       |        // other words, we shouldn't penalize a peer if we aren't *sure* they
  547|       |        // submitted a DoSy tx.
  548|       |        //
  549|       |        // Note that m_lazy_recent_rejects doesn't just record DoSy or invalid
  550|       |        // transactions, but any tx not accepted by the mempool, which may be
  551|       |        // due to node policy (vs. consensus). So we can't blanket penalize a
  552|       |        // peer simply for relaying a tx that our m_lazy_recent_rejects has caught,
  553|       |        // regardless of false positives.
  554|      9|        return {false, std::nullopt};
  555|  1.36k|    } else if (RecentRejectsReconsiderableFilter().contains(wtxid)) {
  ------------------
  |  Branch (555:16): [True: 0, False: 1.36k]
  ------------------
  556|       |        // When a transaction is already in m_lazy_recent_rejects_reconsiderable, we shouldn't submit
  557|       |        // it by itself again. However, look for a matching child in the orphanage, as it is
  558|       |        // possible that they succeed as a package.
  559|      0|        LogDebug(BCLog::TXPACKAGES, "found tx %s (wtxid=%s) in reconsiderable rejects, looking for child in orphanage\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  560|      0|                 txid.ToString(), wtxid.ToString());
  561|      0|        return {false, Find1P1CPackage(ptx, nodeid)};
  562|      0|    }
  563|       |
  564|       |
  565|  1.36k|    return {true, std::nullopt};
  566|  1.37k|}
_ZN4node21TxDownloadManagerImpl12HaveMoreWorkEl:
  569|  22.2k|{
  570|  22.2k|    return m_orphanage.HaveTxToReconsider(nodeid);
  571|  22.2k|}
_ZN4node21TxDownloadManagerImpl17GetTxToReconsiderEl:
  574|   454k|{
  575|   454k|    return m_orphanage.GetTxToReconsider(nodeid);
  576|   454k|}
_ZN4node21TxDownloadManagerImpl12CheckIsEmptyEl:
  579|  8.47k|{
  580|  8.47k|    assert(m_txrequest.Count(nodeid) == 0);
  581|  8.47k|    assert(m_orphanage.UsageByPeer(nodeid) == 0);
  582|  8.47k|}
_ZN4node21TxDownloadManagerImpl12CheckIsEmptyEv:
  584|  8.47k|{
  585|  8.47k|    assert(m_orphanage.TotalOrphanUsage() == 0);
  586|  8.47k|    assert(m_orphanage.Size() == 0);
  587|  8.47k|    assert(m_txrequest.Size() == 0);
  588|  8.47k|    assert(m_num_wtxid_peers == 0);
  589|  8.47k|}
txdownloadman_impl.cpp:_ZZN4node21TxDownloadManagerImpl17MempoolRejectedTxERKNSt3__110shared_ptrIK12CTransactionEERK17TxValidationStatelbENK3$_0clI22transaction_identifierILb0EEEEDaRKT_:
  400|  2.83k|                std::erase_if(unique_parents, [&](const auto& txid){
  401|  2.83k|                    return AlreadyHaveTx(GenTxid::Txid(txid), /*include_reconsiderable=*/false);
  402|  2.83k|                });

_ZN4node21TxDownloadManagerImpl19RecentRejectsFilterEv:
   66|  1.75M|    {
   67|  1.75M|        if (!m_lazy_recent_rejects) {
  ------------------
  |  Branch (67:13): [True: 1, False: 1.75M]
  ------------------
   68|      1|            m_lazy_recent_rejects = std::make_unique<CRollingBloomFilter>(120'000, 0.000'001);
   69|      1|        }
   70|       |
   71|  1.75M|        return *m_lazy_recent_rejects;
   72|  1.75M|    }
_ZN4node21TxDownloadManagerImpl33RecentRejectsReconsiderableFilterEv:
   97|   910k|    {
   98|   910k|        if (!m_lazy_recent_rejects_reconsiderable) {
  ------------------
  |  Branch (98:13): [True: 1, False: 910k]
  ------------------
   99|      1|            m_lazy_recent_rejects_reconsiderable = std::make_unique<CRollingBloomFilter>(120'000, 0.000'001);
  100|      1|        }
  101|       |
  102|   910k|        return *m_lazy_recent_rejects_reconsiderable;
  103|   910k|    }
_ZN4node21TxDownloadManagerImpl33RecentConfirmedTransactionsFilterEv:
  123|  1.75M|    {
  124|  1.75M|        if (!m_lazy_recent_confirmed_transactions) {
  ------------------
  |  Branch (124:13): [True: 1, False: 1.75M]
  ------------------
  125|      1|            m_lazy_recent_confirmed_transactions = std::make_unique<CRollingBloomFilter>(48'000, 0.000'001);
  126|      1|        }
  127|       |
  128|  1.75M|        return *m_lazy_recent_confirmed_transactions;
  129|  1.75M|    }
_ZN4node21TxDownloadManagerImpl8PeerInfoC2ERKNS_24TxDownloadConnectionInfoE:
  137|  7.59k|        PeerInfo(const TxDownloadConnectionInfo& info) : m_connection_info{info} {}

_ZN23TxReconciliationTrackerD2Ev:
  149|      2|TxReconciliationTracker::~TxReconciliationTracker() = default;
_ZN23TxReconciliationTracker15PreRegisterPeerEl:
  152|  3.77k|{
  153|  3.77k|    return m_impl->PreRegisterPeer(peer_id);
  154|  3.77k|}
_ZN23TxReconciliationTracker12RegisterPeerElbjm:
  158|     52|{
  159|     52|    return m_impl->RegisterPeer(peer_id, is_peer_inbound, peer_recon_version, remote_salt);
  160|     52|}
_ZN23TxReconciliationTracker10ForgetPeerEl:
  163|  16.0k|{
  164|  16.0k|    m_impl->ForgetPeer(peer_id);
  165|  16.0k|}
_ZN23TxReconciliationTracker4Impl15PreRegisterPeerEl:
   83|  3.77k|    {
   84|  3.77k|        AssertLockNotHeld(m_txreconciliation_mutex);
  ------------------
  |  |  147|  3.77k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
   85|  3.77k|        LOCK(m_txreconciliation_mutex);
  ------------------
  |  |  257|  3.77k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.77k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.77k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.77k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   86|       |
   87|  3.77k|        LogPrintLevel(BCLog::TXRECONCILIATION, BCLog::Level::Debug, "Pre-register peer=%d\n", peer_id);
  ------------------
  |  |  273|  3.77k|    do {                                                  \
  |  |  274|  3.77k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  ------------------
  |  |  |  Branch (274:13): [True: 0, False: 3.77k]
  |  |  ------------------
  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  |  |  276|      0|        }                                                 \
  |  |  277|  3.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   88|  3.77k|        const uint64_t local_salt{FastRandomContext().rand64()};
   89|       |
   90|       |        // We do this exactly once per peer (which are unique by NodeId, see GetNewNodeId) so it's
   91|       |        // safe to assume we don't have this record yet.
   92|  3.77k|        Assume(m_states.emplace(peer_id, local_salt).second);
  ------------------
  |  |   97|  3.77k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   93|  3.77k|        return local_salt;
   94|  3.77k|    }
_ZN23TxReconciliationTracker4Impl12RegisterPeerElbjm:
   98|     52|    {
   99|     52|        AssertLockNotHeld(m_txreconciliation_mutex);
  ------------------
  |  |  147|     52|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  100|     52|        LOCK(m_txreconciliation_mutex);
  ------------------
  |  |  257|     52|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     52|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     52|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     52|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|     52|        auto recon_state = m_states.find(peer_id);
  102|       |
  103|     52|        if (recon_state == m_states.end()) return ReconciliationRegisterResult::NOT_FOUND;
  ------------------
  |  Branch (103:13): [True: 1, False: 51]
  ------------------
  104|       |
  105|     51|        if (std::holds_alternative<TxReconciliationState>(recon_state->second)) {
  ------------------
  |  Branch (105:13): [True: 0, False: 51]
  ------------------
  106|      0|            return ReconciliationRegisterResult::ALREADY_REGISTERED;
  107|      0|        }
  108|       |
  109|     51|        uint64_t local_salt = *std::get_if<uint64_t>(&recon_state->second);
  110|       |
  111|       |        // If the peer supports the version which is lower than ours, we downgrade to the version
  112|       |        // it supports. For now, this only guarantees that nodes with future reconciliation
  113|       |        // versions have the choice of reconciling with this current version. However, they also
  114|       |        // have the choice to refuse supporting reconciliations if the common version is not
  115|       |        // satisfactory (e.g. too low).
  116|     51|        const uint32_t recon_version{std::min(peer_recon_version, m_recon_version)};
  117|       |        // v1 is the lowest version, so suggesting something below must be a protocol violation.
  118|     51|        if (recon_version < 1) return ReconciliationRegisterResult::PROTOCOL_VIOLATION;
  ------------------
  |  Branch (118:13): [True: 1, False: 50]
  ------------------
  119|       |
  120|     50|        LogPrintLevel(BCLog::TXRECONCILIATION, BCLog::Level::Debug, "Register peer=%d (inbound=%i)\n",
  ------------------
  |  |  273|     50|    do {                                                  \
  |  |  274|     50|        if (LogAcceptCategory((category), (level))) {     \
  |  |  ------------------
  |  |  |  Branch (274:13): [True: 0, False: 50]
  |  |  ------------------
  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  |  |  276|      0|        }                                                 \
  |  |  277|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  121|     50|                      peer_id, is_peer_inbound);
  122|       |
  123|     50|        const uint256 full_salt{ComputeSalt(local_salt, remote_salt)};
  124|     50|        recon_state->second = TxReconciliationState(!is_peer_inbound, full_salt.GetUint64(0), full_salt.GetUint64(1));
  125|     50|        return ReconciliationRegisterResult::SUCCESS;
  126|     51|    }
txreconciliation.cpp:_ZN12_GLOBAL__N_111ComputeSaltEmm:
   27|     50|{
   28|       |    // According to BIP-330, salts should be combined in ascending order.
   29|     50|    return (HashWriter(RECON_SALT_HASHER) << std::min(salt1, salt2) << std::max(salt1, salt2)).GetSHA256();
   30|     50|}
txreconciliation.cpp:_ZN12_GLOBAL__N_121TxReconciliationStateC2Ebmm:
   57|     50|    TxReconciliationState(bool we_initiate, uint64_t k0, uint64_t k1) : m_we_initiate(we_initiate), m_k0(k0), m_k1(k1) {}
_ZN23TxReconciliationTracker4Impl10ForgetPeerEl:
  129|  16.0k|    {
  130|  16.0k|        AssertLockNotHeld(m_txreconciliation_mutex);
  ------------------
  |  |  147|  16.0k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  131|  16.0k|        LOCK(m_txreconciliation_mutex);
  ------------------
  |  |  257|  16.0k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  16.0k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  16.0k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  16.0k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|  16.0k|        if (m_states.erase(peer_id)) {
  ------------------
  |  Branch (132:13): [True: 3.77k, False: 12.2k]
  ------------------
  133|  3.77k|            LogPrintLevel(BCLog::TXRECONCILIATION, BCLog::Level::Debug, "Forget txreconciliation state of peer=%d\n", peer_id);
  ------------------
  |  |  273|  3.77k|    do {                                                  \
  |  |  274|  3.77k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  ------------------
  |  |  |  Branch (274:13): [True: 0, False: 3.77k]
  |  |  ------------------
  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  |  |  276|      0|        }                                                 \
  |  |  277|  3.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  134|  3.77k|        }
  135|  16.0k|    }

_ZN4node8Warnings3SetENSt3__17variantIJN6kernel7WarningENS_7WarningEEEE13bilingual_str:
   30|  3.18k|{
   31|  3.18k|    const auto& [_, inserted]{WITH_LOCK(m_mutex, return m_warnings.insert({id, std::move(message)}))};
  ------------------
  |  |  301|  3.18k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
   32|  3.18k|    if (inserted) uiInterface.NotifyAlertChanged();
  ------------------
  |  Branch (32:9): [True: 1, False: 3.18k]
  ------------------
   33|  3.18k|    return inserted;
   34|  3.18k|}
_ZN4node8Warnings5UnsetENSt3__17variantIJN6kernel7WarningENS_7WarningEEEE:
   37|      4|{
   38|      4|    auto success{WITH_LOCK(m_mutex, return m_warnings.erase(id))};
  ------------------
  |  |  301|      4|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
   39|      4|    if (success) uiInterface.NotifyAlertChanged();
  ------------------
  |  Branch (39:9): [True: 0, False: 4]
  ------------------
   40|      4|    return success;
   41|      4|}

_ZNK8CFeeRate6GetFeeEj:
   24|    928|{
   25|    928|    const int64_t nSize{num_bytes};
   26|       |
   27|       |    // Be explicit that we're converting from a double to int64_t (CAmount) here.
   28|       |    // We've previously had issues with the silent double->int64_t conversion.
   29|    928|    CAmount nFee{static_cast<CAmount>(std::ceil(nSatoshisPerK * nSize / 1000.0))};
   30|       |
   31|    928|    if (nFee == 0 && nSize != 0) {
  ------------------
  |  Branch (31:9): [True: 0, False: 928]
  |  Branch (31:22): [True: 0, False: 0]
  ------------------
   32|      0|        if (nSatoshisPerK > 0) nFee = CAmount(1);
  ------------------
  |  Branch (32:13): [True: 0, False: 0]
  ------------------
   33|      0|        if (nSatoshisPerK < 0) nFee = CAmount(-1);
  ------------------
  |  Branch (33:13): [True: 0, False: 0]
  ------------------
   34|      0|    }
   35|       |
   36|    928|    return nFee;
   37|    928|}

_ZNK8CFeeRate10GetFeePerKEv:
   63|   415k|    CAmount GetFeePerK() const { return nSatoshisPerK; }
_ZN8CFeeRateC2ITkNSt3__18integralElEET_:
   42|  26.3k|    explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {
   43|  26.3k|    }
_ZN8CFeeRateC2ITkNSt3__18integralEiEET_:
   42|  1.36k|    explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {
   43|  1.36k|    }
_ZN8CFeeRateC2ITkNSt3__18integralExEET_:
   42|   408k|    explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {
   43|   408k|    }

_ZN16FeeFilterRounder5roundEl:
 1096|  7.26k|{
 1097|  7.26k|    AssertLockNotHeld(m_insecure_rand_mutex);
  ------------------
  |  |  147|  7.26k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1098|  7.26k|    std::set<double>::iterator it = m_fee_set.lower_bound(currentMinFee);
 1099|  7.26k|    if (it == m_fee_set.end() ||
  ------------------
  |  Branch (1099:9): [True: 4.94k, False: 2.32k]
  |  Branch (1099:9): [True: 4.94k, False: 2.32k]
  ------------------
 1100|  7.26k|        (it != m_fee_set.begin() &&
  ------------------
  |  Branch (1100:10): [True: 0, False: 2.32k]
  ------------------
 1101|  4.94k|         WITH_LOCK(m_insecure_rand_mutex, return insecure_rand.rand32()) % 3 != 0)) {
  ------------------
  |  |  301|      0|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  Branch (1101:10): [True: 0, False: 0]
  ------------------
 1102|  4.94k|        --it;
 1103|  4.94k|    }
 1104|  7.26k|    return static_cast<CAmount>(*it);
 1105|  7.26k|}

_Z16GetDustThresholdRK6CTxOutRK8CFeeRate:
   27|  1.06k|{
   28|       |    // "Dust" is defined in terms of dustRelayFee,
   29|       |    // which has units satoshis-per-kilobyte.
   30|       |    // If you'd pay more in fees than the value of the output
   31|       |    // to spend something, then we consider it dust.
   32|       |    // A typical spendable non-segwit txout is 34 bytes big, and will
   33|       |    // need a CTxIn of at least 148 bytes to spend:
   34|       |    // so dust is a spendable txout less than
   35|       |    // 182*dustRelayFee/1000 (in satoshis).
   36|       |    // 546 satoshis at the default rate of 3000 sat/kvB.
   37|       |    // A typical spendable segwit P2WPKH txout is 31 bytes big, and will
   38|       |    // need a CTxIn of at least 67 bytes to spend:
   39|       |    // so dust is a spendable txout less than
   40|       |    // 98*dustRelayFee/1000 (in satoshis).
   41|       |    // 294 satoshis at the default rate of 3000 sat/kvB.
   42|  1.06k|    if (txout.scriptPubKey.IsUnspendable())
  ------------------
  |  Branch (42:9): [True: 132, False: 928]
  ------------------
   43|    132|        return 0;
   44|       |
   45|    928|    size_t nSize = GetSerializeSize(txout);
   46|    928|    int witnessversion = 0;
   47|    928|    std::vector<unsigned char> witnessprogram;
   48|       |
   49|       |    // Note this computation is for spending a Segwit v0 P2WPKH output (a 33 bytes
   50|       |    // public key + an ECDSA signature). For Segwit v1 Taproot outputs the minimum
   51|       |    // satisfaction is lower (a single BIP340 signature) but this computation was
   52|       |    // kept to not further reduce the dust level.
   53|       |    // See discussion in https://github.com/bitcoin/bitcoin/pull/22779 for details.
   54|    928|    if (txout.scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
  ------------------
  |  Branch (54:9): [True: 879, False: 49]
  ------------------
   55|       |        // sum the sizes of the parts of a transaction input
   56|       |        // with 75% segwit discount applied to the script size.
   57|    879|        nSize += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);
   58|    879|    } else {
   59|     49|        nSize += (32 + 4 + 1 + 107 + 4); // the 148 mentioned above
   60|     49|    }
   61|       |
   62|    928|    return dustRelayFeeIn.GetFee(nSize);
   63|  1.06k|}
_Z6IsDustRK6CTxOutRK8CFeeRate:
   66|  1.06k|{
   67|  1.06k|    return (txout.nValue < GetDustThreshold(txout, dustRelayFeeIn));
   68|  1.06k|}
_Z7GetDustRK12CTransaction8CFeeRate:
   71|    730|{
   72|    730|    std::vector<uint32_t> dust_outputs;
   73|  1.79k|    for (uint32_t i{0}; i < tx.vout.size(); ++i) {
  ------------------
  |  Branch (73:25): [True: 1.06k, False: 730]
  ------------------
   74|  1.06k|        if (IsDust(tx.vout[i], dust_relay_rate)) dust_outputs.push_back(i);
  ------------------
  |  Branch (74:13): [True: 20, False: 1.04k]
  ------------------
   75|  1.06k|    }
   76|    730|    return dust_outputs;
   77|    730|}
_Z10IsStandardRK7CScriptRKNSt3__18optionalIjEER9TxoutType:
   80|  1.39k|{
   81|  1.39k|    std::vector<std::vector<unsigned char> > vSolutions;
   82|  1.39k|    whichType = Solver(scriptPubKey, vSolutions);
   83|       |
   84|  1.39k|    if (whichType == TxoutType::NONSTANDARD) {
  ------------------
  |  Branch (84:9): [True: 278, False: 1.11k]
  ------------------
   85|    278|        return false;
   86|  1.11k|    } else if (whichType == TxoutType::MULTISIG) {
  ------------------
  |  Branch (86:16): [True: 0, False: 1.11k]
  ------------------
   87|      0|        unsigned char m = vSolutions.front()[0];
   88|      0|        unsigned char n = vSolutions.back()[0];
   89|       |        // Support up to x-of-3 multisig txns as standard
   90|      0|        if (n < 1 || n > 3)
  ------------------
  |  Branch (90:13): [True: 0, False: 0]
  |  Branch (90:22): [True: 0, False: 0]
  ------------------
   91|      0|            return false;
   92|      0|        if (m < 1 || m > n)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  |  Branch (92:22): [True: 0, False: 0]
  ------------------
   93|      0|            return false;
   94|  1.11k|    } else if (whichType == TxoutType::NULL_DATA) {
  ------------------
  |  Branch (94:16): [True: 157, False: 961]
  ------------------
   95|    157|        if (!max_datacarrier_bytes || scriptPubKey.size() > *max_datacarrier_bytes) {
  ------------------
  |  Branch (95:13): [True: 0, False: 157]
  |  Branch (95:39): [True: 2, False: 155]
  ------------------
   96|      2|            return false;
   97|      2|        }
   98|    157|    }
   99|       |
  100|  1.11k|    return true;
  101|  1.39k|}
_Z12IsStandardTxRK12CTransactionRKNSt3__18optionalIjEEbRK8CFeeRateRNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  104|  1.16k|{
  105|  1.16k|    if (tx.version > TX_MAX_STANDARD_VERSION || tx.version < 1) {
  ------------------
  |  Branch (105:9): [True: 65, False: 1.09k]
  |  Branch (105:49): [True: 8, False: 1.08k]
  ------------------
  106|     73|        reason = "version";
  107|     73|        return false;
  108|     73|    }
  109|       |
  110|       |    // Extremely large transactions with lots of inputs can cost the network
  111|       |    // almost as much to process as they cost the sender in fees, because
  112|       |    // computing signature hashes is O(ninputs*txsize). Limiting transactions
  113|       |    // to MAX_STANDARD_TX_WEIGHT mitigates CPU exhaustion attacks.
  114|  1.08k|    unsigned int sz = GetTransactionWeight(tx);
  115|  1.08k|    if (sz > MAX_STANDARD_TX_WEIGHT) {
  ------------------
  |  Branch (115:9): [True: 2, False: 1.08k]
  ------------------
  116|      2|        reason = "tx-size";
  117|      2|        return false;
  118|      2|    }
  119|       |
  120|  1.08k|    for (const CTxIn& txin : tx.vin)
  ------------------
  |  Branch (120:28): [True: 3.91k, False: 1.01k]
  ------------------
  121|  3.91k|    {
  122|       |        // Biggest 'standard' txin involving only keys is a 15-of-15 P2SH
  123|       |        // multisig with compressed keys (remember the MAX_SCRIPT_ELEMENT_SIZE byte limit on
  124|       |        // redeemScript size). That works out to a (15*(33+1))+3=513 byte
  125|       |        // redeemScript, 513+1+15*(73+1)+3=1627 bytes of scriptSig, which
  126|       |        // we round off to 1650(MAX_STANDARD_SCRIPTSIG_SIZE) bytes for
  127|       |        // some minor future-proofing. That's also enough to spend a
  128|       |        // 20-of-20 CHECKMULTISIG scriptPubKey, though such a scriptPubKey
  129|       |        // is not considered standard.
  130|  3.91k|        if (txin.scriptSig.size() > MAX_STANDARD_SCRIPTSIG_SIZE) {
  ------------------
  |  Branch (130:13): [True: 3, False: 3.90k]
  ------------------
  131|      3|            reason = "scriptsig-size";
  132|      3|            return false;
  133|      3|        }
  134|  3.90k|        if (!txin.scriptSig.IsPushOnly()) {
  ------------------
  |  Branch (134:13): [True: 74, False: 3.83k]
  ------------------
  135|     74|            reason = "scriptsig-not-pushonly";
  136|     74|            return false;
  137|     74|        }
  138|  3.90k|    }
  139|       |
  140|  1.01k|    unsigned int nDataOut = 0;
  141|  1.01k|    TxoutType whichType;
  142|  1.39k|    for (const CTxOut& txout : tx.vout) {
  ------------------
  |  Branch (142:30): [True: 1.39k, False: 730]
  ------------------
  143|  1.39k|        if (!::IsStandard(txout.scriptPubKey, max_datacarrier_bytes, whichType)) {
  ------------------
  |  Branch (143:13): [True: 280, False: 1.11k]
  ------------------
  144|    280|            reason = "scriptpubkey";
  145|    280|            return false;
  146|    280|        }
  147|       |
  148|  1.11k|        if (whichType == TxoutType::NULL_DATA)
  ------------------
  |  Branch (148:13): [True: 155, False: 961]
  ------------------
  149|    155|            nDataOut++;
  150|    961|        else if ((whichType == TxoutType::MULTISIG) && (!permit_bare_multisig)) {
  ------------------
  |  Branch (150:18): [True: 0, False: 961]
  |  Branch (150:56): [True: 0, False: 0]
  ------------------
  151|      0|            reason = "bare-multisig";
  152|      0|            return false;
  153|      0|        }
  154|  1.11k|    }
  155|       |
  156|       |    // Only MAX_DUST_OUTPUTS_PER_TX dust is permitted(on otherwise valid ephemeral dust)
  157|    730|    if (GetDust(tx, dust_relay_fee).size() > MAX_DUST_OUTPUTS_PER_TX) {
  ------------------
  |  Branch (157:9): [True: 0, False: 730]
  ------------------
  158|      0|        reason = "dust";
  159|      0|        return false;
  160|      0|    }
  161|       |
  162|       |    // only one OP_RETURN txout is permitted
  163|    730|    if (nDataOut > 1) {
  ------------------
  |  Branch (163:9): [True: 3, False: 727]
  ------------------
  164|      3|        reason = "multi-op-return";
  165|      3|        return false;
  166|      3|    }
  167|       |
  168|    727|    return true;
  169|    730|}
_Z17AreInputsStandardRK12CTransactionRK15CCoinsViewCache:
  190|     23|{
  191|     23|    if (tx.IsCoinBase()) {
  ------------------
  |  Branch (191:9): [True: 0, False: 23]
  ------------------
  192|      0|        return true; // Coinbases don't use vin normally
  193|      0|    }
  194|       |
  195|     23|    for (unsigned int i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (195:30): [True: 23, False: 0]
  ------------------
  196|     23|        const CTxOut& prev = mapInputs.AccessCoin(tx.vin[i].prevout).out;
  197|       |
  198|     23|        std::vector<std::vector<unsigned char> > vSolutions;
  199|     23|        TxoutType whichType = Solver(prev.scriptPubKey, vSolutions);
  200|     23|        if (whichType == TxoutType::NONSTANDARD || whichType == TxoutType::WITNESS_UNKNOWN) {
  ------------------
  |  Branch (200:13): [True: 23, False: 0]
  |  Branch (200:52): [True: 0, False: 0]
  ------------------
  201|       |            // WITNESS_UNKNOWN failures are typically also caught with a policy
  202|       |            // flag in the script interpreter, but it can be helpful to catch
  203|       |            // this type of NONSTANDARD transaction earlier in transaction
  204|       |            // validation.
  205|     23|            return false;
  206|     23|        } else if (whichType == TxoutType::SCRIPTHASH) {
  ------------------
  |  Branch (206:20): [True: 0, False: 0]
  ------------------
  207|      0|            std::vector<std::vector<unsigned char> > stack;
  208|       |            // convert the scriptSig into a stack, so we can inspect the redeemScript
  209|      0|            if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker(), SigVersion::BASE))
  ------------------
  |  Branch (209:17): [True: 0, False: 0]
  ------------------
  210|      0|                return false;
  211|      0|            if (stack.empty())
  ------------------
  |  Branch (211:17): [True: 0, False: 0]
  ------------------
  212|      0|                return false;
  213|      0|            CScript subscript(stack.back().begin(), stack.back().end());
  214|      0|            if (subscript.GetSigOpCount(true) > MAX_P2SH_SIGOPS) {
  ------------------
  |  Branch (214:17): [True: 0, False: 0]
  ------------------
  215|      0|                return false;
  216|      0|            }
  217|      0|        }
  218|     23|    }
  219|       |
  220|      0|    return true;
  221|     23|}

_Z19GetNextWorkRequiredPK11CBlockIndexPK12CBlockHeaderRKN9Consensus6ParamsE:
   15|    490|{
   16|    490|    assert(pindexLast != nullptr);
   17|    490|    unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
   18|       |
   19|       |    // Only change once per difficulty adjustment interval
   20|    490|    if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
  ------------------
  |  Branch (20:9): [True: 490, False: 0]
  ------------------
   21|    490|    {
   22|    490|        if (params.fPowAllowMinDifficultyBlocks)
  ------------------
  |  Branch (22:13): [True: 490, False: 0]
  ------------------
   23|    490|        {
   24|       |            // Special difficulty rule for testnet:
   25|       |            // If the new block's timestamp is more than 2* 10 minutes
   26|       |            // then allow mining of a min-difficulty block.
   27|    490|            if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)
  ------------------
  |  Branch (27:17): [True: 421, False: 69]
  ------------------
   28|    421|                return nProofOfWorkLimit;
   29|     69|            else
   30|     69|            {
   31|       |                // Return the last non-special-min-difficulty-rules-block
   32|     69|                const CBlockIndex* pindex = pindexLast;
   33|  2.11k|                while (pindex->pprev && pindex->nHeight % params.DifficultyAdjustmentInterval() != 0 && pindex->nBits == nProofOfWorkLimit)
  ------------------
  |  Branch (33:24): [True: 2.09k, False: 19]
  |  Branch (33:41): [True: 2.04k, False: 50]
  |  Branch (33:105): [True: 2.04k, False: 0]
  ------------------
   34|  2.04k|                    pindex = pindex->pprev;
   35|     69|                return pindex->nBits;
   36|     69|            }
   37|    490|        }
   38|      0|        return pindexLast->nBits;
   39|    490|    }
   40|       |
   41|       |    // Go back by what we want to be 14 days worth of blocks
   42|      0|    int nHeightFirst = pindexLast->nHeight - (params.DifficultyAdjustmentInterval()-1);
   43|      0|    assert(nHeightFirst >= 0);
   44|      0|    const CBlockIndex* pindexFirst = pindexLast->GetAncestor(nHeightFirst);
   45|      0|    assert(pindexFirst);
   46|       |
   47|      0|    return CalculateNextWorkRequired(pindexLast, pindexFirst->GetBlockTime(), params);
   48|      0|}
_Z16CheckProofOfWork7uint256jRKN9Consensus6ParamsE:
  141|  3.09k|{
  142|  3.09k|    if constexpr (G_FUZZING) return (hash.data()[31] & 0x80) == 0;
  143|      0|    return CheckProofOfWorkImpl(hash, nBits, params);
  144|  3.09k|}

_ZN9prevectorILj28EhjiE8item_ptrEi:
  206|  61.5k|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (206:47): [True: 46.0k, False: 15.4k]
  ------------------
_ZNK9prevectorILj28EhjiE9is_directEv:
  173|  1.14M|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj28EhjiE10direct_ptrEi:
  169|  61.5k|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj28EhjiE12indirect_ptrEi:
  171|  15.4k|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj28EhjiE8capacityEv:
  312|  61.2k|    size_t capacity() const {
  313|  61.2k|        if (is_direct()) {
  ------------------
  |  Branch (313:13): [True: 61.2k, False: 0]
  ------------------
  314|  61.2k|            return N;
  315|  61.2k|        } else {
  316|      0|            return _union.indirect_contents.capacity;
  317|      0|        }
  318|  61.2k|    }
_ZN9prevectorILj28EhjiE15change_capacityEj:
  175|  45.4k|    void change_capacity(size_type new_capacity) {
  176|  45.4k|        if (new_capacity <= N) {
  ------------------
  |  Branch (176:13): [True: 29.9k, False: 15.4k]
  ------------------
  177|  29.9k|            if (!is_direct()) {
  ------------------
  |  Branch (177:17): [True: 0, False: 29.9k]
  ------------------
  178|      0|                T* indirect = indirect_ptr(0);
  179|      0|                T* src = indirect;
  180|      0|                T* dst = direct_ptr(0);
  181|      0|                memcpy(dst, src, size() * sizeof(T));
  182|      0|                free(indirect);
  183|      0|                _size -= N + 1;
  184|      0|            }
  185|  29.9k|        } else {
  186|  15.4k|            if (!is_direct()) {
  ------------------
  |  Branch (186:17): [True: 0, False: 15.4k]
  ------------------
  187|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  188|       |                    success. These should instead use an allocator or new/delete so that handlers
  189|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  190|      0|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  191|      0|                assert(_union.indirect_contents.indirect);
  192|      0|                _union.indirect_contents.capacity = new_capacity;
  193|  15.4k|            } else {
  194|  15.4k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  195|  15.4k|                assert(new_indirect);
  196|  15.4k|                T* src = direct_ptr(0);
  197|  15.4k|                T* dst = reinterpret_cast<T*>(new_indirect);
  198|  15.4k|                memcpy(dst, src, size() * sizeof(T));
  199|  15.4k|                _union.indirect_contents.indirect = new_indirect;
  200|  15.4k|                _union.indirect_contents.capacity = new_capacity;
  201|  15.4k|                _size += N + 1;
  202|  15.4k|            }
  203|  15.4k|        }
  204|  45.4k|    }
_ZNK9prevectorILj28EhjiE3endEv:
  305|  15.5k|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZNK9prevectorILj28EhjiE8item_ptrEi:
  207|   133k|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (207:59): [True: 100k, False: 32.3k]
  ------------------
_ZNK9prevectorILj28EhjiE10direct_ptrEi:
  170|   100k|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj28EhjiE12indirect_ptrEi:
  172|  32.3k|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj28EhjiE4sizeEv:
  294|   728k|    size_type size() const {
  295|   728k|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (295:16): [True: 630k, False: 97.9k]
  ------------------
  296|   728k|    }
_ZNK9prevectorILj28EhjiE5beginEv:
  303|  7.78k|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj28EhjiE14const_iteratordeEv:
  111|  35.3k|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj28EhjiE5clearEv:
  355|   117k|    void clear() {
  356|   117k|        resize(0);
  357|   117k|    }
_ZN9prevectorILj28EhjiE6resizeEj:
  328|   117k|    void resize(size_type new_size) {
  329|   117k|        size_type cur_size = size();
  330|   117k|        if (cur_size == new_size) {
  ------------------
  |  Branch (330:13): [True: 117k, False: 0]
  ------------------
  331|   117k|            return;
  332|   117k|        }
  333|      0|        if (cur_size > new_size) {
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            erase(item_ptr(new_size), end());
  335|      0|            return;
  336|      0|        }
  337|      0|        if (new_size > capacity()) {
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  ------------------
  338|      0|            change_capacity(new_size);
  339|      0|        }
  340|      0|        ptrdiff_t increase = new_size - cur_size;
  341|      0|        fill(item_ptr(cur_size), increase);
  342|      0|        _size += increase;
  343|      0|    }
_ZN9prevectorILj28EhjiE13shrink_to_fitEv:
  351|  29.6k|    void shrink_to_fit() {
  352|  29.6k|        change_capacity(size());
  353|  29.6k|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  214|    289|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|    578|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 289, False: 289]
  ------------------
  216|    289|            new(static_cast<void*>(dst)) T(*first);
  217|    289|            ++dst;
  218|    289|            ++first;
  219|    289|        }
  220|    289|    }
_ZNK9prevectorILj28EhjiE14const_iteratorneES1_:
  125|    578|        bool operator!=(const_iterator x) const { return ptr != x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEv:
  114|  5.13k|        const_iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj28EhjiE4dataEv:
  537|   100k|    const value_type* data() const {
  538|   100k|        return item_ptr(0);
  539|   100k|    }
_ZNK9prevectorILj28EhjiE16allocated_memoryEv:
  525|  19.5k|    size_t allocated_memory() const {
  526|  19.5k|        if (is_direct()) {
  ------------------
  |  Branch (526:13): [True: 14.6k, False: 4.93k]
  ------------------
  527|  14.6k|            return 0;
  528|  14.6k|        } else {
  529|  4.93k|            return ((size_t)(sizeof(T))) * _union.indirect_contents.capacity;
  530|  4.93k|        }
  531|  19.5k|    }
_ZN9prevectorILj16EhjiEaSEOS0_:
  284|   294k|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  285|   294k|        if (!is_direct()) {
  ------------------
  |  Branch (285:13): [True: 0, False: 294k]
  ------------------
  286|      0|            free(_union.indirect_contents.indirect);
  287|      0|        }
  288|   294k|        _union = std::move(other._union);
  289|   294k|        _size = other._size;
  290|   294k|        other._size = 0;
  291|   294k|        return *this;
  292|   294k|    }
_ZNK9prevectorILj16EhjiE9is_directEv:
  173|  18.8M|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj16EhjiED2Ev:
  474|  1.18M|    ~prevector() {
  475|  1.18M|        if (!is_direct()) {
  ------------------
  |  Branch (475:13): [True: 25.5k, False: 1.16M]
  ------------------
  476|  25.5k|            free(_union.indirect_contents.indirect);
  477|  25.5k|            _union.indirect_contents.indirect = nullptr;
  478|  25.5k|        }
  479|  1.18M|    }
_ZN9prevectorILj16EhjiEC2ERKS0_:
  263|   430k|    prevector(const prevector<N, T, Size, Diff>& other) {
  264|   430k|        size_type n = other.size();
  265|   430k|        change_capacity(n);
  266|   430k|        _size += n;
  267|   430k|        fill(item_ptr(0), other.begin(),  other.end());
  268|   430k|    }
_ZNK9prevectorILj16EhjiE4sizeEv:
  294|  6.42M|    size_type size() const {
  295|  6.42M|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (295:16): [True: 6.34M, False: 74.2k]
  ------------------
  296|  6.42M|    }
_ZN9prevectorILj16EhjiE15change_capacityEj:
  175|   876k|    void change_capacity(size_type new_capacity) {
  176|   876k|        if (new_capacity <= N) {
  ------------------
  |  Branch (176:13): [True: 851k, False: 25.5k]
  ------------------
  177|   851k|            if (!is_direct()) {
  ------------------
  |  Branch (177:17): [True: 0, False: 851k]
  ------------------
  178|      0|                T* indirect = indirect_ptr(0);
  179|      0|                T* src = indirect;
  180|      0|                T* dst = direct_ptr(0);
  181|      0|                memcpy(dst, src, size() * sizeof(T));
  182|      0|                free(indirect);
  183|      0|                _size -= N + 1;
  184|      0|            }
  185|   851k|        } else {
  186|  25.5k|            if (!is_direct()) {
  ------------------
  |  Branch (186:17): [True: 0, False: 25.5k]
  ------------------
  187|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  188|       |                    success. These should instead use an allocator or new/delete so that handlers
  189|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  190|      0|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  191|      0|                assert(_union.indirect_contents.indirect);
  192|      0|                _union.indirect_contents.capacity = new_capacity;
  193|  25.5k|            } else {
  194|  25.5k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  195|  25.5k|                assert(new_indirect);
  196|  25.5k|                T* src = direct_ptr(0);
  197|  25.5k|                T* dst = reinterpret_cast<T*>(new_indirect);
  198|  25.5k|                memcpy(dst, src, size() * sizeof(T));
  199|  25.5k|                _union.indirect_contents.indirect = new_indirect;
  200|  25.5k|                _union.indirect_contents.capacity = new_capacity;
  201|  25.5k|                _size += N + 1;
  202|  25.5k|            }
  203|  25.5k|        }
  204|   876k|    }
_ZN9prevectorILj16EhjiE12indirect_ptrEi:
  171|  29.8k|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj16EhjiE10direct_ptrEi:
  169|  2.15M|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  214|   438k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  6.92M|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 6.49M, False: 438k]
  ------------------
  216|  6.49M|            new(static_cast<void*>(dst)) T(*first);
  217|  6.49M|            ++dst;
  218|  6.49M|            ++first;
  219|  6.49M|        }
  220|   438k|    }
_ZNK9prevectorILj16EhjiE14const_iteratorneES1_:
  125|  7.86M|        bool operator!=(const_iterator x) const { return ptr != x.ptr; }
_ZNK9prevectorILj16EhjiE14const_iteratordeEv:
  111|  8.32M|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj16EhjiE14const_iteratorppEv:
  114|  8.21M|        const_iterator& operator++() { ptr++; return *this; }
_ZN9prevectorILj16EhjiE8item_ptrEi:
  206|  2.16M|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (206:47): [True: 2.13M, False: 29.8k]
  ------------------
_ZNK9prevectorILj16EhjiE5beginEv:
  303|  4.10M|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj16EhjiE8item_ptrEi:
  207|  7.64M|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (207:59): [True: 7.55M, False: 85.6k]
  ------------------
_ZNK9prevectorILj16EhjiE10direct_ptrEi:
  170|  7.55M|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj16EhjiE12indirect_ptrEi:
  172|  85.6k|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj16EhjiE14const_iteratorC2EPKh:
  109|  4.64M|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZNK9prevectorILj16EhjiE3endEv:
  305|   539k|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZN9prevectorILj16EhjiEaSERKS0_:
  276|  8.57k|    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
  277|  8.57k|        if (&other == this) {
  ------------------
  |  Branch (277:13): [True: 0, False: 8.57k]
  ------------------
  278|      0|            return *this;
  279|      0|        }
  280|  8.57k|        assign(other.begin(), other.end());
  281|  8.57k|        return *this;
  282|  8.57k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorENS0_14const_iteratorEEEvT_S4_:
  233|  8.57k|    void assign(InputIterator first, InputIterator last) {
  234|  8.57k|        size_type n = last - first;
  235|  8.57k|        clear();
  236|  8.57k|        if (capacity() < n) {
  ------------------
  |  Branch (236:13): [True: 17, False: 8.55k]
  ------------------
  237|     17|            change_capacity(n);
  238|     17|        }
  239|  8.57k|        _size += n;
  240|  8.57k|        fill(item_ptr(0), first, last);
  241|  8.57k|    }
_ZmiN9prevectorILj16EhjiE14const_iteratorES1_:
  118|  32.6k|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj16EhjiE5clearEv:
  355|   302k|    void clear() {
  356|   302k|        resize(0);
  357|   302k|    }
_ZN9prevectorILj16EhjiE6resizeEj:
  328|   334k|    void resize(size_type new_size) {
  329|   334k|        size_type cur_size = size();
  330|   334k|        if (cur_size == new_size) {
  ------------------
  |  Branch (330:13): [True: 13.1k, False: 321k]
  ------------------
  331|  13.1k|            return;
  332|  13.1k|        }
  333|   321k|        if (cur_size > new_size) {
  ------------------
  |  Branch (333:13): [True: 316k, False: 4.29k]
  ------------------
  334|   316k|            erase(item_ptr(new_size), end());
  335|   316k|            return;
  336|   316k|        }
  337|  4.29k|        if (new_size > capacity()) {
  ------------------
  |  Branch (337:13): [True: 4.29k, False: 0]
  ------------------
  338|  4.29k|            change_capacity(new_size);
  339|  4.29k|        }
  340|  4.29k|        ptrdiff_t increase = new_size - cur_size;
  341|  4.29k|        fill(item_ptr(cur_size), increase);
  342|  4.29k|        _size += increase;
  343|  4.29k|    }
_ZN9prevectorILj16EhjiE5eraseENS0_8iteratorES1_:
  420|   316k|    iterator erase(iterator first, iterator last) {
  421|       |        // Erase is not allowed to the change the object's capacity. That means
  422|       |        // that when starting with an indirectly allocated prevector with
  423|       |        // size and capacity > N, the result may be a still indirectly allocated
  424|       |        // prevector with size <= N and capacity > N. A shrink_to_fit() call is
  425|       |        // necessary to switch to the (more efficient) directly allocated
  426|       |        // representation (with capacity N and size <= N).
  427|   316k|        iterator p = first;
  428|   316k|        char* endp = (char*)&(*end());
  429|   316k|        _size -= last - p;
  430|   316k|        memmove(&(*first), &(*last), endp - ((char*)(&(*last))));
  431|   316k|        return first;
  432|   316k|    }
_ZNK9prevectorILj16EhjiE8iteratordeEv:
   59|  1.90M|        T& operator*() const { return *ptr; }
_ZmiN9prevectorILj16EhjiE8iteratorES1_:
   66|   316k|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj16EhjiE8iteratorC2EPh:
   58|   950k|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj16EhjiE3endEv:
  304|   633k|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj16EhjiE4fillEPhlRKh:
  209|   626k|    void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
  210|   626k|        std::fill_n(dst, count, value);
  211|   626k|    }
_ZNK9prevectorILj16EhjiE8capacityEv:
  312|   306k|    size_t capacity() const {
  313|   306k|        if (is_direct()) {
  ------------------
  |  Branch (313:13): [True: 306k, False: 0]
  ------------------
  314|   306k|            return N;
  315|   306k|        } else {
  316|      0|            return _union.indirect_contents.capacity;
  317|      0|        }
  318|   306k|    }
_ZN9prevectorILj16EhjiEC2EOS0_:
  271|   315k|        : _union(std::move(other._union)), _size(other._size)
  272|   315k|    {
  273|   315k|        other._size = 0;
  274|   315k|    }
_ZNK9prevectorILj16EhjiEixEj:
  324|  1.17M|    const T& operator[](size_type pos) const {
  325|  1.17M|        return *item_ptr(pos);
  326|  1.17M|    }
_ZNK9prevectorILj16EhjiE4dataEv:
  537|  1.81M|    const value_type* data() const {
  538|  1.81M|        return item_ptr(0);
  539|  1.81M|    }
_ZN9prevectorILj16EhjiE4dataEv:
  533|  32.7k|    value_type* data() {
  534|  32.7k|        return item_ptr(0);
  535|  32.7k|    }
_ZNK9prevectorILj28EhjiE5emptyEv:
  298|   163k|    bool empty() const {
  299|   163k|        return size() == 0;
  300|   163k|    }
_ZNK9prevectorILj28EhjiEixEj:
  324|  8.55k|    const T& operator[](size_type pos) const {
  325|  8.55k|        return *item_ptr(pos);
  326|  8.55k|    }
_ZN9prevectorILj28EhjiED2Ev:
  474|  92.8k|    ~prevector() {
  475|  92.8k|        if (!is_direct()) {
  ------------------
  |  Branch (475:13): [True: 15.4k, False: 77.3k]
  ------------------
  476|  15.4k|            free(_union.indirect_contents.indirect);
  477|  15.4k|            _union.indirect_contents.indirect = nullptr;
  478|  15.4k|        }
  479|  92.8k|    }
_ZN9prevectorILj28EhjiEC2Ev:
  243|  92.1k|    prevector() = default;
_ZN9prevectorILj28EhjiE20resize_uninitializedEj:
  401|  61.2k|    inline void resize_uninitialized(size_type new_size) {
  402|       |        // resize_uninitialized changes the size of the prevector but does not initialize it.
  403|       |        // If size < new_size, the added elements must be initialized explicitly.
  404|  61.2k|        if (capacity() < new_size) {
  ------------------
  |  Branch (404:13): [True: 15.4k, False: 45.7k]
  ------------------
  405|  15.4k|            change_capacity(new_size);
  406|  15.4k|            _size += new_size - size();
  407|  15.4k|            return;
  408|  15.4k|        }
  409|  45.7k|        if (new_size < size()) {
  ------------------
  |  Branch (409:13): [True: 0, False: 45.7k]
  ------------------
  410|      0|            erase(item_ptr(new_size), end());
  411|  45.7k|        } else {
  412|  45.7k|            _size += new_size - size();
  413|  45.7k|        }
  414|  45.7k|    }
_ZN9prevectorILj28EhjiEixEj:
  320|  61.2k|    T& operator[](size_type pos) {
  321|  61.2k|        return *item_ptr(pos);
  322|  61.2k|    }
_ZN9prevectorILj28EhjiE14const_iteratorC2EPKh:
  109|  25.6k|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiEC2ERKS0_:
  263|    289|    prevector(const prevector<N, T, Size, Diff>& other) {
  264|    289|        size_type n = other.size();
  265|    289|        change_capacity(n);
  266|    289|        _size += n;
  267|    289|        fill(item_ptr(0), other.begin(),  other.end());
  268|    289|    }
_ZmiN9prevectorILj28EhjiE14const_iteratorES1_:
  118|  14.5k|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj28EhjiEaSEOS0_:
  284|    180|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  285|    180|        if (!is_direct()) {
  ------------------
  |  Branch (285:13): [True: 0, False: 180]
  ------------------
  286|      0|            free(_union.indirect_contents.indirect);
  287|      0|        }
  288|    180|        _union = std::move(other._union);
  289|    180|        _size = other._size;
  290|    180|        other._size = 0;
  291|    180|        return *this;
  292|    180|    }
_ZNK9prevectorILj16EhjiE14const_iteratorptEv:
  112|  3.53M|        const T* operator->() const { return ptr; }
_ZN9prevectorILj16EhjiE6assignEjRKh:
  223|   179k|    void assign(size_type n, const T& val) {
  224|   179k|        clear();
  225|   179k|        if (capacity() < n) {
  ------------------
  |  Branch (225:13): [True: 0, False: 179k]
  ------------------
  226|      0|            change_capacity(n);
  227|      0|        }
  228|   179k|        _size += n;
  229|   179k|        fill(item_ptr(0), n, val);
  230|   179k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorptEv:
  112|  3.91k|        const T* operator->() const { return ptr; }
_ZNK9prevectorILj28EhjiE14const_iteratorltES1_:
  129|  8.73k|        bool operator<(const_iterator x) const { return ptr < x.ptr; }
_ZN9prevectorILj35EhjiE4dataEv:
  533|     48|    value_type* data() {
  534|     48|        return item_ptr(0);
  535|     48|    }
_ZN9prevectorILj35EhjiE8item_ptrEi:
  206|    384|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (206:47): [True: 384, False: 0]
  ------------------
_ZNK9prevectorILj35EhjiE9is_directEv:
  173|    912|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj35EhjiE10direct_ptrEi:
  169|    384|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZNK9prevectorILj35EhjiE4sizeEv:
  294|    336|    size_type size() const {
  295|    336|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (295:16): [True: 336, False: 0]
  ------------------
  296|    336|    }
_ZN9prevectorILj16EhjiEC2EjRKh:
  249|   442k|    explicit prevector(size_type n, const T& val) {
  250|   442k|        change_capacity(n);
  251|   442k|        _size += n;
  252|   442k|        fill(item_ptr(0), n, val);
  253|   442k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorEPKhEEvT_S5_:
  233|   113k|    void assign(InputIterator first, InputIterator last) {
  234|   113k|        size_type n = last - first;
  235|   113k|        clear();
  236|   113k|        if (capacity() < n) {
  ------------------
  |  Branch (236:13): [True: 0, False: 113k]
  ------------------
  237|      0|            change_capacity(n);
  238|      0|        }
  239|   113k|        _size += n;
  240|   113k|        fill(item_ptr(0), first, last);
  241|   113k|    }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorEPKhEEvPhT_S6_:
  214|   113k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  1.91M|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 1.80M, False: 113k]
  ------------------
  216|  1.80M|            new(static_cast<void*>(dst)) T(*first);
  217|  1.80M|            ++dst;
  218|  1.80M|            ++first;
  219|  1.80M|        }
  220|   113k|    }
_ZN9prevectorILj16EhjiE6assignITkNSt3__114input_iteratorEPhEEvT_S4_:
  233|    459|    void assign(InputIterator first, InputIterator last) {
  234|    459|        size_type n = last - first;
  235|    459|        clear();
  236|    459|        if (capacity() < n) {
  ------------------
  |  Branch (236:13): [True: 0, False: 459]
  ------------------
  237|      0|            change_capacity(n);
  238|      0|        }
  239|    459|        _size += n;
  240|    459|        fill(item_ptr(0), first, last);
  241|    459|    }
_ZN9prevectorILj16EhjiE4fillITkNSt3__114input_iteratorEPhEEvS3_T_S4_:
  214|    459|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  5.04k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 4.59k, False: 459]
  ------------------
  216|  4.59k|            new(static_cast<void*>(dst)) T(*first);
  217|  4.59k|            ++dst;
  218|  4.59k|            ++first;
  219|  4.59k|        }
  220|    459|    }
_ZN9prevectorILj35EhjiEC2ITkNSt3__114input_iteratorEPKhEET_S5_:
  256|     48|    prevector(InputIterator first, InputIterator last) {
  257|     48|        size_type n = last - first;
  258|     48|        change_capacity(n);
  259|     48|        _size += n;
  260|     48|        fill(item_ptr(0), first, last);
  261|     48|    }
_ZN9prevectorILj35EhjiE15change_capacityEj:
  175|     48|    void change_capacity(size_type new_capacity) {
  176|     48|        if (new_capacity <= N) {
  ------------------
  |  Branch (176:13): [True: 48, False: 0]
  ------------------
  177|     48|            if (!is_direct()) {
  ------------------
  |  Branch (177:17): [True: 0, False: 48]
  ------------------
  178|      0|                T* indirect = indirect_ptr(0);
  179|      0|                T* src = indirect;
  180|      0|                T* dst = direct_ptr(0);
  181|      0|                memcpy(dst, src, size() * sizeof(T));
  182|      0|                free(indirect);
  183|      0|                _size -= N + 1;
  184|      0|            }
  185|     48|        } else {
  186|      0|            if (!is_direct()) {
  ------------------
  |  Branch (186:17): [True: 0, False: 0]
  ------------------
  187|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  188|       |                    success. These should instead use an allocator or new/delete so that handlers
  189|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  190|      0|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  191|      0|                assert(_union.indirect_contents.indirect);
  192|      0|                _union.indirect_contents.capacity = new_capacity;
  193|      0|            } else {
  194|      0|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  195|      0|                assert(new_indirect);
  196|      0|                T* src = direct_ptr(0);
  197|      0|                T* dst = reinterpret_cast<T*>(new_indirect);
  198|      0|                memcpy(dst, src, size() * sizeof(T));
  199|      0|                _union.indirect_contents.indirect = new_indirect;
  200|      0|                _union.indirect_contents.capacity = new_capacity;
  201|      0|                _size += N + 1;
  202|      0|            }
  203|      0|        }
  204|     48|    }
_ZN9prevectorILj35EhjiE4fillITkNSt3__114input_iteratorEPKhEEvPhT_S6_:
  214|     96|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  1.68k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 1.58k, False: 96]
  ------------------
  216|  1.58k|            new(static_cast<void*>(dst)) T(*first);
  217|  1.58k|            ++dst;
  218|  1.58k|            ++first;
  219|  1.58k|        }
  220|     96|    }
_ZN9prevectorILj35EhjiED2Ev:
  474|     48|    ~prevector() {
  475|     48|        if (!is_direct()) {
  ------------------
  |  Branch (475:13): [True: 0, False: 48]
  ------------------
  476|      0|            free(_union.indirect_contents.indirect);
  477|      0|            _union.indirect_contents.indirect = nullptr;
  478|      0|        }
  479|     48|    }
_ZN9prevectorILj35EhjiE3endEv:
  304|     96|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj35EhjiE8iteratorC2EPh:
   58|    192|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj35EhjiE6insertITkNSt3__114input_iteratorEPhEEvNS0_8iteratorET_S5_:
  387|     48|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|     48|        size_type p = pos - begin();
  389|     48|        difference_type count = last - first;
  390|     48|        size_type new_size = size() + count;
  391|     48|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 0, False: 48]
  ------------------
  392|      0|            change_capacity(new_size + (new_size >> 1));
  393|      0|        }
  394|     48|        T* ptr = item_ptr(p);
  395|     48|        T* dst = ptr + count;
  396|     48|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|     48|        _size += count;
  398|     48|        fill(ptr, first, last);
  399|     48|    }
_ZmiN9prevectorILj35EhjiE8iteratorES1_:
   66|     96|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj35EhjiE8iteratordeEv:
   59|    192|        T& operator*() const { return *ptr; }
_ZN9prevectorILj35EhjiE5beginEv:
  302|     96|    iterator begin() { return iterator(item_ptr(0)); }
_ZNK9prevectorILj35EhjiE8capacityEv:
  312|     96|    size_t capacity() const {
  313|     96|        if (is_direct()) {
  ------------------
  |  Branch (313:13): [True: 96, False: 0]
  ------------------
  314|     96|            return N;
  315|     96|        } else {
  316|      0|            return _union.indirect_contents.capacity;
  317|      0|        }
  318|     96|    }
_ZN9prevectorILj35EhjiE4fillITkNSt3__114input_iteratorEPhEEvS3_T_S4_:
  214|     48|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|    144|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 96, False: 48]
  ------------------
  216|     96|            new(static_cast<void*>(dst)) T(*first);
  217|     96|            ++dst;
  218|     96|            ++first;
  219|     96|        }
  220|     48|    }
_ZN9prevectorILj35EhjiE6insertITkNSt3__114input_iteratorEPKhEEvNS0_8iteratorET_S6_:
  387|     48|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|     48|        size_type p = pos - begin();
  389|     48|        difference_type count = last - first;
  390|     48|        size_type new_size = size() + count;
  391|     48|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 0, False: 48]
  ------------------
  392|      0|            change_capacity(new_size + (new_size >> 1));
  393|      0|        }
  394|     48|        T* ptr = item_ptr(p);
  395|     48|        T* dst = ptr + count;
  396|     48|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|     48|        _size += count;
  398|     48|        fill(ptr, first, last);
  399|     48|    }
_ZNK9prevectorILj16EhjiEeqERKS0_:
  481|  76.3k|    bool operator==(const prevector<N, T, Size, Diff>& other) const {
  482|  76.3k|        if (other.size() != size()) {
  ------------------
  |  Branch (482:13): [True: 0, False: 76.3k]
  ------------------
  483|      0|            return false;
  484|      0|        }
  485|  76.3k|        const_iterator b1 = begin();
  486|  76.3k|        const_iterator b2 = other.begin();
  487|  76.3k|        const_iterator e1 = end();
  488|   936k|        while (b1 != e1) {
  ------------------
  |  Branch (488:16): [True: 884k, False: 52.2k]
  ------------------
  489|   884k|            if ((*b1) != (*b2)) {
  ------------------
  |  Branch (489:17): [True: 24.1k, False: 860k]
  ------------------
  490|  24.1k|                return false;
  491|  24.1k|            }
  492|   860k|            ++b1;
  493|   860k|            ++b2;
  494|   860k|        }
  495|  52.2k|        return true;
  496|  76.3k|    }
_ZNK9prevectorILj28EhjiE4backEv:
  464|    304|    const T& back() const {
  465|    304|        return *item_ptr(size() - 1);
  466|    304|    }
_ZNK9prevectorILj28EhjiE14const_iteratorplEj:
  119|  2.27k|        const_iterator operator+(size_type n) const { return const_iterator(ptr + n); }
_ZN9prevectorILj28EhjiE14const_iteratorpLEj:
  121|  3.84k|        const_iterator& operator+=(size_type n) { ptr += n; return *this; }
_ZNK9prevectorILj28EhjiE14const_iteratorixEj:
  113|     70|        const T& operator[](size_type pos) const { return ptr[pos]; }
_ZNK9prevectorILj28EhjiE14const_iteratorgeES1_:
  126|  4.80k|        bool operator>=(const_iterator x) const { return ptr >= x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEi:
  116|  4.84k|        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }

_ZNK12CBlockHeader7GetHashEv:
   12|  5.45k|{
   13|  5.45k|    return (HashWriter{} << *this).GetHash();
   14|  5.45k|}

_ZN12CBlockHeaderC2Ev:
   33|  24.0k|    {
   34|  24.0k|        SetNull();
   35|  24.0k|    }
_ZN12CBlockHeader7SetNullEv:
   40|  32.3k|    {
   41|  32.3k|        nVersion = 0;
   42|  32.3k|        hashPrevBlock.SetNull();
   43|  32.3k|        hashMerkleRoot.SetNull();
   44|  32.3k|        nTime = 0;
   45|  32.3k|        nBits = 0;
   46|  32.3k|        nNonce = 0;
   47|  32.3k|    }
_ZNK12CBlockHeader6IsNullEv:
   50|  1.22k|    {
   51|  1.22k|        return (nBits == 0);
   52|  1.22k|    }
_ZNK12CBlockHeader4TimeEv:
   57|    342|    {
   58|    342|        return NodeSeconds{std::chrono::seconds{nTime}};
   59|    342|    }
_ZNK12CBlockHeader12GetBlockTimeEv:
   62|    847|    {
   63|    847|        return (int64_t)nTime;
   64|    847|    }
_ZN6CBlockC2Ev:
   80|  1.91k|    {
   81|  1.91k|        SetNull();
   82|  1.91k|    }
_ZN6CBlockC2ERK12CBlockHeader:
   85|  4.90k|    {
   86|  4.90k|        SetNull();
   87|  4.90k|        *(static_cast<CBlockHeader*>(this)) = header;
   88|  4.90k|    }
_ZN6CBlock7SetNullEv:
   96|  8.35k|    {
   97|  8.35k|        CBlockHeader::SetNull();
   98|  8.35k|        vtx.clear();
   99|  8.35k|        fChecked = false;
  100|  8.35k|        m_checked_witness_commitment = false;
  101|  8.35k|        m_checked_merkle_root = false;
  102|  8.35k|    }
_ZNK6CBlock14GetBlockHeaderEv:
  105|     24|    {
  106|     24|        CBlockHeader block;
  107|     24|        block.nVersion       = nVersion;
  108|     24|        block.hashPrevBlock  = hashPrevBlock;
  109|     24|        block.hashMerkleRoot = hashMerkleRoot;
  110|     24|        block.nTime          = nTime;
  111|     24|        block.nBits          = nBits;
  112|     24|        block.nNonce         = nNonce;
  113|     24|        return block;
  114|     24|    }
_ZN13CBlockLocatorC2EONSt3__16vectorI7uint256NS0_9allocatorIS2_EEEE:
  138|  4.05k|    explicit CBlockLocator(std::vector<uint256>&& have) : vHave(std::move(have)) {}
_ZNK13CBlockLocator6IsNullEv:
  153|     49|    {
  154|     49|        return vHave.empty();
  155|     49|    }
_ZN6CBlock16SerializationOpsI12ParamsStreamIR12SizeComputer20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   91|     70|    {
   92|     70|        READWRITE(AsBase<CBlockHeader>(obj), obj.vtx);
  ------------------
  |  |  156|     70|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   93|     70|    }
_ZN12CBlockHeader16SerializationOpsI12ParamsStreamIR12SizeComputer20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   37|     70|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|     70|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CBlock16SerializationOpsI12ParamsStreamIR10DataStream20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
   91|    192|    {
   92|    192|        READWRITE(AsBase<CBlockHeader>(obj), obj.vtx);
  ------------------
  |  |  156|    192|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   93|    192|    }
_ZN12CBlockHeader16SerializationOpsI12ParamsStreamIR10DataStream20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
   37|    192|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|    192|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN12CBlockHeader16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   37|  3.63k|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|  3.63k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN13CBlockLocatorC2Ev:
  136|    160|    CBlockLocator() = default;
_ZN13CBlockLocator16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
  141|    160|    {
  142|    160|        int nVersion = DUMMY_VERSION;
  143|    160|        READWRITE(nVersion);
  ------------------
  |  |  156|    160|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  144|    160|        READWRITE(obj.vHave);
  ------------------
  |  |  156|    160|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  145|    160|    }
_ZN12CBlockHeader16SerializationOpsI10DataStreamKS_15ActionSerializeEEvRT0_RT_T1_:
   37|    334|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|    334|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CBlock16SerializationOpsI12ParamsStreamIR12VectorWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   91|  6.38k|    {
   92|  6.38k|        READWRITE(AsBase<CBlockHeader>(obj), obj.vtx);
  ------------------
  |  |  156|  6.38k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   93|  6.38k|    }
_ZN12CBlockHeader16SerializationOpsI12ParamsStreamIR12VectorWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   37|  6.38k|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|  6.38k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN12CBlockHeader16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   37|     10|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|     10|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN13CBlockLocator16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
  141|  3.80k|    {
  142|  3.80k|        int nVersion = DUMMY_VERSION;
  143|  3.80k|        READWRITE(nVersion);
  ------------------
  |  |  156|  3.80k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  144|  3.80k|        READWRITE(obj.vHave);
  ------------------
  |  |  156|  3.80k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  145|  3.80k|    }
_ZN6CBlock16SerializationOpsI12ParamsStreamIR8AutoFile20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
   91|  1.53k|    {
   92|  1.53k|        READWRITE(AsBase<CBlockHeader>(obj), obj.vtx);
  ------------------
  |  |  156|  1.53k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
   93|  1.53k|    }
_ZN12CBlockHeader16SerializationOpsI12ParamsStreamIR8AutoFile20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
   37|  1.53k|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|  1.53k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN12CBlockHeader16SerializationOpsI10HashWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   37|  5.45k|    SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce); }
  ------------------
  |  |  156|  5.45k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------

_ZNK12CTransaction17ComputeHasWitnessEv:
   75|  37.3k|{
   76|  37.3k|    return std::any_of(vin.begin(), vin.end(), [](const auto& input) {
   77|  37.3k|        return !input.scriptWitness.IsNull();
   78|  37.3k|    });
   79|  37.3k|}
_ZNK12CTransaction11ComputeHashEv:
   82|  37.3k|{
   83|  37.3k|    return Txid::FromUint256((HashWriter{} << TX_NO_WITNESS(*this)).GetHash());
   84|  37.3k|}
_ZNK12CTransaction18ComputeWitnessHashEv:
   87|  37.3k|{
   88|  37.3k|    if (!HasWitness()) {
  ------------------
  |  Branch (88:9): [True: 35.9k, False: 1.44k]
  ------------------
   89|  35.9k|        return Wtxid::FromUint256(hash.ToUint256());
   90|  35.9k|    }
   91|       |
   92|  1.44k|    return Wtxid::FromUint256((HashWriter{} << TX_WITH_WITNESS(*this)).GetHash());
   93|  37.3k|}
_ZN12CTransactionC2EO19CMutableTransaction:
   96|  37.3k|CTransaction::CTransaction(CMutableTransaction&& tx) : vin(std::move(tx.vin)), vout(std::move(tx.vout)), version{tx.version}, nLockTime{tx.nLockTime}, m_has_witness{ComputeHasWitness()}, hash{ComputeHash()}, m_witness_hash{ComputeWitnessHash()} {}
_ZNK12CTransaction11GetValueOutEv:
   99|     90|{
  100|     90|    CAmount nValueOut = 0;
  101|     92|    for (const auto& tx_out : vout) {
  ------------------
  |  Branch (101:29): [True: 92, False: 90]
  ------------------
  102|     92|        if (!MoneyRange(tx_out.nValue) || !MoneyRange(nValueOut + tx_out.nValue))
  ------------------
  |  Branch (102:13): [True: 0, False: 92]
  |  Branch (102:13): [True: 0, False: 92]
  |  Branch (102:43): [True: 0, False: 92]
  ------------------
  103|      0|            throw std::runtime_error(std::string(__func__) + ": value out of range");
  104|     92|        nValueOut += tx_out.nValue;
  105|     92|    }
  106|     90|    assert(MoneyRange(nValueOut));
  107|     90|    return nValueOut;
  108|     90|}
transaction.cpp:_ZZNK12CTransaction17ComputeHasWitnessEvENK3$_0clI5CTxInEEDaRKT_:
   76|  49.5k|    return std::any_of(vin.begin(), vin.end(), [](const auto& input) {
   77|  49.5k|        return !input.scriptWitness.IsNull();
   78|  49.5k|    });

_ZN9COutPointC2Ev:
   36|  65.2k|    COutPoint(): n(NULL_INDEX) { }
_ZN9COutPointC2ERK22transaction_identifierILb0EEj:
   37|    832|    COutPoint(const Txid& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }
_ZNK9COutPoint6IsNullEv:
   42|  8.07k|    bool IsNull() const { return (hash.IsNull() && n == NULL_INDEX); }
  ------------------
  |  Branch (42:35): [True: 353, False: 7.72k]
  |  Branch (42:52): [True: 119, False: 234]
  ------------------
_ZltRK9COutPointS1_:
   45|  58.0k|    {
   46|  58.0k|        return std::tie(a.hash, a.n) < std::tie(b.hash, b.n);
   47|  58.0k|    }
_ZeqRK9COutPointS1_:
   50|    676|    {
   51|    676|        return (a.hash == b.hash && a.n == b.n);
  ------------------
  |  Branch (51:17): [True: 676, False: 0]
  |  Branch (51:37): [True: 676, False: 0]
  ------------------
   52|    676|    }
_ZN5CTxInC2Ev:
  122|  62.4k|    {
  123|  62.4k|        nSequence = SEQUENCE_FINAL;
  124|  62.4k|    }
_ZN6CTxOutC2Ev:
  156|  29.6k|    {
  157|  29.6k|        SetNull();
  158|  29.6k|    }
_ZN6CTxOut7SetNullEv:
  165|  29.6k|    {
  166|  29.6k|        nValue = -1;
  167|  29.6k|        scriptPubKey.clear();
  168|  29.6k|    }
_ZNK6CTxOut6IsNullEv:
  171|  1.01k|    {
  172|  1.01k|        return (nValue == -1);
  173|  1.01k|    }
_ZNK12CTransaction6IsNullEv:
  339|      6|    bool IsNull() const {
  340|      6|        return vin.empty() && vout.empty();
  ------------------
  |  Branch (340:16): [True: 1, False: 5]
  |  Branch (340:31): [True: 1, False: 0]
  ------------------
  341|      6|    }
_ZNK12CTransaction7GetHashEv:
  343|  16.4k|    const Txid& GetHash() const LIFETIMEBOUND { return hash; }
_ZNK12CTransaction14GetWitnessHashEv:
  344|  17.7k|    const Wtxid& GetWitnessHash() const LIFETIMEBOUND { return m_witness_hash; };
_ZNK12CTransaction10IsCoinBaseEv:
  357|  2.59k|    {
  358|  2.59k|        return (vin.size() == 1 && vin[0].prevout.IsNull());
  ------------------
  |  Branch (358:17): [True: 1.59k, False: 1.00k]
  |  Branch (358:36): [True: 118, False: 1.47k]
  ------------------
  359|  2.59k|    }
_ZNK12CTransaction10HasWitnessEv:
  373|  43.0k|    bool HasWitness() const { return m_has_witness; }
_ZNK19CMutableTransaction10HasWitnessEv:
  413|  1.47k|    {
  414|  3.80k|        for (size_t i = 0; i < vin.size(); i++) {
  ------------------
  |  Branch (414:28): [True: 3.78k, False: 19]
  ------------------
  415|  3.78k|            if (!vin[i].scriptWitness.IsNull()) {
  ------------------
  |  Branch (415:17): [True: 1.45k, False: 2.33k]
  ------------------
  416|  1.45k|                return true;
  417|  1.45k|            }
  418|  3.78k|        }
  419|     19|        return false;
  420|  1.47k|    }
_ZN7GenTxidC2EbRK7uint256:
  431|  1.80M|    GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {}
_ZN7GenTxid4TxidERK7uint256:
  434|  1.78M|    static GenTxid Txid(const uint256& hash) { return GenTxid{false, hash}; }
_ZN7GenTxid5WtxidERK7uint256:
  435|  15.4k|    static GenTxid Wtxid(const uint256& hash) { return GenTxid{true, hash}; }
_ZNK7GenTxid7IsWtxidEv:
  436|  7.10M|    bool IsWtxid() const { return m_is_wtxid; }
_ZNK7GenTxid7GetHashEv:
  437|  7.04M|    const uint256& GetHash() const LIFETIMEBOUND { return m_hash; }
_ZNK12CTransaction9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  328|  8.12k|    inline void Serialize(Stream& s) const {
  329|  8.12k|        SerializeTransaction(*this, s, s.template GetParams<TransactionSerParams>());
  330|  8.12k|    }
_Z20SerializeTransactionI12ParamsStreamIR12SizeComputer20TransactionSerParamsE12CTransactionEvRKT0_RT_RKS3_:
  257|  8.12k|{
  258|  8.12k|    const bool fAllowWitness = params.allow_witness;
  259|       |
  260|  8.12k|    s << tx.version;
  261|  8.12k|    unsigned char flags = 0;
  262|       |    // Consistency check
  263|  8.12k|    if (fAllowWitness) {
  ------------------
  |  Branch (263:9): [True: 2.19k, False: 5.93k]
  ------------------
  264|       |        /* Check whether witnesses need to be serialized. */
  265|  2.19k|        if (tx.HasWitness()) {
  ------------------
  |  Branch (265:13): [True: 517, False: 1.67k]
  ------------------
  266|    517|            flags |= 1;
  267|    517|        }
  268|  2.19k|    }
  269|  8.12k|    if (flags) {
  ------------------
  |  Branch (269:9): [True: 517, False: 7.60k]
  ------------------
  270|       |        /* Use extended format in case witnesses are to be serialized. */
  271|    517|        std::vector<CTxIn> vinDummy;
  272|    517|        s << vinDummy;
  273|    517|        s << flags;
  274|    517|    }
  275|  8.12k|    s << tx.vin;
  276|  8.12k|    s << tx.vout;
  277|  8.12k|    if (flags & 1) {
  ------------------
  |  Branch (277:9): [True: 517, False: 7.60k]
  ------------------
  278|  6.85k|        for (size_t i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (278:28): [True: 6.33k, False: 517]
  ------------------
  279|  6.33k|            s << tx.vin[i].scriptWitness.stack;
  280|  6.33k|        }
  281|    517|    }
  282|  8.12k|    s << tx.nLockTime;
  283|  8.12k|}
_ZN5CTxIn16SerializationOpsI12ParamsStreamIR12SizeComputer20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  129|  40.4k|    SERIALIZE_METHODS(CTxIn, obj) { READWRITE(obj.prevout, obj.scriptSig, obj.nSequence); }
  ------------------
  |  |  156|  40.4k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN9COutPoint16SerializationOpsI12ParamsStreamIR12SizeComputer20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   39|  40.4k|    SERIALIZE_METHODS(COutPoint, obj) { READWRITE(obj.hash, obj.n); }
  ------------------
  |  |  156|  40.4k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CTxOut16SerializationOpsI12ParamsStreamIR12SizeComputer20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  162|  16.5k|    SERIALIZE_METHODS(CTxOut, obj) { READWRITE(obj.nValue, obj.scriptPubKey); }
  ------------------
  |  |  156|  16.5k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN12CTransactionC2I12ParamsStreamIR10DataStream20TransactionSerParamsEEE16deserialize_typeRT_:
  337|  36.3k|    CTransaction(deserialize_type, Stream& s) : CTransaction(CMutableTransaction(deserialize, s)) {}
_ZN19CMutableTransactionC2I12ParamsStreamIR10DataStream20TransactionSerParamsEEE16deserialize_typeRT_:
  403|  36.3k|    CMutableTransaction(deserialize_type, Stream& s) {
  404|  36.3k|        Unserialize(s);
  405|  36.3k|    }
_ZN19CMutableTransaction11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  393|  36.3k|    inline void Unserialize(Stream& s) {
  394|  36.3k|        UnserializeTransaction(*this, s, s.template GetParams<TransactionSerParams>());
  395|  36.3k|    }
_Z22UnserializeTransactionI12ParamsStreamIR10DataStream20TransactionSerParamsE19CMutableTransactionEvRT0_RT_RKS3_:
  217|  36.3k|{
  218|  36.3k|    const bool fAllowWitness = params.allow_witness;
  219|       |
  220|  36.3k|    s >> tx.version;
  221|  36.3k|    unsigned char flags = 0;
  222|  36.3k|    tx.vin.clear();
  223|  36.3k|    tx.vout.clear();
  224|       |    /* Try to read the vin. In case the dummy is there, this will be read as an empty vector. */
  225|  36.3k|    s >> tx.vin;
  226|  36.3k|    if (tx.vin.size() == 0 && fAllowWitness) {
  ------------------
  |  Branch (226:9): [True: 27.3k, False: 9.02k]
  |  Branch (226:31): [True: 27.3k, False: 0]
  ------------------
  227|       |        /* We read a dummy or an empty vin. */
  228|  27.3k|        s >> flags;
  229|  27.3k|        if (flags != 0) {
  ------------------
  |  Branch (229:13): [True: 1.53k, False: 25.7k]
  ------------------
  230|  1.53k|            s >> tx.vin;
  231|  1.53k|            s >> tx.vout;
  232|  1.53k|        }
  233|  27.3k|    } else {
  234|       |        /* We read a non-empty vin. Assume a normal vout follows. */
  235|  9.02k|        s >> tx.vout;
  236|  9.02k|    }
  237|  36.3k|    if ((flags & 1) && fAllowWitness) {
  ------------------
  |  Branch (237:9): [True: 1.45k, False: 34.8k]
  |  Branch (237:24): [True: 1.45k, False: 0]
  ------------------
  238|       |        /* The witness flag is present, and we support witnesses. */
  239|  1.45k|        flags ^= 1;
  240|  16.1k|        for (size_t i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (240:28): [True: 14.7k, False: 1.45k]
  ------------------
  241|  14.7k|            s >> tx.vin[i].scriptWitness.stack;
  242|  14.7k|        }
  243|  1.45k|        if (!tx.HasWitness()) {
  ------------------
  |  Branch (243:13): [True: 19, False: 1.43k]
  ------------------
  244|       |            /* It's illegal to encode witnesses when all witness stacks are empty. */
  245|     19|            throw std::ios_base::failure("Superfluous witness record");
  246|     19|        }
  247|  1.45k|    }
  248|  36.3k|    if (flags) {
  ------------------
  |  Branch (248:9): [True: 8, False: 36.3k]
  ------------------
  249|       |        /* Unknown flag in the serialization */
  250|      8|        throw std::ios_base::failure("Unknown transaction optional data");
  251|      8|    }
  252|  36.3k|    s >> tx.nLockTime;
  253|  36.3k|}
_ZN5CTxIn16SerializationOpsI12ParamsStreamIR10DataStream20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
  129|  60.9k|    SERIALIZE_METHODS(CTxIn, obj) { READWRITE(obj.prevout, obj.scriptSig, obj.nSequence); }
  ------------------
  |  |  156|  60.9k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN9COutPoint16SerializationOpsI12ParamsStreamIR10DataStream20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
   39|  60.9k|    SERIALIZE_METHODS(COutPoint, obj) { READWRITE(obj.hash, obj.n); }
  ------------------
  |  |  156|  60.9k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CTxOut16SerializationOpsI12ParamsStreamIR10DataStream20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
  162|  23.5k|    SERIALIZE_METHODS(CTxOut, obj) { READWRITE(obj.nValue, obj.scriptPubKey); }
  ------------------
  |  |  156|  23.5k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CTxOut16SerializationOpsI12SizeComputerKS_15ActionSerializeEEvRT0_RT_T1_:
  162|    928|    SERIALIZE_METHODS(CTxOut, obj) { READWRITE(obj.nValue, obj.scriptPubKey); }
  ------------------
  |  |  156|    928|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZNK12CTransaction9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  328|  1.48k|    inline void Serialize(Stream& s) const {
  329|  1.48k|        SerializeTransaction(*this, s, s.template GetParams<TransactionSerParams>());
  330|  1.48k|    }
_Z20SerializeTransactionI12ParamsStreamIR12VectorWriter20TransactionSerParamsE12CTransactionEvRKT0_RT_RKS3_:
  257|  1.48k|{
  258|  1.48k|    const bool fAllowWitness = params.allow_witness;
  259|       |
  260|  1.48k|    s << tx.version;
  261|  1.48k|    unsigned char flags = 0;
  262|       |    // Consistency check
  263|  1.48k|    if (fAllowWitness) {
  ------------------
  |  Branch (263:9): [True: 57, False: 1.43k]
  ------------------
  264|       |        /* Check whether witnesses need to be serialized. */
  265|     57|        if (tx.HasWitness()) {
  ------------------
  |  Branch (265:13): [True: 22, False: 35]
  ------------------
  266|     22|            flags |= 1;
  267|     22|        }
  268|     57|    }
  269|  1.48k|    if (flags) {
  ------------------
  |  Branch (269:9): [True: 22, False: 1.46k]
  ------------------
  270|       |        /* Use extended format in case witnesses are to be serialized. */
  271|     22|        std::vector<CTxIn> vinDummy;
  272|     22|        s << vinDummy;
  273|     22|        s << flags;
  274|     22|    }
  275|  1.48k|    s << tx.vin;
  276|  1.48k|    s << tx.vout;
  277|  1.48k|    if (flags & 1) {
  ------------------
  |  Branch (277:9): [True: 22, False: 1.46k]
  ------------------
  278|     44|        for (size_t i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (278:28): [True: 22, False: 22]
  ------------------
  279|     22|            s << tx.vin[i].scriptWitness.stack;
  280|     22|        }
  281|     22|    }
  282|  1.48k|    s << tx.nLockTime;
  283|  1.48k|}
_ZN5CTxIn16SerializationOpsI12ParamsStreamIR12VectorWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  129|  1.48k|    SERIALIZE_METHODS(CTxIn, obj) { READWRITE(obj.prevout, obj.scriptSig, obj.nSequence); }
  ------------------
  |  |  156|  1.48k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN9COutPoint16SerializationOpsI12ParamsStreamIR12VectorWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   39|  1.48k|    SERIALIZE_METHODS(COutPoint, obj) { READWRITE(obj.hash, obj.n); }
  ------------------
  |  |  156|  1.48k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CTxOut16SerializationOpsI12ParamsStreamIR12VectorWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  162|  1.54k|    SERIALIZE_METHODS(CTxOut, obj) { READWRITE(obj.nValue, obj.scriptPubKey); }
  ------------------
  |  |  156|  1.54k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN12CTransactionC2I12ParamsStreamIR8AutoFile20TransactionSerParamsEEE16deserialize_typeRT_:
  337|  1.53k|    CTransaction(deserialize_type, Stream& s) : CTransaction(CMutableTransaction(deserialize, s)) {}
_ZN19CMutableTransactionC2I12ParamsStreamIR8AutoFile20TransactionSerParamsEEE16deserialize_typeRT_:
  403|  1.53k|    CMutableTransaction(deserialize_type, Stream& s) {
  404|  1.53k|        Unserialize(s);
  405|  1.53k|    }
_ZN19CMutableTransaction11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  393|  1.53k|    inline void Unserialize(Stream& s) {
  394|  1.53k|        UnserializeTransaction(*this, s, s.template GetParams<TransactionSerParams>());
  395|  1.53k|    }
_Z22UnserializeTransactionI12ParamsStreamIR8AutoFile20TransactionSerParamsE19CMutableTransactionEvRT0_RT_RKS3_:
  217|  1.53k|{
  218|  1.53k|    const bool fAllowWitness = params.allow_witness;
  219|       |
  220|  1.53k|    s >> tx.version;
  221|  1.53k|    unsigned char flags = 0;
  222|  1.53k|    tx.vin.clear();
  223|  1.53k|    tx.vout.clear();
  224|       |    /* Try to read the vin. In case the dummy is there, this will be read as an empty vector. */
  225|  1.53k|    s >> tx.vin;
  226|  1.53k|    if (tx.vin.size() == 0 && fAllowWitness) {
  ------------------
  |  Branch (226:9): [True: 77, False: 1.45k]
  |  Branch (226:31): [True: 77, False: 0]
  ------------------
  227|       |        /* We read a dummy or an empty vin. */
  228|     77|        s >> flags;
  229|     77|        if (flags != 0) {
  ------------------
  |  Branch (229:13): [True: 77, False: 0]
  ------------------
  230|     77|            s >> tx.vin;
  231|     77|            s >> tx.vout;
  232|     77|        }
  233|  1.45k|    } else {
  234|       |        /* We read a non-empty vin. Assume a normal vout follows. */
  235|  1.45k|        s >> tx.vout;
  236|  1.45k|    }
  237|  1.53k|    if ((flags & 1) && fAllowWitness) {
  ------------------
  |  Branch (237:9): [True: 77, False: 1.45k]
  |  Branch (237:24): [True: 77, False: 0]
  ------------------
  238|       |        /* The witness flag is present, and we support witnesses. */
  239|     77|        flags ^= 1;
  240|    154|        for (size_t i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (240:28): [True: 77, False: 77]
  ------------------
  241|     77|            s >> tx.vin[i].scriptWitness.stack;
  242|     77|        }
  243|     77|        if (!tx.HasWitness()) {
  ------------------
  |  Branch (243:13): [True: 0, False: 77]
  ------------------
  244|       |            /* It's illegal to encode witnesses when all witness stacks are empty. */
  245|      0|            throw std::ios_base::failure("Superfluous witness record");
  246|      0|        }
  247|     77|    }
  248|  1.53k|    if (flags) {
  ------------------
  |  Branch (248:9): [True: 0, False: 1.53k]
  ------------------
  249|       |        /* Unknown flag in the serialization */
  250|      0|        throw std::ios_base::failure("Unknown transaction optional data");
  251|      0|    }
  252|  1.53k|    s >> tx.nLockTime;
  253|  1.53k|}
_ZN5CTxIn16SerializationOpsI12ParamsStreamIR8AutoFile20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
  129|  1.53k|    SERIALIZE_METHODS(CTxIn, obj) { READWRITE(obj.prevout, obj.scriptSig, obj.nSequence); }
  ------------------
  |  |  156|  1.53k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN9COutPoint16SerializationOpsI12ParamsStreamIR8AutoFile20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
   39|  1.53k|    SERIALIZE_METHODS(COutPoint, obj) { READWRITE(obj.hash, obj.n); }
  ------------------
  |  |  156|  1.53k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CTxOut16SerializationOpsI12ParamsStreamIR8AutoFile20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
  162|  1.60k|    SERIALIZE_METHODS(CTxOut, obj) { READWRITE(obj.nValue, obj.scriptPubKey); }
  ------------------
  |  |  156|  1.60k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN5CTxIn16SerializationOpsI12ParamsStreamIR10HashWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  129|  74.3k|    SERIALIZE_METHODS(CTxIn, obj) { READWRITE(obj.prevout, obj.scriptSig, obj.nSequence); }
  ------------------
  |  |  156|  74.3k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN9COutPoint16SerializationOpsI12ParamsStreamIR10HashWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
   39|  74.3k|    SERIALIZE_METHODS(COutPoint, obj) { READWRITE(obj.hash, obj.n); }
  ------------------
  |  |  156|  74.3k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN6CTxOut16SerializationOpsI12ParamsStreamIR10HashWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  162|  27.7k|    SERIALIZE_METHODS(CTxOut, obj) { READWRITE(obj.nValue, obj.scriptPubKey); }
  ------------------
  |  |  156|  27.7k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZNK12CTransaction9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  328|  38.8k|    inline void Serialize(Stream& s) const {
  329|  38.8k|        SerializeTransaction(*this, s, s.template GetParams<TransactionSerParams>());
  330|  38.8k|    }
_Z20SerializeTransactionI12ParamsStreamIR10HashWriter20TransactionSerParamsE12CTransactionEvRKT0_RT_RKS3_:
  257|  38.8k|{
  258|  38.8k|    const bool fAllowWitness = params.allow_witness;
  259|       |
  260|  38.8k|    s << tx.version;
  261|  38.8k|    unsigned char flags = 0;
  262|       |    // Consistency check
  263|  38.8k|    if (fAllowWitness) {
  ------------------
  |  Branch (263:9): [True: 1.44k, False: 37.3k]
  ------------------
  264|       |        /* Check whether witnesses need to be serialized. */
  265|  1.44k|        if (tx.HasWitness()) {
  ------------------
  |  Branch (265:13): [True: 1.44k, False: 0]
  ------------------
  266|  1.44k|            flags |= 1;
  267|  1.44k|        }
  268|  1.44k|    }
  269|  38.8k|    if (flags) {
  ------------------
  |  Branch (269:9): [True: 1.44k, False: 37.3k]
  ------------------
  270|       |        /* Use extended format in case witnesses are to be serialized. */
  271|  1.44k|        std::vector<CTxIn> vinDummy;
  272|  1.44k|        s << vinDummy;
  273|  1.44k|        s << flags;
  274|  1.44k|    }
  275|  38.8k|    s << tx.vin;
  276|  38.8k|    s << tx.vout;
  277|  38.8k|    if (flags & 1) {
  ------------------
  |  Branch (277:9): [True: 1.44k, False: 37.3k]
  ------------------
  278|  15.6k|        for (size_t i = 0; i < tx.vin.size(); i++) {
  ------------------
  |  Branch (278:28): [True: 14.1k, False: 1.44k]
  ------------------
  279|  14.1k|            s << tx.vin[i].scriptWitness.stack;
  280|  14.1k|        }
  281|  1.44k|    }
  282|  38.8k|    s << tx.nLockTime;
  283|  38.8k|}

_ZN14CMessageHeaderC2ERKNSt3__15arrayIhLm4EEEPKcj:
   11|  66.2k|    : pchMessageStart{pchMessageStartIn}
   12|  66.2k|{
   13|       |    // Copy the message type name
   14|  66.2k|    size_t i = 0;
   15|   547k|    for (; i < MESSAGE_TYPE_SIZE && msg_type[i] != 0; ++i) m_msg_type[i] = msg_type[i];
  ------------------
  |  Branch (15:12): [True: 547k, False: 206]
  |  Branch (15:37): [True: 481k, False: 66.0k]
  ------------------
   16|  66.2k|    assert(msg_type[i] == 0); // Assert that the message type name passed in is not longer than MESSAGE_TYPE_SIZE
   17|       |
   18|  66.2k|    nMessageSize = nMessageSizeIn;
   19|  66.2k|}
_ZNK14CMessageHeader14GetMessageTypeEv:
   22|  24.5k|{
   23|  24.5k|    return std::string(m_msg_type, m_msg_type + strnlen(m_msg_type, MESSAGE_TYPE_SIZE));
   24|  24.5k|}
_ZNK14CMessageHeader18IsMessageTypeValidEv:
   27|  24.5k|{
   28|       |    // Check the message type string for errors
   29|   196k|    for (const char* p1 = m_msg_type; p1 < m_msg_type + MESSAGE_TYPE_SIZE; ++p1) {
  ------------------
  |  Branch (29:39): [True: 172k, False: 24.1k]
  ------------------
   30|   172k|        if (*p1 == 0) {
  ------------------
  |  Branch (30:13): [True: 24.1k, False: 148k]
  ------------------
   31|       |            // Must be all zeros after the first zero
   32|   167k|            for (; p1 < m_msg_type + MESSAGE_TYPE_SIZE; ++p1) {
  ------------------
  |  Branch (32:20): [True: 143k, False: 24.1k]
  ------------------
   33|   143k|                if (*p1 != 0) {
  ------------------
  |  Branch (33:21): [True: 0, False: 143k]
  ------------------
   34|      0|                    return false;
   35|      0|                }
   36|   143k|            }
   37|   148k|        } else if (*p1 < ' ' || *p1 > 0x7E) {
  ------------------
  |  Branch (37:20): [True: 312, False: 148k]
  |  Branch (37:33): [True: 7, False: 148k]
  ------------------
   38|    319|            return false;
   39|    319|        }
   40|   172k|    }
   41|       |
   42|  24.1k|    return true;
   43|  24.5k|}
_ZN4CInvC2Ev:
   46|  2.94M|{
   47|  2.94M|    type = 0;
   48|  2.94M|    hash.SetNull();
   49|  2.94M|}
_ZN4CInvC2EjRK7uint256:
   51|   845k|CInv::CInv(uint32_t typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) {}
_Z9ToGenTxidRK4CInv:
  122|   950k|{
  123|   950k|    assert(inv.IsGenTxMsg());
  124|   950k|    return inv.IsMsgWtx() ? GenTxid::Wtxid(inv.hash) : GenTxid::Txid(inv.hash);
  ------------------
  |  Branch (124:12): [True: 13.4k, False: 937k]
  ------------------
  125|   950k|}

_ZN8CAddressC2Ev:
  396|   338k|    CAddress() : CService{} {};
_ZN8CAddressC2E8CService12ServiceFlagsNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEE:
  398|  16.9k|    CAddress(CService ipIn, ServiceFlags nServicesIn, NodeSeconds time) : CService{ipIn}, nTime{time}, nServices{nServicesIn} {};
_ZNK4CInv8IsMsgBlkEv:
  508|  2.31M|    bool IsMsgBlk() const { return type == MSG_BLOCK; }
_ZNK4CInv8IsMsgWtxEv:
  509|  3.38M|    bool IsMsgWtx() const { return type == MSG_WTX; }
_ZNK4CInv16IsMsgFilteredBlkEv:
  510|     83|    bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
_ZNK4CInv13IsMsgCmpctBlkEv:
  511|     56|    bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
_ZNK4CInv15IsMsgWitnessBlkEv:
  512|  1.66k|    bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }
_ZNK4CInv10IsGenTxMsgEv:
  516|  3.73M|    {
  517|  3.73M|        return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
  ------------------
  |  Branch (517:16): [True: 1.87M, False: 1.86M]
  |  Branch (517:34): [True: 27.3k, False: 1.84M]
  |  Branch (517:53): [True: 3.60k, False: 1.83M]
  ------------------
  518|  3.73M|    }
_ZNK4CInv11IsGenBlkMsgEv:
  520|   430k|    {
  521|   430k|        return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
  ------------------
  |  Branch (521:16): [True: 3.23k, False: 427k]
  |  Branch (521:37): [True: 1.36k, False: 425k]
  |  Branch (521:67): [True: 4.20k, False: 421k]
  |  Branch (521:94): [True: 77, False: 421k]
  ------------------
  522|   430k|    }
_ZN14CMessageHeaderC2Ev:
   38|  8.47k|    explicit CMessageHeader() = default;
_ZN8CAddress16SerializationOpsI12ParamsStreamIR10DataStreamNS_9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_:
  414|   299k|    {
  415|   299k|        bool use_v2;
  416|   299k|        auto& params = SER_PARAMS(SerParams);
  ------------------
  |  |  217|   299k|#define SER_PARAMS(type) (s.template GetParams<type>())
  ------------------
  417|   299k|        if (params.fmt == Format::Disk) {
  ------------------
  |  Branch (417:13): [True: 0, False: 299k]
  ------------------
  418|       |            // In the disk serialization format, the encoding (v1 or v2) is determined by a flag version
  419|       |            // that's part of the serialization itself. ADDRV2_FORMAT in the stream version only determines
  420|       |            // whether V2 is chosen/permitted at all.
  421|      0|            uint32_t stored_format_version = DISK_VERSION_INIT;
  422|      0|            if (params.enc == Encoding::V2) stored_format_version |= DISK_VERSION_ADDRV2;
  ------------------
  |  Branch (422:17): [True: 0, False: 0]
  ------------------
  423|      0|            READWRITE(stored_format_version);
  ------------------
  |  |  156|      0|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  424|      0|            stored_format_version &= ~DISK_VERSION_IGNORE_MASK; // ignore low bits
  425|      0|            if (stored_format_version == 0) {
  ------------------
  |  Branch (425:17): [True: 0, False: 0]
  ------------------
  426|      0|                use_v2 = false;
  427|      0|            } else if (stored_format_version == DISK_VERSION_ADDRV2 && params.enc == Encoding::V2) {
  ------------------
  |  Branch (427:24): [True: 0, False: 0]
  |  Branch (427:72): [True: 0, False: 0]
  ------------------
  428|       |                // Only support v2 deserialization if V2 is set.
  429|      0|                use_v2 = true;
  430|      0|            } else {
  431|      0|                throw std::ios_base::failure("Unsupported CAddress disk format version");
  432|      0|            }
  433|   299k|        } else {
  434|   299k|            assert(params.fmt == Format::Network);
  435|       |            // In the network serialization format, the encoding (v1 or v2) is determined directly by
  436|       |            // the value of enc in the stream params, as no explicitly encoded version
  437|       |            // exists in the stream.
  438|   299k|            use_v2 = params.enc == Encoding::V2;
  439|   299k|        }
  440|       |
  441|   299k|        READWRITE(Using<LossyChronoFormatter<uint32_t>>(obj.nTime));
  ------------------
  |  |  156|   299k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  442|       |        // nServices is serialized as CompactSize in V2; as uint64_t in V1.
  443|   299k|        if (use_v2) {
  ------------------
  |  Branch (443:13): [True: 194k, False: 105k]
  ------------------
  444|   194k|            uint64_t services_tmp;
  445|   194k|            SER_WRITE(obj, services_tmp = obj.nServices);
  ------------------
  |  |  158|   194k|#define SER_WRITE(obj, code) ser_action.SerWrite(s, obj, [&](Stream& s, const Type& obj) { code; })
  ------------------
  446|   194k|            READWRITE(Using<CompactSizeFormatter<false>>(services_tmp));
  ------------------
  |  |  156|   194k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  447|   194k|            SER_READ(obj, obj.nServices = static_cast<ServiceFlags>(services_tmp));
  ------------------
  |  |  157|   194k|#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, typename std::remove_const<Type>::type& obj) { code; })
  ------------------
  448|   194k|        } else {
  449|   105k|            READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));
  ------------------
  |  |  156|   105k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  450|   105k|        }
  451|       |        // Invoke V1/V2 serializer for CService parent object.
  452|   299k|        const auto ser_params{use_v2 ? CNetAddr::V2 : CNetAddr::V1};
  ------------------
  |  Branch (452:31): [True: 194k, False: 105k]
  ------------------
  453|   299k|        READWRITE(ser_params(AsBase<CService>(obj)));
  ------------------
  |  |  156|   299k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  454|   299k|    }
_ZN14CMessageHeader16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   48|  24.5k|    SERIALIZE_METHODS(CMessageHeader, obj) { READWRITE(obj.pchMessageStart, obj.m_msg_type, obj.nMessageSize, obj.pchChecksum); }
  ------------------
  |  |  156|  24.5k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN4CInv16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
  499|  2.94M|    SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
  ------------------
  |  |  156|  2.94M|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN14CMessageHeader16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
   48|  66.2k|    SERIALIZE_METHODS(CMessageHeader, obj) { READWRITE(obj.pchMessageStart, obj.m_msg_type, obj.nMessageSize, obj.pchChecksum); }
  ------------------
  |  |  156|  66.2k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN4CInv16SerializationOpsI12VectorWriterKS_15ActionSerializeEEvRT0_RT_T1_:
  499|   889k|    SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
  ------------------
  |  |  156|   889k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
net_processing.cpp:_ZL22MayHaveUsefulAddressDB12ServiceFlags:
  361|   111k|{
  362|   111k|    return (services & NODE_NETWORK) || (services & NODE_NETWORK_LIMITED);
  ------------------
  |  Branch (362:12): [True: 57.6k, False: 53.6k]
  |  Branch (362:41): [True: 15.0k, False: 38.6k]
  ------------------
  363|   111k|}
_ZN8CAddress16SerializationOpsI12ParamsStreamIR12VectorWriterNS_9SerParamsEEKS_15ActionSerializeEEvRT0_RT_T1_:
  414|  5.29k|    {
  415|  5.29k|        bool use_v2;
  416|  5.29k|        auto& params = SER_PARAMS(SerParams);
  ------------------
  |  |  217|  5.29k|#define SER_PARAMS(type) (s.template GetParams<type>())
  ------------------
  417|  5.29k|        if (params.fmt == Format::Disk) {
  ------------------
  |  Branch (417:13): [True: 0, False: 5.29k]
  ------------------
  418|       |            // In the disk serialization format, the encoding (v1 or v2) is determined by a flag version
  419|       |            // that's part of the serialization itself. ADDRV2_FORMAT in the stream version only determines
  420|       |            // whether V2 is chosen/permitted at all.
  421|      0|            uint32_t stored_format_version = DISK_VERSION_INIT;
  422|      0|            if (params.enc == Encoding::V2) stored_format_version |= DISK_VERSION_ADDRV2;
  ------------------
  |  Branch (422:17): [True: 0, False: 0]
  ------------------
  423|      0|            READWRITE(stored_format_version);
  ------------------
  |  |  156|      0|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  424|      0|            stored_format_version &= ~DISK_VERSION_IGNORE_MASK; // ignore low bits
  425|      0|            if (stored_format_version == 0) {
  ------------------
  |  Branch (425:17): [True: 0, False: 0]
  ------------------
  426|      0|                use_v2 = false;
  427|      0|            } else if (stored_format_version == DISK_VERSION_ADDRV2 && params.enc == Encoding::V2) {
  ------------------
  |  Branch (427:24): [True: 0, False: 0]
  |  Branch (427:72): [True: 0, False: 0]
  ------------------
  428|       |                // Only support v2 deserialization if V2 is set.
  429|      0|                use_v2 = true;
  430|      0|            } else {
  431|      0|                throw std::ios_base::failure("Unsupported CAddress disk format version");
  432|      0|            }
  433|  5.29k|        } else {
  434|  5.29k|            assert(params.fmt == Format::Network);
  435|       |            // In the network serialization format, the encoding (v1 or v2) is determined directly by
  436|       |            // the value of enc in the stream params, as no explicitly encoded version
  437|       |            // exists in the stream.
  438|  5.29k|            use_v2 = params.enc == Encoding::V2;
  439|  5.29k|        }
  440|       |
  441|  5.29k|        READWRITE(Using<LossyChronoFormatter<uint32_t>>(obj.nTime));
  ------------------
  |  |  156|  5.29k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  442|       |        // nServices is serialized as CompactSize in V2; as uint64_t in V1.
  443|  5.29k|        if (use_v2) {
  ------------------
  |  Branch (443:13): [True: 0, False: 5.29k]
  ------------------
  444|      0|            uint64_t services_tmp;
  445|      0|            SER_WRITE(obj, services_tmp = obj.nServices);
  ------------------
  |  |  158|      0|#define SER_WRITE(obj, code) ser_action.SerWrite(s, obj, [&](Stream& s, const Type& obj) { code; })
  ------------------
  446|      0|            READWRITE(Using<CompactSizeFormatter<false>>(services_tmp));
  ------------------
  |  |  156|      0|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  447|      0|            SER_READ(obj, obj.nServices = static_cast<ServiceFlags>(services_tmp));
  ------------------
  |  |  157|      0|#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, typename std::remove_const<Type>::type& obj) { code; })
  ------------------
  448|  5.29k|        } else {
  449|  5.29k|            READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));
  ------------------
  |  |  156|  5.29k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  450|  5.29k|        }
  451|       |        // Invoke V1/V2 serializer for CService parent object.
  452|  5.29k|        const auto ser_params{use_v2 ? CNetAddr::V2 : CNetAddr::V1};
  ------------------
  |  Branch (452:31): [True: 0, False: 5.29k]
  ------------------
  453|  5.29k|        READWRITE(ser_params(AsBase<CService>(obj)));
  ------------------
  |  |  156|  5.29k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
  454|  5.29k|    }

_ZN7CPubKey6GetLenEh:
   61|     70|    {
   62|     70|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (62:13): [True: 17, False: 53]
  |  Branch (62:30): [True: 15, False: 38]
  ------------------
   63|     32|            return COMPRESSED_SIZE;
   64|     38|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (64:13): [True: 3, False: 35]
  |  Branch (64:30): [True: 3, False: 32]
  |  Branch (64:47): [True: 5, False: 27]
  ------------------
   65|     11|            return SIZE;
   66|     27|        return 0;
   67|     38|    }
_ZN7CPubKey9ValidSizeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
   77|     76|    bool static ValidSize(const std::vector<unsigned char> &vch) {
   78|     76|      return vch.size() > 0 && GetLen(vch[0]) == vch.size();
  ------------------
  |  Branch (78:14): [True: 70, False: 6]
  |  Branch (78:32): [True: 26, False: 44]
  ------------------
   79|     76|    }

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

_ZN11RandomMixinI17FastRandomContextE9randrangeITkNSt3__18integralEiEET_S4_:
  255|  19.6k|    {
  256|  19.6k|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  257|  19.6k|        Assume(range > 0);
  ------------------
  |  |   97|  19.6k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  258|  19.6k|        uint64_t maxval = range - 1U;
  259|  19.6k|        int bits = std::bit_width(maxval);
  260|  19.6k|        while (true) {
  ------------------
  |  Branch (260:16): [Folded - Ignored]
  ------------------
  261|  19.6k|            uint64_t ret = Impl().randbits(bits);
  262|  19.6k|            if (ret <= maxval) return ret;
  ------------------
  |  Branch (262:17): [True: 19.6k, False: 0]
  ------------------
  263|  19.6k|        }
  264|  19.6k|    }
_ZN11RandomMixinI17FastRandomContextE4ImplEv:
  185|   952k|    RandomNumberGenerator auto& Impl() noexcept { return static_cast<T&>(*this); }
_ZN11RandomMixinI17FastRandomContextE8randbitsEi:
  205|   643k|    {
  206|   643k|        Assume(bits <= 64);
  ------------------
  |  |   97|   643k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  207|       |        // Requests for the full 64 bits are passed through.
  208|   643k|        if (bits == 64) return Impl().rand64();
  ------------------
  |  Branch (208:13): [True: 0, False: 643k]
  ------------------
  209|   643k|        uint64_t ret;
  210|   643k|        if (bits <= bitbuf_size) {
  ------------------
  |  Branch (210:13): [True: 526k, False: 116k]
  ------------------
  211|       |            // If there is enough entropy left in bitbuf, return its bottom bits bits.
  212|   526k|            ret = bitbuf;
  213|   526k|            bitbuf >>= bits;
  214|   526k|            bitbuf_size -= bits;
  215|   526k|        } 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|   116k|            uint64_t gen = Impl().rand64();
  220|   116k|            ret = (gen << bitbuf_size) | bitbuf;
  221|   116k|            bitbuf = gen >> (bits - bitbuf_size);
  222|   116k|            bitbuf_size = 64 + bitbuf_size - bits;
  223|   116k|        }
  224|       |        // Return the bottom bits bits of ret.
  225|   643k|        return ret & ((uint64_t{1} << bits) - 1);
  226|   643k|    }
_ZN17FastRandomContext6rand64Ev:
  396|   321k|    {
  397|   321k|        if (requires_seed) RandomSeed();
  ------------------
  |  Branch (397:13): [True: 32.6k, False: 288k]
  ------------------
  398|   321k|        std::array<std::byte, 8> buf;
  399|   321k|        rng.Keystream(buf);
  400|   321k|        return ReadLE64(buf.data());
  401|   321k|    }
_Z11GetRandHashv:
  455|  32.6k|{
  456|  32.6k|    uint256 hash;
  457|  32.6k|    GetRandBytes(hash);
  458|  32.6k|    return hash;
  459|  32.6k|}
_ZN11RandomMixinI17FastRandomContextEclEv:
  367|   157k|    inline uint64_t operator()() noexcept { return Impl().rand64(); }
_ZN11RandomMixinI17FastRandomContextE9randrangeITkNSt3__18integralEmEET_S4_:
  255|   435k|    {
  256|   435k|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  257|   435k|        Assume(range > 0);
  ------------------
  |  |   97|   435k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  258|   435k|        uint64_t maxval = range - 1U;
  259|   435k|        int bits = std::bit_width(maxval);
  260|   622k|        while (true) {
  ------------------
  |  Branch (260:16): [Folded - Ignored]
  ------------------
  261|   622k|            uint64_t ret = Impl().randbits(bits);
  262|   622k|            if (ret <= maxval) return ret;
  ------------------
  |  Branch (262:17): [True: 435k, False: 186k]
  ------------------
  263|   622k|        }
  264|   435k|    }
_ZN11RandomMixinI17FastRandomContextE8randbitsILi32EEEmv:
  231|  9.94k|    {
  232|  9.94k|        static_assert(Bits >= 0 && Bits <= 64);
  233|       |        if constexpr (Bits == 64) {
  234|       |            return Impl().rand64();
  235|  9.94k|        } else {
  236|  9.94k|            uint64_t ret;
  237|  9.94k|            if (Bits <= bitbuf_size) {
  ------------------
  |  Branch (237:17): [True: 0, False: 9.94k]
  ------------------
  238|      0|                ret = bitbuf;
  239|      0|                bitbuf >>= Bits;
  240|      0|                bitbuf_size -= Bits;
  241|  9.94k|            } else {
  242|  9.94k|                uint64_t gen = Impl().rand64();
  243|  9.94k|                ret = (gen << bitbuf_size) | bitbuf;
  244|  9.94k|                bitbuf = gen >> (Bits - bitbuf_size);
  245|  9.94k|                bitbuf_size = 64 + bitbuf_size - Bits;
  246|  9.94k|            }
  247|  9.94k|            constexpr uint64_t MASK = (uint64_t{1} << Bits) - 1;
  248|  9.94k|            return ret & MASK;
  249|  9.94k|        }
  250|  9.94k|    }
_ZN11RandomMixinI17FastRandomContextE4randITkNSt3__18integralEjEET_v:
  288|  9.94k|    {
  289|  9.94k|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  290|  9.94k|        static constexpr auto BITS = std::bit_width(uint64_t(std::numeric_limits<I>::max()));
  291|  9.94k|        static_assert(std::numeric_limits<I>::max() == std::numeric_limits<uint64_t>::max() >> (64 - BITS));
  292|  9.94k|        return I(Impl().template randbits<BITS>());
  293|  9.94k|    }
_ZN11RandomMixinI17FastRandomContextEC2Ev:
  195|  36.7k|    constexpr RandomMixin() noexcept = default;
_ZN11RandomMixinI17FastRandomContextE9randrangeITkNSt3__18integralExEET_S4_:
  255|    784|    {
  256|    784|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max());
  257|    784|        Assume(range > 0);
  ------------------
  |  |   97|    784|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  258|    784|        uint64_t maxval = range - 1U;
  259|    784|        int bits = std::bit_width(maxval);
  260|  1.34k|        while (true) {
  ------------------
  |  Branch (260:16): [Folded - Ignored]
  ------------------
  261|  1.34k|            uint64_t ret = Impl().randbits(bits);
  262|  1.34k|            if (ret <= maxval) return ret;
  ------------------
  |  Branch (262:17): [True: 784, False: 562]
  ------------------
  263|  1.34k|        }
  264|    784|    }
_ZN11RandomMixinI17FastRandomContextE17rand_exp_durationENSt3__16chrono8durationIxNS2_5ratioILl1ELl1000000EEEEE:
  357|  15.0k|    {
  358|  15.0k|        using namespace std::chrono_literals;
  359|  15.0k|        auto unscaled = MakeExponentiallyDistributed(Impl().rand64());
  360|  15.0k|        return std::chrono::duration_cast<std::chrono::microseconds>(unscaled * mean + 0.5us);
  361|  15.0k|    }
_ZN11RandomMixinI17FastRandomContextE9randrangeITk17StdChronoDurationNSt3__16chrono8durationIxNS3_5ratioILl1ELl1000000EEEEEEET_NS3_11common_typeIJS9_EE4typeE:
  342|    784|    {
  343|    784|        return Dur{Impl().randrange(range.count())};
  344|    784|    }

_ZN10CSchedulerD2Ev:
   17|      2|{
   18|      2|    assert(nThreadsServicingQueue == 0);
   19|      2|    if (stopWhenEmpty) assert(taskQueue.empty());
  ------------------
  |  Branch (19:9): [True: 0, False: 2]
  ------------------
   20|      2|}
_ZN10CScheduler12serviceQueueEv:
   24|      0|{
   25|      0|    WAIT_LOCK(newTaskMutex, lock);
  ------------------
  |  |  262|      0|#define WAIT_LOCK(cs, name) UniqueLock name(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|  8.47k|    while (!shouldStop()) {
  ------------------
  |  Branch (31:12): [True: 8.47k, False: 2]
  ------------------
   32|  8.47k|        try {
   33|  16.9k|            while (!shouldStop() && taskQueue.empty()) {
  ------------------
  |  Branch (33:20): [True: 16.9k, False: 0]
  |  Branch (33:37): [True: 8.47k, False: 8.47k]
  ------------------
   34|       |                // Wait until there is something to do.
   35|  8.47k|                newTaskScheduled.wait(lock);
   36|  8.47k|            }
   37|       |
   38|       |            // Wait until either there is a new task, or until
   39|       |            // the time of the first item on the queue:
   40|       |
   41|  8.47k|            while (!shouldStop() && !taskQueue.empty()) {
  ------------------
  |  Branch (41:20): [True: 8.47k, False: 0]
  |  Branch (41:37): [True: 8.47k, False: 0]
  ------------------
   42|  8.47k|                std::chrono::steady_clock::time_point timeToWaitFor = taskQueue.begin()->first;
   43|  8.47k|                if (newTaskScheduled.wait_until(lock, timeToWaitFor) == std::cv_status::timeout) {
  ------------------
  |  Branch (43:21): [True: 8.47k, False: 0]
  ------------------
   44|  8.47k|                    break; // Exit loop after timeout, it means we reached the time of the event
   45|  8.47k|                }
   46|  8.47k|            }
   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|  8.47k|            if (shouldStop() || taskQueue.empty())
  ------------------
  |  Branch (50:17): [True: 0, False: 8.47k]
  |  Branch (50:33): [True: 0, False: 8.47k]
  ------------------
   51|      2|                continue;
   52|       |
   53|  8.47k|            Function f = taskQueue.begin()->second;
   54|  8.47k|            taskQueue.erase(taskQueue.begin());
   55|       |
   56|  8.47k|            {
   57|       |                // Unlock before calling f, so it can reschedule itself or another task
   58|       |                // without deadlocking:
   59|  8.47k|                REVERSE_LOCK(lock);
  ------------------
  |  |  243|  8.47k|#define REVERSE_LOCK(g) typename std::decay<decltype(g)>::type::reverse_lock UNIQUE_NAME(revlock)(g, #g, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|  8.47k|                f();
   61|  8.47k|            }
   62|  8.47k|        } catch (...) {
   63|      0|            --nThreadsServicingQueue;
   64|      0|            throw;
   65|      0|        }
   66|  8.47k|    }
   67|      2|    --nThreadsServicingQueue;
   68|      2|    newTaskScheduled.notify_one();
   69|      2|}
_ZN10CScheduler8scheduleENSt3__18functionIFvvEEENS0_6chrono10time_pointINS4_12steady_clockENS4_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
   72|  8.47k|{
   73|  8.47k|    {
   74|  8.47k|        LOCK(newTaskMutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   75|  8.47k|        taskQueue.insert(std::make_pair(t, f));
   76|  8.47k|    }
   77|  8.47k|    newTaskScheduled.notify_one();
   78|  8.47k|}
_ZNK10CScheduler24AreThreadsServicingQueueEv:
  126|      2|{
  127|      2|    LOCK(newTaskMutex);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|      2|    return nThreadsServicingQueue;
  129|      2|}
_ZN16SerialTaskRunner25MaybeScheduleProcessQueueEv:
  133|  16.9k|{
  134|  16.9k|    {
  135|  16.9k|        LOCK(m_callbacks_mutex);
  ------------------
  |  |  257|  16.9k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  16.9k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  16.9k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  16.9k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|       |        // Try to avoid scheduling too many copies here, but if we
  137|       |        // accidentally have two ProcessQueue's scheduled at once its
  138|       |        // not a big deal.
  139|  16.9k|        if (m_are_callbacks_running) return;
  ------------------
  |  Branch (139:13): [True: 0, False: 16.9k]
  ------------------
  140|  16.9k|        if (m_callbacks_pending.empty()) return;
  ------------------
  |  Branch (140:13): [True: 8.47k, False: 8.47k]
  ------------------
  141|  16.9k|    }
  142|  8.47k|    m_scheduler.schedule([this] { this->ProcessQueue(); }, std::chrono::steady_clock::now());
  143|  8.47k|}
_ZN16SerialTaskRunner12ProcessQueueEv:
  146|  8.47k|{
  147|  8.47k|    std::function<void()> callback;
  148|  8.47k|    {
  149|  8.47k|        LOCK(m_callbacks_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|  8.47k|        if (m_are_callbacks_running) return;
  ------------------
  |  Branch (150:13): [True: 0, False: 8.47k]
  ------------------
  151|  8.47k|        if (m_callbacks_pending.empty()) return;
  ------------------
  |  Branch (151:13): [True: 2, False: 8.47k]
  ------------------
  152|  8.47k|        m_are_callbacks_running = true;
  153|       |
  154|  8.47k|        callback = std::move(m_callbacks_pending.front());
  155|  8.47k|        m_callbacks_pending.pop_front();
  156|  8.47k|    }
  157|       |
  158|       |    // RAII the setting of fCallbacksRunning and calling MaybeScheduleProcessQueue
  159|       |    // to ensure both happen safely even if callback() throws.
  160|      0|    struct RAIICallbacksRunning {
  161|  8.47k|        SerialTaskRunner* instance;
  162|  8.47k|        explicit RAIICallbacksRunning(SerialTaskRunner* _instance) : instance(_instance) {}
  163|  8.47k|        ~RAIICallbacksRunning()
  164|  8.47k|        {
  165|  8.47k|            {
  166|  8.47k|                LOCK(instance->m_callbacks_mutex);
  167|  8.47k|                instance->m_are_callbacks_running = false;
  168|  8.47k|            }
  169|  8.47k|            instance->MaybeScheduleProcessQueue();
  170|  8.47k|        }
  171|  8.47k|    } raiicallbacksrunning(this);
  172|       |
  173|  8.47k|    callback();
  174|  8.47k|}
_ZN16SerialTaskRunner6insertENSt3__18functionIFvvEEE:
  177|  8.47k|{
  178|  8.47k|    {
  179|  8.47k|        LOCK(m_callbacks_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  8.47k|        m_callbacks_pending.emplace_back(std::move(func));
  181|  8.47k|    }
  182|  8.47k|    MaybeScheduleProcessQueue();
  183|  8.47k|}
_ZN16SerialTaskRunner5flushEv:
  186|      2|{
  187|      2|    assert(!m_scheduler.AreThreadsServicingQueue());
  188|      2|    bool should_continue = true;
  189|      4|    while (should_continue) {
  ------------------
  |  Branch (189:12): [True: 2, False: 2]
  ------------------
  190|      2|        ProcessQueue();
  191|      2|        LOCK(m_callbacks_mutex);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|      2|        should_continue = !m_callbacks_pending.empty();
  193|      2|    }
  194|      2|}
_ZN16SerialTaskRunner4sizeEv:
  197|  1.54k|{
  198|  1.54k|    LOCK(m_callbacks_mutex);
  ------------------
  |  |  257|  1.54k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.54k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.54k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.54k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|  1.54k|    return m_callbacks_pending.size();
  200|  1.54k|}
scheduler.cpp:_ZZN16SerialTaskRunner12ProcessQueueEvEN20RAIICallbacksRunningC2EPS_:
  162|  8.47k|        explicit RAIICallbacksRunning(SerialTaskRunner* _instance) : instance(_instance) {}
scheduler.cpp:_ZZN16SerialTaskRunner12ProcessQueueEvEN20RAIICallbacksRunningD2Ev:
  164|  8.47k|        {
  165|  8.47k|            {
  166|  8.47k|                LOCK(instance->m_callbacks_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|  8.47k|                instance->m_are_callbacks_running = false;
  168|  8.47k|            }
  169|  8.47k|            instance->MaybeScheduleProcessQueue();
  170|  8.47k|        }
scheduler.cpp:_ZZN16SerialTaskRunner25MaybeScheduleProcessQueueEvENK3$_0clEv:
  142|  8.47k|    m_scheduler.schedule([this] { this->ProcessQueue(); }, std::chrono::steady_clock::now());

_ZN10CScheduler4stopEv:
   80|      2|    {
   81|      2|        WITH_LOCK(newTaskMutex, stopRequested = true);
  ------------------
  |  |  301|      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|    }
_ZNK10CScheduler10shouldStopEv:
  111|  42.3k|    bool shouldStop() const EXCLUSIVE_LOCKS_REQUIRED(newTaskMutex) { return stopRequested || (stopWhenEmpty && taskQueue.empty()); }
  ------------------
  |  Branch (111:77): [True: 8, False: 42.3k]
  |  Branch (111:95): [True: 0, False: 42.3k]
  |  Branch (111:112): [True: 0, False: 0]
  ------------------

_ZN26PrecomputedTransactionDataC2Ev:
  174|  1.36k|    PrecomputedTransactionData() = default;

_ZNK7CScript13GetSigOpCountEb:
  160|    102|{
  161|    102|    unsigned int n = 0;
  162|    102|    const_iterator pc = begin();
  163|    102|    opcodetype lastOpcode = OP_INVALIDOPCODE;
  164|    301|    while (pc < end())
  ------------------
  |  Branch (164:12): [True: 211, False: 90]
  ------------------
  165|    211|    {
  166|    211|        opcodetype opcode;
  167|    211|        if (!GetOp(pc, opcode))
  ------------------
  |  Branch (167:13): [True: 12, False: 199]
  ------------------
  168|     12|            break;
  169|    199|        if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)
  ------------------
  |  Branch (169:13): [True: 0, False: 199]
  |  Branch (169:38): [True: 0, False: 199]
  ------------------
  170|      0|            n++;
  171|    199|        else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)
  ------------------
  |  Branch (171:18): [True: 0, False: 199]
  |  Branch (171:48): [True: 0, False: 199]
  ------------------
  172|      0|        {
  173|      0|            if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16)
  ------------------
  |  Branch (173:17): [True: 0, False: 0]
  |  Branch (173:30): [True: 0, False: 0]
  |  Branch (173:52): [True: 0, False: 0]
  ------------------
  174|      0|                n += DecodeOP_N(lastOpcode);
  175|      0|            else
  176|      0|                n += MAX_PUBKEYS_PER_MULTISIG;
  177|      0|        }
  178|    199|        lastOpcode = opcode;
  179|    199|    }
  180|    102|    return n;
  181|    102|}
_ZNK7CScript13IsPayToAnchorEv:
  208|    269|{
  209|    269|    return (this->size() == 4 &&
  ------------------
  |  Branch (209:13): [True: 1, False: 268]
  ------------------
  210|    269|        (*this)[0] == OP_1 &&
  ------------------
  |  Branch (210:9): [True: 0, False: 1]
  ------------------
  211|    269|        (*this)[1] == 0x02 &&
  ------------------
  |  Branch (211:9): [True: 0, False: 0]
  ------------------
  212|    269|        (*this)[2] == 0x4e &&
  ------------------
  |  Branch (212:9): [True: 0, False: 0]
  ------------------
  213|    269|        (*this)[3] == 0x73);
  ------------------
  |  Branch (213:9): [True: 0, False: 0]
  ------------------
  214|    269|}
_ZNK7CScript17IsPayToScriptHashEv:
  225|  1.41k|{
  226|       |    // Extra-fast test for pay-to-script-hash CScripts:
  227|  1.41k|    return (this->size() == 23 &&
  ------------------
  |  Branch (227:13): [True: 39, False: 1.38k]
  ------------------
  228|  1.41k|            (*this)[0] == OP_HASH160 &&
  ------------------
  |  Branch (228:13): [True: 10, False: 29]
  ------------------
  229|  1.41k|            (*this)[1] == 0x14 &&
  ------------------
  |  Branch (229:13): [True: 8, False: 2]
  ------------------
  230|  1.41k|            (*this)[22] == OP_EQUAL);
  ------------------
  |  Branch (230:13): [True: 7, False: 1]
  ------------------
  231|  1.41k|}
_ZNK7CScript16IsWitnessProgramERiRNSt3__16vectorIhNS1_9allocatorIhEEEE:
  244|  2.34k|{
  245|  2.34k|    if (this->size() < 4 || this->size() > 42) {
  ------------------
  |  Branch (245:9): [True: 107, False: 2.23k]
  |  Branch (245:29): [True: 42, False: 2.19k]
  ------------------
  246|    149|        return false;
  247|    149|    }
  248|  2.19k|    if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
  ------------------
  |  Branch (248:9): [True: 941, False: 1.25k]
  |  Branch (248:32): [True: 107, False: 834]
  |  Branch (248:53): [True: 265, False: 569]
  ------------------
  249|    372|        return false;
  250|    372|    }
  251|  1.81k|    if ((size_t)((*this)[1] + 2) == this->size()) {
  ------------------
  |  Branch (251:9): [True: 1.77k, False: 47]
  ------------------
  252|  1.77k|        version = DecodeOP_N((opcodetype)(*this)[0]);
  253|  1.77k|        program = std::vector<unsigned char>(this->begin() + 2, this->end());
  254|  1.77k|        return true;
  255|  1.77k|    }
  256|     47|    return false;
  257|  1.81k|}
_ZNK7CScript10IsPushOnlyEN9prevectorILj28EhjiE14const_iteratorE:
  260|  4.10k|{
  261|  8.42k|    while (pc < end())
  ------------------
  |  Branch (261:12): [True: 4.43k, False: 3.99k]
  ------------------
  262|  4.43k|    {
  263|  4.43k|        opcodetype opcode;
  264|  4.43k|        if (!GetOp(pc, opcode))
  ------------------
  |  Branch (264:13): [True: 69, False: 4.37k]
  ------------------
  265|     69|            return false;
  266|       |        // Note that IsPushOnly() *does* consider OP_RESERVED to be a
  267|       |        // push-type opcode, however execution of OP_RESERVED fails, so
  268|       |        // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
  269|       |        // the P2SH special validation code being executed.
  270|  4.37k|        if (opcode > OP_16)
  ------------------
  |  Branch (270:13): [True: 49, False: 4.32k]
  ------------------
  271|     49|            return false;
  272|  4.37k|    }
  273|  3.99k|    return true;
  274|  4.10k|}
_ZNK7CScript10IsPushOnlyEv:
  277|  3.90k|{
  278|  3.90k|    return this->IsPushOnly(begin());
  279|  3.90k|}
_Z11GetScriptOpRN9prevectorILj28EhjiE14const_iteratorES1_R10opcodetypePNSt3__16vectorIhNS5_9allocatorIhEEEE:
  307|  4.80k|{
  308|  4.80k|    opcodeRet = OP_INVALIDOPCODE;
  309|  4.80k|    if (pvchRet)
  ------------------
  |  Branch (309:9): [True: 157, False: 4.65k]
  ------------------
  310|    157|        pvchRet->clear();
  311|  4.80k|    if (pc >= end)
  ------------------
  |  Branch (311:9): [True: 0, False: 4.80k]
  ------------------
  312|      0|        return false;
  313|       |
  314|       |    // Read instruction
  315|  4.80k|    if (end - pc < 1)
  ------------------
  |  Branch (315:9): [True: 0, False: 4.80k]
  ------------------
  316|      0|        return false;
  317|  4.80k|    unsigned int opcode = *pc++;
  318|       |
  319|       |    // Immediate operand
  320|  4.80k|    if (opcode <= OP_PUSHDATA4)
  ------------------
  |  Branch (320:9): [True: 3.86k, False: 943]
  ------------------
  321|  3.86k|    {
  322|  3.86k|        unsigned int nSize = 0;
  323|  3.86k|        if (opcode < OP_PUSHDATA1)
  ------------------
  |  Branch (323:13): [True: 3.74k, False: 116]
  ------------------
  324|  3.74k|        {
  325|  3.74k|            nSize = opcode;
  326|  3.74k|        }
  327|    116|        else if (opcode == OP_PUSHDATA1)
  ------------------
  |  Branch (327:18): [True: 39, False: 77]
  ------------------
  328|     39|        {
  329|     39|            if (end - pc < 1)
  ------------------
  |  Branch (329:17): [True: 2, False: 37]
  ------------------
  330|      2|                return false;
  331|     37|            nSize = *pc++;
  332|     37|        }
  333|     77|        else if (opcode == OP_PUSHDATA2)
  ------------------
  |  Branch (333:18): [True: 33, False: 44]
  ------------------
  334|     33|        {
  335|     33|            if (end - pc < 2)
  ------------------
  |  Branch (335:17): [True: 3, False: 30]
  ------------------
  336|      3|                return false;
  337|     30|            nSize = ReadLE16(&pc[0]);
  338|     30|            pc += 2;
  339|     30|        }
  340|     44|        else if (opcode == OP_PUSHDATA4)
  ------------------
  |  Branch (340:18): [True: 44, False: 0]
  ------------------
  341|     44|        {
  342|     44|            if (end - pc < 4)
  ------------------
  |  Branch (342:17): [True: 4, False: 40]
  ------------------
  343|      4|                return false;
  344|     40|            nSize = ReadLE32(&pc[0]);
  345|     40|            pc += 4;
  346|     40|        }
  347|  3.85k|        if (end - pc < 0 || (unsigned int)(end - pc) < nSize)
  ------------------
  |  Branch (347:13): [True: 0, False: 3.85k]
  |  Branch (347:29): [True: 82, False: 3.77k]
  ------------------
  348|     82|            return false;
  349|  3.77k|        if (pvchRet)
  ------------------
  |  Branch (349:13): [True: 102, False: 3.67k]
  ------------------
  350|    102|            pvchRet->assign(pc, pc + nSize);
  351|  3.77k|        pc += nSize;
  352|  3.77k|    }
  353|       |
  354|  4.71k|    opcodeRet = static_cast<opcodetype>(opcode);
  355|  4.71k|    return true;
  356|  4.80k|}
_Z16CheckMinimalPushRKNSt3__16vectorIhNS_9allocatorIhEEEE10opcodetype:
  366|     96|bool CheckMinimalPush(const std::vector<unsigned char>& data, opcodetype opcode) {
  367|       |    // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal
  368|     96|    assert(0 <= opcode && opcode <= OP_PUSHDATA4);
  369|     96|    if (data.size() == 0) {
  ------------------
  |  Branch (369:9): [True: 1, False: 95]
  ------------------
  370|       |        // Should have used OP_0.
  371|      1|        return opcode == OP_0;
  372|     95|    } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
  ------------------
  |  Branch (372:16): [True: 27, False: 68]
  |  Branch (372:36): [True: 26, False: 1]
  |  Branch (372:52): [True: 6, False: 20]
  ------------------
  373|       |        // Should have used OP_1 .. OP_16.
  374|      6|        return false;
  375|     89|    } else if (data.size() == 1 && data[0] == 0x81) {
  ------------------
  |  Branch (375:16): [True: 21, False: 68]
  |  Branch (375:36): [True: 1, False: 20]
  ------------------
  376|       |        // Should have used OP_1NEGATE.
  377|      1|        return false;
  378|     88|    } else if (data.size() <= 75) {
  ------------------
  |  Branch (378:16): [True: 87, False: 1]
  ------------------
  379|       |        // Must have used a direct push (opcode indicating number of bytes pushed + those bytes).
  380|     87|        return opcode == data.size();
  381|     87|    } else if (data.size() <= 255) {
  ------------------
  |  Branch (381:16): [True: 1, False: 0]
  ------------------
  382|       |        // Must have used OP_PUSHDATA.
  383|      1|        return opcode == OP_PUSHDATA1;
  384|      1|    } else if (data.size() <= 65535) {
  ------------------
  |  Branch (384:16): [True: 0, False: 0]
  ------------------
  385|       |        // Must have used OP_PUSHDATA2.
  386|      0|        return opcode == OP_PUSHDATA2;
  387|      0|    }
  388|      0|    return true;
  389|     96|}

_ZN15scriptnum_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  223|     12|    explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {}
_ZN10CScriptNumC2ERKNSt3__16vectorIhNS0_9allocatorIhEEEEbm:
  247|     88|    {
  248|     88|        if (vch.size() > nMaxNumSize) {
  ------------------
  |  Branch (248:13): [True: 8, False: 80]
  ------------------
  249|      8|            throw scriptnum_error("script number overflow");
  250|      8|        }
  251|     80|        if (fRequireMinimal && vch.size() > 0) {
  ------------------
  |  Branch (251:13): [True: 80, False: 0]
  |  Branch (251:32): [True: 80, False: 0]
  ------------------
  252|       |            // Check that the number is encoded with the minimum possible
  253|       |            // number of bytes.
  254|       |            //
  255|       |            // If the most-significant-byte - excluding the sign bit - is zero
  256|       |            // then we're not minimal. Note how this test also rejects the
  257|       |            // negative-zero encoding, 0x80.
  258|     80|            if ((vch.back() & 0x7f) == 0) {
  ------------------
  |  Branch (258:17): [True: 10, False: 70]
  ------------------
  259|       |                // One exception: if there's more than one byte and the most
  260|       |                // significant bit of the second-most-significant-byte is set
  261|       |                // it would conflict with the sign bit. An example of this case
  262|       |                // is +-255, which encode to 0xff00 and 0xff80 respectively.
  263|       |                // (big-endian).
  264|     10|                if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {
  ------------------
  |  Branch (264:21): [True: 1, False: 9]
  |  Branch (264:40): [True: 3, False: 6]
  ------------------
  265|      4|                    throw scriptnum_error("non-minimally encoded script number");
  266|      4|                }
  267|     10|            }
  268|     80|        }
  269|     76|        m_value = set_vch(vch);
  270|     76|    }
_ZNK10CScriptNum6getintEv:
  334|     76|    {
  335|     76|        if (m_value > std::numeric_limits<int>::max())
  ------------------
  |  Branch (335:13): [True: 0, False: 76]
  ------------------
  336|      0|            return std::numeric_limits<int>::max();
  337|     76|        else if (m_value < std::numeric_limits<int>::min())
  ------------------
  |  Branch (337:18): [True: 0, False: 76]
  ------------------
  338|      0|            return std::numeric_limits<int>::min();
  339|     76|        return m_value;
  340|     76|    }
_ZN10CScriptNum7set_vchERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  384|     76|    {
  385|     76|      if (vch.empty())
  ------------------
  |  Branch (385:11): [True: 0, False: 76]
  ------------------
  386|      0|          return 0;
  387|       |
  388|     76|      int64_t result = 0;
  389|    289|      for (size_t i = 0; i != vch.size(); ++i)
  ------------------
  |  Branch (389:26): [True: 213, False: 76]
  ------------------
  390|    213|          result |= static_cast<int64_t>(vch[i]) << 8*i;
  391|       |
  392|       |      // If the input vector's most significant byte is 0x80, remove it from
  393|       |      // the result's msb and return a negative.
  394|     76|      if (vch.back() & 0x80)
  ------------------
  |  Branch (394:11): [True: 27, False: 49]
  ------------------
  395|     27|          return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1)))));
  396|       |
  397|     49|      return result;
  398|     76|    }
_ZNK7CScript5GetOpERN9prevectorILj28EhjiE14const_iteratorER10opcodetypeRNSt3__16vectorIhNS6_9allocatorIhEEEE:
  507|    157|    {
  508|    157|        return GetScriptOp(pc, end(), opcodeRet, &vchRet);
  509|    157|    }
_ZNK7CScript5GetOpERN9prevectorILj28EhjiE14const_iteratorER10opcodetype:
  512|  4.65k|    {
  513|  4.65k|        return GetScriptOp(pc, end(), opcodeRet, nullptr);
  514|  4.65k|    }
_ZN7CScript10DecodeOP_NE10opcodetype:
  518|  1.80k|    {
  519|  1.80k|        if (opcode == OP_0)
  ------------------
  |  Branch (519:13): [True: 1.23k, False: 570]
  ------------------
  520|  1.23k|            return 0;
  521|    570|        assert(opcode >= OP_1 && opcode <= OP_16);
  522|    570|        return (int)opcode - (int)(OP_1 - 1);
  523|    570|    }
_ZNK7CScript13IsUnspendableEv:
  572|  1.06k|    {
  573|  1.06k|        return (size() > 0 && *begin() == OP_RETURN) || (size() > MAX_SCRIPT_SIZE);
  ------------------
  |  Branch (573:17): [True: 1.06k, False: 0]
  |  Branch (573:31): [True: 132, False: 928]
  |  Branch (573:57): [True: 0, False: 928]
  ------------------
  574|  1.06k|    }
_ZN7CScript5clearEv:
  577|  29.6k|    {
  578|       |        // The default prevector::clear() does not release memory
  579|  29.6k|        CScriptBase::clear();
  580|  29.6k|        shrink_to_fit();
  581|  29.6k|    }
_ZNK14CScriptWitness6IsNullEv:
  593|  53.3k|    bool IsNull() const { return stack.empty(); }
_ZN7CScript16SerializationOpsI12ParamsStreamIR12SizeComputer20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  465|  56.9k|    SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
  ------------------
  |  |  156|  56.9k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN7CScriptC2Ev:
  461|  92.1k|    CScript() = default;
_ZN14CScriptWitnessC2Ev:
  591|  62.4k|    CScriptWitness() = default;
_ZN7CScript16SerializationOpsI12ParamsStreamIR10DataStream20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
  465|  84.3k|    SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
  ------------------
  |  |  156|  84.3k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN7CScript16SerializationOpsI12SizeComputerKS_15ActionSerializeEEvRT0_RT_T1_:
  465|    928|    SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
  ------------------
  |  |  156|    928|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN7CScript16SerializationOpsI12ParamsStreamIR12VectorWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  465|  3.03k|    SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
  ------------------
  |  |  156|  3.03k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN7CScript16SerializationOpsI12ParamsStreamIR8AutoFile20TransactionSerParamsES_17ActionUnserializeEEvRT0_RT_T1_:
  465|  3.13k|    SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
  ------------------
  |  |  156|  3.13k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------
_ZN7CScript16SerializationOpsI12ParamsStreamIR10HashWriter20TransactionSerParamsEKS_15ActionSerializeEEvRT0_RT_T1_:
  465|   102k|    SERIALIZE_METHODS(CScript, obj) { READWRITE(AsBase<CScriptBase>(obj)); }
  ------------------
  |  |  156|   102k|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------

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

_Z12IsPushdataOp10opcodetype:
   41|    109|{
   42|    109|    return opcode > OP_FALSE && opcode <= OP_PUSHDATA4;
  ------------------
  |  Branch (42:12): [True: 107, False: 2]
  |  Branch (42:33): [True: 96, False: 11]
  ------------------
   43|    109|}

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|      4|static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {
   23|      4|    return ctx->built;
   24|      4|}

secp256k1.c:secp256k1_fe_clear:
   21|      2|SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
   22|      2|    secp256k1_memclear(a, sizeof(secp256k1_fe));
   23|      2|}

secp256k1.c:secp256k1_ge_clear:
  305|      2|static void secp256k1_ge_clear(secp256k1_ge *r) {
  306|      2|    secp256k1_memclear(r, sizeof(secp256k1_ge));
  307|      2|}

secp256k1.c:secp256k1_scalar_clear:
   30|      2|SECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar *r) {
   31|      2|    secp256k1_memclear(r, sizeof(secp256k1_scalar));
   32|      2|}

secp256k1_context_preallocated_destroy:
  176|      2|void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
  177|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  178|       |
  179|       |    /* Defined as noop */
  180|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (180:9): [True: 0, False: 2]
  ------------------
  181|      0|        return;
  182|      0|    }
  183|       |
  184|      2|    secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
  185|      2|}
secp256k1_context_destroy:
  187|      2|void secp256k1_context_destroy(secp256k1_context* ctx) {
  188|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  189|       |
  190|       |    /* Defined as noop */
  191|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (191:9): [True: 0, False: 2]
  ------------------
  192|      0|        return;
  193|      0|    }
  194|       |
  195|      2|    secp256k1_context_preallocated_destroy(ctx);
  196|      2|    free(ctx);
  197|      2|}
secp256k1.c:secp256k1_context_is_proper:
   82|      4|static int secp256k1_context_is_proper(const secp256k1_context* ctx) {
   83|      4|    return secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx);
   84|      4|}

secp256k1.c:secp256k1_memclear:
  223|      6|static SECP256K1_INLINE void secp256k1_memclear(void *ptr, size_t len) {
  224|       |#if defined(_MSC_VER)
  225|       |    /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */
  226|       |    SecureZeroMemory(ptr, len);
  227|       |#elif defined(__GNUC__)
  228|       |    /* We use a memory barrier that scares the compiler away from optimizing out the memset.
  229|       |     *
  230|       |     * Quoting Adam Langley <agl@google.com> in commit ad1907fe73334d6c696c8539646c21b11178f20f
  231|       |     * in BoringSSL (ISC License):
  232|       |     *    As best as we can tell, this is sufficient to break any optimisations that
  233|       |     *    might try to eliminate "superfluous" memsets.
  234|       |     * This method is used in memzero_explicit() the Linux kernel, too. Its advantage is that it
  235|       |     * is pretty efficient, because the compiler can still implement the memset() efficently,
  236|       |     * just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
  237|       |     * Yang et al. (USENIX Security 2017) for more background.
  238|       |     */
  239|      6|    memset(ptr, 0, len);
  240|      6|    __asm__ __volatile__("" : : "r"(ptr) : "memory");
  241|       |#else
  242|       |    void *(*volatile const volatile_memset)(void *, int, size_t) = memset;
  243|       |    volatile_memset(ptr, 0, len);
  244|       |#endif
  245|       |#ifdef VERIFY
  246|       |    SECP256K1_CHECKMEM_UNDEFINE(ptr, len);
  247|       |#endif
  248|      6|}

_Z20GetSizeOfCompactSizem:
  298|    928|{
  299|    928|    if (nSize < 253)             return sizeof(unsigned char);
  ------------------
  |  Branch (299:9): [True: 928, False: 0]
  ------------------
  300|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t);
  ------------------
  |  Branch (300:14): [True: 0, False: 0]
  ------------------
  301|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())  return sizeof(unsigned char) + sizeof(unsigned int);
  ------------------
  |  Branch (301:14): [True: 0, False: 0]
  ------------------
  302|      0|    else                         return sizeof(unsigned char) + sizeof(uint64_t);
  303|    928|}
_ZN12SizeComputer5writeE4SpanIKSt4byteE:
 1069|  1.08M|    {
 1070|  1.08M|        this->nSize += src.size();
 1071|  1.08M|    }
_ZN12SizeComputer4seekEm:
 1075|    928|    {
 1076|    928|        this->nSize += _nSize;
 1077|    928|    }
_ZNK12SizeComputer4sizeEv:
 1086|  8.19k|    size_t size() const {
 1087|  8.19k|        return nSize;
 1088|  8.19k|    }
_Z16WriteCompactSizeR12SizeComputerm:
 1098|    928|{
 1099|    928|    s.seek(GetSizeOfCompactSize(nSize));
 1100|    928|}
_ZNK20TransactionSerParamsclIRK12CTransactionEEDaOT_:
 1228|  45.3k|    {                                                                                    \
 1229|  45.3k|        return ParamsWrapper{*this, t};                                                  \
 1230|  45.3k|    }
_ZNK20TransactionSerParamsclIRK6CBlockEEDaOT_:
 1228|  1.54k|    {                                                                                    \
 1229|  1.54k|        return ParamsWrapper{*this, t};                                                  \
 1230|  1.54k|    }
_Z16GetSerializeSizeI13ParamsWrapperI20TransactionSerParamsK12CTransactionEEmRKT_:
 1104|  6.46k|{
 1105|  6.46k|    return (SizeComputer() << t).size();
 1106|  6.46k|}
_ZN12SizeComputerlsI13ParamsWrapperI20TransactionSerParamsK12CTransactionEEERS_RKT_:
 1081|  6.46k|    {
 1082|  6.46k|        ::Serialize(*this, obj);
 1083|  6.46k|        return (*this);
 1084|  6.46k|    }
_Z9SerializeI12SizeComputer13ParamsWrapperI20TransactionSerParamsK12CTransactionEQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  6.46k|{
  754|  6.46k|    a.Serialize(os);
  755|  6.46k|}
_ZNK13ParamsWrapperI20TransactionSerParamsK12CTransactionE9SerializeI12SizeComputerEEvRT_:
 1199|  6.46k|    {
 1200|  6.46k|        ParamsStream ss{s, m_params};
 1201|  6.46k|        ::Serialize(ss, m_object);
 1202|  6.46k|    }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE12CTransactionQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  8.12k|{
  754|  8.12k|    a.Serialize(os);
  755|  8.12k|}
_ZNK12ParamsStreamIR12SizeComputer20TransactionSerParamsE9GetParamsIS2_EERKDav:
 1144|  8.12k|    {
 1145|  8.12k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  8.12k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  8.12k|    }
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsElsIjEERS3_RKT_:
 1133|  16.2k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_j:
  262|  97.4k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
_Z15ser_writedata32I12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_j:
   69|  97.5k|{
   70|  97.5k|    obj = htole32_internal(obj);
   71|  97.5k|    s.write(AsBytes(Span{&obj, 1}));
   72|  97.5k|}
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsE9GetStreamEv:
 1154|  1.08M|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  1.08M|        } else {
 1158|  1.08M|            return m_substream;
 1159|  1.08M|        }
 1160|  1.08M|    }
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsE5writeE4SpanIKSt4byteE:
 1135|  1.08M|    void write(Span<const std::byte> src) { GetStream().write(src); }
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsElsINSt3__16vectorI5CTxInNS5_9allocatorIS7_EEEEEERS3_RKT_:
 1133|  8.64k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE5CTxInNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|  8.64k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  8.64k|    } else {
  859|  8.64k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  8.64k|    }
  861|  8.64k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|  8.64k|{
  754|  8.64k|    a.Serialize(os);
  755|  8.64k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  482|  8.64k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__16vectorI5CTxInNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|  8.64k|    {
  663|  8.64k|        Formatter formatter;
  664|  8.64k|        WriteCompactSize(s, v.size());
  665|  40.4k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 40.4k, False: 8.64k]
  ------------------
  666|  40.4k|            formatter.Ser(s, elem);
  667|  40.4k|        }
  668|  8.64k|    }
_Z16WriteCompactSizeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_m:
  309|   867k|{
  310|   867k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 865k, False: 2.64k]
  ------------------
  311|   865k|    {
  312|   865k|        ser_writedata8(os, nSize);
  313|   865k|    }
  314|  2.64k|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 2.55k, False: 92]
  ------------------
  315|  2.55k|    {
  316|  2.55k|        ser_writedata8(os, 253);
  317|  2.55k|        ser_writedata16(os, nSize);
  318|  2.55k|    }
  319|     92|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 92, False: 0]
  ------------------
  320|     92|    {
  321|     92|        ser_writedata8(os, 254);
  322|     92|        ser_writedata32(os, nSize);
  323|     92|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|   867k|    return;
  330|   867k|}
_Z14ser_writedata8I12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_h:
   55|   868k|{
   56|   868k|    s.write(AsBytes(Span{&obj, 1}));
   57|   868k|}
_Z15ser_writedata16I12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_t:
   59|  2.55k|{
   60|  2.55k|    obj = htole16_internal(obj);
   61|  2.55k|    s.write(AsBytes(Span{&obj, 1}));
   62|  2.55k|}
_Z15ser_writedata64I12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_m:
   79|  16.5k|{
   80|  16.5k|    obj = htole64_internal(obj);
   81|  16.5k|    s.write(AsBytes(Span{&obj, 1}));
   82|  16.5k|}
_ZN16DefaultFormatter3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsE5CTxInEEvRT_RKT0_:
  774|  40.4k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE5CTxInQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  40.4k|{
  754|  40.4k|    a.Serialize(os);
  755|  40.4k|}
_ZNK5CTxIn9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  222|  40.4k|    {                                                                                               \
  223|  40.4k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  40.4k|        Ser(s, *this);                                                                              \
  225|  40.4k|    }                                                                                               \
_ZN5CTxIn3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_RKS_:
  178|  40.4k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ9COutPoint7CScriptjEEEvRT_DpRKT0_:
 1013|  40.4k|    {
 1014|  40.4k|        ::SerializeMany(s, args...);
 1015|  40.4k|    }
_Z13SerializeManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ9COutPoint7CScriptjEEvRT_DpRKT0_:
  995|  40.4k|{
  996|  40.4k|    (::Serialize(s, args), ...);
  997|  40.4k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE7CScriptQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  56.9k|{
  754|  56.9k|    a.Serialize(os);
  755|  56.9k|}
_ZNK7CScript9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  222|  56.9k|    {                                                                                               \
  223|  56.9k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  56.9k|        Ser(s, *this);                                                                              \
  225|  56.9k|    }                                                                                               \
_ZN7CScript3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_RKS_:
  178|  56.9k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_Z6AsBaseI9prevectorILj28EhjiE7CScriptERKT_RKT0_:
  151|   163k|{
  152|   163k|    static_assert(std::is_base_of_v<Out, In>);
  153|   163k|    return x;
  154|   163k|}
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ9prevectorILj28EhjiEEEEvRT_DpRKT0_:
 1013|  56.9k|    {
 1014|  56.9k|        ::SerializeMany(s, args...);
 1015|  56.9k|    }
_Z13SerializeManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ9prevectorILj28EhjiEEEvRT_DpRKT0_:
  995|  56.9k|{
  996|  56.9k|    (::Serialize(s, args), ...);
  997|  56.9k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsELj28EhEvRT_RK9prevectorIXT0_ET1_jiE:
  811|  56.9k|{
  812|  56.9k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  813|  56.9k|        WriteCompactSize(os, v.size());
  814|  56.9k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (814:13): [True: 26.4k, False: 30.5k]
  ------------------
  815|       |    } else {
  816|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  817|       |    }
  818|  56.9k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE9COutPointQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  40.4k|{
  754|  40.4k|    a.Serialize(os);
  755|  40.4k|}
_ZNK9COutPoint9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  222|  40.4k|    {                                                                                               \
  223|  40.4k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  40.4k|        Ser(s, *this);                                                                              \
  225|  40.4k|    }                                                                                               \
_ZN9COutPoint3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_RKS_:
  178|  40.4k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ22transaction_identifierILb0EEjEEEvRT_DpRKT0_:
 1013|  40.4k|    {
 1014|  40.4k|        ::SerializeMany(s, args...);
 1015|  40.4k|    }
_Z13SerializeManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ22transaction_identifierILb0EEjEEvRT_DpRKT0_:
  995|  40.4k|{
  996|  40.4k|    (::Serialize(s, args), ...);
  997|  40.4k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE22transaction_identifierILb0EEQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|  40.4k|{
  754|  40.4k|    a.Serialize(os);
  755|  40.4k|}
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsElsI4SpanIKhEEERS3_RKT_:
 1133|  40.6k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsETk9BasicByteKhEvRT_4SpanIT0_E:
  268|  40.6k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsElsIhEERS3_RKT_:
 1133|    517|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_h:
  258|    517|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsElsINSt3__16vectorI6CTxOutNS5_9allocatorIS7_EEEEEERS3_RKT_:
 1133|  8.12k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE6CTxOutNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|  8.12k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  8.12k|    } else {
  859|  8.12k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  8.12k|    }
  861|  8.12k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|  8.12k|{
  754|  8.12k|    a.Serialize(os);
  755|  8.12k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  482|  8.12k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__16vectorI6CTxOutNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|  8.12k|    {
  663|  8.12k|        Formatter formatter;
  664|  8.12k|        WriteCompactSize(s, v.size());
  665|  16.5k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 16.5k, False: 8.12k]
  ------------------
  666|  16.5k|            formatter.Ser(s, elem);
  667|  16.5k|        }
  668|  8.12k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsE6CTxOutEEvRT_RKT0_:
  774|  16.5k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE6CTxOutQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  16.5k|{
  754|  16.5k|    a.Serialize(os);
  755|  16.5k|}
_ZNK6CTxOut9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  222|  16.5k|    {                                                                                               \
  223|  16.5k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  16.5k|        Ser(s, *this);                                                                              \
  225|  16.5k|    }                                                                                               \
_ZN6CTxOut3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_RKS_:
  178|  16.5k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJl7CScriptEEEvRT_DpRKT0_:
 1013|  16.5k|    {
 1014|  16.5k|        ::SerializeMany(s, args...);
 1015|  16.5k|    }
_Z13SerializeManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJl7CScriptEEvRT_DpRKT0_:
  995|  16.5k|{
  996|  16.5k|    (::Serialize(s, args), ...);
  997|  16.5k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_l:
  263|  16.5k|template<typename Stream> inline void Serialize(Stream& s, int64_t a ) { ser_writedata64(s, a); }
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsElsINSt3__16vectorINS6_IhNS5_9allocatorIhEEEENS7_IS9_EEEEEERS3_RKT_:
 1133|  6.33k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__16vectorIhNS5_9allocatorIhEEEENS7_IS9_EEEvRT_RKNS6_IT0_T1_EE:
  846|  6.33k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  6.33k|    } else {
  859|  6.33k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  6.33k|    }
  861|  6.33k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINSA_IhNS9_9allocatorIhEEEENSB_ISD_EEEEEQ12SerializableIT0_T_EEvRSK_RKSJ_:
  753|  6.33k|{
  754|  6.33k|    a.Serialize(os);
  755|  6.33k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  482|  6.33k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__16vectorINS9_IhNS8_9allocatorIhEEEENSA_ISC_EEEEEEvRT_RKT0_:
  662|  6.33k|    {
  663|  6.33k|        Formatter formatter;
  664|  6.33k|        WriteCompactSize(s, v.size());
  665|   787k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 787k, False: 6.33k]
  ------------------
  666|   787k|            formatter.Ser(s, elem);
  667|   787k|        }
  668|  6.33k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__16vectorIhNS6_9allocatorIhEEEEEEvRT_RKT0_:
  774|   787k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEhNSt3__19allocatorIhEEEvRT_RKNS5_6vectorIT0_T1_EE:
  846|   787k|{
  847|   787k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|   787k|        WriteCompactSize(os, v.size());
  849|   787k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (849:13): [True: 31.1k, False: 756k]
  ------------------
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|       |    } else {
  859|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|       |    }
  861|   787k|}
_Z16GetSerializeSizeI13ParamsWrapperI20TransactionSerParamsK6CBlockEEmRKT_:
 1104|     70|{
 1105|     70|    return (SizeComputer() << t).size();
 1106|     70|}
_ZN12SizeComputerlsI13ParamsWrapperI20TransactionSerParamsK6CBlockEEERS_RKT_:
 1081|     70|    {
 1082|     70|        ::Serialize(*this, obj);
 1083|     70|        return (*this);
 1084|     70|    }
_Z9SerializeI12SizeComputer13ParamsWrapperI20TransactionSerParamsK6CBlockEQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|     70|{
  754|     70|    a.Serialize(os);
  755|     70|}
_ZNK13ParamsWrapperI20TransactionSerParamsK6CBlockE9SerializeI12SizeComputerEEvRT_:
 1199|     70|    {
 1200|     70|        ParamsStream ss{s, m_params};
 1201|     70|        ::Serialize(ss, m_object);
 1202|     70|    }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE6CBlockQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|     70|{
  754|     70|    a.Serialize(os);
  755|     70|}
_ZNK6CBlock9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  222|     70|    {                                                                                               \
  223|     70|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|     70|        Ser(s, *this);                                                                              \
  225|     70|    }                                                                                               \
_ZN6CBlock3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_RKS_:
  178|     70|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_Z6AsBaseI12CBlockHeader6CBlockERKT_RKT0_:
  151|  6.45k|{
  152|  6.45k|    static_assert(std::is_base_of_v<Out, In>);
  153|  6.45k|    return x;
  154|  6.45k|}
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ12CBlockHeaderNSt3__16vectorINS7_10shared_ptrIK12CTransactionEENS7_9allocatorISC_EEEEEEEvRT_DpRKT0_:
 1013|     70|    {
 1014|     70|        ::SerializeMany(s, args...);
 1015|     70|    }
_Z13SerializeManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJ12CBlockHeaderNSt3__16vectorINS6_10shared_ptrIK12CTransactionEENS6_9allocatorISB_EEEEEEvRT_DpRKT0_:
  995|     70|{
  996|     70|    (::Serialize(s, args), ...);
  997|     70|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEENS5_9allocatorIS9_EEEvRT_RKNS5_6vectorIT0_T1_EE:
  846|     70|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|     70|    } else {
  859|     70|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|     70|    }
  861|     70|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEQ12SerializableIT0_T_EEvRSM_RKSL_:
  753|     70|{
  754|     70|    a.Serialize(os);
  755|     70|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  482|     70|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEvRT_RKT0_:
  662|     70|    {
  663|     70|        Formatter formatter;
  664|     70|        WriteCompactSize(s, v.size());
  665|    929|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 929, False: 70]
  ------------------
  666|    929|            formatter.Ser(s, elem);
  667|    929|        }
  668|     70|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEEEEvRT_RKT0_:
  774|    929|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE12CTransactionEvRT_RKNSt3__110shared_ptrIKT0_EE:
  979|  1.66k|{
  980|  1.66k|    Serialize(os, *p);
  981|  1.66k|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE12CBlockHeaderQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|     70|{
  754|     70|    a.Serialize(os);
  755|     70|}
_ZNK12CBlockHeader9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  222|     70|    {                                                                                               \
  223|     70|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|     70|        Ser(s, *this);                                                                              \
  225|     70|    }                                                                                               \
_ZN12CBlockHeader3SerI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_RKS_:
  178|     70|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJi7uint256S6_jjjEEEvRT_DpRKT0_:
 1013|     70|    {
 1014|     70|        ::SerializeMany(s, args...);
 1015|     70|    }
_Z13SerializeManyI12ParamsStreamIR12SizeComputer20TransactionSerParamsEJi7uint256S5_jjjEEvRT_DpRKT0_:
  995|     70|{
  996|     70|    (::Serialize(s, args), ...);
  997|     70|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsE7uint256Q12SerializableIT0_T_EEvRS7_RKS6_:
  753|    140|{
  754|    140|    a.Serialize(os);
  755|    140|}
_Z9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEvRT_i:
  261|     70|template<typename Stream> inline void Serialize(Stream& s, int32_t a ) { ser_writedata32(s, a); }
_Z14ser_readdata32I8AutoFileEjRT_:
  102|     62|{
  103|     62|    uint32_t obj;
  104|     62|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|     62|    return le32toh_internal(obj);
  106|     62|}
_Z11UnserializeI8AutoFileEvRT_Rj:
  277|     62|template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }
_ZNK20TransactionSerParamsclIRKNSt3__110shared_ptrIK12CTransactionEEEEDaOT_:
 1228|    732|    {                                                                                    \
 1229|    732|        return ParamsWrapper{*this, t};                                                  \
 1230|    732|    }
_ZNK20TransactionSerParamsclIRNSt3__110shared_ptrIK12CTransactionEEEEDaOT_:
 1228|  1.66k|    {                                                                                    \
 1229|  1.66k|        return ParamsWrapper{*this, t};                                                  \
 1230|  1.66k|    }
_ZNK20TransactionSerParamsclIR6CBlockEEDaOT_:
 1228|  1.72k|    {                                                                                    \
 1229|  1.72k|        return ParamsWrapper{*this, t};                                                  \
 1230|  1.72k|    }
_ZN13ParamsWrapperI20TransactionSerParams6CBlockEC2ERKS0_RS1_:
 1195|  1.72k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_ZN12SizeComputerC2Ev:
 1066|  8.19k|    SizeComputer() = default;
_ZN12ParamsStreamIR12SizeComputer20TransactionSerParamsEC2ES1_RKS2_:
 1127|  7.26k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  8.64k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEEC2ESA_:
  481|  50.4k|    explicit Wrapper(T obj) : m_object(obj) {}
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  8.12k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEEC2ESA_:
  481|  48.4k|    explicit Wrapper(T obj) : m_object(obj) {}
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSE_:
  497|  6.33k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEEC2ESB_:
  481|  20.5k|    explicit Wrapper(T obj) : m_object(obj) {}
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE7WrapperIT_RT0_EOSG_:
  497|     70|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEEC2ESD_:
  481|  6.45k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN13ParamsWrapperI20TransactionSerParamsK6CBlockEC2ERKS0_RS2_:
 1195|  1.54k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z11UnserializeI10DataStreamR13ParamsWrapperI20TransactionSerParams6CBlockEQ14UnserializableIT0_T_EEvRS7_OS6_:
  762|    192|{
  763|    192|    a.Unserialize(is);
  764|    192|}
_ZN13ParamsWrapperI20TransactionSerParams6CBlockE11UnserializeI10DataStreamEEvRT_:
 1205|    192|    {
 1206|    192|        ParamsStream ss{s, m_params};
 1207|    192|        ::Unserialize(ss, m_object);
 1208|    192|    }
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsEC2ES1_RKS2_:
 1127|  14.4k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER6CBlockQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|    192|{
  763|    192|    a.Unserialize(is);
  764|    192|}
_ZN6CBlock11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  228|    192|    {                                                                                               \
  229|    192|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    192|        Unser(s, *this);                                                                            \
  231|    192|    }
_ZN6CBlock5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_RS_:
  180|    192|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR12CBlockHeaderRNSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEEvRT_DpOT0_:
 1033|    192|    {
 1034|    192|        ::UnserializeMany(s, args...);
 1035|    192|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR12CBlockHeaderRNSt3__16vectorINS7_10shared_ptrIK12CTransactionEENS7_9allocatorISC_EEEEEEvRT_DpOT0_:
 1001|    192|{
 1002|    192|    (::Unserialize(s, args), ...);
 1003|    192|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER12CBlockHeaderQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|    192|{
  763|    192|    a.Unserialize(is);
  764|    192|}
_ZN12CBlockHeader11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  228|    192|    {                                                                                               \
  229|    192|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    192|        Unser(s, *this);                                                                            \
  231|    192|    }
_ZN12CBlockHeader5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_RS_:
  180|    192|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJRiR7uint256S8_RjS9_S9_EEEvRT_DpOT0_:
 1033|    192|    {
 1034|    192|        ::UnserializeMany(s, args...);
 1035|    192|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJRiR7uint256S7_RjS8_S8_EEvRT_DpOT0_:
 1001|    192|{
 1002|    192|    (::Unserialize(s, args), ...);
 1003|    192|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEvRT_Ri:
  276|    192|template<typename Stream> inline void Unserialize(Stream& s, int32_t& a ) { a = ser_readdata32(s); }
_Z14ser_readdata32I12ParamsStreamIR10DataStream20TransactionSerParamsEEjRT_:
  102|   194k|{
  103|   194k|    uint32_t obj;
  104|   194k|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|   194k|    return le32toh_internal(obj);
  106|   194k|}
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsE4readE4SpanISt4byteE:
 1136|  4.53M|    void read(Span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsE9GetStreamEv:
 1154|  4.53M|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  4.53M|        } else {
 1158|  4.53M|            return m_substream;
 1159|  4.53M|        }
 1160|  4.53M|    }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER7uint256Q14UnserializableIT0_T_EEvRS8_OS7_:
  762|    382|{
  763|    382|    a.Unserialize(is);
  764|    382|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEvRT_Rj:
  277|   194k|template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEENS5_9allocatorIS9_EEEvRT_RNS5_6vectorIT0_T1_EE:
  866|    191|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|    191|    } else {
  879|    191|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|    191|    }
  881|    191|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEQ14UnserializableIT0_T_EEvRSL_OSK_:
  762|    191|{
  763|    191|    a.Unserialize(is);
  764|    191|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  483|    286|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEvRT_RT0_:
  672|    286|    {
  673|    286|        Formatter formatter;
  674|    286|        v.clear();
  675|    286|        size_t size = ReadCompactSize(s);
  676|    286|        size_t allocated = 0;
  677|    553|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 267, False: 286]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|    267|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|    267|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|    267|            v.reserve(allocated);
  684|  22.4k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 22.2k, False: 267]
  ------------------
  685|  22.2k|                v.emplace_back();
  686|  22.2k|                formatter.Unser(s, v.back());
  687|  22.2k|            }
  688|    267|        }
  689|    286|    };
_Z15ReadCompactSizeI12ParamsStreamIR10DataStream20TransactionSerParamsEEmRT_b:
  340|  4.14M|{
  341|  4.14M|    uint8_t chSize = ser_readdata8(is);
  342|  4.14M|    uint64_t nSizeRet = 0;
  343|  4.14M|    if (chSize < 253)
  ------------------
  |  Branch (343:9): [True: 4.13M, False: 1.76k]
  ------------------
  344|  4.13M|    {
  345|  4.13M|        nSizeRet = chSize;
  346|  4.13M|    }
  347|  1.76k|    else if (chSize == 253)
  ------------------
  |  Branch (347:14): [True: 1.43k, False: 328]
  ------------------
  348|  1.43k|    {
  349|  1.43k|        nSizeRet = ser_readdata16(is);
  350|  1.43k|        if (nSizeRet < 253)
  ------------------
  |  Branch (350:13): [True: 4, False: 1.43k]
  ------------------
  351|      4|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|  1.43k|    }
  353|    328|    else if (chSize == 254)
  ------------------
  |  Branch (353:14): [True: 193, False: 135]
  ------------------
  354|    193|    {
  355|    193|        nSizeRet = ser_readdata32(is);
  356|    193|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (356:13): [True: 8, False: 185]
  ------------------
  357|      8|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|    193|    }
  359|    135|    else
  360|    135|    {
  361|    135|        nSizeRet = ser_readdata64(is);
  362|    135|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (362:13): [True: 25, False: 110]
  ------------------
  363|     25|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  364|    135|    }
  365|  4.13M|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (365:9): [True: 4.13M, False: 28]
  |  Branch (365:24): [True: 104, False: 4.13M]
  ------------------
  366|    104|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  367|    104|    }
  368|  4.13M|    return nSizeRet;
  369|  4.13M|}
_Z13ser_readdata8I12ParamsStreamIR10DataStream20TransactionSerParamsEEhRT_:
   84|  4.16M|{
   85|  4.16M|    uint8_t obj;
   86|  4.16M|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|  4.16M|    return obj;
   88|  4.16M|}
_Z14ser_readdata16I12ParamsStreamIR10DataStream20TransactionSerParamsEEtRT_:
   90|  1.43k|{
   91|  1.43k|    uint16_t obj;
   92|  1.43k|    s.read(AsWritableBytes(Span{&obj, 1}));
   93|  1.43k|    return le16toh_internal(obj);
   94|  1.43k|}
_Z14ser_readdata64I12ParamsStreamIR10DataStream20TransactionSerParamsEEmRT_:
  114|  23.6k|{
  115|  23.6k|    uint64_t obj;
  116|  23.6k|    s.read(AsWritableBytes(Span{&obj, 1}));
  117|  23.6k|    return le64toh_internal(obj);
  118|  23.6k|}
_ZN16DefaultFormatter5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEEEEvRT_RT0_:
  777|  34.6k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE12CTransactionEvRT_RNSt3__110shared_ptrIKT0_EE:
  985|  36.3k|{
  986|  36.3k|    p = std::make_shared<const T>(deserialize, is);
  987|  36.3k|}
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsErsIRjEERS3_OT_:
 1134|  72.2k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsErsIRNSt3__16vectorI5CTxInNS5_9allocatorIS7_EEEEEERS3_OT_:
 1134|  37.8k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE5CTxInNSt3__19allocatorIS5_EEEvRT_RNS6_6vectorIT0_T1_EE:
  866|  37.8k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  37.8k|    } else {
  879|  37.8k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  37.8k|    }
  881|  37.8k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS9_9allocatorISB_EEEEEQ14UnserializableIT0_T_EEvRSI_OSH_:
  762|  37.8k|{
  763|  37.8k|    a.Unserialize(is);
  764|  37.8k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  483|  37.8k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__16vectorI5CTxInNS8_9allocatorISA_EEEEEEvRT_RT0_:
  672|  37.8k|    {
  673|  37.8k|        Formatter formatter;
  674|  37.8k|        v.clear();
  675|  37.8k|        size_t size = ReadCompactSize(s);
  676|  37.8k|        size_t allocated = 0;
  677|  48.2k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 10.4k, False: 37.8k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  10.4k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  10.4k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  10.4k|            v.reserve(allocated);
  684|  71.3k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 60.9k, False: 10.4k]
  ------------------
  685|  60.9k|                v.emplace_back();
  686|  60.9k|                formatter.Unser(s, v.back());
  687|  60.9k|            }
  688|  10.4k|        }
  689|  37.8k|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsE5CTxInEEvRT_RT0_:
  777|  60.9k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER5CTxInQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  60.9k|{
  763|  60.9k|    a.Unserialize(is);
  764|  60.9k|}
_ZN5CTxIn11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  228|  60.9k|    {                                                                                               \
  229|  60.9k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  60.9k|        Unser(s, *this);                                                                            \
  231|  60.9k|    }
_ZN5CTxIn5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_RS_:
  180|  60.9k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR9COutPointR7CScriptRjEEEvRT_DpOT0_:
 1033|  60.9k|    {
 1034|  60.9k|        ::UnserializeMany(s, args...);
 1035|  60.9k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR9COutPointR7CScriptRjEEvRT_DpOT0_:
 1001|  60.9k|{
 1002|  60.9k|    (::Unserialize(s, args), ...);
 1003|  60.9k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER9COutPointQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  60.9k|{
  763|  60.9k|    a.Unserialize(is);
  764|  60.9k|}
_ZN9COutPoint11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  228|  60.9k|    {                                                                                               \
  229|  60.9k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  60.9k|        Unser(s, *this);                                                                            \
  231|  60.9k|    }
_ZN9COutPoint5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_RS_:
  180|  60.9k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR22transaction_identifierILb0EERjEEEvRT_DpOT0_:
 1033|  60.9k|    {
 1034|  60.9k|        ::UnserializeMany(s, args...);
 1035|  60.9k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR22transaction_identifierILb0EERjEEvRT_DpOT0_:
 1001|  60.9k|{
 1002|  60.9k|    (::Unserialize(s, args), ...);
 1003|  60.9k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER22transaction_identifierILb0EEQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|  60.9k|{
  763|  60.9k|    a.Unserialize(is);
  764|  60.9k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER7CScriptQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  84.3k|{
  763|  84.3k|    a.Unserialize(is);
  764|  84.3k|}
_ZN7CScript11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  228|  84.3k|    {                                                                                               \
  229|  84.3k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  84.3k|        Unser(s, *this);                                                                            \
  231|  84.3k|    }
_ZN7CScript5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_RS_:
  180|  84.3k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR9prevectorILj28EhjiEEEEvRT_DpOT0_:
 1033|  84.3k|    {
 1034|  84.3k|        ::UnserializeMany(s, args...);
 1035|  84.3k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJR9prevectorILj28EhjiEEEvRT_DpOT0_:
 1001|  84.3k|{
 1002|  84.3k|    (::Unserialize(s, args), ...);
 1003|  84.3k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsELj28EhEvRT_R9prevectorIXT0_ET1_jiE:
  823|  84.3k|{
  824|  84.3k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  825|       |        // Limit size per read so bogus size value won't cause out of memory
  826|  84.3k|        v.clear();
  827|  84.3k|        unsigned int nSize = ReadCompactSize(is);
  828|  84.3k|        unsigned int i = 0;
  829|   142k|        while (i < nSize) {
  ------------------
  |  Branch (829:16): [True: 58.1k, False: 84.3k]
  ------------------
  830|  58.1k|            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  831|  58.1k|            v.resize_uninitialized(i + blk);
  832|  58.1k|            is.read(AsWritableBytes(Span{&v[i], blk}));
  833|  58.1k|            i += blk;
  834|  58.1k|        }
  835|       |    } else {
  836|       |        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  837|       |    }
  838|  84.3k|}
_Z6AsBaseI9prevectorILj28EhjiE7CScriptERT_RT0_:
  145|  87.5k|{
  146|  87.5k|    static_assert(std::is_base_of_v<Out, In>);
  147|  87.5k|    return x;
  148|  87.5k|}
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|  37.8k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEEC2ES9_:
  481|  39.4k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsErsIRhEERS3_OT_:
 1134|  27.3k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEvRT_Rh:
  273|  27.3k|template<typename Stream> inline void Unserialize(Stream& s, uint8_t& a ) { a = ser_readdata8(s); }
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsErsIRNSt3__16vectorI6CTxOutNS5_9allocatorIS7_EEEEEERS3_OT_:
 1134|  10.2k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE6CTxOutNSt3__19allocatorIS5_EEEvRT_RNS6_6vectorIT0_T1_EE:
  866|  10.2k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  10.2k|    } else {
  879|  10.2k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  10.2k|    }
  881|  10.2k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS9_9allocatorISB_EEEEEQ14UnserializableIT0_T_EEvRSI_OSH_:
  762|  10.2k|{
  763|  10.2k|    a.Unserialize(is);
  764|  10.2k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  483|  10.2k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__16vectorI6CTxOutNS8_9allocatorISA_EEEEEEvRT_RT0_:
  672|  10.2k|    {
  673|  10.2k|        Formatter formatter;
  674|  10.2k|        v.clear();
  675|  10.2k|        size_t size = ReadCompactSize(s);
  676|  10.2k|        size_t allocated = 0;
  677|  18.0k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 7.81k, False: 10.2k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  7.81k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  7.81k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  7.81k|            v.reserve(allocated);
  684|  31.3k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 23.5k, False: 7.81k]
  ------------------
  685|  23.5k|                v.emplace_back();
  686|  23.5k|                formatter.Unser(s, v.back());
  687|  23.5k|            }
  688|  7.81k|        }
  689|  10.2k|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsE6CTxOutEEvRT_RT0_:
  777|  23.5k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER6CTxOutQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  23.5k|{
  763|  23.5k|    a.Unserialize(is);
  764|  23.5k|}
_ZN6CTxOut11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  228|  23.5k|    {                                                                                               \
  229|  23.5k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  23.5k|        Unser(s, *this);                                                                            \
  231|  23.5k|    }
_ZN6CTxOut5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_RS_:
  180|  23.5k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJRlR7CScriptEEEvRT_DpOT0_:
 1033|  23.5k|    {
 1034|  23.5k|        ::UnserializeMany(s, args...);
 1035|  23.5k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStream20TransactionSerParamsEJRlR7CScriptEEvRT_DpOT0_:
 1001|  23.5k|{
 1002|  23.5k|    (::Unserialize(s, args), ...);
 1003|  23.5k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEvRT_Rl:
  278|  23.5k|template<typename Stream> inline void Unserialize(Stream& s, int64_t& a ) { a = ser_readdata64(s); }
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|  10.2k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEEC2ES9_:
  481|  11.8k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN12ParamsStreamIR10DataStream20TransactionSerParamsErsIRNSt3__16vectorINS6_IhNS5_9allocatorIhEEEENS7_IS9_EEEEEERS3_OT_:
 1134|  14.7k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__16vectorIhNS5_9allocatorIhEEEENS7_IS9_EEEvRT_RNS6_IT0_T1_EE:
  866|  14.7k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  14.7k|    } else {
  879|  14.7k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  14.7k|    }
  881|  14.7k|}
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINSA_IhNS9_9allocatorIhEEEENSB_ISD_EEEEEQ14UnserializableIT0_T_EEvRSJ_OSI_:
  762|  14.7k|{
  763|  14.7k|    a.Unserialize(is);
  764|  14.7k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  483|  14.7k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__16vectorINS9_IhNS8_9allocatorIhEEEENSA_ISC_EEEEEEvRT_RT0_:
  672|  14.7k|    {
  673|  14.7k|        Formatter formatter;
  674|  14.7k|        v.clear();
  675|  14.7k|        size_t size = ReadCompactSize(s);
  676|  14.7k|        size_t allocated = 0;
  677|  21.1k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 6.45k, False: 14.7k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  6.45k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  6.45k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  6.45k|            v.reserve(allocated);
  684|  3.99M|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 3.99M, False: 6.45k]
  ------------------
  685|  3.99M|                v.emplace_back();
  686|  3.99M|                formatter.Unser(s, v.back());
  687|  3.99M|            }
  688|  6.45k|        }
  689|  14.7k|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR10DataStream20TransactionSerParamsENSt3__16vectorIhNS6_9allocatorIhEEEEEEvRT_RT0_:
  777|  3.99M|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEhNSt3__19allocatorIhEEEvRT_RNS5_6vectorIT0_T1_EE:
  866|  3.99M|{
  867|  3.99M|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|  3.99M|        v.clear();
  870|  3.99M|        unsigned int nSize = ReadCompactSize(is);
  871|  3.99M|        unsigned int i = 0;
  872|  4.02M|        while (i < nSize) {
  ------------------
  |  Branch (872:16): [True: 27.6k, False: 3.99M]
  ------------------
  873|  27.6k|            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|  27.6k|            v.resize(i + blk);
  875|  27.6k|            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|  27.6k|            i += blk;
  877|  27.6k|        }
  878|       |    } else {
  879|       |        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|       |    }
  881|  3.99M|}
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSD_:
  497|  14.7k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEEC2ESA_:
  481|  14.7k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK12ParamsStreamIR10DataStream20TransactionSerParamsE9GetParamsIS2_EERKDav:
 1144|  36.3k|    {
 1145|  36.3k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  36.3k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  36.3k|    }
block.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE7WrapperIT_RT0_EOSF_:
  497|    191|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEEC2ESC_:
  481|  1.81k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z6AsBaseI12CBlockHeader6CBlockERT_RT0_:
  145|  1.72k|{
  146|  1.72k|    static_assert(std::is_base_of_v<Out, In>);
  147|  1.72k|    return x;
  148|  1.72k|}
_Z11UnserializeI10DataStreamR12CBlockHeaderQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|  3.63k|{
  763|  3.63k|    a.Unserialize(is);
  764|  3.63k|}
_ZN12CBlockHeader11UnserializeI10DataStreamEEvRT_:
  228|  3.63k|    {                                                                                               \
  229|  3.63k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  3.63k|        Unser(s, *this);                                                                            \
  231|  3.63k|    }
_ZN12CBlockHeader5UnserI10DataStreamEEvRT_RS_:
  180|  3.63k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRiR7uint256S4_RjS5_S5_EEEvRT_DpOT0_:
 1033|  3.63k|    {
 1034|  3.63k|        ::UnserializeMany(s, args...);
 1035|  3.63k|    }
_Z15UnserializeManyI10DataStreamJRiR7uint256S3_RjS4_S4_EEvRT_DpOT0_:
 1001|  3.63k|{
 1002|  3.63k|    (::Unserialize(s, args), ...);
 1003|  3.63k|}
_Z11UnserializeI10DataStreamEvRT_Ri:
  276|  20.5k|template<typename Stream> inline void Unserialize(Stream& s, int32_t& a ) { a = ser_readdata32(s); }
_Z14ser_readdata32I10DataStreamEjRT_:
  102|  3.00M|{
  103|  3.00M|    uint32_t obj;
  104|  3.00M|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|  3.00M|    return le32toh_internal(obj);
  106|  3.00M|}
_Z11UnserializeI10DataStreamR7uint256Q14UnserializableIT0_T_EEvRS4_OS3_:
  762|  2.95M|{
  763|  2.95M|    a.Unserialize(is);
  764|  2.95M|}
_Z11UnserializeI10DataStreamEvRT_Rj:
  277|  2.97M|template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }
_Z11UnserializeI10DataStreamR13CBlockLocatorQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|    160|{
  763|    160|    a.Unserialize(is);
  764|    160|}
_ZN13CBlockLocator11UnserializeI10DataStreamEEvRT_:
  228|    160|    {                                                                                               \
  229|    160|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    160|        Unser(s, *this);                                                                            \
  231|    160|    }
_ZN13CBlockLocator5UnserI10DataStreamEEvRT_RS_:
  180|    160|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRiEEEvRT_DpOT0_:
 1033|    160|    {
 1034|    160|        ::UnserializeMany(s, args...);
 1035|    160|    }
_Z15UnserializeManyI10DataStreamJRiEEvRT_DpOT0_:
 1001|    160|{
 1002|    160|    (::Unserialize(s, args), ...);
 1003|    160|}
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRNSt3__16vectorI7uint256NS2_9allocatorIS4_EEEEEEEvRT_DpOT0_:
 1033|    154|    {
 1034|    154|        ::UnserializeMany(s, args...);
 1035|    154|    }
_Z15UnserializeManyI10DataStreamJRNSt3__16vectorI7uint256NS1_9allocatorIS3_EEEEEEvRT_DpOT0_:
 1001|    154|{
 1002|    154|    (::Unserialize(s, args), ...);
 1003|    154|}
_Z11UnserializeI10DataStream7uint256NSt3__19allocatorIS1_EEEvRT_RNS2_6vectorIT0_T1_EE:
  866|    154|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|    154|    } else {
  879|    154|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|    154|    }
  881|    154|}
_Z11UnserializeI10DataStream7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI7uint256NS5_9allocatorIS7_EEEEEQ14UnserializableIT0_T_EEvRSE_OSD_:
  762|    154|{
  763|    154|    a.Unserialize(is);
  764|    154|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI7uint256NS3_9allocatorIS5_EEEEE11UnserializeI10DataStreamEEvRT_:
  483|    154|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI10DataStreamNSt3__16vectorI7uint256NS4_9allocatorIS6_EEEEEEvRT_RT0_:
  672|    154|    {
  673|    154|        Formatter formatter;
  674|    154|        v.clear();
  675|    154|        size_t size = ReadCompactSize(s);
  676|    154|        size_t allocated = 0;
  677|    266|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 112, False: 154]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|    112|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|    112|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|    112|            v.reserve(allocated);
  684|  1.63k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 1.52k, False: 112]
  ------------------
  685|  1.52k|                v.emplace_back();
  686|  1.52k|                formatter.Unser(s, v.back());
  687|  1.52k|            }
  688|    112|        }
  689|    154|    };
_Z15ReadCompactSizeI10DataStreamEmRT_b:
  340|  30.6k|{
  341|  30.6k|    uint8_t chSize = ser_readdata8(is);
  342|  30.6k|    uint64_t nSizeRet = 0;
  343|  30.6k|    if (chSize < 253)
  ------------------
  |  Branch (343:9): [True: 29.4k, False: 1.19k]
  ------------------
  344|  29.4k|    {
  345|  29.4k|        nSizeRet = chSize;
  346|  29.4k|    }
  347|  1.19k|    else if (chSize == 253)
  ------------------
  |  Branch (347:14): [True: 876, False: 314]
  ------------------
  348|    876|    {
  349|    876|        nSizeRet = ser_readdata16(is);
  350|    876|        if (nSizeRet < 253)
  ------------------
  |  Branch (350:13): [True: 6, False: 870]
  ------------------
  351|      6|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|    876|    }
  353|    314|    else if (chSize == 254)
  ------------------
  |  Branch (353:14): [True: 166, False: 148]
  ------------------
  354|    166|    {
  355|    166|        nSizeRet = ser_readdata32(is);
  356|    166|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (356:13): [True: 9, False: 157]
  ------------------
  357|      9|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|    166|    }
  359|    148|    else
  360|    148|    {
  361|    148|        nSizeRet = ser_readdata64(is);
  362|    148|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (362:13): [True: 21, False: 127]
  ------------------
  363|     21|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  364|    148|    }
  365|  30.5k|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (365:9): [True: 30.5k, False: 63]
  |  Branch (365:24): [True: 94, False: 30.4k]
  ------------------
  366|     94|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  367|     94|    }
  368|  30.4k|    return nSizeRet;
  369|  30.5k|}
_Z13ser_readdata8I10DataStreamEhRT_:
   84|  39.1k|{
   85|  39.1k|    uint8_t obj;
   86|  39.1k|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|  39.1k|    return obj;
   88|  39.1k|}
_Z14ser_readdata16I10DataStreamEtRT_:
   90|    876|{
   91|    876|    uint16_t obj;
   92|    876|    s.read(AsWritableBytes(Span{&obj, 1}));
   93|    876|    return le16toh_internal(obj);
   94|    876|}
_Z14ser_readdata64I10DataStreamEmRT_:
  114|  17.6k|{
  115|  17.6k|    uint64_t obj;
  116|  17.6k|    s.read(AsWritableBytes(Span{&obj, 1}));
  117|  17.6k|    return le64toh_internal(obj);
  118|  17.6k|}
_ZN16DefaultFormatter5UnserI10DataStream7uint256EEvRT_RT0_:
  777|  1.52k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
block_header.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI7uint256NS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|    154|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI7uint256NS3_9allocatorIS5_EEEEEC2ES9_:
  481|    154|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN15CheckVarIntModeIL10VarIntMode0EjEC2Ev:
  410|    552|    {
  411|    552|        static_assert(Mode != VarIntMode::DEFAULT || std::is_unsigned<I>::value, "Unsigned type required with mode DEFAULT.");
  412|    552|        static_assert(Mode != VarIntMode::NONNEGATIVE_SIGNED || std::is_signed<I>::value, "Signed type required with mode NONNEGATIVE_SIGNED.");
  413|    552|    }
_ZN7WrapperI15VarIntFormatterIL10VarIntMode0EERjEC2ES3_:
  481|    552|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamEvRT_Rh:
  273|     59|template<typename Stream> inline void Unserialize(Stream& s, uint8_t& a ) { a = ser_readdata8(s); }
_Z11UnserializeI10DataStreamhNSt3__19allocatorIhEEEvRT_RNS1_6vectorIT0_T1_EE:
  866|     78|{
  867|     78|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|     78|        v.clear();
  870|     78|        unsigned int nSize = ReadCompactSize(is);
  871|     78|        unsigned int i = 0;
  872|    139|        while (i < nSize) {
  ------------------
  |  Branch (872:16): [True: 61, False: 78]
  ------------------
  873|     61|            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|     61|            v.resize(i + blk);
  875|     61|            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|     61|            i += blk;
  877|     61|        }
  878|       |    } else {
  879|       |        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|       |    }
  881|     78|}
_Z14ser_writedata8I12VectorWriterEvRT_h:
   55|  60.9k|{
   56|  60.9k|    s.write(AsBytes(Span{&obj, 1}));
   57|  60.9k|}
_Z9SerializeI10DataStreamEvRT_h:
  258|  17.0k|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_Z14ser_writedata8I10DataStreamEvRT_h:
   55|  35.3k|{
   56|  35.3k|    s.write(AsBytes(Span{&obj, 1}));
   57|  35.3k|}
_Z9SerializeI10DataStream7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  753|    668|{
  754|    668|    a.Serialize(os);
  755|    668|}
_Z9SerializeI10DataStreamTk9BasicByteKhEvRT_4SpanIT0_E:
  268|  1.22k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI10DataStreamhNSt3__19allocatorIhEEEvRT_RKNS1_6vectorIT0_T1_EE:
  846|  16.4k|{
  847|  16.4k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|  16.4k|        WriteCompactSize(os, v.size());
  849|  16.4k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (849:13): [True: 16.4k, False: 0]
  ------------------
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|       |    } else {
  859|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|       |    }
  861|  16.4k|}
_Z16WriteCompactSizeI10DataStreamEvRT_m:
  309|  16.4k|{
  310|  16.4k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 16.4k, False: 0]
  ------------------
  311|  16.4k|    {
  312|  16.4k|        ser_writedata8(os, nSize);
  313|  16.4k|    }
  314|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 0, False: 0]
  ------------------
  315|      0|    {
  316|      0|        ser_writedata8(os, 253);
  317|      0|        ser_writedata16(os, nSize);
  318|      0|    }
  319|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|    {
  321|      0|        ser_writedata8(os, 254);
  322|      0|        ser_writedata32(os, nSize);
  323|      0|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|  16.4k|    return;
  330|  16.4k|}
_Z15ser_writedata32I10DataStreamEvRT_j:
   69|  1.33k|{
   70|  1.33k|    obj = htole32_internal(obj);
   71|  1.33k|    s.write(AsBytes(Span{&obj, 1}));
   72|  1.33k|}
_Z15ser_writedata64I10DataStreamEvRT_m:
   79|    334|{
   80|    334|    obj = htole64_internal(obj);
   81|    334|    s.write(AsBytes(Span{&obj, 1}));
   82|    334|}
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEC2ES1_RKS3_:
 1127|  17.8k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEERS3_Q14UnserializableIT0_T_EEvRS8_OS7_:
  762|   299k|{
  763|   299k|    a.Unserialize(is);
  764|   299k|}
_ZN8CAddress11UnserializeI12ParamsStreamIR10DataStreamNS_9SerParamsEEEEvRT_:
  228|   299k|    {                                                                                               \
  229|   299k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|   299k|        Unser(s, *this);                                                                            \
  231|   299k|    }
_ZN8CAddress5UnserI12ParamsStreamIR10DataStreamNS_9SerParamsEEEEvRT_RS_:
  180|   299k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZNK12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE9GetParamsIS3_EERKDav:
 1144|   299k|    {
 1145|   299k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|   299k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|   299k|    }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEvRT_Rj:
  277|   299k|template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }
_Z14ser_readdata32I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEjRT_:
  102|   300k|{
  103|   300k|    uint32_t obj;
  104|   300k|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|   300k|    return le32toh_internal(obj);
  106|   300k|}
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE4readE4SpanISt4byteE:
 1136|   655k|    void read(Span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE9GetStreamEv:
 1154|  1.64M|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  1.64M|        } else {
 1158|  1.64M|            return m_substream;
 1159|  1.64M|        }
 1160|  1.64M|    }
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNSB_8durationIxNSA_5ratioILl1ELl1EEEEEEEEEEEvRT_DpOT0_:
 1033|   299k|    {
 1034|   299k|        ::UnserializeMany(s, args...);
 1035|   299k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEEEvRT_DpOT0_:
 1001|   299k|{
 1002|   299k|    (::Unserialize(s, args), ...);
 1003|   299k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEQ14UnserializableIT0_T_EEvRSM_OSL_:
  762|   299k|{
  763|   299k|    a.Unserialize(is);
  764|   299k|}
_ZN7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  483|   299k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15ChronoFormatterIjLb1EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEENSt3__16chrono10time_pointI9NodeClockNS9_8durationIxNS8_5ratioILl1ELl1EEEEEEEEEvRT_RT0_:
  591|   299k|    {
  592|   299k|        U u;
  593|   299k|        s >> u;
  594|       |        // Lossy deserialization does not make sense, so force Wnarrowing
  595|   299k|        tp = Tp{typename Tp::duration{typename Tp::duration::rep{u}}};
  596|   299k|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRjEERS4_OT_:
 1134|   299k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
deserialize.cpp:_ZL5UsingI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE7WrapperIT_RT0_EOSE_:
  497|   299k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15ChronoFormatterIjLb1EERNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEEC2ESB_:
  481|   299k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN17ActionUnserialize8SerWriteI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEERS4_ZNS4_16SerializationOpsIS6_S4_S_EEvRT0_RT_T1_EUlRS6_RKS4_E_EEvSC_OS9_OSD_:
 1045|   194k|    {
 1046|   194k|    }
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ7WrapperI20CompactSizeFormatterILb0EERmEEEEvRT_DpOT0_:
 1033|   194k|    {
 1034|   194k|        ::UnserializeMany(s, args...);
 1035|   194k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR7WrapperI20CompactSizeFormatterILb0EERmEEEvRT_DpOT0_:
 1001|   194k|{
 1002|   194k|    (::Unserialize(s, args), ...);
 1003|   194k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI20CompactSizeFormatterILb0EERmEQ14UnserializableIT0_T_EEvRSD_OSC_:
  762|   194k|{
  763|   194k|    a.Unserialize(is);
  764|   194k|}
_ZN7WrapperI20CompactSizeFormatterILb0EERmE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  483|   194k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb0EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEmEEvRT_RT0_:
  569|   194k|    {
  570|   194k|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  571|   194k|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (571:13): [True: 21, False: 194k]
  |  Branch (571:50): [True: 0, False: 194k]
  ------------------
  572|      0|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  573|      0|        }
  574|   194k|        v = n;
  575|   194k|    }
_Z15ReadCompactSizeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEmRT_b:
  340|   212k|{
  341|   212k|    uint8_t chSize = ser_readdata8(is);
  342|   212k|    uint64_t nSizeRet = 0;
  343|   212k|    if (chSize < 253)
  ------------------
  |  Branch (343:9): [True: 207k, False: 5.27k]
  ------------------
  344|   207k|    {
  345|   207k|        nSizeRet = chSize;
  346|   207k|    }
  347|  5.27k|    else if (chSize == 253)
  ------------------
  |  Branch (347:14): [True: 627, False: 4.65k]
  ------------------
  348|    627|    {
  349|    627|        nSizeRet = ser_readdata16(is);
  350|    627|        if (nSizeRet < 253)
  ------------------
  |  Branch (350:13): [True: 3, False: 624]
  ------------------
  351|      3|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|    627|    }
  353|  4.65k|    else if (chSize == 254)
  ------------------
  |  Branch (353:14): [True: 188, False: 4.46k]
  ------------------
  354|    188|    {
  355|    188|        nSizeRet = ser_readdata32(is);
  356|    188|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (356:13): [True: 11, False: 177]
  ------------------
  357|     11|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|    188|    }
  359|  4.46k|    else
  360|  4.46k|    {
  361|  4.46k|        nSizeRet = ser_readdata64(is);
  362|  4.46k|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (362:13): [True: 17, False: 4.44k]
  ------------------
  363|     17|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  364|  4.46k|    }
  365|   212k|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (365:9): [True: 17.8k, False: 194k]
  |  Branch (365:24): [True: 76, False: 17.7k]
  ------------------
  366|     76|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  367|     76|    }
  368|   212k|    return nSizeRet;
  369|   212k|}
_Z13ser_readdata8I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEhRT_:
   84|   229k|{
   85|   229k|    uint8_t obj;
   86|   229k|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|   229k|    return obj;
   88|   229k|}
_Z14ser_readdata16I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEtRT_:
   90|    627|{
   91|    627|    uint16_t obj;
   92|    627|    s.read(AsWritableBytes(Span{&obj, 1}));
   93|    627|    return le16toh_internal(obj);
   94|    627|}
_Z14ser_readdata64I12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEmRT_:
  114|  4.45k|{
  115|  4.45k|    uint64_t obj;
  116|  4.45k|    s.read(AsWritableBytes(Span{&obj, 1}));
  117|  4.45k|    return le64toh_internal(obj);
  118|  4.45k|}
deserialize.cpp:_ZL5UsingI20CompactSizeFormatterILb0EERmE7WrapperIT_RT0_EOS5_:
  497|   194k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI20CompactSizeFormatterILb0EERmEC2ES2_:
  481|   194k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN17ActionUnserialize7SerReadI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEERS4_ZNS4_16SerializationOpsIS6_S4_S_EEvRT0_RT_T1_EUlRS6_S7_E_EEvSC_OS9_OSD_:
 1039|   194k|    {
 1040|   194k|        fn(s, std::forward<Type>(obj));
 1041|   194k|    }
_ZZN8CAddress16SerializationOpsI12ParamsStreamIR10DataStreamNS_9SerParamsEES_17ActionUnserializeEEvRT0_RT_T1_ENKUlRS5_RS_E_clESC_SD_:
  157|   194k|#define SER_READ(obj, code) ser_action.SerRead(s, obj, [&](Stream& s, typename std::remove_const<Type>::type& obj) { code; })
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEEEEvRT_DpOT0_:
 1033|   105k|    {
 1034|   105k|        ::UnserializeMany(s, args...);
 1035|   105k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEEEvRT_DpOT0_:
 1001|   105k|{
 1002|   105k|    (::Unserialize(s, args), ...);
 1003|   105k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEQ14UnserializableIT0_T_EEvRSE_OSD_:
  762|   105k|{
  763|   105k|    a.Unserialize(is);
  764|   105k|}
_ZN7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  483|   105k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi8ELb0EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE12ServiceFlagsEEvRT_RT0_:
  547|   105k|    {
  548|   105k|        using U = typename std::conditional<std::is_enum<I>::value, std::underlying_type<I>, std::common_type<I>>::type::type;
  549|   105k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  550|   105k|        uint64_t raw = 0;
  551|   105k|        if (BigEndian) {
  ------------------
  |  Branch (551:13): [Folded - Ignored]
  ------------------
  552|      0|            s.read(AsWritableBytes(Span{&raw, 1}).last(Bytes));
  553|      0|            v = static_cast<I>(be64toh_internal(raw));
  554|   105k|        } else {
  555|   105k|            s.read(AsWritableBytes(Span{&raw, 1}).first(Bytes));
  556|   105k|            v = static_cast<I>(le64toh_internal(raw));
  557|   105k|        }
  558|   105k|    }
deserialize.cpp:_ZL5UsingI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE7WrapperIT_RT0_EOS6_:
  497|   105k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEC2ES3_:
  481|   121k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJ13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEEEEvRT_DpOT0_:
 1033|   299k|    {
 1034|   299k|        ::UnserializeMany(s, args...);
 1035|   299k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEJR13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEEEvRT_DpOT0_:
 1001|   299k|{
 1002|   299k|    (::Unserialize(s, args), ...);
 1003|   299k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEQ14UnserializableIT0_T_EEvRSD_OSC_:
  762|   299k|{
  763|   299k|    a.Unserialize(is);
  764|   299k|}
_ZN13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
 1205|   299k|    {
 1206|   299k|        ParamsStream ss{s, m_params};
 1207|   299k|        ::Unserialize(ss, m_object);
 1208|   299k|    }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEC2ES5_RKS7_:
 1127|   299k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEER8CServiceQ14UnserializableIT0_T_EEvRSD_OSC_:
  762|   299k|{
  763|   299k|    a.Unserialize(is);
  764|   299k|}
_ZN8CService11UnserializeI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  228|   299k|    {                                                                                               \
  229|   299k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|   299k|        Unser(s, *this);                                                                            \
  231|   299k|    }
_ZN8CService5UnserI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_RS_:
  180|   299k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIRS1_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEJRS8_7WrapperI19CustomUintFormatterILi2ELb1EERtEEEEvRT_DpOT0_:
 1033|   299k|    {
 1034|   299k|        ::UnserializeMany(s, args...);
 1035|   299k|    }
_Z15UnserializeManyI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEJRS7_R7WrapperI19CustomUintFormatterILi2ELb1EERtEEEvRT_DpOT0_:
 1001|   299k|{
 1002|   299k|    (::Unserialize(s, args), ...);
 1003|   299k|}
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEERS7_Q14UnserializableIT0_T_EEvRSC_OSB_:
  762|   299k|{
  763|   299k|    a.Unserialize(is);
  764|   299k|}
_ZNK12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE9GetParamsIS7_EERKDav:
 1144|   299k|    {
 1145|   299k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|   299k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|   299k|    }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsIRhEERS8_OT_:
 1134|   194k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEvRT_Rh:
  273|   194k|template<typename Stream> inline void Unserialize(Stream& s, uint8_t& a ) { a = ser_readdata8(s); }
_Z13ser_readdata8I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEhRT_:
   84|   389k|{
   85|   389k|    uint8_t obj;
   86|   389k|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|   389k|    return obj;
   88|   389k|}
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE4readE4SpanISt4byteE:
 1136|   809k|    void read(Span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE9GetStreamEv:
 1154|   989k|    {
 1155|   989k|        if constexpr (ContainsStream<SubStream>) {
 1156|   989k|            return m_substream.GetStream();
 1157|       |        } else {
 1158|       |            return m_substream;
 1159|       |        }
 1160|   989k|    }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsI7WrapperI20CompactSizeFormatterILb1EERmEEERS8_OT_:
 1134|   194k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEER7WrapperI20CompactSizeFormatterILb1EERmEQ14UnserializableIT0_T_EEvRSH_OSG_:
  762|   194k|{
  763|   194k|    a.Unserialize(is);
  764|   194k|}
_ZN7WrapperI20CompactSizeFormatterILb1EERmE11UnserializeI12ParamsStreamIRS5_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  483|   194k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb1EE5UnserI12ParamsStreamIRS2_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEmEEvRT_RT0_:
  569|   194k|    {
  570|   194k|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  571|   194k|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (571:13): [True: 110, False: 194k]
  |  Branch (571:50): [True: 0, False: 194k]
  ------------------
  572|      0|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  573|      0|        }
  574|   194k|        v = n;
  575|   194k|    }
_Z15ReadCompactSizeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEmRT_b:
  340|   194k|{
  341|   194k|    uint8_t chSize = ser_readdata8(is);
  342|   194k|    uint64_t nSizeRet = 0;
  343|   194k|    if (chSize < 253)
  ------------------
  |  Branch (343:9): [True: 194k, False: 168]
  ------------------
  344|   194k|    {
  345|   194k|        nSizeRet = chSize;
  346|   194k|    }
  347|    168|    else if (chSize == 253)
  ------------------
  |  Branch (347:14): [True: 48, False: 120]
  ------------------
  348|     48|    {
  349|     48|        nSizeRet = ser_readdata16(is);
  350|     48|        if (nSizeRet < 253)
  ------------------
  |  Branch (350:13): [True: 1, False: 47]
  ------------------
  351|      1|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|     48|    }
  353|    120|    else if (chSize == 254)
  ------------------
  |  Branch (353:14): [True: 25, False: 95]
  ------------------
  354|     25|    {
  355|     25|        nSizeRet = ser_readdata32(is);
  356|     25|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (356:13): [True: 3, False: 22]
  ------------------
  357|      3|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|     25|    }
  359|     95|    else
  360|     95|    {
  361|     95|        nSizeRet = ser_readdata64(is);
  362|     95|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (362:13): [True: 7, False: 88]
  ------------------
  363|      7|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  364|     95|    }
  365|   194k|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (365:9): [True: 194k, False: 16]
  |  Branch (365:24): [True: 83, False: 194k]
  ------------------
  366|     83|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  367|     83|    }
  368|   194k|    return nSizeRet;
  369|   194k|}
_Z14ser_readdata16I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEtRT_:
   90|     48|{
   91|     48|    uint16_t obj;
   92|     48|    s.read(AsWritableBytes(Span{&obj, 1}));
   93|     48|    return le16toh_internal(obj);
   94|     48|}
_Z14ser_readdata32I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEjRT_:
  102|     25|{
  103|     25|    uint32_t obj;
  104|     25|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|     25|    return le32toh_internal(obj);
  106|     25|}
_Z14ser_readdata64I12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEmRT_:
  114|     88|{
  115|     88|    uint64_t obj;
  116|     88|    s.read(AsWritableBytes(Span{&obj, 1}));
  117|     88|    return le64toh_internal(obj);
  118|     88|}
deserialize.cpp:_ZL5UsingI20CompactSizeFormatterILb1EERmE7WrapperIT_RT0_EOS5_:
  497|   211k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI20CompactSizeFormatterILb1EERmEC2ES2_:
  481|   211k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsI4SpanIhEEERS8_OT_:
 1134|  15.1k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEETk9BasicBytehEvRT_4SpanIT0_E:
  283|  15.1k|template <typename Stream, BasicByte B> void Unserialize(Stream& s, Span<B> span) { s.read(AsWritableBytes(span)); }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE6ignoreEm:
 1137|   179k|    void ignore(size_t num) { GetStream().ignore(num); }
_ZN12ParamsStreamIRS_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEErsIRA16_hEERS8_OT_:
 1134|   105k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEETk9BasicBytehLi16EEvRT_RAT1__T0_:
  280|   105k|template <typename Stream, BasicByte B, int N> void Unserialize(Stream& s, B (&a)[N]) { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI12ParamsStreamIRS0_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEER7WrapperI19CustomUintFormatterILi2ELb1EERtEQ14UnserializableIT0_T_EEvRSH_OSG_:
  762|   299k|{
  763|   299k|    a.Unserialize(is);
  764|   299k|}
_ZN7WrapperI19CustomUintFormatterILi2ELb1EERtE11UnserializeI12ParamsStreamIRS5_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  483|   299k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi2ELb1EE5UnserI12ParamsStreamIRS2_IR10DataStreamN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEtEEvRT_RT0_:
  547|   299k|    {
  548|   299k|        using U = typename std::conditional<std::is_enum<I>::value, std::underlying_type<I>, std::common_type<I>>::type::type;
  549|   299k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  550|   299k|        uint64_t raw = 0;
  551|   299k|        if (BigEndian) {
  ------------------
  |  Branch (551:13): [Folded - Ignored]
  ------------------
  552|   299k|            s.read(AsWritableBytes(Span{&raw, 1}).last(Bytes));
  553|   299k|            v = static_cast<I>(be64toh_internal(raw));
  554|   299k|        } else {
  555|      0|            s.read(AsWritableBytes(Span{&raw, 1}).first(Bytes));
  556|      0|            v = static_cast<I>(le64toh_internal(raw));
  557|      0|        }
  558|   299k|    }
_Z6AsBaseI8CNetAddr8CServiceERT_RT0_:
  145|   308k|{
  146|   308k|    static_assert(std::is_base_of_v<Out, In>);
  147|   308k|    return x;
  148|   308k|}
deserialize.cpp:_ZL5UsingI19CustomUintFormatterILi2ELb1EERtE7WrapperIT_RT0_EOS5_:
  497|   299k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI19CustomUintFormatterILi2ELb1EERtEC2ES2_:
  481|   308k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK8CNetAddr9SerParamsclIR8CServiceEEDaOT_:
 1228|   316k|    {                                                                                    \
 1229|   316k|        return ParamsWrapper{*this, t};                                                  \
 1230|   316k|    }
_ZN13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEC2ERKS1_RS2_:
 1195|   342k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z6AsBaseI8CService8CAddressERT_RT0_:
  145|   299k|{
  146|   299k|    static_assert(std::is_base_of_v<Out, In>);
  147|   299k|    return x;
  148|   299k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER8CNetAddrQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|  16.4k|{
  763|  16.4k|    a.Unserialize(is);
  764|  16.4k|}
_ZNK12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE9GetParamsIN8CNetAddr9SerParamsEEERKDav:
 1144|  16.4k|    {
 1145|  16.4k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  16.4k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  16.4k|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsIRhEERS4_OT_:
 1134|  16.4k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEvRT_Rh:
  273|  16.4k|template<typename Stream> inline void Unserialize(Stream& s, uint8_t& a ) { a = ser_readdata8(s); }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsI7WrapperI20CompactSizeFormatterILb1EERmEEERS4_OT_:
 1134|  16.4k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEER7WrapperI20CompactSizeFormatterILb1EERmEQ14UnserializableIT0_T_EEvRSD_OSC_:
  762|  16.4k|{
  763|  16.4k|    a.Unserialize(is);
  764|  16.4k|}
_ZN7WrapperI20CompactSizeFormatterILb1EERmE11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEEEvRT_:
  483|  16.4k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb1EE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEEmEEvRT_RT0_:
  569|  16.4k|    {
  570|  16.4k|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  571|  16.4k|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (571:13): [True: 0, False: 16.4k]
  |  Branch (571:50): [True: 0, False: 16.4k]
  ------------------
  572|      0|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  573|      0|        }
  574|  16.4k|        v = n;
  575|  16.4k|    }
_ZN12ParamsStreamIR10DataStreamN8CAddress9SerParamsEErsI4SpanIhEEERS4_OT_:
 1134|  16.4k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEETk9BasicBytehEvRT_4SpanIT0_E:
  283|  16.4k|template <typename Stream, BasicByte B> void Unserialize(Stream& s, Span<B> span) { s.read(AsWritableBytes(span)); }
_ZN15VarIntFormatterIL10VarIntMode0EE3SerI10DataStreamjEEvRT_T0_:
  509|    552|    {
  510|    552|        WriteVarInt<Stream,Mode,typename std::remove_cv<I>::type>(s, v);
  511|    552|    }
_Z11WriteVarIntI10DataStreamL10VarIntMode0EjEvRT_T1_:
  435|    552|{
  436|    552|    CheckVarIntMode<Mode, I>();
  437|    552|    unsigned char tmp[(sizeof(n)*8+6)/7];
  438|    552|    int len=0;
  439|  1.82k|    while(true) {
  ------------------
  |  Branch (439:11): [Folded - Ignored]
  ------------------
  440|  1.82k|        tmp[len] = (n & 0x7F) | (len ? 0x80 : 0x00);
  ------------------
  |  Branch (440:34): [True: 1.27k, False: 552]
  ------------------
  441|  1.82k|        if (n <= 0x7F)
  ------------------
  |  Branch (441:13): [True: 552, False: 1.27k]
  ------------------
  442|    552|            break;
  443|  1.27k|        n = (n >> 7) - 1;
  444|  1.27k|        len++;
  445|  1.27k|    }
  446|  1.82k|    do {
  447|  1.82k|        ser_writedata8(os, tmp[len]);
  448|  1.82k|    } while(len--);
  ------------------
  |  Branch (448:13): [True: 1.27k, False: 552]
  ------------------
  449|    552|}
_Z11UnserializeI10DataStreamR25CBlockHeaderAndShortTxIDsQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|    411|{
  763|    411|    a.Unserialize(is);
  764|    411|}
_ZN25CBlockHeaderAndShortTxIDs11UnserializeI10DataStreamEEvRT_:
  228|    411|    {                                                                                               \
  229|    411|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    411|        Unser(s, *this);                                                                            \
  231|    411|    }
_ZN25CBlockHeaderAndShortTxIDs5UnserI10DataStreamEEvRT_RS_:
  180|    411|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJR12CBlockHeaderRm7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERNSt3__16vectorImNSA_9allocatorImEEEEERNSB_I20PrefilledTransactionNSC_ISH_EEEEEEEvRT_DpOT0_:
 1033|    411|    {
 1034|    411|        ::UnserializeMany(s, args...);
 1035|    411|    }
_Z15UnserializeManyI10DataStreamJR12CBlockHeaderRmR7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERNSt3__16vectorImNS9_9allocatorImEEEEERNSA_I20PrefilledTransactionNSB_ISH_EEEEEEvRT_DpOT0_:
 1001|    411|{
 1002|    411|    (::Unserialize(s, args), ...);
 1003|    411|}
_Z11UnserializeI10DataStreamEvRT_Rm:
  279|  9.08k|template<typename Stream> inline void Unserialize(Stream& s, uint64_t& a) { a = ser_readdata64(s); }
_Z11UnserializeI10DataStreamR7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERNSt3__16vectorImNS6_9allocatorImEEEEEQ14UnserializableIT0_T_EEvRSF_OSE_:
  762|    408|{
  763|    408|    a.Unserialize(is);
  764|    408|}
_ZN7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERNSt3__16vectorImNS4_9allocatorImEEEEE11UnserializeI10DataStreamEEvRT_:
  483|    408|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI19CustomUintFormatterILi6ELb0EEE5UnserI10DataStreamNSt3__16vectorImNS5_9allocatorImEEEEEEvRT_RT0_:
  672|    408|    {
  673|    408|        Formatter formatter;
  674|    408|        v.clear();
  675|    408|        size_t size = ReadCompactSize(s);
  676|    408|        size_t allocated = 0;
  677|    680|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 272, False: 408]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|    272|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|    272|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|    272|            v.reserve(allocated);
  684|  72.9k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 72.6k, False: 272]
  ------------------
  685|  72.6k|                v.emplace_back();
  686|  72.6k|                formatter.Unser(s, v.back());
  687|  72.6k|            }
  688|    272|        }
  689|    408|    };
_ZN19CustomUintFormatterILi6ELb0EE5UnserI10DataStreammEEvRT_RT0_:
  547|  72.6k|    {
  548|  72.6k|        using U = typename std::conditional<std::is_enum<I>::value, std::underlying_type<I>, std::common_type<I>>::type::type;
  549|  72.6k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  550|  72.6k|        uint64_t raw = 0;
  551|  72.6k|        if (BigEndian) {
  ------------------
  |  Branch (551:13): [Folded - Ignored]
  ------------------
  552|      0|            s.read(AsWritableBytes(Span{&raw, 1}).last(Bytes));
  553|      0|            v = static_cast<I>(be64toh_internal(raw));
  554|  72.6k|        } else {
  555|  72.6k|            s.read(AsWritableBytes(Span{&raw, 1}).first(Bytes));
  556|  72.6k|            v = static_cast<I>(le64toh_internal(raw));
  557|  72.6k|        }
  558|  72.6k|    }
_Z11UnserializeI10DataStream20PrefilledTransactionNSt3__19allocatorIS1_EEEvRT_RNS2_6vectorIT0_T1_EE:
  866|    368|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|    368|    } else {
  879|    368|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|    368|    }
  881|    368|}
_Z11UnserializeI10DataStream7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI20PrefilledTransactionNS5_9allocatorIS7_EEEEEQ14UnserializableIT0_T_EEvRSE_OSD_:
  762|    368|{
  763|    368|    a.Unserialize(is);
  764|    368|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI20PrefilledTransactionNS3_9allocatorIS5_EEEEE11UnserializeI10DataStreamEEvRT_:
  483|    368|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI10DataStreamNSt3__16vectorI20PrefilledTransactionNS4_9allocatorIS6_EEEEEEvRT_RT0_:
  672|    368|    {
  673|    368|        Formatter formatter;
  674|    368|        v.clear();
  675|    368|        size_t size = ReadCompactSize(s);
  676|    368|        size_t allocated = 0;
  677|    438|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 70, False: 368]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|     70|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|     70|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|     70|            v.reserve(allocated);
  684|  12.5k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 12.4k, False: 70]
  ------------------
  685|  12.4k|                v.emplace_back();
  686|  12.4k|                formatter.Unser(s, v.back());
  687|  12.4k|            }
  688|     70|        }
  689|    368|    };
_ZN16DefaultFormatter5UnserI10DataStream20PrefilledTransactionEEvRT_RT0_:
  777|  12.4k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI10DataStreamR20PrefilledTransactionQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|  12.4k|{
  763|  12.4k|    a.Unserialize(is);
  764|  12.4k|}
_ZN20PrefilledTransaction11UnserializeI10DataStreamEEvRT_:
  228|  12.4k|    {                                                                                               \
  229|  12.4k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  12.4k|        Unser(s, *this);                                                                            \
  231|  12.4k|    }
_ZN20PrefilledTransaction5UnserI10DataStreamEEvRT_RS_:
  180|  12.4k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJ7WrapperI20CompactSizeFormatterILb1EERtE13ParamsWrapperI20TransactionSerParamsS2_I16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEEEEEvRT_DpOT0_:
 1033|  12.4k|    {
 1034|  12.4k|        ::UnserializeMany(s, args...);
 1035|  12.4k|    }
_Z15UnserializeManyI10DataStreamJR7WrapperI20CompactSizeFormatterILb1EERtER13ParamsWrapperI20TransactionSerParamsS1_I16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEEEEvRT_DpOT0_:
 1001|  12.4k|{
 1002|  12.4k|    (::Unserialize(s, args), ...);
 1003|  12.4k|}
_Z11UnserializeI10DataStreamR7WrapperI20CompactSizeFormatterILb1EERtEQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  12.4k|{
  763|  12.4k|    a.Unserialize(is);
  764|  12.4k|}
_ZN7WrapperI20CompactSizeFormatterILb1EERtE11UnserializeI10DataStreamEEvRT_:
  483|  12.4k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN20CompactSizeFormatterILb1EE5UnserI10DataStreamtEEvRT_RT0_:
  569|  12.4k|    {
  570|  12.4k|        uint64_t n = ReadCompactSize<Stream>(s, RangeCheck);
  571|  12.4k|        if (n < std::numeric_limits<I>::min() || n > std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (571:13): [True: 2, False: 12.4k]
  |  Branch (571:50): [True: 2, False: 12.4k]
  ------------------
  572|      2|            throw std::ios_base::failure("CompactSize exceeds limit of type");
  573|      2|        }
  574|  12.4k|        v = n;
  575|  12.4k|    }
_Z11UnserializeI10DataStreamR13ParamsWrapperI20TransactionSerParams7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEEQ14UnserializableIT0_T_EEvRSF_OSE_:
  762|  12.4k|{
  763|  12.4k|    a.Unserialize(is);
  764|  12.4k|}
_ZN13ParamsWrapperI20TransactionSerParams7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEE11UnserializeI10DataStreamEEvRT_:
 1205|  12.4k|    {
 1206|  12.4k|        ParamsStream ss{s, m_params};
 1207|  12.4k|        ::Unserialize(ss, m_object);
 1208|  12.4k|    }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEQ14UnserializableIT0_T_EEvRSG_OSF_:
  762|  12.4k|{
  763|  12.4k|    a.Unserialize(is);
  764|  12.4k|}
_ZN7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  483|  12.4k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
deserialize.cpp:_ZL5UsingI20CompactSizeFormatterILb1EERtE7WrapperIT_RT0_EOS5_:
  497|  12.4k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI20CompactSizeFormatterILb1EERtEC2ES2_:
  481|  12.4k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK20TransactionSerParamsclI7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEEEDaOT_:
 1228|  12.4k|    {                                                                                    \
 1229|  12.4k|        return ParamsWrapper{*this, t};                                                  \
 1230|  12.4k|    }
_ZN13ParamsWrapperI20TransactionSerParams7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEEC2ERKS0_RS9_:
 1195|  12.4k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
deserialize.cpp:_ZL5UsingI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEE7WrapperIT_RT0_EOS9_:
  497|  12.4k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI16DefaultFormatterRNSt3__110shared_ptrIK12CTransactionEEEC2ES6_:
  481|  12.4k|    explicit Wrapper(T obj) : m_object(obj) {}
deserialize.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI20PrefilledTransactionNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|    368|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI20PrefilledTransactionNS3_9allocatorIS5_EEEEEC2ES9_:
  481|    368|    explicit Wrapper(T obj) : m_object(obj) {}
deserialize.cpp:_ZL5UsingI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERNSt3__16vectorImNS4_9allocatorImEEEEE7WrapperIT_RT0_EOSC_:
  497|    411|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERNSt3__16vectorImNS4_9allocatorImEEEEEC2ES9_:
  481|    411|    explicit Wrapper(T obj) : m_object(obj) {}
_Z9SerializeI10DataStream12CBlockHeaderQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|    334|{
  754|    334|    a.Serialize(os);
  755|    334|}
_ZNK12CBlockHeader9SerializeI10DataStreamEEvRT_:
  222|    334|    {                                                                                               \
  223|    334|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|    334|        Ser(s, *this);                                                                              \
  225|    334|    }                                                                                               \
_ZN12CBlockHeader3SerI10DataStreamEEvRT_RKS_:
  178|    334|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI10DataStreamJi7uint256S2_jjjEEEvRT_DpRKT0_:
 1013|    334|    {
 1014|    334|        ::SerializeMany(s, args...);
 1015|    334|    }
_Z13SerializeManyI10DataStreamJi7uint256S1_jjjEEvRT_DpRKT0_:
  995|    334|{
  996|    334|    (::Serialize(s, args), ...);
  997|    334|}
_Z9SerializeI10DataStreamEvRT_i:
  261|    334|template<typename Stream> inline void Serialize(Stream& s, int32_t a ) { ser_writedata32(s, a); }
_Z9SerializeI10DataStreamEvRT_j:
  262|  1.00k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
_Z9SerializeI10DataStreamEvRT_m:
  264|    334|template<typename Stream> inline void Serialize(Stream& s, uint64_t a) { ser_writedata64(s, a); }
_ZN7WrapperI20CompactSizeFormatterILb1EERKtEC2ES3_:
  481|     10|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK20TransactionSerParamsclI7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEEEDaOT_:
 1228|     10|    {                                                                                    \
 1229|     10|        return ParamsWrapper{*this, t};                                                  \
 1230|     10|    }
_ZN13ParamsWrapperI20TransactionSerParams7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEEC2ERKS0_RSA_:
 1195|     10|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_ZN7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEC2ES7_:
  481|     10|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI20PrefilledTransactionNS3_9allocatorIS5_EEEEEC2ESA_:
  481|     10|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERKNSt3__16vectorImNS4_9allocatorImEEEEEC2ESA_:
  481|     10|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamEvRT_Rl:
  278|  8.50k|template<typename Stream> inline void Unserialize(Stream& s, int64_t& a ) { a = ser_readdata64(s); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI7uint256NS3_9allocatorIS5_EEEEEC2ESA_:
  481|  3.80k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z9SerializeI10DataStream22transaction_identifierILb0EEQ12SerializableIT0_T_EEvRS4_RKS3_:
  753|    552|{
  754|    552|    a.Serialize(os);
  755|    552|}
_Z11UnserializeI10DataStreamTk9BasicBytehLi4EEvRT_RAT1__T0_:
  280|  24.5k|template <typename Stream, BasicByte B, int N> void Unserialize(Stream& s, B (&a)[N]) { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI10DataStreamR13ParamsWrapperI20TransactionSerParamsNSt3__110shared_ptrIK12CTransactionEEEQ14UnserializableIT0_T_EEvRSB_OSA_:
  762|  1.66k|{
  763|  1.66k|    a.Unserialize(is);
  764|  1.66k|}
_ZN13ParamsWrapperI20TransactionSerParamsNSt3__110shared_ptrIK12CTransactionEEE11UnserializeI10DataStreamEEvRT_:
 1205|  1.66k|    {
 1206|  1.66k|        ParamsStream ss{s, m_params};
 1207|  1.66k|        ::Unserialize(ss, m_object);
 1208|  1.66k|    }
_ZN13ParamsWrapperI20TransactionSerParamsNSt3__110shared_ptrIK12CTransactionEEEC2ERKS0_RS5_:
 1195|  1.66k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z15ser_writedata64I12SizeComputerEvRT_m:
   79|    928|{
   80|    928|    obj = htole64_internal(obj);
   81|    928|    s.write(AsBytes(Span{&obj, 1}));
   82|    928|}
_Z9SerializeI12SizeComputer13ParamsWrapperI20TransactionSerParamsKNSt3__110shared_ptrIK12CTransactionEEEQ12SerializableIT0_T_EEvRSB_RKSA_:
  753|    732|{
  754|    732|    a.Serialize(os);
  755|    732|}
_ZNK13ParamsWrapperI20TransactionSerParamsKNSt3__110shared_ptrIK12CTransactionEEE9SerializeI12SizeComputerEEvRT_:
 1199|    732|    {
 1200|    732|        ParamsStream ss{s, m_params};
 1201|    732|        ::Serialize(ss, m_object);
 1202|    732|    }
_ZN13ParamsWrapperI20TransactionSerParamsKNSt3__110shared_ptrIK12CTransactionEEEC2ERKS0_RS6_:
 1195|    732|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z9SerializeI12SizeComputer6CTxOutQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|    928|{
  754|    928|    a.Serialize(os);
  755|    928|}
_ZNK6CTxOut9SerializeI12SizeComputerEEvRT_:
  222|    928|    {                                                                                               \
  223|    928|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|    928|        Ser(s, *this);                                                                              \
  225|    928|    }                                                                                               \
_ZN6CTxOut3SerI12SizeComputerEEvRT_RKS_:
  178|    928|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12SizeComputerJl7CScriptEEEvRT_DpRKT0_:
 1013|    928|    {
 1014|    928|        ::SerializeMany(s, args...);
 1015|    928|    }
_Z13SerializeManyI12SizeComputerJl7CScriptEEvRT_DpRKT0_:
  995|    928|{
  996|    928|    (::Serialize(s, args), ...);
  997|    928|}
_Z9SerializeI12SizeComputerEvRT_l:
  263|    928|template<typename Stream> inline void Serialize(Stream& s, int64_t a ) { ser_writedata64(s, a); }
_Z9SerializeI12SizeComputer7CScriptQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|    928|{
  754|    928|    a.Serialize(os);
  755|    928|}
_ZNK7CScript9SerializeI12SizeComputerEEvRT_:
  222|    928|    {                                                                                               \
  223|    928|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|    928|        Ser(s, *this);                                                                              \
  225|    928|    }                                                                                               \
_ZN7CScript3SerI12SizeComputerEEvRT_RKS_:
  178|    928|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12SizeComputerJ9prevectorILj28EhjiEEEEvRT_DpRKT0_:
 1013|    928|    {
 1014|    928|        ::SerializeMany(s, args...);
 1015|    928|    }
_Z13SerializeManyI12SizeComputerJ9prevectorILj28EhjiEEEvRT_DpRKT0_:
  995|    928|{
  996|    928|    (::Serialize(s, args), ...);
  997|    928|}
_Z9SerializeI12SizeComputerLj28EhEvRT_RK9prevectorIXT0_ET1_jiE:
  811|    928|{
  812|    928|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  813|    928|        WriteCompactSize(os, v.size());
  814|    928|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (814:13): [True: 928, False: 0]
  ------------------
  815|       |    } else {
  816|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  817|       |    }
  818|    928|}
_Z16WriteCompactSizeI12VectorWriterEvRT_m:
  309|  37.3k|{
  310|  37.3k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 36.3k, False: 968]
  ------------------
  311|  36.3k|    {
  312|  36.3k|        ser_writedata8(os, nSize);
  313|  36.3k|    }
  314|    968|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 968, False: 0]
  ------------------
  315|    968|    {
  316|    968|        ser_writedata8(os, 253);
  317|    968|        ser_writedata16(os, nSize);
  318|    968|    }
  319|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|    {
  321|      0|        ser_writedata8(os, 254);
  322|      0|        ser_writedata32(os, nSize);
  323|      0|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|  37.3k|    return;
  330|  37.3k|}
_Z15ser_writedata16I12VectorWriterEvRT_t:
   59|    968|{
   60|    968|    obj = htole16_internal(obj);
   61|    968|    s.write(AsBytes(Span{&obj, 1}));
   62|    968|}
_Z15ser_writedata32I12VectorWriterEvRT_j:
   69|   997k|{
   70|   997k|    obj = htole32_internal(obj);
   71|   997k|    s.write(AsBytes(Span{&obj, 1}));
   72|   997k|}
_Z15ser_writedata64I12VectorWriterEvRT_m:
   79|   100k|{
   80|   100k|    obj = htole64_internal(obj);
   81|   100k|    s.write(AsBytes(Span{&obj, 1}));
   82|   100k|}
_Z9SerializeI12VectorWriter7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  753|   965k|{
  754|   965k|    a.Serialize(os);
  755|   965k|}
_Z9SerializeI12VectorWriterTk9BasicByteKhEvRT_4SpanIT0_E:
  268|   965k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI12VectorWriterTk9BasicBytehLi4EEvRT_RAT1__KT0_:
  265|  66.2k|template <typename Stream, BasicByte B, int N> void Serialize(Stream& s, const B (&a)[N]) { s.write(MakeByteSpan(a)); }
_Z9SerializeI12VectorWriterEvRT_j:
  262|   959k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
deserialize.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE7WrapperIT_RT0_EOSF_:
  497|     98|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z9SerializeI10DataStream7WrapperI15VarIntFormatterIL10VarIntMode0EERjEQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|    552|{
  754|    552|    a.Serialize(os);
  755|    552|}
_ZNK7WrapperI15VarIntFormatterIL10VarIntMode0EERjE9SerializeI10DataStreamEEvRT_:
  482|    552|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEC2ES1_RKS3_:
 1127|  8.40k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEERS3_Q14UnserializableIT0_T_EEvRS8_OS7_:
  762|  8.40k|{
  763|  8.40k|    a.Unserialize(is);
  764|  8.40k|}
_ZNK12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEE9GetParamsIS3_EERKDav:
 1144|  8.40k|    {
 1145|  8.40k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  8.40k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  8.40k|    }
_ZN12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEE4readE4SpanISt4byteE:
 1136|  16.8k|    void read(Span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEE9GetStreamEv:
 1154|  16.8k|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  16.8k|        } else {
 1158|  16.8k|            return m_substream;
 1159|  16.8k|        }
 1160|  16.8k|    }
_ZN12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEErsIRA16_hEERS4_OT_:
 1134|  8.40k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEETk9BasicBytehLi16EEvRT_RAT1__T0_:
  280|  8.40k|template <typename Stream, BasicByte B, int N> void Unserialize(Stream& s, B (&a)[N]) { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI10DataStreamR13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  8.40k|{
  763|  8.40k|    a.Unserialize(is);
  764|  8.40k|}
_ZN13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceE11UnserializeI10DataStreamEEvRT_:
 1205|  8.40k|    {
 1206|  8.40k|        ParamsStream ss{s, m_params};
 1207|  8.40k|        ::Unserialize(ss, m_object);
 1208|  8.40k|    }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEER8CServiceQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|  8.40k|{
  763|  8.40k|    a.Unserialize(is);
  764|  8.40k|}
_ZN8CService11UnserializeI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEEEvRT_:
  228|  8.40k|    {                                                                                               \
  229|  8.40k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  8.40k|        Unser(s, *this);                                                                            \
  231|  8.40k|    }
_ZN8CService5UnserI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEEEvRT_RS_:
  180|  8.40k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEJRS4_7WrapperI19CustomUintFormatterILi2ELb1EERtEEEEvRT_DpOT0_:
 1033|  8.40k|    {
 1034|  8.40k|        ::UnserializeMany(s, args...);
 1035|  8.40k|    }
_Z15UnserializeManyI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEJRS3_R7WrapperI19CustomUintFormatterILi2ELb1EERtEEEvRT_DpOT0_:
 1001|  8.40k|{
 1002|  8.40k|    (::Unserialize(s, args), ...);
 1003|  8.40k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEER7WrapperI19CustomUintFormatterILi2ELb1EERtEQ14UnserializableIT0_T_EEvRSD_OSC_:
  762|  8.40k|{
  763|  8.40k|    a.Unserialize(is);
  764|  8.40k|}
_ZN7WrapperI19CustomUintFormatterILi2ELb1EERtE11UnserializeI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEEEvRT_:
  483|  8.40k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi2ELb1EE5UnserI12ParamsStreamIR10DataStreamN8CNetAddr9SerParamsEEtEEvRT_RT0_:
  547|  8.40k|    {
  548|  8.40k|        using U = typename std::conditional<std::is_enum<I>::value, std::underlying_type<I>, std::common_type<I>>::type::type;
  549|  8.40k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  550|  8.40k|        uint64_t raw = 0;
  551|  8.40k|        if (BigEndian) {
  ------------------
  |  Branch (551:13): [Folded - Ignored]
  ------------------
  552|  8.40k|            s.read(AsWritableBytes(Span{&raw, 1}).last(Bytes));
  553|  8.40k|            v = static_cast<I>(be64toh_internal(raw));
  554|  8.40k|        } else {
  555|      0|            s.read(AsWritableBytes(Span{&raw, 1}).first(Bytes));
  556|      0|            v = static_cast<I>(le64toh_internal(raw));
  557|      0|        }
  558|  8.40k|    }
_Z6AsBaseI8CNetAddr8CServiceERKT_RKT0_:
  151|  39.1k|{
  152|  39.1k|    static_assert(std::is_base_of_v<Out, In>);
  153|  39.1k|    return x;
  154|  39.1k|}
_ZN7WrapperI19CustomUintFormatterILi2ELb1EERKtEC2ES3_:
  481|  39.1k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK8CNetAddr9SerParamsclIRK8CServiceEEDaOT_:
 1228|  5.29k|    {                                                                                    \
 1229|  5.29k|        return ParamsWrapper{*this, t};                                                  \
 1230|  5.29k|    }
_ZN13ParamsWrapperIN8CNetAddr9SerParamsEK8CServiceEC2ERKS1_RS3_:
 1195|  5.29k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z11UnserializeI10DataStreamR14CMessageHeaderQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|  24.5k|{
  763|  24.5k|    a.Unserialize(is);
  764|  24.5k|}
_ZN14CMessageHeader11UnserializeI10DataStreamEEvRT_:
  228|  24.5k|    {                                                                                               \
  229|  24.5k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  24.5k|        Unser(s, *this);                                                                            \
  231|  24.5k|    }
_ZN14CMessageHeader5UnserI10DataStreamEEvRT_RS_:
  180|  24.5k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRNSt3__15arrayIhLm4EEERA12_cRjRA4_hEEEvRT_DpOT0_:
 1033|  24.5k|    {
 1034|  24.5k|        ::UnserializeMany(s, args...);
 1035|  24.5k|    }
_Z15UnserializeManyI10DataStreamJRNSt3__15arrayIhLm4EEERA12_cRjRA4_hEEvRT_DpOT0_:
 1001|  24.5k|{
 1002|  24.5k|    (::Unserialize(s, args), ...);
 1003|  24.5k|}
_Z11UnserializeI10DataStreamTk9BasicBytehLm4EEvRT_RNSt3__15arrayIT0_XT1_EEE:
  281|  24.5k|template <typename Stream, BasicByte B, std::size_t N> void Unserialize(Stream& s, std::array<B, N>& a) { s.read(MakeWritableByteSpan(a)); }
_Z11UnserializeI10DataStreamTk9BasicBytecLi12EEvRT_RAT1__T0_:
  280|  24.5k|template <typename Stream, BasicByte B, int N> void Unserialize(Stream& s, B (&a)[N]) { s.read(MakeWritableByteSpan(a)); }
_ZN7WrapperI15ChronoFormatterIjLb1EERKNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEEC2ESC_:
  481|  5.29k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN7WrapperI19CustomUintFormatterILi8ELb0EERK12ServiceFlagsEC2ES4_:
  481|  5.29k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z6AsBaseI8CService8CAddressERKT_RKT0_:
  151|  5.29k|{
  152|  5.29k|    static_assert(std::is_base_of_v<Out, In>);
  153|  5.29k|    return x;
  154|  5.29k|}
_Z11UnserializeI10DataStreamR4CInvQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|  2.94M|{
  763|  2.94M|    a.Unserialize(is);
  764|  2.94M|}
_ZN4CInv11UnserializeI10DataStreamEEvRT_:
  228|  2.94M|    {                                                                                               \
  229|  2.94M|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  2.94M|        Unser(s, *this);                                                                            \
  231|  2.94M|    }
_ZN4CInv5UnserI10DataStreamEEvRT_RS_:
  180|  2.94M|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRjR7uint256EEEvRT_DpOT0_:
 1033|  2.94M|    {
 1034|  2.94M|        ::UnserializeMany(s, args...);
 1035|  2.94M|    }
_Z15UnserializeManyI10DataStreamJRjR7uint256EEvRT_DpOT0_:
 1001|  2.94M|{
 1002|  2.94M|    (::Unserialize(s, args), ...);
 1003|  2.94M|}
_Z11UnserializeI10DataStreamR12CBloomFilterQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|     34|{
  763|     34|    a.Unserialize(is);
  764|     34|}
_ZN12CBloomFilter11UnserializeI10DataStreamEEvRT_:
  228|     34|    {                                                                                               \
  229|     34|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|     34|        Unser(s, *this);                                                                            \
  231|     34|    }
_ZN12CBloomFilter5UnserI10DataStreamEEvRT_RS_:
  180|     34|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRNSt3__16vectorIhNS2_9allocatorIhEEEERjS8_RhEEEvRT_DpOT0_:
 1033|     34|    {
 1034|     34|        ::UnserializeMany(s, args...);
 1035|     34|    }
_Z15UnserializeManyI10DataStreamJRNSt3__16vectorIhNS1_9allocatorIhEEEERjS7_RhEEvRT_DpOT0_:
 1001|     34|{
 1002|     34|    (::Unserialize(s, args), ...);
 1003|     34|}
_Z11UnserializeI10DataStreamR17BlockTransactionsQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|     98|{
  763|     98|    a.Unserialize(is);
  764|     98|}
_ZN17BlockTransactions11UnserializeI10DataStreamEEvRT_:
  228|     98|    {                                                                                               \
  229|     98|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|     98|        Unser(s, *this);                                                                            \
  231|     98|    }
_ZN17BlockTransactions5UnserI10DataStreamEEvRT_RS_:
  180|     98|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJR7uint25613ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINSA_10shared_ptrIK12CTransactionEENSA_9allocatorISF_EEEEEEEEEvRT_DpOT0_:
 1033|     98|    {
 1034|     98|        ::UnserializeMany(s, args...);
 1035|     98|    }
_Z15UnserializeManyI10DataStreamJR7uint256R13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEEEEvRT_DpOT0_:
 1001|     98|{
 1002|     98|    (::Unserialize(s, args), ...);
 1003|     98|}
_Z11UnserializeI10DataStreamR13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS7_10shared_ptrIK12CTransactionEENS7_9allocatorISC_EEEEEEQ14UnserializableIT0_T_EEvRSL_OSK_:
  762|     95|{
  763|     95|    a.Unserialize(is);
  764|     95|}
_ZN13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS5_10shared_ptrIK12CTransactionEENS5_9allocatorISA_EEEEEE11UnserializeI10DataStreamEEvRT_:
 1205|     95|    {
 1206|     95|        ParamsStream ss{s, m_params};
 1207|     95|        ::Unserialize(ss, m_object);
 1208|     95|    }
_Z11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsER7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEQ14UnserializableIT0_T_EEvRSM_OSL_:
  762|     95|{
  763|     95|    a.Unserialize(is);
  764|     95|}
_ZNK20TransactionSerParamsclI7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS5_10shared_ptrIK12CTransactionEENS5_9allocatorISA_EEEEEEEDaOT_:
 1228|     98|    {                                                                                    \
 1229|     98|        return ParamsWrapper{*this, t};                                                  \
 1230|     98|    }
_ZN13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS5_10shared_ptrIK12CTransactionEENS5_9allocatorISA_EEEEEEC2ERKS0_RSF_:
 1195|     98|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_ZNK20TransactionSerParamsclI7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS5_10shared_ptrIK12CTransactionEENS5_9allocatorISA_EEEEEEEDaOT_:
 1228|      2|    {                                                                                    \
 1229|      2|        return ParamsWrapper{*this, t};                                                  \
 1230|      2|    }
_ZN13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS5_10shared_ptrIK12CTransactionEENS5_9allocatorISA_EEEEEEC2ERKS0_RSG_:
 1195|      2|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z11UnserializeI10DataStreamR24BlockTransactionsRequestQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|    139|{
  763|    139|    a.Unserialize(is);
  764|    139|}
_ZN24BlockTransactionsRequest11UnserializeI10DataStreamEEvRT_:
  228|    139|    {                                                                                               \
  229|    139|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    139|        Unser(s, *this);                                                                            \
  231|    139|    }
_ZN24BlockTransactionsRequest5UnserI10DataStreamEEvRT_RS_:
  180|    139|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJR7uint2567WrapperI15VectorFormatterI19DifferenceFormatterERNSt3__16vectorItNS8_9allocatorItEEEEEEEEvRT_DpOT0_:
 1033|    139|    {
 1034|    139|        ::UnserializeMany(s, args...);
 1035|    139|    }
_Z15UnserializeManyI10DataStreamJR7uint256R7WrapperI15VectorFormatterI19DifferenceFormatterERNSt3__16vectorItNS7_9allocatorItEEEEEEEvRT_DpOT0_:
 1001|    139|{
 1002|    139|    (::Unserialize(s, args), ...);
 1003|    139|}
_Z11UnserializeI10DataStreamR7WrapperI15VectorFormatterI19DifferenceFormatterERNSt3__16vectorItNS5_9allocatorItEEEEEQ14UnserializableIT0_T_EEvRSE_OSD_:
  762|    131|{
  763|    131|    a.Unserialize(is);
  764|    131|}
_ZN7WrapperI15VectorFormatterI19DifferenceFormatterERNSt3__16vectorItNS3_9allocatorItEEEEE11UnserializeI10DataStreamEEvRT_:
  483|    131|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI19DifferenceFormatterE5UnserI10DataStreamNSt3__16vectorItNS4_9allocatorItEEEEEEvRT_RT0_:
  672|    131|    {
  673|    131|        Formatter formatter;
  674|    131|        v.clear();
  675|    131|        size_t size = ReadCompactSize(s);
  676|    131|        size_t allocated = 0;
  677|    234|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 103, False: 131]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|    103|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|    103|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|    103|            v.reserve(allocated);
  684|  3.12k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 3.02k, False: 103]
  ------------------
  685|  3.02k|                v.emplace_back();
  686|  3.02k|                formatter.Unser(s, v.back());
  687|  3.02k|            }
  688|    103|        }
  689|    131|    };
deserialize.cpp:_ZL5UsingI15VectorFormatterI19DifferenceFormatterERNSt3__16vectorItNS3_9allocatorItEEEEE7WrapperIT_RT0_EOSB_:
  497|    139|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI19DifferenceFormatterERNSt3__16vectorItNS3_9allocatorItEEEEEC2ES8_:
  481|    139|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN7WrapperI15VectorFormatterI19DifferenceFormatterERKNSt3__16vectorItNS3_9allocatorItEEEEEC2ES9_:
  481|     71|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamEvRT_Rb:
  286|  8.43k|template <typename Stream> inline void Unserialize(Stream& s, bool& a) { uint8_t f = ser_readdata8(s); a = f; }
_Z13SerializeManyI12VectorWriterJ13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEEEEvRT_DpRKT0_:
  995|     45|{
  996|     45|    (::Serialize(s, args), ...);
  997|     45|}
_Z9SerializeI12VectorWriter13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEEQ12SerializableIT0_T_EEvRSB_RKSA_:
  753|     45|{
  754|     45|    a.Serialize(os);
  755|     45|}
_ZNK13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS1_9allocatorIS3_EEEEE9SerializeI12VectorWriterEEvRT_:
 1199|     45|    {
 1200|     45|        ParamsStream ss{s, m_params};
 1201|     45|        ::Serialize(ss, m_object);
 1202|     45|    }
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsEC2ES1_RKS2_:
 1127|  1.53k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE6CBlockNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|     45|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|     45|    } else {
  859|     45|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|     45|    }
  861|     45|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CBlockNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|     45|{
  754|     45|    a.Serialize(os);
  755|     45|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  482|     45|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorI6CBlockNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|     45|    {
  663|     45|        Formatter formatter;
  664|     45|        WriteCompactSize(s, v.size());
  665|  4.90k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 4.90k, False: 45]
  ------------------
  666|  4.90k|            formatter.Ser(s, elem);
  667|  4.90k|        }
  668|     45|    }
_Z16WriteCompactSizeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_m:
  309|  12.5k|{
  310|  12.5k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 12.5k, False: 0]
  ------------------
  311|  12.5k|    {
  312|  12.5k|        ser_writedata8(os, nSize);
  313|  12.5k|    }
  314|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 0, False: 0]
  ------------------
  315|      0|    {
  316|      0|        ser_writedata8(os, 253);
  317|      0|        ser_writedata16(os, nSize);
  318|      0|    }
  319|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|    {
  321|      0|        ser_writedata8(os, 254);
  322|      0|        ser_writedata32(os, nSize);
  323|      0|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|  12.5k|    return;
  330|  12.5k|}
_Z14ser_writedata8I12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_h:
   55|  12.5k|{
   56|  12.5k|    s.write(AsBytes(Span{&obj, 1}));
   57|  12.5k|}
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsE5writeE4SpanIKSt4byteE:
 1135|  62.8k|    void write(Span<const std::byte> src) { GetStream().write(src); }
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsE9GetStreamEv:
 1154|  62.8k|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  62.8k|        } else {
 1158|  62.8k|            return m_substream;
 1159|  62.8k|        }
 1160|  62.8k|    }
_Z15ser_writedata32I12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_j:
   69|  31.4k|{
   70|  31.4k|    obj = htole32_internal(obj);
   71|  31.4k|    s.write(AsBytes(Span{&obj, 1}));
   72|  31.4k|}
_Z15ser_writedata64I12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_m:
   79|  1.54k|{
   80|  1.54k|    obj = htole64_internal(obj);
   81|  1.54k|    s.write(AsBytes(Span{&obj, 1}));
   82|  1.54k|}
_ZN16DefaultFormatter3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsE6CBlockEEvRT_RKT0_:
  774|  4.90k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE6CBlockQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  6.38k|{
  754|  6.38k|    a.Serialize(os);
  755|  6.38k|}
_ZNK6CBlock9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  222|  6.38k|    {                                                                                               \
  223|  6.38k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  6.38k|        Ser(s, *this);                                                                              \
  225|  6.38k|    }                                                                                               \
_ZN6CBlock3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  6.38k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ12CBlockHeaderNSt3__16vectorINS7_10shared_ptrIK12CTransactionEENS7_9allocatorISC_EEEEEEEvRT_DpRKT0_:
 1013|  6.38k|    {
 1014|  6.38k|        ::SerializeMany(s, args...);
 1015|  6.38k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ12CBlockHeaderNSt3__16vectorINS6_10shared_ptrIK12CTransactionEENS6_9allocatorISB_EEEEEEvRT_DpRKT0_:
  995|  6.38k|{
  996|  6.38k|    (::Serialize(s, args), ...);
  997|  6.38k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE12CBlockHeaderQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  6.38k|{
  754|  6.38k|    a.Serialize(os);
  755|  6.38k|}
_ZNK12CBlockHeader9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  222|  6.38k|    {                                                                                               \
  223|  6.38k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  6.38k|        Ser(s, *this);                                                                              \
  225|  6.38k|    }                                                                                               \
_ZN12CBlockHeader3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  6.38k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJi7uint256S6_jjjEEEvRT_DpRKT0_:
 1013|  6.38k|    {
 1014|  6.38k|        ::SerializeMany(s, args...);
 1015|  6.38k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJi7uint256S5_jjjEEvRT_DpRKT0_:
  995|  6.38k|{
  996|  6.38k|    (::Serialize(s, args), ...);
  997|  6.38k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_i:
  261|  6.38k|template<typename Stream> inline void Serialize(Stream& s, int32_t a ) { ser_writedata32(s, a); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7uint256Q12SerializableIT0_T_EEvRS7_RKS6_:
  753|  12.7k|{
  754|  12.7k|    a.Serialize(os);
  755|  12.7k|}
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsElsI4SpanIKhEEERS3_RKT_:
 1133|  14.2k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsETk9BasicByteKhEvRT_4SpanIT0_E:
  268|  14.2k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_j:
  262|  25.1k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEENS5_9allocatorIS9_EEEvRT_RKNS5_6vectorIT0_T1_EE:
  846|  6.38k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  6.38k|    } else {
  859|  6.38k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  6.38k|    }
  861|  6.38k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEQ12SerializableIT0_T_EEvRSM_RKSL_:
  753|  6.38k|{
  754|  6.38k|    a.Serialize(os);
  755|  6.38k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  482|  6.38k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEvRT_RKT0_:
  662|  6.38k|    {
  663|  6.38k|        Formatter formatter;
  664|  6.38k|        WriteCompactSize(s, v.size());
  665|  6.38k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 1.47k, False: 6.38k]
  ------------------
  666|  1.47k|            formatter.Ser(s, elem);
  667|  1.47k|        }
  668|  6.38k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEEEEvRT_RKT0_:
  774|  1.48k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE12CTransactionEvRT_RKNSt3__110shared_ptrIKT0_EE:
  979|  1.48k|{
  980|  1.48k|    Serialize(os, *p);
  981|  1.48k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE12CTransactionQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  1.48k|{
  754|  1.48k|    a.Serialize(os);
  755|  1.48k|}
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsElsIjEERS3_RKT_:
 1133|  2.97k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsElsINSt3__16vectorI5CTxInNS5_9allocatorIS7_EEEEEERS3_RKT_:
 1133|  1.51k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE5CTxInNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|  1.51k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  1.51k|    } else {
  859|  1.51k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  1.51k|    }
  861|  1.51k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|  1.51k|{
  754|  1.51k|    a.Serialize(os);
  755|  1.51k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  482|  1.51k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorI5CTxInNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|  1.51k|    {
  663|  1.51k|        Formatter formatter;
  664|  1.51k|        WriteCompactSize(s, v.size());
  665|  1.51k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 1.48k, False: 1.51k]
  ------------------
  666|  1.48k|            formatter.Ser(s, elem);
  667|  1.48k|        }
  668|  1.51k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsE5CTxInEEvRT_RKT0_:
  774|  1.48k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE5CTxInQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  1.48k|{
  754|  1.48k|    a.Serialize(os);
  755|  1.48k|}
_ZNK5CTxIn9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  222|  1.48k|    {                                                                                               \
  223|  1.48k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  1.48k|        Ser(s, *this);                                                                              \
  225|  1.48k|    }                                                                                               \
_ZN5CTxIn3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  1.48k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ9COutPoint7CScriptjEEEvRT_DpRKT0_:
 1013|  1.48k|    {
 1014|  1.48k|        ::SerializeMany(s, args...);
 1015|  1.48k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ9COutPoint7CScriptjEEvRT_DpRKT0_:
  995|  1.48k|{
  996|  1.48k|    (::Serialize(s, args), ...);
  997|  1.48k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE9COutPointQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  1.48k|{
  754|  1.48k|    a.Serialize(os);
  755|  1.48k|}
_ZNK9COutPoint9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  222|  1.48k|    {                                                                                               \
  223|  1.48k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  1.48k|        Ser(s, *this);                                                                              \
  225|  1.48k|    }                                                                                               \
_ZN9COutPoint3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  1.48k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ22transaction_identifierILb0EEjEEEvRT_DpRKT0_:
 1013|  1.48k|    {
 1014|  1.48k|        ::SerializeMany(s, args...);
 1015|  1.48k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ22transaction_identifierILb0EEjEEvRT_DpRKT0_:
  995|  1.48k|{
  996|  1.48k|    (::Serialize(s, args), ...);
  997|  1.48k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE22transaction_identifierILb0EEQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|  1.48k|{
  754|  1.48k|    a.Serialize(os);
  755|  1.48k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7CScriptQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  3.03k|{
  754|  3.03k|    a.Serialize(os);
  755|  3.03k|}
_ZNK7CScript9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  222|  3.03k|    {                                                                                               \
  223|  3.03k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  3.03k|        Ser(s, *this);                                                                              \
  225|  3.03k|    }                                                                                               \
_ZN7CScript3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  3.03k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ9prevectorILj28EhjiEEEEvRT_DpRKT0_:
 1013|  3.03k|    {
 1014|  3.03k|        ::SerializeMany(s, args...);
 1015|  3.03k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJ9prevectorILj28EhjiEEEvRT_DpRKT0_:
  995|  3.03k|{
  996|  3.03k|    (::Serialize(s, args), ...);
  997|  3.03k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsELj28EhEvRT_RK9prevectorIXT0_ET1_jiE:
  811|  3.03k|{
  812|  3.03k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  813|  3.03k|        WriteCompactSize(os, v.size());
  814|  3.03k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (814:13): [True: 3.03k, False: 0]
  ------------------
  815|       |    } else {
  816|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  817|       |    }
  818|  3.03k|}
p2p_headers_presync.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  1.51k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsElsIhEERS3_RKT_:
 1133|     22|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_h:
  258|     22|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsElsINSt3__16vectorI6CTxOutNS5_9allocatorIS7_EEEEEERS3_RKT_:
 1133|  1.48k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE6CTxOutNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|  1.48k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  1.48k|    } else {
  859|  1.48k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  1.48k|    }
  861|  1.48k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|  1.48k|{
  754|  1.48k|    a.Serialize(os);
  755|  1.48k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  482|  1.48k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorI6CTxOutNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|  1.48k|    {
  663|  1.48k|        Formatter formatter;
  664|  1.48k|        WriteCompactSize(s, v.size());
  665|  1.54k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 1.54k, False: 1.48k]
  ------------------
  666|  1.54k|            formatter.Ser(s, elem);
  667|  1.54k|        }
  668|  1.48k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsE6CTxOutEEvRT_RKT0_:
  774|  1.54k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE6CTxOutQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  1.54k|{
  754|  1.54k|    a.Serialize(os);
  755|  1.54k|}
_ZNK6CTxOut9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  222|  1.54k|    {                                                                                               \
  223|  1.54k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  1.54k|        Ser(s, *this);                                                                              \
  225|  1.54k|    }                                                                                               \
_ZN6CTxOut3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  1.54k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJl7CScriptEEEvRT_DpRKT0_:
 1013|  1.54k|    {
 1014|  1.54k|        ::SerializeMany(s, args...);
 1015|  1.54k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriter20TransactionSerParamsEJl7CScriptEEvRT_DpRKT0_:
  995|  1.54k|{
  996|  1.54k|    (::Serialize(s, args), ...);
  997|  1.54k|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEvRT_l:
  263|  1.54k|template<typename Stream> inline void Serialize(Stream& s, int64_t a ) { ser_writedata64(s, a); }
p2p_headers_presync.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  1.48k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN12ParamsStreamIR12VectorWriter20TransactionSerParamsElsINSt3__16vectorINS6_IhNS5_9allocatorIhEEEENS7_IS9_EEEEEERS3_RKT_:
 1133|     22|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorIhNS5_9allocatorIhEEEENS7_IS9_EEEvRT_RKNS6_IT0_T1_EE:
  846|     22|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|     22|    } else {
  859|     22|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|     22|    }
  861|     22|}
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINSA_IhNS9_9allocatorIhEEEENSB_ISD_EEEEEQ12SerializableIT0_T_EEvRSK_RKSJ_:
  753|     22|{
  754|     22|    a.Serialize(os);
  755|     22|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  482|     22|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorINS9_IhNS8_9allocatorIhEEEENSA_ISC_EEEEEEvRT_RKT0_:
  662|     22|    {
  663|     22|        Formatter formatter;
  664|     22|        WriteCompactSize(s, v.size());
  665|     22|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 22, False: 22]
  ------------------
  666|     22|            formatter.Ser(s, elem);
  667|     22|        }
  668|     22|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR12VectorWriter20TransactionSerParamsENSt3__16vectorIhNS6_9allocatorIhEEEEEEvRT_RKT0_:
  774|     22|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEhNSt3__19allocatorIhEEEvRT_RKNS5_6vectorIT0_T1_EE:
  846|     22|{
  847|     22|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|     22|        WriteCompactSize(os, v.size());
  849|     22|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (849:13): [True: 22, False: 0]
  ------------------
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|       |    } else {
  859|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|       |    }
  861|     22|}
p2p_headers_presync.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSE_:
  497|     22|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZNK12ParamsStreamIR12VectorWriter20TransactionSerParamsE9GetParamsIS2_EERKDav:
 1144|  1.48k|    {
 1145|  1.48k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  1.48k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  1.48k|    }
p2p_headers_presync.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE7WrapperIT_RT0_EOSG_:
  497|  4.90k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
p2p_headers_presync.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|     45|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEEC2ESA_:
  481|     45|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK20TransactionSerParamsclIRNSt3__16vectorI6CBlockNS1_9allocatorIS3_EEEEEEDaOT_:
 1228|     45|    {                                                                                    \
 1229|     45|        return ParamsWrapper{*this, t};                                                  \
 1230|     45|    }
_ZN13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS1_9allocatorIS3_EEEEEC2ERKS0_RS6_:
 1195|     45|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
transaction.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  40.2k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
transaction.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  38.8k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
transaction.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSE_:
  497|  14.1k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN13ParamsWrapperI20TransactionSerParamsK12CTransactionEC2ERKS0_RS2_:
 1195|  45.3k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z9SerializeI10HashWriterEvRT_j:
  262|  16.3k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
_Z15ser_writedata32I10HashWriterEvRT_j:
   69|  69.8k|{
   70|  69.8k|    obj = htole32_internal(obj);
   71|  69.8k|    s.write(AsBytes(Span{&obj, 1}));
   72|  69.8k|}
_Z11UnserializeI8AutoFileTk9BasicBytehLm4EEvRT_RNSt3__15arrayIT0_XT1_EEE:
  281|     62|template <typename Stream, BasicByte B, std::size_t N> void Unserialize(Stream& s, std::array<B, N>& a) { s.read(MakeWritableByteSpan(a)); }
_ZNK8CAddress9SerParamsclIR8CNetAddrEEDaOT_:
 1228|  16.4k|    {                                                                                    \
 1229|  16.4k|        return ParamsWrapper{*this, t};                                                  \
 1230|  16.4k|    }
_ZN13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrEC2ERKS1_RS2_:
 1195|  16.4k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_Z11UnserializeI10DataStreamR13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrEQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  16.4k|{
  763|  16.4k|    a.Unserialize(is);
  764|  16.4k|}
_ZN13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrE11UnserializeI10DataStreamEEvRT_:
 1205|  16.4k|    {
 1206|  16.4k|        ParamsStream ss{s, m_params};
 1207|  16.4k|        ::Unserialize(ss, m_object);
 1208|  16.4k|    }
_Z16GetSerializeSizeI6CTxOutEmRKT_:
 1104|    928|{
 1105|    928|    return (SizeComputer() << t).size();
 1106|    928|}
_ZN12SizeComputerlsI6CTxOutEERS_RKT_:
 1081|    928|    {
 1082|    928|        ::Serialize(*this, obj);
 1083|    928|        return (*this);
 1084|    928|    }
_Z16WriteCompactSizeI10HashWriterEvRT_m:
  309|   188k|{
  310|   188k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 188k, False: 0]
  ------------------
  311|   188k|    {
  312|   188k|        ser_writedata8(os, nSize);
  313|   188k|    }
  314|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 0, False: 0]
  ------------------
  315|      0|    {
  316|      0|        ser_writedata8(os, 253);
  317|      0|        ser_writedata16(os, nSize);
  318|      0|    }
  319|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|    {
  321|      0|        ser_writedata8(os, 254);
  322|      0|        ser_writedata32(os, nSize);
  323|      0|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|   188k|    return;
  330|   188k|}
_Z14ser_writedata8I10HashWriterEvRT_h:
   55|   236k|{
   56|   236k|    s.write(AsBytes(Span{&obj, 1}));
   57|   236k|}
_Z15ser_writedata64I10HashWriterEvRT_m:
   79|  46.8k|{
   80|  46.8k|    obj = htole64_internal(obj);
   81|  46.8k|    s.write(AsBytes(Span{&obj, 1}));
   82|  46.8k|}
_Z9SerializeI10HashWriterhNSt3__19allocatorIhEEEvRT_RKNS1_6vectorIT0_T1_EE:
  846|   188k|{
  847|   188k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|   188k|        WriteCompactSize(os, v.size());
  849|   188k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (849:13): [True: 188k, False: 0]
  ------------------
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|       |    } else {
  859|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|       |    }
  861|   188k|}
_ZNK8CNetAddr9SerParamsclI8CServiceEEDaOT_:
 1228|  25.4k|    {                                                                                    \
 1229|  25.4k|        return ParamsWrapper{*this, t};                                                  \
 1230|  25.4k|    }
net.cpp:_ZL5UsingI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE7WrapperIT_RT0_EOS6_:
  497|  8.47k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJi7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEll13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceElSB_mNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEEibEEvRT_DpRKT0_:
  995|  8.47k|{
  996|  8.47k|    (::Serialize(s, args), ...);
  997|  8.47k|}
_Z9SerializeI12VectorWriterEvRT_i:
  261|  37.7k|template<typename Stream> inline void Serialize(Stream& s, int32_t a ) { ser_writedata32(s, a); }
_Z9SerializeI12VectorWriter7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|  8.47k|{
  754|  8.47k|    a.Serialize(os);
  755|  8.47k|}
_ZNK7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE9SerializeI12VectorWriterEEvRT_:
  482|  8.47k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN19CustomUintFormatterILi8ELb0EE3SerI12VectorWriter12ServiceFlagsEEvRT_T0_:
  535|  8.47k|    {
  536|  8.47k|        if (v < 0 || v > MAX) throw std::ios_base::failure("CustomUintFormatter value out of range");
  ------------------
  |  Branch (536:13): [True: 0, False: 8.47k]
  |  Branch (536:22): [True: 0, False: 8.47k]
  ------------------
  537|  8.47k|        if (BigEndian) {
  ------------------
  |  Branch (537:13): [Folded - Ignored]
  ------------------
  538|      0|            uint64_t raw = htobe64_internal(v);
  539|      0|            s.write(AsBytes(Span{&raw, 1}).last(Bytes));
  540|  8.47k|        } else {
  541|  8.47k|            uint64_t raw = htole64_internal(v);
  542|  8.47k|            s.write(AsBytes(Span{&raw, 1}).first(Bytes));
  543|  8.47k|        }
  544|  8.47k|    }
_Z9SerializeI12VectorWriterEvRT_l:
  263|  41.1k|template<typename Stream> inline void Serialize(Stream& s, int64_t a ) { ser_writedata64(s, a); }
_Z9SerializeI12VectorWriter13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  33.8k|{
  754|  33.8k|    a.Serialize(os);
  755|  33.8k|}
_ZNK13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceE9SerializeI12VectorWriterEEvRT_:
 1199|  33.8k|    {
 1200|  33.8k|        ParamsStream ss{s, m_params};
 1201|  33.8k|        ::Serialize(ss, m_object);
 1202|  33.8k|    }
_ZN12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEC2ES1_RKS3_:
 1127|  33.8k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEE8CServiceQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|  33.8k|{
  754|  33.8k|    a.Serialize(os);
  755|  33.8k|}
_ZNK8CService9SerializeI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEEEvRT_:
  222|  33.8k|    {                                                                                               \
  223|  33.8k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  33.8k|        Ser(s, *this);                                                                              \
  225|  33.8k|    }                                                                                               \
_ZN8CService3SerI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEEEvRT_RKS_:
  178|  33.8k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEJS4_7WrapperI19CustomUintFormatterILi2ELb1EERKtEEEEvRT_DpRKT0_:
 1013|  33.8k|    {
 1014|  33.8k|        ::SerializeMany(s, args...);
 1015|  33.8k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEJS3_7WrapperI19CustomUintFormatterILi2ELb1EERKtEEEvRT_DpRKT0_:
  995|  33.8k|{
  996|  33.8k|    (::Serialize(s, args), ...);
  997|  33.8k|}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEES3_Q12SerializableIT0_T_EEvRS7_RKS6_:
  753|  33.8k|{
  754|  33.8k|    a.Serialize(os);
  755|  33.8k|}
_ZNK12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEE9GetParamsIS3_EERKDav:
 1144|  33.8k|    {
 1145|  33.8k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  33.8k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  33.8k|    }
_ZN12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEE5writeE4SpanIKSt4byteE:
 1135|  67.7k|    void write(Span<const std::byte> src) { GetStream().write(src); }
_ZN12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEE9GetStreamEv:
 1154|  67.7k|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  67.7k|        } else {
 1158|  67.7k|            return m_substream;
 1159|  67.7k|        }
 1160|  67.7k|    }
_ZN12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEElsIA16_hEERS4_RKT_:
 1133|  33.8k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEETk9BasicBytehLi16EEvRT_RAT1__KT0_:
  265|  33.8k|template <typename Stream, BasicByte B, int N> void Serialize(Stream& s, const B (&a)[N]) { s.write(MakeByteSpan(a)); }
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEE7WrapperI19CustomUintFormatterILi2ELb1EERKtEQ12SerializableIT0_T_EEvRSD_RKSC_:
  753|  33.8k|{
  754|  33.8k|    a.Serialize(os);
  755|  33.8k|}
_ZNK7WrapperI19CustomUintFormatterILi2ELb1EERKtE9SerializeI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEEEvRT_:
  482|  33.8k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN19CustomUintFormatterILi2ELb1EE3SerI12ParamsStreamIR12VectorWriterN8CNetAddr9SerParamsEEtEEvRT_T0_:
  535|  33.8k|    {
  536|  33.8k|        if (v < 0 || v > MAX) throw std::ios_base::failure("CustomUintFormatter value out of range");
  ------------------
  |  Branch (536:13): [True: 0, False: 33.8k]
  |  Branch (536:22): [True: 0, False: 33.8k]
  ------------------
  537|  33.8k|        if (BigEndian) {
  ------------------
  |  Branch (537:13): [Folded - Ignored]
  ------------------
  538|  33.8k|            uint64_t raw = htobe64_internal(v);
  539|  33.8k|            s.write(AsBytes(Span{&raw, 1}).last(Bytes));
  540|  33.8k|        } else {
  541|      0|            uint64_t raw = htole64_internal(v);
  542|      0|            s.write(AsBytes(Span{&raw, 1}).first(Bytes));
  543|      0|        }
  544|  33.8k|    }
net.cpp:_ZL5UsingI19CustomUintFormatterILi2ELb1EERKtE7WrapperIT_RT0_EOS6_:
  497|  16.9k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z9SerializeI12VectorWriterEvRT_m:
  264|  59.6k|template<typename Stream> inline void Serialize(Stream& s, uint64_t a) { ser_writedata64(s, a); }
_Z9SerializeI12VectorWritercEvRT_RKNSt3__112basic_stringIT0_NS3_11char_traitsIS5_EENS3_9allocatorIS5_EEEE:
  789|  16.9k|{
  790|  16.9k|    WriteCompactSize(os, str.size());
  791|  16.9k|    if (!str.empty())
  ------------------
  |  Branch (791:9): [True: 0, False: 16.9k]
  ------------------
  792|      0|        os.write(MakeByteSpan(str));
  793|  16.9k|}
_Z9SerializeI12VectorWriterEvRT_b:
  285|  23.6k|template <typename Stream> inline void Serialize(Stream& s, bool a) { uint8_t f = a; ser_writedata8(s, f); }
_ZNK8CAddress9SerParamsclIRNSt3__16vectorIS_NS2_9allocatorIS_EEEEEEDaOT_:
 1228|  1.53k|    {                                                                                    \
 1229|  1.53k|        return ParamsWrapper{*this, t};                                                  \
 1230|  1.53k|    }
_ZN13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS0_NS2_9allocatorIS0_EEEEEC2ERKS1_RS6_:
 1195|  1.53k|    explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI8CAddressNS3_9allocatorIS5_EEEEEC2ESA_:
  481|    129|    explicit Wrapper(T obj) : m_object(obj) {}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI8CAddressNS3_9allocatorIS5_EEEEEC2ES9_:
  481|  1.40k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z9SerializeI10HashWriter7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  753|   152k|{
  754|   152k|    a.Serialize(os);
  755|   152k|}
_Z9SerializeI10HashWriterTk9BasicByteKhEvRT_4SpanIT0_E:
  268|   152k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI10HashWriterEvRT_m:
  264|  46.8k|template<typename Stream> inline void Serialize(Stream& s, uint64_t a) { ser_writedata64(s, a); }
_Z9SerializeI10HashWriterEvRT_h:
  258|  48.0k|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_Z9SerializeI10HashWriterEvRT_i:
  261|  53.5k|template<typename Stream> inline void Serialize(Stream& s, int32_t a ) { ser_writedata32(s, a); }
_Z13SerializeManyI12VectorWriterJ14CMessageHeaderEEvRT_DpRKT0_:
  995|  66.2k|{
  996|  66.2k|    (::Serialize(s, args), ...);
  997|  66.2k|}
_Z9SerializeI12VectorWriter14CMessageHeaderQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|  66.2k|{
  754|  66.2k|    a.Serialize(os);
  755|  66.2k|}
_ZNK14CMessageHeader9SerializeI12VectorWriterEEvRT_:
  222|  66.2k|    {                                                                                               \
  223|  66.2k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  66.2k|        Ser(s, *this);                                                                              \
  225|  66.2k|    }                                                                                               \
_ZN14CMessageHeader3SerI12VectorWriterEEvRT_RKS_:
  178|  66.2k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJNSt3__15arrayIhLm4EEEA12_cjA4_hEEEvRT_DpRKT0_:
 1013|  66.2k|    {
 1014|  66.2k|        ::SerializeMany(s, args...);
 1015|  66.2k|    }
_Z13SerializeManyI12VectorWriterJNSt3__15arrayIhLm4EEEA12_cjA4_hEEvRT_DpRKT0_:
  995|  66.2k|{
  996|  66.2k|    (::Serialize(s, args), ...);
  997|  66.2k|}
_Z9SerializeI12VectorWriterTk9BasicBytehLm4EEvRT_RKNSt3__15arrayIT0_XT1_EEE:
  266|  66.2k|template <typename Stream, BasicByte B, std::size_t N> void Serialize(Stream& s, const std::array<B, N>& a) { s.write(MakeByteSpan(a)); }
_Z9SerializeI12VectorWriterTk9BasicBytecLi12EEvRT_RAT1__KT0_:
  265|  66.2k|template <typename Stream, BasicByte B, int N> void Serialize(Stream& s, const B (&a)[N]) { s.write(MakeByteSpan(a)); }
_Z13SerializeManyI12VectorWriterJbmEEvRT_DpRKT0_:
  995|  6.69k|{
  996|  6.69k|    (::Serialize(s, args), ...);
  997|  6.69k|}
_Z13SerializeManyI12VectorWriterJ25CBlockHeaderAndShortTxIDsEEvRT_DpRKT0_:
  995|     10|{
  996|     10|    (::Serialize(s, args), ...);
  997|     10|}
_Z9SerializeI12VectorWriter25CBlockHeaderAndShortTxIDsQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK25CBlockHeaderAndShortTxIDs9SerializeI12VectorWriterEEvRT_:
  222|     10|    {                                                                                               \
  223|     10|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|     10|        Ser(s, *this);                                                                              \
  225|     10|    }                                                                                               \
_ZN25CBlockHeaderAndShortTxIDs3SerI12VectorWriterEEvRT_RKS_:
  178|     10|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJ12CBlockHeaderm7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERKNSt3__16vectorImNS8_9allocatorImEEEEENS9_I20PrefilledTransactionNSA_ISG_EEEEEEEvRT_DpRKT0_:
 1013|     10|    {
 1014|     10|        ::SerializeMany(s, args...);
 1015|     10|    }
_Z13SerializeManyI12VectorWriterJ12CBlockHeaderm7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERKNSt3__16vectorImNS7_9allocatorImEEEEENS8_I20PrefilledTransactionNS9_ISF_EEEEEEvRT_DpRKT0_:
  995|     10|{
  996|     10|    (::Serialize(s, args), ...);
  997|     10|}
_Z9SerializeI12VectorWriter12CBlockHeaderQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK12CBlockHeader9SerializeI12VectorWriterEEvRT_:
  222|     10|    {                                                                                               \
  223|     10|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|     10|        Ser(s, *this);                                                                              \
  225|     10|    }                                                                                               \
_ZN12CBlockHeader3SerI12VectorWriterEEvRT_RKS_:
  178|     10|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJi7uint256S2_jjjEEEvRT_DpRKT0_:
 1013|     10|    {
 1014|     10|        ::SerializeMany(s, args...);
 1015|     10|    }
_Z13SerializeManyI12VectorWriterJi7uint256S1_jjjEEvRT_DpRKT0_:
  995|     10|{
  996|     10|    (::Serialize(s, args), ...);
  997|     10|}
_Z9SerializeI12VectorWriter7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERKNSt3__16vectorImNS6_9allocatorImEEEEEQ12SerializableIT0_T_EEvRSF_RKSE_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK7WrapperI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERKNSt3__16vectorImNS4_9allocatorImEEEEE9SerializeI12VectorWriterEEvRT_:
  482|     10|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI19CustomUintFormatterILi6ELb0EEE3SerI12VectorWriterNSt3__16vectorImNS5_9allocatorImEEEEEEvRT_RKT0_:
  662|     10|    {
  663|     10|        Formatter formatter;
  664|     10|        WriteCompactSize(s, v.size());
  665|     10|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 0, False: 10]
  ------------------
  666|      0|            formatter.Ser(s, elem);
  667|      0|        }
  668|     10|    }
_Z9SerializeI12VectorWriter20PrefilledTransactionNSt3__19allocatorIS1_EEEvRT_RKNS2_6vectorIT0_T1_EE:
  846|     10|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|     10|    } else {
  859|     10|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|     10|    }
  861|     10|}
_Z9SerializeI12VectorWriter7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI20PrefilledTransactionNS5_9allocatorIS7_EEEEEQ12SerializableIT0_T_EEvRSF_RKSE_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI20PrefilledTransactionNS3_9allocatorIS5_EEEEE9SerializeI12VectorWriterEEvRT_:
  482|     10|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12VectorWriterNSt3__16vectorI20PrefilledTransactionNS4_9allocatorIS6_EEEEEEvRT_RKT0_:
  662|     10|    {
  663|     10|        Formatter formatter;
  664|     10|        WriteCompactSize(s, v.size());
  665|     10|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 10, False: 10]
  ------------------
  666|     10|            formatter.Ser(s, elem);
  667|     10|        }
  668|     10|    }
_ZN16DefaultFormatter3SerI12VectorWriter20PrefilledTransactionEEvRT_RKT0_:
  774|     10|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12VectorWriter20PrefilledTransactionQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK20PrefilledTransaction9SerializeI12VectorWriterEEvRT_:
  222|     10|    {                                                                                               \
  223|     10|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|     10|        Ser(s, *this);                                                                              \
  225|     10|    }                                                                                               \
_ZN20PrefilledTransaction3SerI12VectorWriterEEvRT_RKS_:
  178|     10|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJ7WrapperI20CompactSizeFormatterILb1EERKtE13ParamsWrapperI20TransactionSerParamsS2_I16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEEEEEvRT_DpRKT0_:
 1013|     10|    {
 1014|     10|        ::SerializeMany(s, args...);
 1015|     10|    }
_Z13SerializeManyI12VectorWriterJ7WrapperI20CompactSizeFormatterILb1EERKtE13ParamsWrapperI20TransactionSerParamsS1_I16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEEEEvRT_DpRKT0_:
  995|     10|{
  996|     10|    (::Serialize(s, args), ...);
  997|     10|}
_Z9SerializeI12VectorWriter7WrapperI20CompactSizeFormatterILb1EERKtEQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK7WrapperI20CompactSizeFormatterILb1EERKtE9SerializeI12VectorWriterEEvRT_:
  482|     10|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN20CompactSizeFormatterILb1EE3SerI12VectorWritertEEvRT_T0_:
  579|     10|    {
  580|     10|        static_assert(std::is_unsigned<I>::value, "CompactSize only supported for unsigned integers");
  581|     10|        static_assert(std::numeric_limits<I>::max() <= std::numeric_limits<uint64_t>::max(), "CompactSize only supports 64-bit integers and below");
  582|       |
  583|     10|        WriteCompactSize<Stream>(s, v);
  584|     10|    }
_Z9SerializeI12VectorWriter13ParamsWrapperI20TransactionSerParams7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEEQ12SerializableIT0_T_EEvRSF_RKSE_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK13ParamsWrapperI20TransactionSerParams7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEE9SerializeI12VectorWriterEEvRT_:
 1199|     10|    {
 1200|     10|        ParamsStream ss{s, m_params};
 1201|     10|        ::Serialize(ss, m_object);
 1202|     10|    }
_Z9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsE7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEEQ12SerializableIT0_T_EEvRSG_RKSF_:
  753|     10|{
  754|     10|    a.Serialize(os);
  755|     10|}
_ZNK7WrapperI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  482|     10|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
net_processing.cpp:_ZL5UsingI20CompactSizeFormatterILb1EERKtE7WrapperIT_RT0_EOS6_:
  497|     10|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
net_processing.cpp:_ZL5UsingI16DefaultFormatterRKNSt3__110shared_ptrIK12CTransactionEEE7WrapperIT_RT0_EOSA_:
  497|     10|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI20PrefilledTransactionNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|     10|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
net_processing.cpp:_ZL5UsingI15VectorFormatterI19CustomUintFormatterILi6ELb0EEERKNSt3__16vectorImNS4_9allocatorImEEEEE7WrapperIT_RT0_EOSD_:
  497|     10|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJNSt3__16vectorI4CInvNS1_9allocatorIS3_EEEEEEvRT_DpRKT0_:
  995|  15.5k|{
  996|  15.5k|    (::Serialize(s, args), ...);
  997|  15.5k|}
_Z9SerializeI12VectorWriter4CInvNSt3__19allocatorIS1_EEEvRT_RKNS2_6vectorIT0_T1_EE:
  846|  15.5k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  15.5k|    } else {
  859|  15.5k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  15.5k|    }
  861|  15.5k|}
_Z9SerializeI12VectorWriter7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI4CInvNS5_9allocatorIS7_EEEEEQ12SerializableIT0_T_EEvRSF_RKSE_:
  753|  15.5k|{
  754|  15.5k|    a.Serialize(os);
  755|  15.5k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI4CInvNS3_9allocatorIS5_EEEEE9SerializeI12VectorWriterEEvRT_:
  482|  15.5k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12VectorWriterNSt3__16vectorI4CInvNS4_9allocatorIS6_EEEEEEvRT_RKT0_:
  662|  15.5k|    {
  663|  15.5k|        Formatter formatter;
  664|  15.5k|        WriteCompactSize(s, v.size());
  665|   889k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 889k, False: 15.5k]
  ------------------
  666|   889k|            formatter.Ser(s, elem);
  667|   889k|        }
  668|  15.5k|    }
_ZN16DefaultFormatter3SerI12VectorWriter4CInvEEvRT_RKT0_:
  774|   889k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12VectorWriter4CInvQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|   889k|{
  754|   889k|    a.Serialize(os);
  755|   889k|}
_ZNK4CInv9SerializeI12VectorWriterEEvRT_:
  222|   889k|    {                                                                                               \
  223|   889k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|   889k|        Ser(s, *this);                                                                              \
  225|   889k|    }                                                                                               \
_ZN4CInv3SerI12VectorWriterEEvRT_RKS_:
  178|   889k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJj7uint256EEEvRT_DpRKT0_:
 1013|   889k|    {
 1014|   889k|        ::SerializeMany(s, args...);
 1015|   889k|    }
_Z13SerializeManyI12VectorWriterJj7uint256EEvRT_DpRKT0_:
  995|   889k|{
  996|   889k|    (::Serialize(s, args), ...);
  997|   889k|}
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI4CInvNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  15.5k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI4CInvNS3_9allocatorIS5_EEEEEC2ESA_:
  481|  15.5k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamR7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|  8.40k|{
  763|  8.40k|    a.Unserialize(is);
  764|  8.40k|}
_ZN7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE11UnserializeI10DataStreamEEvRT_:
  483|  8.40k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN19CustomUintFormatterILi8ELb0EE5UnserI10DataStream12ServiceFlagsEEvRT_RT0_:
  547|  8.40k|    {
  548|  8.40k|        using U = typename std::conditional<std::is_enum<I>::value, std::underlying_type<I>, std::common_type<I>>::type::type;
  549|  8.40k|        static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small");
  550|  8.40k|        uint64_t raw = 0;
  551|  8.40k|        if (BigEndian) {
  ------------------
  |  Branch (551:13): [Folded - Ignored]
  ------------------
  552|      0|            s.read(AsWritableBytes(Span{&raw, 1}).last(Bytes));
  553|      0|            v = static_cast<I>(be64toh_internal(raw));
  554|  8.40k|        } else {
  555|  8.40k|            s.read(AsWritableBytes(Span{&raw, 1}).first(Bytes));
  556|  8.40k|            v = static_cast<I>(le64toh_internal(raw));
  557|  8.40k|        }
  558|  8.40k|    }
net_processing.cpp:_ZL5UsingI19CustomUintFormatterILi8ELb0EER12ServiceFlagsE7WrapperIT_RT0_EOS6_:
  497|  8.40k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
net_processing.cpp:_ZL5UsingI19CustomUintFormatterILi2ELb1EERtE7WrapperIT_RT0_EOS5_:
  497|  8.40k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z11UnserializeI10DataStreamR7WrapperI22LimitedStringFormatterILm256EERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEQ14UnserializableIT0_T_EEvRSF_OSE_:
  762|  8.35k|{
  763|  8.35k|    a.Unserialize(is);
  764|  8.35k|}
_ZN7WrapperI22LimitedStringFormatterILm256EERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE11UnserializeI10DataStreamEEvRT_:
  483|  8.35k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN22LimitedStringFormatterILm256EE5UnserI10DataStreamEEvRT_RNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
  628|  8.35k|    {
  629|  8.35k|        size_t size = ReadCompactSize(s);
  630|  8.35k|        if (size > Limit) {
  ------------------
  |  Branch (630:13): [True: 0, False: 8.35k]
  ------------------
  631|      0|            throw std::ios_base::failure("String length limit exceeded");
  632|      0|        }
  633|  8.35k|        v.resize(size);
  634|  8.35k|        if (size != 0) s.read(MakeWritableByteSpan(v));
  ------------------
  |  Branch (634:13): [True: 0, False: 8.35k]
  ------------------
  635|  8.35k|    }
net_processing.cpp:_ZL5UsingI22LimitedStringFormatterILm256EERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE7WrapperIT_RT0_EOSC_:
  497|  8.35k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI22LimitedStringFormatterILm256EERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEC2ES9_:
  481|  8.35k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z13SerializeManyI12VectorWriterJimlm13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEmS5_mNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEibEEvRT_DpRKT0_:
  995|  8.47k|{
  996|  8.47k|    (::Serialize(s, args), ...);
  997|  8.47k|}
net_processing.cpp:_ZL5UsingI19CustomUintFormatterILi2ELb1EERKtE7WrapperIT_RT0_EOS6_:
  497|  22.2k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJjmEEvRT_DpRKT0_:
  995|  3.77k|{
  996|  3.77k|    (::Serialize(s, args), ...);
  997|  3.77k|}
_Z13SerializeManyI12VectorWriterJNSt3__15arrayISt4byteLm168EEEEEvRT_DpRKT0_:
  995|  1.45k|{
  996|  1.45k|    (::Serialize(s, args), ...);
  997|  1.45k|}
_Z9SerializeI12VectorWriterTk9BasicByteSt4byteLm168EEvRT_RKNSt3__15arrayIT0_XT1_EEE:
  266|  1.45k|template <typename Stream, BasicByte B, std::size_t N> void Serialize(Stream& s, const std::array<B, N>& a) { s.write(MakeByteSpan(a)); }
_Z11UnserializeI10DataStreamR13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS2_NS4_9allocatorIS2_EEEEEQ14UnserializableIT0_T_EEvRSC_OSB_:
  762|  1.40k|{
  763|  1.40k|    a.Unserialize(is);
  764|  1.40k|}
_ZN13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS0_NS2_9allocatorIS0_EEEEE11UnserializeI10DataStreamEEvRT_:
 1205|  1.40k|    {
 1206|  1.40k|        ParamsStream ss{s, m_params};
 1207|  1.40k|        ::Unserialize(ss, m_object);
 1208|  1.40k|    }
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEES3_NSt3__19allocatorIS3_EEEvRT_RNS6_6vectorIT0_T1_EE:
  866|  1.40k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  1.40k|    } else {
  879|  1.40k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  1.40k|    }
  881|  1.40k|}
_Z11UnserializeI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorIS3_NSA_9allocatorIS3_EEEEEQ14UnserializableIT0_T_EEvRSI_OSH_:
  762|  1.40k|{
  763|  1.40k|    a.Unserialize(is);
  764|  1.40k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI8CAddressNS3_9allocatorIS5_EEEEE11UnserializeI12ParamsStreamIR10DataStreamNS5_9SerParamsEEEEvRT_:
  483|  1.40k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEENSt3__16vectorIS6_NS9_9allocatorIS6_EEEEEEvRT_RT0_:
  672|  1.40k|    {
  673|  1.40k|        Formatter formatter;
  674|  1.40k|        v.clear();
  675|  1.40k|        size_t size = ReadCompactSize(s);
  676|  1.40k|        size_t allocated = 0;
  677|  2.67k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 1.27k, False: 1.40k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  1.27k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  1.27k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  1.27k|            v.reserve(allocated);
  684|   301k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 299k, False: 1.27k]
  ------------------
  685|   299k|                v.emplace_back();
  686|   299k|                formatter.Unser(s, v.back());
  687|   299k|            }
  688|  1.27k|        }
  689|  1.40k|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR10DataStreamN8CAddress9SerParamsEES4_EEvRT_RT0_:
  777|   299k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI8CAddressNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|  1.40k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z11UnserializeI10DataStream4CInvNSt3__19allocatorIS1_EEEvRT_RNS2_6vectorIT0_T1_EE:
  866|  1.95k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  1.95k|    } else {
  879|  1.95k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  1.95k|    }
  881|  1.95k|}
_Z11UnserializeI10DataStream7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI4CInvNS5_9allocatorIS7_EEEEEQ14UnserializableIT0_T_EEvRSE_OSD_:
  762|  1.95k|{
  763|  1.95k|    a.Unserialize(is);
  764|  1.95k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI4CInvNS3_9allocatorIS5_EEEEE11UnserializeI10DataStreamEEvRT_:
  483|  1.95k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI10DataStreamNSt3__16vectorI4CInvNS4_9allocatorIS6_EEEEEEvRT_RT0_:
  672|  1.95k|    {
  673|  1.95k|        Formatter formatter;
  674|  1.95k|        v.clear();
  675|  1.95k|        size_t size = ReadCompactSize(s);
  676|  1.95k|        size_t allocated = 0;
  677|  3.85k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 1.89k, False: 1.95k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  1.89k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  1.89k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  1.89k|            v.reserve(allocated);
  684|  2.94M|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 2.94M, False: 1.89k]
  ------------------
  685|  2.94M|                v.emplace_back();
  686|  2.94M|                formatter.Unser(s, v.back());
  687|  2.94M|            }
  688|  1.89k|        }
  689|  1.95k|    };
_ZN16DefaultFormatter5UnserI10DataStream4CInvEEvRT_RT0_:
  777|  2.94M|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI4CInvNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|  1.95k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI4CInvNS3_9allocatorIS5_EEEEEC2ES9_:
  481|  1.95k|    explicit Wrapper(T obj) : m_object(obj) {}
_Z13SerializeManyI12VectorWriterJ13CBlockLocator7uint256EEvRT_DpRKT0_:
  995|  3.80k|{
  996|  3.80k|    (::Serialize(s, args), ...);
  997|  3.80k|}
_Z9SerializeI12VectorWriter13CBlockLocatorQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|  3.80k|{
  754|  3.80k|    a.Serialize(os);
  755|  3.80k|}
_ZNK13CBlockLocator9SerializeI12VectorWriterEEvRT_:
  222|  3.80k|    {                                                                                               \
  223|  3.80k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  3.80k|        Ser(s, *this);                                                                              \
  225|  3.80k|    }                                                                                               \
_ZN13CBlockLocator3SerI12VectorWriterEEvRT_RKS_:
  178|  3.80k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJiEEEvRT_DpRKT0_:
 1013|  3.80k|    {
 1014|  3.80k|        ::SerializeMany(s, args...);
 1015|  3.80k|    }
_Z13SerializeManyI12VectorWriterJiEEvRT_DpRKT0_:
  995|  3.80k|{
  996|  3.80k|    (::Serialize(s, args), ...);
  997|  3.80k|}
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJNSt3__16vectorI7uint256NS2_9allocatorIS4_EEEEEEEvRT_DpRKT0_:
 1013|  3.80k|    {
 1014|  3.80k|        ::SerializeMany(s, args...);
 1015|  3.80k|    }
_Z13SerializeManyI12VectorWriterJNSt3__16vectorI7uint256NS1_9allocatorIS3_EEEEEEvRT_DpRKT0_:
  995|  3.80k|{
  996|  3.80k|    (::Serialize(s, args), ...);
  997|  3.80k|}
_Z9SerializeI12VectorWriter7uint256NSt3__19allocatorIS1_EEEvRT_RKNS2_6vectorIT0_T1_EE:
  846|  3.80k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  3.80k|    } else {
  859|  3.80k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  3.80k|    }
  861|  3.80k|}
_Z9SerializeI12VectorWriter7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI7uint256NS5_9allocatorIS7_EEEEEQ12SerializableIT0_T_EEvRSF_RKSE_:
  753|  3.80k|{
  754|  3.80k|    a.Serialize(os);
  755|  3.80k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI7uint256NS3_9allocatorIS5_EEEEE9SerializeI12VectorWriterEEvRT_:
  482|  3.80k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12VectorWriterNSt3__16vectorI7uint256NS4_9allocatorIS6_EEEEEEvRT_RKT0_:
  662|  3.80k|    {
  663|  3.80k|        Formatter formatter;
  664|  3.80k|        WriteCompactSize(s, v.size());
  665|  72.2k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 72.2k, False: 3.80k]
  ------------------
  666|  72.2k|            formatter.Ser(s, elem);
  667|  72.2k|        }
  668|  3.80k|    }
_ZN16DefaultFormatter3SerI12VectorWriter7uint256EEvRT_RKT0_:
  774|  72.2k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI7uint256NS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|  3.80k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJ4SpanIhEEEvRT_DpRKT0_:
  995|     62|{
  996|     62|    (::Serialize(s, args), ...);
  997|     62|}
_Z9SerializeI12VectorWriterTk9BasicBytehEvRT_4SpanIT0_E:
  268|     62|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z13SerializeManyI12VectorWriterJ13ParamsWrapperI20TransactionSerParamsK6CBlockEEEvRT_DpRKT0_:
  995|  1.47k|{
  996|  1.47k|    (::Serialize(s, args), ...);
  997|  1.47k|}
_Z9SerializeI12VectorWriter13ParamsWrapperI20TransactionSerParamsK6CBlockEQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  1.47k|{
  754|  1.47k|    a.Serialize(os);
  755|  1.47k|}
_ZNK13ParamsWrapperI20TransactionSerParamsK6CBlockE9SerializeI12VectorWriterEEvRT_:
 1199|  1.47k|    {
 1200|  1.47k|        ParamsStream ss{s, m_params};
 1201|  1.47k|        ::Serialize(ss, m_object);
 1202|  1.47k|    }
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE7WrapperIT_RT0_EOSG_:
  497|  1.48k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJ17BlockTransactionsEEvRT_DpRKT0_:
  995|      2|{
  996|      2|    (::Serialize(s, args), ...);
  997|      2|}
_Z9SerializeI12VectorWriter17BlockTransactionsQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|      2|{
  754|      2|    a.Serialize(os);
  755|      2|}
_ZNK17BlockTransactions9SerializeI12VectorWriterEEvRT_:
  222|      2|    {                                                                                               \
  223|      2|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|      2|        Ser(s, *this);                                                                              \
  225|      2|    }                                                                                               \
_ZN17BlockTransactions3SerI12VectorWriterEEvRT_RKS_:
  178|      2|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJ7uint25613ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEEEEEvRT_DpRKT0_:
 1013|      2|    {
 1014|      2|        ::SerializeMany(s, args...);
 1015|      2|    }
_Z13SerializeManyI12VectorWriterJ7uint25613ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEEEvRT_DpRKT0_:
  995|      2|{
  996|      2|    (::Serialize(s, args), ...);
  997|      2|}
_Z9SerializeI12VectorWriter13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS7_10shared_ptrIK12CTransactionEENS7_9allocatorISC_EEEEEEQ12SerializableIT0_T_EEvRSL_RKSK_:
  753|      2|{
  754|      2|    a.Serialize(os);
  755|      2|}
_ZNK13ParamsWrapperI20TransactionSerParams7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS5_10shared_ptrIK12CTransactionEENS5_9allocatorISA_EEEEEE9SerializeI12VectorWriterEEvRT_:
 1199|      2|    {
 1200|      2|        ParamsStream ss{s, m_params};
 1201|      2|        ::Serialize(ss, m_object);
 1202|      2|    }
_Z13SerializeManyI12VectorWriterJ24BlockTransactionsRequestEEvRT_DpRKT0_:
  995|     71|{
  996|     71|    (::Serialize(s, args), ...);
  997|     71|}
_Z9SerializeI12VectorWriter24BlockTransactionsRequestQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|     71|{
  754|     71|    a.Serialize(os);
  755|     71|}
_ZNK24BlockTransactionsRequest9SerializeI12VectorWriterEEvRT_:
  222|     71|    {                                                                                               \
  223|     71|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|     71|        Ser(s, *this);                                                                              \
  225|     71|    }                                                                                               \
_ZN24BlockTransactionsRequest3SerI12VectorWriterEEvRT_RKS_:
  178|     71|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12VectorWriterJ7uint2567WrapperI15VectorFormatterI19DifferenceFormatterERKNSt3__16vectorItNS7_9allocatorItEEEEEEEEvRT_DpRKT0_:
 1013|     71|    {
 1014|     71|        ::SerializeMany(s, args...);
 1015|     71|    }
_Z13SerializeManyI12VectorWriterJ7uint2567WrapperI15VectorFormatterI19DifferenceFormatterERKNSt3__16vectorItNS6_9allocatorItEEEEEEEvRT_DpRKT0_:
  995|     71|{
  996|     71|    (::Serialize(s, args), ...);
  997|     71|}
_Z9SerializeI12VectorWriter7WrapperI15VectorFormatterI19DifferenceFormatterERKNSt3__16vectorItNS5_9allocatorItEEEEEQ12SerializableIT0_T_EEvRSE_RKSD_:
  753|     71|{
  754|     71|    a.Serialize(os);
  755|     71|}
_ZNK7WrapperI15VectorFormatterI19DifferenceFormatterERKNSt3__16vectorItNS3_9allocatorItEEEEE9SerializeI12VectorWriterEEvRT_:
  482|     71|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI19DifferenceFormatterE3SerI12VectorWriterNSt3__16vectorItNS4_9allocatorItEEEEEEvRT_RKT0_:
  662|     71|    {
  663|     71|        Formatter formatter;
  664|     71|        WriteCompactSize(s, v.size());
  665|    939|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 939, False: 71]
  ------------------
  666|    939|            formatter.Ser(s, elem);
  667|    939|        }
  668|     71|    }
net_processing.cpp:_ZL5UsingI15VectorFormatterI19DifferenceFormatterERKNSt3__16vectorItNS3_9allocatorItEEEEE7WrapperIT_RT0_EOSC_:
  497|     71|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJmEEvRT_DpRKT0_:
  995|  6.76k|{
  996|  6.76k|    (::Serialize(s, args), ...);
  997|  6.76k|}
_Z13SerializeManyI12VectorWriterJ13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS2_NS4_9allocatorIS2_EEEEEEEvRT_DpRKT0_:
  995|    129|{
  996|    129|    (::Serialize(s, args), ...);
  997|    129|}
_Z9SerializeI12VectorWriter13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS2_NS4_9allocatorIS2_EEEEEQ12SerializableIT0_T_EEvRSB_RKSA_:
  753|    129|{
  754|    129|    a.Serialize(os);
  755|    129|}
_ZNK13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS0_NS2_9allocatorIS0_EEEEE9SerializeI12VectorWriterEEvRT_:
 1199|    129|    {
 1200|    129|        ParamsStream ss{s, m_params};
 1201|    129|        ::Serialize(ss, m_object);
 1202|    129|    }
_ZN12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEC2ES1_RKS3_:
 1127|    129|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEES3_NSt3__19allocatorIS3_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|    129|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|    129|    } else {
  859|    129|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|    129|    }
  861|    129|}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorIS3_NSA_9allocatorIS3_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|    129|{
  754|    129|    a.Serialize(os);
  755|    129|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI8CAddressNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR12VectorWriterNS5_9SerParamsEEEEvRT_:
  482|    129|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEENSt3__16vectorIS6_NS9_9allocatorIS6_EEEEEEvRT_RKT0_:
  662|    129|    {
  663|    129|        Formatter formatter;
  664|    129|        WriteCompactSize(s, v.size());
  665|  5.29k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 5.29k, False: 129]
  ------------------
  666|  5.29k|            formatter.Ser(s, elem);
  667|  5.29k|        }
  668|    129|    }
_Z16WriteCompactSizeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEvRT_m:
  309|    129|{
  310|    129|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 122, False: 7]
  ------------------
  311|    122|    {
  312|    122|        ser_writedata8(os, nSize);
  313|    122|    }
  314|      7|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 7, False: 0]
  ------------------
  315|      7|    {
  316|      7|        ser_writedata8(os, 253);
  317|      7|        ser_writedata16(os, nSize);
  318|      7|    }
  319|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|    {
  321|      0|        ser_writedata8(os, 254);
  322|      0|        ser_writedata32(os, nSize);
  323|      0|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|    129|    return;
  330|    129|}
_Z14ser_writedata8I12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEvRT_h:
   55|    129|{
   56|    129|    s.write(AsBytes(Span{&obj, 1}));
   57|    129|}
_ZN12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE5writeE4SpanIKSt4byteE:
 1135|  10.7k|    void write(Span<const std::byte> src) { GetStream().write(src); }
_ZN12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE9GetStreamEv:
 1154|  21.3k|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  21.3k|        } else {
 1158|  21.3k|            return m_substream;
 1159|  21.3k|        }
 1160|  21.3k|    }
_Z15ser_writedata16I12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEvRT_t:
   59|      7|{
   60|      7|    obj = htole16_internal(obj);
   61|      7|    s.write(AsBytes(Span{&obj, 1}));
   62|      7|}
_Z15ser_writedata32I12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEvRT_j:
   69|  5.29k|{
   70|  5.29k|    obj = htole32_internal(obj);
   71|  5.29k|    s.write(AsBytes(Span{&obj, 1}));
   72|  5.29k|}
_ZN16DefaultFormatter3SerI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEES4_EEvRT_RKT0_:
  774|  5.29k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEES3_Q12SerializableIT0_T_EEvRS7_RKS6_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK8CAddress9SerializeI12ParamsStreamIR12VectorWriterNS_9SerParamsEEEEvRT_:
  222|  5.29k|    {                                                                                               \
  223|  5.29k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  5.29k|        Ser(s, *this);                                                                              \
  225|  5.29k|    }                                                                                               \
_ZN8CAddress3SerI12ParamsStreamIR12VectorWriterNS_9SerParamsEEEEvRT_RKS_:
  178|  5.29k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZNK12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE9GetParamsIS3_EERKDav:
 1144|  5.29k|    {
 1145|  5.29k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  5.29k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  5.29k|    }
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEvRT_j:
  262|  5.29k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEJ7WrapperI15ChronoFormatterIjLb1EERKNSt3__16chrono10time_pointI9NodeClockNSB_8durationIxNSA_5ratioILl1ELl1EEEEEEEEEEEvRT_DpRKT0_:
 1013|  5.29k|    {
 1014|  5.29k|        ::SerializeMany(s, args...);
 1015|  5.29k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEJ7WrapperI15ChronoFormatterIjLb1EERKNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEEEvRT_DpRKT0_:
  995|  5.29k|{
  996|  5.29k|    (::Serialize(s, args), ...);
  997|  5.29k|}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE7WrapperI15ChronoFormatterIjLb1EERKNSt3__16chrono10time_pointI9NodeClockNSA_8durationIxNS9_5ratioILl1ELl1EEEEEEEEQ12SerializableIT0_T_EEvRSM_RKSL_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK7WrapperI15ChronoFormatterIjLb1EERKNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEEvRT_:
  482|  5.29k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15ChronoFormatterIjLb1EE3SerI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEENSt3__16chrono10time_pointI9NodeClockNS9_8durationIxNS8_5ratioILl1ELl1EEEEEEEEEvRT_T0_:
  599|  5.29k|    {
  600|  5.29k|        if constexpr (LOSSY) {
  601|  5.29k|            s << U(tp.time_since_epoch().count());
  602|       |        } else {
  603|       |            s << U{tp.time_since_epoch().count()};
  604|       |        }
  605|  5.29k|    }
_ZN12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEElsIjEERS4_RKT_:
 1133|  5.29k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
net_processing.cpp:_ZL5UsingI15ChronoFormatterIjLb1EERKNSt3__16chrono10time_pointI9NodeClockNS3_8durationIxNS2_5ratioILl1ELl1EEEEEEEE7WrapperIT_RT0_EOSF_:
  497|  5.29k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEJ7WrapperI19CustomUintFormatterILi8ELb0EERK12ServiceFlagsEEEEvRT_DpRKT0_:
 1013|  5.29k|    {
 1014|  5.29k|        ::SerializeMany(s, args...);
 1015|  5.29k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEJ7WrapperI19CustomUintFormatterILi8ELb0EERK12ServiceFlagsEEEvRT_DpRKT0_:
  995|  5.29k|{
  996|  5.29k|    (::Serialize(s, args), ...);
  997|  5.29k|}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE7WrapperI19CustomUintFormatterILi8ELb0EERK12ServiceFlagsEQ12SerializableIT0_T_EEvRSE_RKSD_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK7WrapperI19CustomUintFormatterILi8ELb0EERK12ServiceFlagsE9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEEvRT_:
  482|  5.29k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN19CustomUintFormatterILi8ELb0EE3SerI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE12ServiceFlagsEEvRT_T0_:
  535|  5.29k|    {
  536|  5.29k|        if (v < 0 || v > MAX) throw std::ios_base::failure("CustomUintFormatter value out of range");
  ------------------
  |  Branch (536:13): [True: 0, False: 5.29k]
  |  Branch (536:22): [True: 0, False: 5.29k]
  ------------------
  537|  5.29k|        if (BigEndian) {
  ------------------
  |  Branch (537:13): [Folded - Ignored]
  ------------------
  538|      0|            uint64_t raw = htobe64_internal(v);
  539|      0|            s.write(AsBytes(Span{&raw, 1}).last(Bytes));
  540|  5.29k|        } else {
  541|  5.29k|            uint64_t raw = htole64_internal(v);
  542|  5.29k|            s.write(AsBytes(Span{&raw, 1}).first(Bytes));
  543|  5.29k|        }
  544|  5.29k|    }
net_processing.cpp:_ZL5UsingI19CustomUintFormatterILi8ELb0EERK12ServiceFlagsE7WrapperIT_RT0_EOS7_:
  497|  5.29k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEJ13ParamsWrapperIN8CNetAddr9SerParamsEK8CServiceEEEEvRT_DpRKT0_:
 1013|  5.29k|    {
 1014|  5.29k|        ::SerializeMany(s, args...);
 1015|  5.29k|    }
_Z13SerializeManyI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEJ13ParamsWrapperIN8CNetAddr9SerParamsEK8CServiceEEEvRT_DpRKT0_:
  995|  5.29k|{
  996|  5.29k|    (::Serialize(s, args), ...);
  997|  5.29k|}
_Z9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEE13ParamsWrapperIN8CNetAddr9SerParamsEK8CServiceEQ12SerializableIT0_T_EEvRSD_RKSC_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK13ParamsWrapperIN8CNetAddr9SerParamsEK8CServiceE9SerializeI12ParamsStreamIR12VectorWriterN8CAddress9SerParamsEEEEvRT_:
 1199|  5.29k|    {
 1200|  5.29k|        ParamsStream ss{s, m_params};
 1201|  5.29k|        ::Serialize(ss, m_object);
 1202|  5.29k|    }
_ZN12ParamsStreamIRS_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEC2ES5_RKS7_:
 1127|  5.29k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z9SerializeI12ParamsStreamIRS0_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE8CServiceQ12SerializableIT0_T_EEvRSC_RKSB_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK8CService9SerializeI12ParamsStreamIRS1_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  222|  5.29k|    {                                                                                               \
  223|  5.29k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  5.29k|        Ser(s, *this);                                                                              \
  225|  5.29k|    }                                                                                               \
_ZN8CService3SerI12ParamsStreamIRS1_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_RKS_:
  178|  5.29k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIRS1_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEJS8_7WrapperI19CustomUintFormatterILi2ELb1EERKtEEEEvRT_DpRKT0_:
 1013|  5.29k|    {
 1014|  5.29k|        ::SerializeMany(s, args...);
 1015|  5.29k|    }
_Z13SerializeManyI12ParamsStreamIRS0_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEJS7_7WrapperI19CustomUintFormatterILi2ELb1EERKtEEEvRT_DpRKT0_:
  995|  5.29k|{
  996|  5.29k|    (::Serialize(s, args), ...);
  997|  5.29k|}
_Z9SerializeI12ParamsStreamIRS0_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEES7_Q12SerializableIT0_T_EEvRSB_RKSA_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK12ParamsStreamIRS_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE9GetParamsIS7_EERKDav:
 1144|  5.29k|    {
 1145|  5.29k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  5.29k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  5.29k|    }
_ZN12ParamsStreamIRS_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE5writeE4SpanIKSt4byteE:
 1135|  10.5k|    void write(Span<const std::byte> src) { GetStream().write(src); }
_ZN12ParamsStreamIRS_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE9GetStreamEv:
 1154|  10.5k|    {
 1155|  10.5k|        if constexpr (ContainsStream<SubStream>) {
 1156|  10.5k|            return m_substream.GetStream();
 1157|       |        } else {
 1158|       |            return m_substream;
 1159|       |        }
 1160|  10.5k|    }
_ZN12ParamsStreamIRS_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEElsIA16_hEERS8_RKT_:
 1133|  5.29k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIRS0_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEETk9BasicBytehLi16EEvRT_RAT1__KT0_:
  265|  5.29k|template <typename Stream, BasicByte B, int N> void Serialize(Stream& s, const B (&a)[N]) { s.write(MakeByteSpan(a)); }
_Z9SerializeI12ParamsStreamIRS0_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEE7WrapperI19CustomUintFormatterILi2ELb1EERKtEQ12SerializableIT0_T_EEvRSH_RKSG_:
  753|  5.29k|{
  754|  5.29k|    a.Serialize(os);
  755|  5.29k|}
_ZNK7WrapperI19CustomUintFormatterILi2ELb1EERKtE9SerializeI12ParamsStreamIRS6_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEEEvRT_:
  482|  5.29k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN19CustomUintFormatterILi2ELb1EE3SerI12ParamsStreamIRS2_IR12VectorWriterN8CAddress9SerParamsEEN8CNetAddr9SerParamsEEtEEvRT_T0_:
  535|  5.29k|    {
  536|  5.29k|        if (v < 0 || v > MAX) throw std::ios_base::failure("CustomUintFormatter value out of range");
  ------------------
  |  Branch (536:13): [True: 0, False: 5.29k]
  |  Branch (536:22): [True: 0, False: 5.29k]
  ------------------
  537|  5.29k|        if (BigEndian) {
  ------------------
  |  Branch (537:13): [Folded - Ignored]
  ------------------
  538|  5.29k|            uint64_t raw = htobe64_internal(v);
  539|  5.29k|            s.write(AsBytes(Span{&raw, 1}).last(Bytes));
  540|  5.29k|        } else {
  541|      0|            uint64_t raw = htole64_internal(v);
  542|      0|            s.write(AsBytes(Span{&raw, 1}).first(Bytes));
  543|      0|        }
  544|  5.29k|    }
net_processing.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI8CAddressNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSD_:
  497|    129|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z13SerializeManyI12VectorWriterJlEEvRT_DpRKT0_:
  995|  7.24k|{
  996|  7.24k|    (::Serialize(s, args), ...);
  997|  7.24k|}
_Z11UnserializeI8AutoFileR13ParamsWrapperI20TransactionSerParams6CBlockEQ14UnserializableIT0_T_EEvRS7_OS6_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN13ParamsWrapperI20TransactionSerParams6CBlockE11UnserializeI8AutoFileEEvRT_:
 1205|  1.53k|    {
 1206|  1.53k|        ParamsStream ss{s, m_params};
 1207|  1.53k|        ::Unserialize(ss, m_object);
 1208|  1.53k|    }
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsEC2ES1_RKS2_:
 1127|  1.53k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER6CBlockQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN6CBlock11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  228|  1.53k|    {                                                                                               \
  229|  1.53k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  1.53k|        Unser(s, *this);                                                                            \
  231|  1.53k|    }
_ZN6CBlock5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_RS_:
  180|  1.53k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR12CBlockHeaderRNSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEEvRT_DpOT0_:
 1033|  1.53k|    {
 1034|  1.53k|        ::UnserializeMany(s, args...);
 1035|  1.53k|    }
_Z15UnserializeManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR12CBlockHeaderRNSt3__16vectorINS7_10shared_ptrIK12CTransactionEENS7_9allocatorISC_EEEEEEvRT_DpOT0_:
 1001|  1.53k|{
 1002|  1.53k|    (::Unserialize(s, args), ...);
 1003|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER12CBlockHeaderQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN12CBlockHeader11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  228|  1.53k|    {                                                                                               \
  229|  1.53k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  1.53k|        Unser(s, *this);                                                                            \
  231|  1.53k|    }
_ZN12CBlockHeader5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_RS_:
  180|  1.53k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJRiR7uint256S8_RjS9_S9_EEEvRT_DpOT0_:
 1033|  1.53k|    {
 1034|  1.53k|        ::UnserializeMany(s, args...);
 1035|  1.53k|    }
_Z15UnserializeManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJRiR7uint256S7_RjS8_S8_EEvRT_DpOT0_:
 1001|  1.53k|{
 1002|  1.53k|    (::Unserialize(s, args), ...);
 1003|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEvRT_Ri:
  276|  1.53k|template<typename Stream> inline void Unserialize(Stream& s, int32_t& a ) { a = ser_readdata32(s); }
_Z14ser_readdata32I12ParamsStreamIR8AutoFile20TransactionSerParamsEEjRT_:
  102|  12.2k|{
  103|  12.2k|    uint32_t obj;
  104|  12.2k|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|  12.2k|    return le32toh_internal(obj);
  106|  12.2k|}
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsE4readE4SpanISt4byteE:
 1136|  29.6k|    void read(Span<std::byte> dst) { GetStream().read(dst); }
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsE9GetStreamEv:
 1154|  29.6k|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  29.6k|        } else {
 1158|  29.6k|            return m_substream;
 1159|  29.6k|        }
 1160|  29.6k|    }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER7uint256Q14UnserializableIT0_T_EEvRS8_OS7_:
  762|  3.06k|{
  763|  3.06k|    a.Unserialize(is);
  764|  3.06k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEvRT_Rj:
  277|  10.7k|template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEENS5_9allocatorIS9_EEEvRT_RNS5_6vectorIT0_T1_EE:
  866|  1.53k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  1.53k|    } else {
  879|  1.53k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  1.53k|    }
  881|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS9_10shared_ptrIK12CTransactionEENS9_9allocatorISE_EEEEEQ14UnserializableIT0_T_EEvRSL_OSK_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  483|  1.53k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__16vectorINS8_10shared_ptrIK12CTransactionEENS8_9allocatorISD_EEEEEEvRT_RT0_:
  672|  1.53k|    {
  673|  1.53k|        Formatter formatter;
  674|  1.53k|        v.clear();
  675|  1.53k|        size_t size = ReadCompactSize(s);
  676|  1.53k|        size_t allocated = 0;
  677|  3.06k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 1.53k, False: 1.53k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  1.53k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  1.53k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  1.53k|            v.reserve(allocated);
  684|  3.06k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 1.53k, False: 1.53k]
  ------------------
  685|  1.53k|                v.emplace_back();
  686|  1.53k|                formatter.Unser(s, v.back());
  687|  1.53k|            }
  688|  1.53k|        }
  689|  1.53k|    };
_Z15ReadCompactSizeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEmRT_b:
  340|  7.95k|{
  341|  7.95k|    uint8_t chSize = ser_readdata8(is);
  342|  7.95k|    uint64_t nSizeRet = 0;
  343|  7.95k|    if (chSize < 253)
  ------------------
  |  Branch (343:9): [True: 7.95k, False: 0]
  ------------------
  344|  7.95k|    {
  345|  7.95k|        nSizeRet = chSize;
  346|  7.95k|    }
  347|      0|    else if (chSize == 253)
  ------------------
  |  Branch (347:14): [True: 0, False: 0]
  ------------------
  348|      0|    {
  349|      0|        nSizeRet = ser_readdata16(is);
  350|      0|        if (nSizeRet < 253)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|      0|    }
  353|      0|    else if (chSize == 254)
  ------------------
  |  Branch (353:14): [True: 0, False: 0]
  ------------------
  354|      0|    {
  355|      0|        nSizeRet = ser_readdata32(is);
  356|      0|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (356:13): [True: 0, False: 0]
  ------------------
  357|      0|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|      0|    }
  359|      0|    else
  360|      0|    {
  361|      0|        nSizeRet = ser_readdata64(is);
  362|      0|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 0]
  ------------------
  363|      0|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  364|      0|    }
  365|  7.95k|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (365:9): [True: 7.95k, False: 0]
  |  Branch (365:24): [True: 0, False: 7.95k]
  ------------------
  366|      0|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  367|      0|    }
  368|  7.95k|    return nSizeRet;
  369|  7.95k|}
_Z13ser_readdata8I12ParamsStreamIR8AutoFile20TransactionSerParamsEEhRT_:
   84|  8.03k|{
   85|  8.03k|    uint8_t obj;
   86|  8.03k|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|  8.03k|    return obj;
   88|  8.03k|}
_Z14ser_readdata64I12ParamsStreamIR8AutoFile20TransactionSerParamsEEmRT_:
  114|  1.60k|{
  115|  1.60k|    uint64_t obj;
  116|  1.60k|    s.read(AsWritableBytes(Span{&obj, 1}));
  117|  1.60k|    return le64toh_internal(obj);
  118|  1.60k|}
_ZN16DefaultFormatter5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__110shared_ptrIK12CTransactionEEEEvRT_RT0_:
  777|  1.53k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE12CTransactionEvRT_RNSt3__110shared_ptrIKT0_EE:
  985|  1.53k|{
  986|  1.53k|    p = std::make_shared<const T>(deserialize, is);
  987|  1.53k|}
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsErsIRjEERS3_OT_:
 1134|  3.06k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsErsIRNSt3__16vectorI5CTxInNS5_9allocatorIS7_EEEEEERS3_OT_:
 1134|  1.60k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE5CTxInNSt3__19allocatorIS5_EEEvRT_RNS6_6vectorIT0_T1_EE:
  866|  1.60k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  1.60k|    } else {
  879|  1.60k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  1.60k|    }
  881|  1.60k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS9_9allocatorISB_EEEEEQ14UnserializableIT0_T_EEvRSI_OSH_:
  762|  1.60k|{
  763|  1.60k|    a.Unserialize(is);
  764|  1.60k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  483|  1.60k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__16vectorI5CTxInNS8_9allocatorISA_EEEEEEvRT_RT0_:
  672|  1.60k|    {
  673|  1.60k|        Formatter formatter;
  674|  1.60k|        v.clear();
  675|  1.60k|        size_t size = ReadCompactSize(s);
  676|  1.60k|        size_t allocated = 0;
  677|  3.13k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 1.53k, False: 1.60k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  1.53k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  1.53k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  1.53k|            v.reserve(allocated);
  684|  3.06k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 1.53k, False: 1.53k]
  ------------------
  685|  1.53k|                v.emplace_back();
  686|  1.53k|                formatter.Unser(s, v.back());
  687|  1.53k|            }
  688|  1.53k|        }
  689|  1.60k|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsE5CTxInEEvRT_RT0_:
  777|  1.53k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER5CTxInQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN5CTxIn11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  228|  1.53k|    {                                                                                               \
  229|  1.53k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  1.53k|        Unser(s, *this);                                                                            \
  231|  1.53k|    }
_ZN5CTxIn5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_RS_:
  180|  1.53k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR9COutPointR7CScriptRjEEEvRT_DpOT0_:
 1033|  1.53k|    {
 1034|  1.53k|        ::UnserializeMany(s, args...);
 1035|  1.53k|    }
_Z15UnserializeManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR9COutPointR7CScriptRjEEvRT_DpOT0_:
 1001|  1.53k|{
 1002|  1.53k|    (::Unserialize(s, args), ...);
 1003|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER9COutPointQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN9COutPoint11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  228|  1.53k|    {                                                                                               \
  229|  1.53k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  1.53k|        Unser(s, *this);                                                                            \
  231|  1.53k|    }
_ZN9COutPoint5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_RS_:
  180|  1.53k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR22transaction_identifierILb0EERjEEEvRT_DpOT0_:
 1033|  1.53k|    {
 1034|  1.53k|        ::UnserializeMany(s, args...);
 1035|  1.53k|    }
_Z15UnserializeManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR22transaction_identifierILb0EERjEEvRT_DpOT0_:
 1001|  1.53k|{
 1002|  1.53k|    (::Unserialize(s, args), ...);
 1003|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER22transaction_identifierILb0EEQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER7CScriptQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  3.13k|{
  763|  3.13k|    a.Unserialize(is);
  764|  3.13k|}
_ZN7CScript11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  228|  3.13k|    {                                                                                               \
  229|  3.13k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  3.13k|        Unser(s, *this);                                                                            \
  231|  3.13k|    }
_ZN7CScript5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_RS_:
  180|  3.13k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR9prevectorILj28EhjiEEEEvRT_DpOT0_:
 1033|  3.13k|    {
 1034|  3.13k|        ::UnserializeMany(s, args...);
 1035|  3.13k|    }
_Z15UnserializeManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJR9prevectorILj28EhjiEEEvRT_DpOT0_:
 1001|  3.13k|{
 1002|  3.13k|    (::Unserialize(s, args), ...);
 1003|  3.13k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsELj28EhEvRT_R9prevectorIXT0_ET1_jiE:
  823|  3.13k|{
  824|  3.13k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  825|       |        // Limit size per read so bogus size value won't cause out of memory
  826|  3.13k|        v.clear();
  827|  3.13k|        unsigned int nSize = ReadCompactSize(is);
  828|  3.13k|        unsigned int i = 0;
  829|  6.27k|        while (i < nSize) {
  ------------------
  |  Branch (829:16): [True: 3.13k, False: 3.13k]
  ------------------
  830|  3.13k|            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  831|  3.13k|            v.resize_uninitialized(i + blk);
  832|  3.13k|            is.read(AsWritableBytes(Span{&v[i], blk}));
  833|  3.13k|            i += blk;
  834|  3.13k|        }
  835|       |    } else {
  836|       |        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  837|       |    }
  838|  3.13k|}
blockstorage.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|  1.60k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsErsIRhEERS3_OT_:
 1134|     77|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEvRT_Rh:
  273|     77|template<typename Stream> inline void Unserialize(Stream& s, uint8_t& a ) { a = ser_readdata8(s); }
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsErsIRNSt3__16vectorI6CTxOutNS5_9allocatorIS7_EEEEEERS3_OT_:
 1134|  1.53k|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE6CTxOutNSt3__19allocatorIS5_EEEvRT_RNS6_6vectorIT0_T1_EE:
  866|  1.53k|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|  1.53k|    } else {
  879|  1.53k|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|  1.53k|    }
  881|  1.53k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS9_9allocatorISB_EEEEEQ14UnserializableIT0_T_EEvRSI_OSH_:
  762|  1.53k|{
  763|  1.53k|    a.Unserialize(is);
  764|  1.53k|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  483|  1.53k|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__16vectorI6CTxOutNS8_9allocatorISA_EEEEEEvRT_RT0_:
  672|  1.53k|    {
  673|  1.53k|        Formatter formatter;
  674|  1.53k|        v.clear();
  675|  1.53k|        size_t size = ReadCompactSize(s);
  676|  1.53k|        size_t allocated = 0;
  677|  3.06k|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 1.53k, False: 1.53k]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|  1.53k|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|  1.53k|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|  1.53k|            v.reserve(allocated);
  684|  3.13k|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 1.60k, False: 1.53k]
  ------------------
  685|  1.60k|                v.emplace_back();
  686|  1.60k|                formatter.Unser(s, v.back());
  687|  1.60k|            }
  688|  1.53k|        }
  689|  1.53k|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsE6CTxOutEEvRT_RT0_:
  777|  1.60k|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsER6CTxOutQ14UnserializableIT0_T_EEvRS8_OS7_:
  762|  1.60k|{
  763|  1.60k|    a.Unserialize(is);
  764|  1.60k|}
_ZN6CTxOut11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  228|  1.60k|    {                                                                                               \
  229|  1.60k|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|  1.60k|        Unser(s, *this);                                                                            \
  231|  1.60k|    }
_ZN6CTxOut5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_RS_:
  180|  1.60k|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJRlR7CScriptEEEvRT_DpOT0_:
 1033|  1.60k|    {
 1034|  1.60k|        ::UnserializeMany(s, args...);
 1035|  1.60k|    }
_Z15UnserializeManyI12ParamsStreamIR8AutoFile20TransactionSerParamsEJRlR7CScriptEEvRT_DpOT0_:
 1001|  1.60k|{
 1002|  1.60k|    (::Unserialize(s, args), ...);
 1003|  1.60k|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEvRT_Rl:
  278|  1.60k|template<typename Stream> inline void Unserialize(Stream& s, int64_t& a ) { a = ser_readdata64(s); }
blockstorage.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE7WrapperIT_RT0_EOSC_:
  497|  1.53k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN12ParamsStreamIR8AutoFile20TransactionSerParamsErsIRNSt3__16vectorINS6_IhNS5_9allocatorIhEEEENS7_IS9_EEEEEERS3_OT_:
 1134|     77|    template <typename U> ParamsStream& operator>>(U&& obj) { ::Unserialize(*this, obj); return *this; }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__16vectorIhNS5_9allocatorIhEEEENS7_IS9_EEEvRT_RNS6_IT0_T1_EE:
  866|     77|{
  867|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|       |        v.clear();
  870|       |        unsigned int nSize = ReadCompactSize(is);
  871|       |        unsigned int i = 0;
  872|       |        while (i < nSize) {
  873|       |            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|       |            v.resize(i + blk);
  875|       |            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|       |            i += blk;
  877|       |        }
  878|     77|    } else {
  879|     77|        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|     77|    }
  881|     77|}
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINSA_IhNS9_9allocatorIhEEEENSB_ISD_EEEEEQ14UnserializableIT0_T_EEvRSJ_OSI_:
  762|     77|{
  763|     77|    a.Unserialize(is);
  764|     77|}
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  483|     77|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__16vectorINS9_IhNS8_9allocatorIhEEEENSA_ISC_EEEEEEvRT_RT0_:
  672|     77|    {
  673|     77|        Formatter formatter;
  674|     77|        v.clear();
  675|     77|        size_t size = ReadCompactSize(s);
  676|     77|        size_t allocated = 0;
  677|    154|        while (allocated < size) {
  ------------------
  |  Branch (677:16): [True: 77, False: 77]
  ------------------
  678|       |            // For DoS prevention, do not blindly allocate as much as the stream claims to contain.
  679|       |            // Instead, allocate in 5MiB batches, so that an attacker actually needs to provide
  680|       |            // X MiB of data to make us allocate X+5 Mib.
  681|     77|            static_assert(sizeof(typename V::value_type) <= MAX_VECTOR_ALLOCATE, "Vector element size too large");
  682|     77|            allocated = std::min(size, allocated + MAX_VECTOR_ALLOCATE / sizeof(typename V::value_type));
  683|     77|            v.reserve(allocated);
  684|    154|            while (v.size() < allocated) {
  ------------------
  |  Branch (684:20): [True: 77, False: 77]
  ------------------
  685|     77|                v.emplace_back();
  686|     77|                formatter.Unser(s, v.back());
  687|     77|            }
  688|     77|        }
  689|     77|    };
_ZN16DefaultFormatter5UnserI12ParamsStreamIR8AutoFile20TransactionSerParamsENSt3__16vectorIhNS6_9allocatorIhEEEEEEvRT_RT0_:
  777|     77|    static void Unser(Stream& s, T& t) { Unserialize(s, t); }
_Z11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEhNSt3__19allocatorIhEEEvRT_RNS5_6vectorIT0_T1_EE:
  866|     77|{
  867|     77|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  868|       |        // Limit size per read so bogus size value won't cause out of memory
  869|     77|        v.clear();
  870|     77|        unsigned int nSize = ReadCompactSize(is);
  871|     77|        unsigned int i = 0;
  872|    154|        while (i < nSize) {
  ------------------
  |  Branch (872:16): [True: 77, False: 77]
  ------------------
  873|     77|            unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
  874|     77|            v.resize(i + blk);
  875|     77|            is.read(AsWritableBytes(Span{&v[i], blk}));
  876|     77|            i += blk;
  877|     77|        }
  878|       |    } else {
  879|       |        Unserialize(is, Using<VectorFormatter<DefaultFormatter>>(v));
  880|       |    }
  881|     77|}
blockstorage.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSD_:
  497|     77|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZNK12ParamsStreamIR8AutoFile20TransactionSerParamsE9GetParamsIS2_EERKDav:
 1144|  1.53k|    {
 1145|  1.53k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  1.53k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  1.53k|    }
blockstorage.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERNSt3__16vectorINS3_10shared_ptrIK12CTransactionEENS3_9allocatorIS8_EEEEE7WrapperIT_RT0_EOSF_:
  497|  1.53k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
txdb.cpp:_Z9SerializeI10DataStreamN12_GLOBAL__N_19CoinEntryEQ12SerializableIT0_T_EEvRS4_RKS3_:
  753|    552|{
  754|    552|    a.Serialize(os);
  755|    552|}
txdb.cpp:_ZNK12_GLOBAL__N_19CoinEntry9SerializeI10DataStreamEEvRT_:
  222|    552|    {                                                                                               \
  223|    552|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|    552|        Ser(s, *this);                                                                              \
  225|    552|    }                                                                                               \
txdb.cpp:_ZN12_GLOBAL__N_19CoinEntry3SerI10DataStreamEEvRT_RKS0_:
  178|    552|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI10DataStreamJh22transaction_identifierILb0EE7WrapperI15VarIntFormatterIL10VarIntMode0EERjEEEEvRT_DpRKT0_:
 1013|    552|    {
 1014|    552|        ::SerializeMany(s, args...);
 1015|    552|    }
_Z13SerializeManyI10DataStreamJh22transaction_identifierILb0EE7WrapperI15VarIntFormatterIL10VarIntMode0EERjEEEvRT_DpRKT0_:
  995|    552|{
  996|    552|    (::Serialize(s, args), ...);
  997|    552|}
txdb.cpp:_ZL5UsingI15VarIntFormatterIL10VarIntMode0EERjE7WrapperIT_RT0_EOS6_:
  497|    552|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z16GetSerializeSizeI13ParamsWrapperI20TransactionSerParamsKNSt3__110shared_ptrIK12CTransactionEEEEmRKT_:
 1104|    732|{
 1105|    732|    return (SizeComputer() << t).size();
 1106|    732|}
_ZN12SizeComputerlsI13ParamsWrapperI20TransactionSerParamsKNSt3__110shared_ptrIK12CTransactionEEEEERS_RKT_:
 1081|    732|    {
 1082|    732|        ::Serialize(*this, obj);
 1083|    732|        return (*this);
 1084|    732|    }
_Z9SerializeI10HashWriter12CBlockHeaderQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|  5.45k|{
  754|  5.45k|    a.Serialize(os);
  755|  5.45k|}
_ZNK12CBlockHeader9SerializeI10HashWriterEEvRT_:
  222|  5.45k|    {                                                                                               \
  223|  5.45k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  5.45k|        Ser(s, *this);                                                                              \
  225|  5.45k|    }                                                                                               \
_ZN12CBlockHeader3SerI10HashWriterEEvRT_RKS_:
  178|  5.45k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI10HashWriterJi7uint256S2_jjjEEEvRT_DpRKT0_:
 1013|  5.45k|    {
 1014|  5.45k|        ::SerializeMany(s, args...);
 1015|  5.45k|    }
_Z13SerializeManyI10HashWriterJi7uint256S1_jjjEEvRT_DpRKT0_:
  995|  5.45k|{
  996|  5.45k|    (::Serialize(s, args), ...);
  997|  5.45k|}
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsEC2ES1_RKS2_:
 1127|  38.8k|    ParamsStream(SubStream&& substream, const Params& params LIFETIMEBOUND) : m_params{params}, m_substream{std::forward<SubStream>(substream)} {}
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsElsIjEERS3_RKT_:
 1133|  77.6k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_j:
  262|   226k|template<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }
_Z15ser_writedata32I12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_j:
   69|   226k|{
   70|   226k|    obj = htole32_internal(obj);
   71|   226k|    s.write(AsBytes(Span{&obj, 1}));
   72|   226k|}
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsE5writeE4SpanIKSt4byteE:
 1135|  1.00M|    void write(Span<const std::byte> src) { GetStream().write(src); }
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsE9GetStreamEv:
 1154|  1.00M|    {
 1155|       |        if constexpr (ContainsStream<SubStream>) {
 1156|       |            return m_substream.GetStream();
 1157|  1.00M|        } else {
 1158|  1.00M|            return m_substream;
 1159|  1.00M|        }
 1160|  1.00M|    }
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsElsINSt3__16vectorI5CTxInNS5_9allocatorIS7_EEEEEERS3_RKT_:
 1133|  40.2k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE5CTxInNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|  40.2k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  40.2k|    } else {
  859|  40.2k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  40.2k|    }
  861|  40.2k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|  40.2k|{
  754|  40.2k|    a.Serialize(os);
  755|  40.2k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI5CTxInNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  482|  40.2k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsENSt3__16vectorI5CTxInNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|  40.2k|    {
  663|  40.2k|        Formatter formatter;
  664|  40.2k|        WriteCompactSize(s, v.size());
  665|  74.3k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 74.3k, False: 40.2k]
  ------------------
  666|  74.3k|            formatter.Ser(s, elem);
  667|  74.3k|        }
  668|  40.2k|    }
_Z16WriteCompactSizeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_m:
  309|   578k|{
  310|   578k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 576k, False: 1.42k]
  ------------------
  311|   576k|    {
  312|   576k|        ser_writedata8(os, nSize);
  313|   576k|    }
  314|  1.42k|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 1.34k, False: 82]
  ------------------
  315|  1.34k|    {
  316|  1.34k|        ser_writedata8(os, 253);
  317|  1.34k|        ser_writedata16(os, nSize);
  318|  1.34k|    }
  319|     82|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 82, False: 0]
  ------------------
  320|     82|    {
  321|     82|        ser_writedata8(os, 254);
  322|     82|        ser_writedata32(os, nSize);
  323|     82|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|   578k|    return;
  330|   578k|}
_Z14ser_writedata8I12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_h:
   55|   579k|{
   56|   579k|    s.write(AsBytes(Span{&obj, 1}));
   57|   579k|}
_Z15ser_writedata16I12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_t:
   59|  1.34k|{
   60|  1.34k|    obj = htole16_internal(obj);
   61|  1.34k|    s.write(AsBytes(Span{&obj, 1}));
   62|  1.34k|}
_Z15ser_writedata64I12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_m:
   79|  27.7k|{
   80|  27.7k|    obj = htole64_internal(obj);
   81|  27.7k|    s.write(AsBytes(Span{&obj, 1}));
   82|  27.7k|}
_ZN16DefaultFormatter3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsE5CTxInEEvRT_RKT0_:
  774|  74.3k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE5CTxInQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  74.3k|{
  754|  74.3k|    a.Serialize(os);
  755|  74.3k|}
_ZNK5CTxIn9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  222|  74.3k|    {                                                                                               \
  223|  74.3k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  74.3k|        Ser(s, *this);                                                                              \
  225|  74.3k|    }                                                                                               \
_ZN5CTxIn3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  74.3k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJ9COutPoint7CScriptjEEEvRT_DpRKT0_:
 1013|  74.3k|    {
 1014|  74.3k|        ::SerializeMany(s, args...);
 1015|  74.3k|    }
_Z13SerializeManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJ9COutPoint7CScriptjEEvRT_DpRKT0_:
  995|  74.3k|{
  996|  74.3k|    (::Serialize(s, args), ...);
  997|  74.3k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE9COutPointQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  74.3k|{
  754|  74.3k|    a.Serialize(os);
  755|  74.3k|}
_ZNK9COutPoint9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  222|  74.3k|    {                                                                                               \
  223|  74.3k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  74.3k|        Ser(s, *this);                                                                              \
  225|  74.3k|    }                                                                                               \
_ZN9COutPoint3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  74.3k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJ22transaction_identifierILb0EEjEEEvRT_DpRKT0_:
 1013|  74.3k|    {
 1014|  74.3k|        ::SerializeMany(s, args...);
 1015|  74.3k|    }
_Z13SerializeManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJ22transaction_identifierILb0EEjEEvRT_DpRKT0_:
  995|  74.3k|{
  996|  74.3k|    (::Serialize(s, args), ...);
  997|  74.3k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE22transaction_identifierILb0EEQ12SerializableIT0_T_EEvRS8_RKS7_:
  753|  74.3k|{
  754|  74.3k|    a.Serialize(os);
  755|  74.3k|}
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsElsI4SpanIKhEEERS3_RKT_:
 1133|  74.3k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsETk9BasicByteKhEvRT_4SpanIT0_E:
  268|  74.3k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE7CScriptQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|   102k|{
  754|   102k|    a.Serialize(os);
  755|   102k|}
_ZNK7CScript9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  222|   102k|    {                                                                                               \
  223|   102k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|   102k|        Ser(s, *this);                                                                              \
  225|   102k|    }                                                                                               \
_ZN7CScript3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_RKS_:
  178|   102k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJ9prevectorILj28EhjiEEEEvRT_DpRKT0_:
 1013|   102k|    {
 1014|   102k|        ::SerializeMany(s, args...);
 1015|   102k|    }
_Z13SerializeManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJ9prevectorILj28EhjiEEEvRT_DpRKT0_:
  995|   102k|{
  996|   102k|    (::Serialize(s, args), ...);
  997|   102k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsELj28EhEvRT_RK9prevectorIXT0_ET1_jiE:
  811|   102k|{
  812|   102k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  813|   102k|        WriteCompactSize(os, v.size());
  814|   102k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (814:13): [True: 70.5k, False: 31.5k]
  ------------------
  815|       |    } else {
  816|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  817|       |    }
  818|   102k|}
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsElsIhEERS3_RKT_:
 1133|  1.44k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_h:
  258|  1.44k|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsElsINSt3__16vectorI6CTxOutNS5_9allocatorIS7_EEEEEERS3_RKT_:
 1133|  38.8k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE6CTxOutNSt3__19allocatorIS5_EEEvRT_RKNS6_6vectorIT0_T1_EE:
  846|  38.8k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  38.8k|    } else {
  859|  38.8k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  38.8k|    }
  861|  38.8k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS9_9allocatorISB_EEEEEQ12SerializableIT0_T_EEvRSJ_RKSI_:
  753|  38.8k|{
  754|  38.8k|    a.Serialize(os);
  755|  38.8k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorI6CTxOutNS3_9allocatorIS5_EEEEE9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  482|  38.8k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsENSt3__16vectorI6CTxOutNS8_9allocatorISA_EEEEEEvRT_RKT0_:
  662|  38.8k|    {
  663|  38.8k|        Formatter formatter;
  664|  38.8k|        WriteCompactSize(s, v.size());
  665|  38.8k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 27.7k, False: 38.8k]
  ------------------
  666|  27.7k|            formatter.Ser(s, elem);
  667|  27.7k|        }
  668|  38.8k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsE6CTxOutEEvRT_RKT0_:
  774|  27.7k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE6CTxOutQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  27.7k|{
  754|  27.7k|    a.Serialize(os);
  755|  27.7k|}
_ZNK6CTxOut9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  222|  27.7k|    {                                                                                               \
  223|  27.7k|        static_assert(std::is_same<const cls&, decltype(*this)>::value, "Serialize type mismatch"); \
  224|  27.7k|        Ser(s, *this);                                                                              \
  225|  27.7k|    }                                                                                               \
_ZN6CTxOut3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_RKS_:
  178|  27.7k|    static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
_ZN15ActionSerialize16SerReadWriteManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJl7CScriptEEEvRT_DpRKT0_:
 1013|  27.7k|    {
 1014|  27.7k|        ::SerializeMany(s, args...);
 1015|  27.7k|    }
_Z13SerializeManyI12ParamsStreamIR10HashWriter20TransactionSerParamsEJl7CScriptEEvRT_DpRKT0_:
  995|  27.7k|{
  996|  27.7k|    (::Serialize(s, args), ...);
  997|  27.7k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEvRT_l:
  263|  27.7k|template<typename Stream> inline void Serialize(Stream& s, int64_t a ) { ser_writedata64(s, a); }
_ZN12ParamsStreamIR10HashWriter20TransactionSerParamsElsINSt3__16vectorINS6_IhNS5_9allocatorIhEEEENS7_IS9_EEEEEERS3_RKT_:
 1133|  14.1k|    template <typename U> ParamsStream& operator<<(const U& obj) { ::Serialize(*this, obj); return *this; }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsENSt3__16vectorIhNS5_9allocatorIhEEEENS7_IS9_EEEvRT_RKNS6_IT0_T1_EE:
  846|  14.1k|{
  847|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|       |        WriteCompactSize(os, v.size());
  849|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|  14.1k|    } else {
  859|  14.1k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|  14.1k|    }
  861|  14.1k|}
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINSA_IhNS9_9allocatorIhEEEENSB_ISD_EEEEEQ12SerializableIT0_T_EEvRSK_RKSJ_:
  753|  14.1k|{
  754|  14.1k|    a.Serialize(os);
  755|  14.1k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  482|  14.1k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsENSt3__16vectorINS9_IhNS8_9allocatorIhEEEENSA_ISC_EEEEEEvRT_RKT0_:
  662|  14.1k|    {
  663|  14.1k|        Formatter formatter;
  664|  14.1k|        WriteCompactSize(s, v.size());
  665|   382k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (665:49): [True: 382k, False: 14.1k]
  ------------------
  666|   382k|            formatter.Ser(s, elem);
  667|   382k|        }
  668|  14.1k|    }
_ZN16DefaultFormatter3SerI12ParamsStreamIR10HashWriter20TransactionSerParamsENSt3__16vectorIhNS6_9allocatorIhEEEEEEvRT_RKT0_:
  774|   382k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEhNSt3__19allocatorIhEEEvRT_RKNS5_6vectorIT0_T1_EE:
  846|   382k|{
  847|   382k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  848|   382k|        WriteCompactSize(os, v.size());
  849|   382k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (849:13): [True: 26.1k, False: 356k]
  ------------------
  850|       |    } else if constexpr (std::is_same_v<T, bool>) {
  851|       |        // A special case for std::vector<bool>, as dereferencing
  852|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  853|       |        // due to std::vector's special casing for bool arguments.
  854|       |        WriteCompactSize(os, v.size());
  855|       |        for (bool elem : v) {
  856|       |            ::Serialize(os, elem);
  857|       |        }
  858|       |    } else {
  859|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  860|       |    }
  861|   382k|}
_ZNK12ParamsStreamIR10HashWriter20TransactionSerParamsE9GetParamsIS2_EERKDav:
 1144|  38.8k|    {
 1145|  38.8k|        if constexpr (std::is_convertible_v<Params, P>) {
 1146|  38.8k|            return m_params;
 1147|       |        } else {
 1148|       |            return m_substream.template GetParams<P>();
 1149|       |        }
 1150|  38.8k|    }
_Z9SerializeI10HashWriter13ParamsWrapperI20TransactionSerParamsK12CTransactionEQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  38.8k|{
  754|  38.8k|    a.Serialize(os);
  755|  38.8k|}
_ZNK13ParamsWrapperI20TransactionSerParamsK12CTransactionE9SerializeI10HashWriterEEvRT_:
 1199|  38.8k|    {
 1200|  38.8k|        ParamsStream ss{s, m_params};
 1201|  38.8k|        ::Serialize(ss, m_object);
 1202|  38.8k|    }
_Z9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsE12CTransactionQ12SerializableIT0_T_EEvRS7_RKS6_:
  753|  38.8k|{
  754|  38.8k|    a.Serialize(os);
  755|  38.8k|}

_Z9UCharCastPKh:
  285|  66.2k|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPKSt4byte:
  287|  6.67M|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }
_ZNK4SpanIKSt4byteE4lastEm:
  211|  39.1k|    {
  212|  39.1k|         ASSERT_IF_DEBUG(size() >= count);
  213|  39.1k|         return Span<C>(m_data + m_size - count, count);
  214|  39.1k|    }
_ZNK4SpanIKSt4byteE5firstEm:
  206|  13.7k|    {
  207|  13.7k|        ASSERT_IF_DEBUG(size() >= count);
  208|  13.7k|        return Span<C>(m_data, count);
  209|  13.7k|    }
_ZNK4SpanISt4byteE4lastEm:
  211|   308k|    {
  212|   308k|         ASSERT_IF_DEBUG(size() >= count);
  213|   308k|         return Span<C>(m_data + m_size - count, count);
  214|   308k|    }
_ZNK4SpanISt4byteE5firstEm:
  206|   186k|    {
  207|   186k|        ASSERT_IF_DEBUG(size() >= count);
  208|   186k|        return Span<C>(m_data, count);
  209|   186k|    }
_ZNK4SpanIKSt4byteE4sizeEv:
  187|  13.3M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKcE4dataEv:
  174|  66.2k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKSt4byteE4dataEv:
  174|  7.29M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4sizeEv:
  187|   122M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKhE5beginEv:
  175|   461k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKhE3endEv:
  176|   122k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIhE4sizeEv:
  187|   123k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIhE4dataEv:
  174|  10.1M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4dataEv:
  174|  44.0M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE5firstEm:
  206|  16.0k|    {
  207|  16.0k|        ASSERT_IF_DEBUG(size() >= count);
  208|  16.0k|        return Span<C>(m_data, count);
  209|  16.0k|    }
_ZNK4SpanIKhE7subspanEmm:
  201|    406|    {
  202|    406|        ASSERT_IF_DEBUG(size() >= offset + count);
  203|    406|        return Span<C>(m_data + offset, count);
  204|    406|    }
_ZNK4SpanISt4byteE4sizeEv:
  187|  38.7M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanISt4byteEixEm:
  191|   449k|    {
  192|   449k|        ASSERT_IF_DEBUG(size() > pos);
  193|   449k|        return m_data[pos];
  194|   449k|    }
_ZNK4SpanIKSt4byteEixEm:
  191|   449k|    {
  192|   449k|        ASSERT_IF_DEBUG(size() > pos);
  193|   449k|        return m_data[pos];
  194|   449k|    }
_ZNK4SpanIKhE5emptyEv:
  189|   406k|    constexpr bool empty() const noexcept { return size() == 0; }
_ZNK4SpanISt4byteE4dataEv:
  174|  12.2M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE7subspanEm:
  196|  56.2M|    {
  197|  56.2M|        ASSERT_IF_DEBUG(size() >= offset);
  198|  56.2M|        return Span<C>(m_data + offset, m_size - offset);
  199|  56.2M|    }
_ZNK4SpanIKSt4byteE5beginEv:
  175|  54.7k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKSt4byteE3endEv:
  176|  54.7k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanISt4byteE7subspanEmm:
  201|  29.8k|    {
  202|  29.8k|        ASSERT_IF_DEBUG(size() >= offset + count);
  203|  29.8k|        return Span<C>(m_data + offset, count);
  204|  29.8k|    }
_ZNK4SpanISt4byteE7subspanEm:
  196|   266k|    {
  197|   266k|        ASSERT_IF_DEBUG(size() >= offset);
  198|   266k|        return Span<C>(m_data + offset, m_size - offset);
  199|   266k|    }
_Z13UCharSpanCastIKhE4SpanINSt3__114remove_pointerIDTcl9UCharCastcldtfp_4dataEEEE4typeEES1_IT_E:
  293|  66.2k|template <typename T> constexpr auto UCharSpanCast(Span<T> s) -> Span<typename std::remove_pointer<decltype(UCharCast(s.data()))>::type> { return {UCharCast(s.data()), s.size()}; }
_ZNK4SpanIKhE10size_bytesEv:
  188|  1.79M|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKhE4SpanIKSt4byteES1_IT_E:
  259|  1.79M|{
  260|  1.79M|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  1.79M|}
_Z12MakeByteSpanIRKNSt3__16vectorIhNS0_9allocatorIhEEEEE4SpanIKSt4byteEOT_:
  270|   262k|{
  271|   262k|    return AsBytes(Span{std::forward<V>(v)});
  272|   262k|}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  172|   777k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2IS1_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEEPS6_m:
  119|  5.42M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS9_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS9_EE4sizeEEmEE5valueEDnE4typeE:
  165|    246|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanISt4byteEC2INSt3__15arrayIS0_Lm8EEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS7_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS7_EE4sizeEEmEE5valueEDnE4typeE:
  165|   321k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIjE4dataEv:
  174|  4.93M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIjE10size_bytesEv:
  188|  4.93M|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIjE4SpanIKSt4byteES0_IT_E:
  259|  1.42M|{
  260|  1.42M|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  1.42M|}
_ZNK4SpanIhE10size_bytesEv:
  188|  9.99M|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIhE4SpanIKSt4byteES0_IT_E:
  259|  1.82M|{
  260|  1.82M|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  1.82M|}
_ZNK4SpanItE4dataEv:
  174|  7.85k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanItE10size_bytesEv:
  188|  7.85k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesItE4SpanIKSt4byteES0_IT_E:
  259|  4.87k|{
  260|  4.87k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  4.87k|}
_ZNK4SpanImE4dataEv:
  174|   789k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanImE10size_bytesEv:
  188|   789k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesImE4SpanIKSt4byteES0_IT_E:
  259|   247k|{
  260|   247k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|   247k|}
_Z12MakeByteSpanIRK9prevectorILj28EhjiEE4SpanIKSt4byteEOT_:
  270|   100k|{
  271|   100k|    return AsBytes(Span{std::forward<V>(v)});
  272|   100k|}
_ZN4SpanIKhEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  56.3M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanISt4byteEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  13.0M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesIhE4SpanISt4byteES0_IT_E:
  264|  8.16M|{
  265|  8.16M|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|  8.16M|}
_ZN4SpanIhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_hEE5valueEiE4typeELi0EEEPS4_m:
  119|  6.74M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesItE4SpanISt4byteES0_IT_E:
  264|  2.98k|{
  265|  2.98k|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|  2.98k|}
_ZN4SpanItEC2ItTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_tEE5valueEiE4typeELi0EEEPS4_m:
  119|  7.85k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesIjE4SpanISt4byteES0_IT_E:
  264|  3.50M|{
  265|  3.50M|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|  3.50M|}
_ZN4SpanIjEC2IjTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_jEE5valueEiE4typeELi0EEEPS4_m:
  119|  4.93M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesImE4SpanISt4byteES0_IT_E:
  264|   541k|{
  265|   541k|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|   541k|}
_ZN4SpanImEC2ImTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_mEE5valueEiE4typeELi0EEEPS4_m:
  119|   789k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesIcE4SpanISt4byteES0_IT_E:
  264|  24.5k|{
  265|  24.5k|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|  24.5k|}
_ZNK4SpanIcE4dataEv:
  174|  24.5k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIcE10size_bytesEv:
  188|  24.5k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKcE4SpanIKSt4byteES1_IT_E:
  259|  66.2k|{
  260|  66.2k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  66.2k|}
_ZNK4SpanIKcE10size_bytesEv:
  188|  66.2k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_ZN4SpanIKSt4byteEC2INSt3__16vectorIS0_NS4_9allocatorIS0_EEEEEERT_NS4_9enable_ifIXaaaantsr7is_SpanIS9_EE5valuesr3std14is_convertibleIPA_NS4_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S1_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  165|  29.8k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2INSt3__15arrayIS0_Lm32EEEEERKT_NS4_9enable_ifIXaaaantsr7is_SpanIS7_EE5valuesr3std14is_convertibleIPA_NS4_14remove_pointerIDTcldtclsr3stdE7declvalIS9_EE4dataEEE4typeEPA_S1_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS9_EE4sizeEEmEE5valueEDnE4typeE:
  172|  36.7k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2INSt3__15arrayIhLm32EEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS8_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS8_EE4sizeEEmEE5valueEDnE4typeE:
  172|  1.24M|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2I9prevectorILj28EhjiEEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS8_14remove_pointerIDTcldtclsr3stdE7declvalIS7_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS7_EE4sizeEEmEE5valueEDnE4typeE:
  172|   100k|        : m_data(other.data()), m_size(other.size()){}
_Z20MakeWritableByteSpanIRNSt3__15arrayIhLm32EEEE4SpanISt4byteEOT_:
  275|  3.01M|{
  276|  3.01M|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|  3.01M|}
_ZN4SpanIhEC2INSt3__15arrayIhLm32EEEEERT_NS2_9enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS2_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  165|  3.01M|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2I7uint256EERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  6.89M|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRKNSt3__16vectorIhNS0_9allocatorIhEEEEEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS8_:
  296|  66.2k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZN4SpanIhEC2I7uint256EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|   156k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIhEC2INSt3__16vectorIhNS2_9allocatorIhEEEEEERT_NS2_9enable_ifIXaaaantsr7is_SpanIS7_EE5valuesr3std14is_convertibleIPA_NS2_14remove_pointerIDTcldtclsr3stdE7declvalIS8_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS8_EE4sizeEEmEE5valueEDnE4typeE:
  165|    124|        : m_data(other.data()), m_size(other.size()){}
_Z20MakeWritableByteSpanIRNSt3__16vectorIhNS0_9allocatorIhEEEEE4SpanISt4byteEOT_:
  275|     62|{
  276|     62|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|     62|}
_ZN4SpanIhEC2I9prevectorILj16EhjiEEERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS6_14remove_pointerIDTcldtclsr3stdE7declvalIS5_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS5_EE4sizeEEmEE5valueEDnE4typeE:
  165|  31.6k|        : m_data(other.data()), m_size(other.size()){}
_Z20MakeWritableByteSpanIRA16_hE4SpanISt4byteEOT_:
  275|   113k|{
  276|   113k|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|   113k|}
_ZN4SpanIhEC2ILi16EEERAT__h:
  151|   113k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2ILi16EEERAT__S0_:
  151|   152k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_Z20MakeWritableByteSpanIRA4_hE4SpanISt4byteEOT_:
  275|  24.5k|{
  276|  24.5k|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|  24.5k|}
_ZN4SpanIhEC2ILi4EEERAT__h:
  151|  24.5k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_Z12MakeByteSpanIRA4_KhE4SpanIKSt4byteEOT_:
  270|  66.2k|{
  271|  66.2k|    return AsBytes(Span{std::forward<V>(v)});
  272|  66.2k|}
_ZN4SpanIKhEC2ILi4EEERAT__S0_:
  151|  66.2k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2I9prevectorILj16EhjiEEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS8_14remove_pointerIDTcldtclsr3stdE7declvalIS7_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS7_EE4sizeEEmEE5valueEDnE4typeE:
  172|   146k|        : m_data(other.data()), m_size(other.size()){}
_Z12MakeByteSpanIRA16_KhE4SpanIKSt4byteEOT_:
  270|  39.1k|{
  271|  39.1k|    return AsBytes(Span{std::forward<V>(v)});
  272|  39.1k|}
_Z20MakeWritableByteSpanIRNSt3__15arrayIhLm4EEEE4SpanISt4byteEOT_:
  275|  24.5k|{
  276|  24.5k|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|  24.5k|}
_ZN4SpanIhEC2INSt3__15arrayIhLm4EEEEERT_NS2_9enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS2_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  165|  24.5k|        : m_data(other.data()), m_size(other.size()){}
_Z20MakeWritableByteSpanIRA12_cE4SpanISt4byteEOT_:
  275|  24.5k|{
  276|  24.5k|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|  24.5k|}
_ZN4SpanIcEC2ILi12EEERAT__c:
  151|  24.5k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_Z12MakeByteSpanIRKNSt3__15arrayIhLm4EEEE4SpanIKSt4byteEOT_:
  270|  66.2k|{
  271|  66.2k|    return AsBytes(Span{std::forward<V>(v)});
  272|  66.2k|}
_ZN4SpanIKhEC2INSt3__15arrayIhLm4EEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS8_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS8_EE4sizeEEmEE5valueEDnE4typeE:
  172|  66.2k|        : m_data(other.data()), m_size(other.size()){}
_Z12MakeByteSpanIRA12_KcE4SpanIKSt4byteEOT_:
  270|  66.2k|{
  271|  66.2k|    return AsBytes(Span{std::forward<V>(v)});
  272|  66.2k|}
_ZN4SpanIKcEC2ILi12EEERAT__S0_:
  151|  66.2k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2ILi32EEERAT__S0_:
  151|  8.78k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIhEC2ILi32EEERAT__h:
  151|     48|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZNK4SpanISt4byteE5beginEv:
  175|   353k|    constexpr C* begin() const noexcept { return m_data; }
_ZN4SpanIKSt4byteEC2I10DataStreamEERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S1_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  165|    552|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIKhEixEm:
  191|  11.3k|    {
  192|  11.3k|        ASSERT_IF_DEBUG(size() > pos);
  193|  11.3k|        return m_data[pos];
  194|  11.3k|    }
_ZN4SpanIKhEC2ILi1EEERAT__S0_:
  151|     48|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2I9prevectorILj35EhjiEEERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  165|     48|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIKhE4lastEm:
  211|  4.72k|    {
  212|  4.72k|         ASSERT_IF_DEBUG(size() >= count);
  213|  4.72k|         return Span<C>(m_data + m_size - count, count);
  214|  4.72k|    }
_ZN4SpanIKhEC2I7uint256EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS6_14remove_pointerIDTcldtclsr3stdE7declvalIS5_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS5_EE4sizeEEmEE5valueEDnE4typeE:
  165|      2|        : m_data(other.data()), m_size(other.size()){}
_Z12MakeByteSpanIRK7uint256E4SpanIKSt4byteEOT_:
  270|  8.47k|{
  271|  8.47k|    return AsBytes(Span{std::forward<V>(v)});
  272|  8.47k|}
_Z12MakeByteSpanIR7uint256E4SpanIKSt4byteEOT_:
  270|  32.6k|{
  271|  32.6k|    return AsBytes(Span{std::forward<V>(v)});
  272|  32.6k|}
_Z7AsBytesIKSt4byteE4SpanIS1_ES2_IT_E:
  259|  1.45k|{
  260|  1.45k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  1.45k|}
_ZNK4SpanIKSt4byteE10size_bytesEv:
  188|  1.45k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z12MakeByteSpanIRKNSt3__15arrayISt4byteLm168EEEE4SpanIKS2_EOT_:
  270|  1.45k|{
  271|  1.45k|    return AsBytes(Span{std::forward<V>(v)});
  272|  1.45k|}
_ZN4SpanIKSt4byteEC2INSt3__15arrayIS0_Lm168EEEEERKT_NS4_9enable_ifIXaaaantsr7is_SpanIS7_EE5valuesr3std14is_convertibleIPA_NS4_14remove_pointerIDTcldtclsr3stdE7declvalIS9_EE4dataEEE4typeEPA_S1_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS9_EE4sizeEEmEE5valueEDnE4typeE:
  172|  1.45k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanISt4byteE5emptyEv:
  189|   707k|    constexpr bool empty() const noexcept { return size() == 0; }
_ZN4SpanISt4byteEC2INSt3__15arrayIS0_Lm64EEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS7_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS7_EE4sizeEEmEE5valueEDnE4typeE:
  165|  87.1k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIKhE5frontEv:
  178|  55.9M|    {
  179|  55.9M|        ASSERT_IF_DEBUG(size() > 0);
  180|  55.9M|        return m_data[0];
  181|  55.9M|    }

_ZN8AutoFileC2EP8_IO_FILENSt3__16vectorISt4byteNS2_9allocatorIS4_EEEE:
   13|  1.59k|    : m_file{file}, m_xor{std::move(data_xor)}
   14|  1.59k|{
   15|  1.59k|    if (!IsNull()) {
  ------------------
  |  Branch (15:9): [True: 1.59k, False: 0]
  ------------------
   16|  1.59k|        auto pos{std::ftell(m_file)};
   17|  1.59k|        if (pos >= 0) m_position = pos;
  ------------------
  |  Branch (17:13): [True: 1.59k, False: 0]
  ------------------
   18|  1.59k|    }
   19|  1.59k|}
_ZN8AutoFile12detail_freadE4SpanISt4byteE:
   22|  29.8k|{
   23|  29.8k|    if (!m_file) throw std::ios_base::failure("AutoFile::read: file handle is nullptr");
  ------------------
  |  Branch (23:9): [True: 0, False: 29.8k]
  ------------------
   24|  29.8k|    size_t ret = std::fread(dst.data(), 1, dst.size(), m_file);
   25|  29.8k|    if (!m_xor.empty()) {
  ------------------
  |  Branch (25:9): [True: 29.8k, False: 0]
  ------------------
   26|  29.8k|        if (!m_position.has_value()) throw std::ios_base::failure("AutoFile::read: position unknown");
  ------------------
  |  Branch (26:13): [True: 0, False: 29.8k]
  ------------------
   27|  29.8k|        util::Xor(dst.subspan(0, ret), m_xor, *m_position);
   28|  29.8k|    }
   29|  29.8k|    if (m_position.has_value()) *m_position += ret;
  ------------------
  |  Branch (29:9): [True: 29.8k, False: 0]
  ------------------
   30|  29.8k|    return ret;
   31|  29.8k|}
_ZN8AutoFile4readE4SpanISt4byteE:
   61|  29.8k|{
   62|  29.8k|    if (detail_fread(dst) != dst.size()) {
  ------------------
  |  Branch (62:9): [True: 0, False: 29.8k]
  ------------------
   63|      0|        throw std::ios_base::failure(feof() ? "AutoFile::read: end of file" : "AutoFile::read: fread failed");
  ------------------
  |  Branch (63:38): [True: 0, False: 0]
  ------------------
   64|      0|    }
   65|  29.8k|}
_ZNK10DataStream14GetMemoryUsageEv:
  116|  47.8k|{
  117|  47.8k|    return sizeof(*this) + memusage::DynamicUsage(vch);
  118|  47.8k|}

_ZN4util3XorE4SpanISt4byteES0_IKS1_Em:
   29|  29.8k|{
   30|  29.8k|    if (key.size() == 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 29.8k]
  ------------------
   31|      0|        return;
   32|      0|    }
   33|  29.8k|    key_offset %= key.size();
   34|       |
   35|   479k|    for (size_t i = 0, j = key_offset; i != write.size(); i++) {
  ------------------
  |  Branch (35:40): [True: 449k, False: 29.8k]
  ------------------
   36|   449k|        write[i] ^= key[j++];
   37|       |
   38|       |        // This potentially acts on very many bytes of data, so it's
   39|       |        // important that we calculate `j`, i.e. the `key` index in this
   40|       |        // way instead of doing a %, which would effectively be a division
   41|       |        // for each byte Xor'd -- much slower than need be.
   42|   449k|        if (j == key.size())
  ------------------
  |  Branch (42:13): [True: 55.1k, False: 394k]
  ------------------
   43|  55.1k|            j = 0;
   44|   449k|    }
   45|  29.8k|}
_ZN12VectorWriterC2ERNSt3__16vectorIhNS0_9allocatorIhEEEEm:
   60|   164k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn) : vchData{vchDataIn}, nPos{nPosIn}
   61|   164k|    {
   62|   164k|        if(nPos > vchData.size())
  ------------------
  |  Branch (62:12): [True: 0, False: 164k]
  ------------------
   63|      0|            vchData.resize(nPos);
   64|   164k|    }
_ZN12VectorWriter5writeE4SpanIKSt4byteE:
   75|  2.48M|    {
   76|  2.48M|        assert(nPos <= vchData.size());
   77|  2.48M|        size_t nOverwrite = std::min(src.size(), vchData.size() - nPos);
   78|  2.48M|        if (nOverwrite) {
  ------------------
  |  Branch (78:13): [True: 0, False: 2.48M]
  ------------------
   79|      0|            memcpy(vchData.data() + nPos, src.data(), nOverwrite);
   80|      0|        }
   81|  2.48M|        if (nOverwrite < src.size()) {
  ------------------
  |  Branch (81:13): [True: 2.48M, False: 0]
  ------------------
   82|  2.48M|            vchData.insert(vchData.end(), UCharCast(src.data()) + nOverwrite, UCharCast(src.data() + src.size()));
   83|  2.48M|        }
   84|  2.48M|        nPos += src.size();
   85|  2.48M|    }
_ZN10DataStream5beginEv:
  178|    668|    iterator begin()                                 { return vch.begin() + m_read_pos; }
_ZN10DataStream3endEv:
  180|    334|    iterator end()                                   { return vch.end(); }
_ZNK10DataStream4sizeEv:
  181|  16.7k|    size_type size() const                           { return vch.size() - m_read_pos; }
_ZNK10DataStream5emptyEv:
  182|  33.4k|    bool empty() const                               { return vch.size() == m_read_pos; }
_ZN10DataStream6resizeEmSt4byte:
  183|  48.9k|    void resize(size_type n, value_type c = value_type{}) { vch.resize(n + m_read_pos, c); }
_ZN10DataStream7reserveEm:
  184|    552|    void reserve(size_type n)                        { vch.reserve(n + m_read_pos); }
_ZN10DataStreamixEm:
  186|  40.4k|    reference operator[](size_type pos)              { return vch[pos + m_read_pos]; }
_ZN10DataStream5clearEv:
  187|  65.9k|    void clear()                                     { vch.clear(); m_read_pos = 0; }
_ZN10DataStream4dataEv:
  188|    552|    value_type* data()                               { return vch.data() + m_read_pos; }
_ZNK10DataStream8in_availEv:
  216|    186|    int in_avail() const         { return size(); }
_ZN10DataStream4readE4SpanISt4byteE:
  219|  12.1M|    {
  220|  12.1M|        if (dst.size() == 0) return;
  ------------------
  |  Branch (220:13): [True: 0, False: 12.1M]
  ------------------
  221|       |
  222|       |        // Read from the beginning of the buffer
  223|  12.1M|        auto next_read_pos{CheckedAdd(m_read_pos, dst.size())};
  224|  12.1M|        if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
  ------------------
  |  Branch (224:13): [True: 0, False: 12.1M]
  |  Branch (224:43): [True: 791, False: 12.1M]
  ------------------
  225|    791|            throw std::ios_base::failure("DataStream::read(): end of data");
  226|    791|        }
  227|  12.1M|        memcpy(dst.data(), &vch[m_read_pos], dst.size());
  228|  12.1M|        if (next_read_pos.value() == vch.size()) {
  ------------------
  |  Branch (228:13): [True: 51.0k, False: 12.1M]
  ------------------
  229|  51.0k|            m_read_pos = 0;
  230|  51.0k|            vch.clear();
  231|  51.0k|            return;
  232|  51.0k|        }
  233|  12.1M|        m_read_pos = next_read_pos.value();
  234|  12.1M|    }
_ZN10DataStream6ignoreEm:
  237|   196k|    {
  238|       |        // Ignore from the beginning of the buffer
  239|   196k|        auto next_read_pos{CheckedAdd(m_read_pos, num_ignore)};
  240|   196k|        if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
  ------------------
  |  Branch (240:13): [True: 0, False: 196k]
  |  Branch (240:43): [True: 41, False: 196k]
  ------------------
  241|     41|            throw std::ios_base::failure("DataStream::ignore(): end of data");
  242|     41|        }
  243|   196k|        if (next_read_pos.value() == vch.size()) {
  ------------------
  |  Branch (243:13): [True: 8, False: 196k]
  ------------------
  244|      8|            m_read_pos = 0;
  245|      8|            vch.clear();
  246|      8|            return;
  247|      8|        }
  248|   196k|        m_read_pos = next_read_pos.value();
  249|   196k|    }
_ZN10DataStream5writeE4SpanIKSt4byteE:
  252|  54.7k|    {
  253|       |        // Write to the end of the buffer
  254|  54.7k|        vch.insert(vch.end(), src.begin(), src.end());
  255|  54.7k|    }
_ZN8AutoFileD2Ev:
  401|  1.59k|    ~AutoFile() { fclose(); }
_ZN8AutoFile6fcloseEv:
  410|  1.59k|    {
  411|  1.59k|        if (auto rel{release()}) return std::fclose(rel);
  ------------------
  |  Branch (411:18): [True: 1.59k, False: 0]
  ------------------
  412|      0|        return 0;
  413|  1.59k|    }
_ZN8AutoFile7releaseEv:
  420|  1.59k|    {
  421|  1.59k|        std::FILE* ret{m_file};
  422|  1.59k|        m_file = nullptr;
  423|  1.59k|        return ret;
  424|  1.59k|    }
_ZNK8AutoFile6IsNullEv:
  428|  3.18k|    bool IsNull() const { return m_file == nullptr; }
_ZN10DataStreamC2Ev:
  164|  34.3k|    explicit DataStream() = default;
_ZN8AutoFilersIRjEERS_OT_:
  464|     62|    {
  465|     62|        ::Unserialize(*this, obj);
  466|     62|        return *this;
  467|     62|    }
_ZN10DataStreamrsI13ParamsWrapperI20TransactionSerParams6CBlockEEERS_OT_:
  266|    192|    {
  267|    192|        ::Unserialize(*this, obj);
  268|    192|        return (*this);
  269|    192|    }
_ZN10DataStreamrsIR12CBlockHeaderEERS_OT_:
  266|  3.22k|    {
  267|  3.22k|        ::Unserialize(*this, obj);
  268|  3.22k|        return (*this);
  269|  3.22k|    }
_ZN10DataStreamrsIR13CBlockLocatorEERS_OT_:
  266|    160|    {
  267|    160|        ::Unserialize(*this, obj);
  268|    160|        return (*this);
  269|    160|    }
_ZN10DataStreamrsIRhEERS_OT_:
  266|     37|    {
  267|     37|        ::Unserialize(*this, obj);
  268|     37|        return (*this);
  269|     37|    }
_ZN10DataStreamrsIR7uint256EERS_OT_:
  266|    131|    {
  267|    131|        ::Unserialize(*this, obj);
  268|    131|        return (*this);
  269|    131|    }
_ZN10DataStreamrsIRNSt3__16vectorIhNS1_9allocatorIhEEEEEERS_OT_:
  266|     44|    {
  267|     44|        ::Unserialize(*this, obj);
  268|     44|        return (*this);
  269|     44|    }
_ZN10DataStreamlsIhEERS_RKT_:
  259|  16.4k|    {
  260|  16.4k|        ::Serialize(*this, obj);
  261|  16.4k|        return (*this);
  262|  16.4k|    }
_ZN10DataStreamlsI4SpanIKhEEERS_RKT_:
  259|  1.22k|    {
  260|  1.22k|        ::Serialize(*this, obj);
  261|  1.22k|        return (*this);
  262|  1.22k|    }
_ZN10DataStreamlsINSt3__16vectorIhNS1_9allocatorIhEEEEEERS_RKT_:
  259|  16.4k|    {
  260|  16.4k|        ::Serialize(*this, obj);
  261|  16.4k|        return (*this);
  262|  16.4k|    }
_ZN10DataStreamrsIR25CBlockHeaderAndShortTxIDsEERS_OT_:
  266|    411|    {
  267|    411|        ::Unserialize(*this, obj);
  268|    411|        return (*this);
  269|    411|    }
_ZN10DataStreamrsIRjEERS_OT_:
  266|     79|    {
  267|     79|        ::Unserialize(*this, obj);
  268|     79|        return (*this);
  269|     79|    }
_ZN12VectorWriterlsI4SpanIKhEEERS_RKT_:
   88|   965k|    {
   89|   965k|        ::Serialize(*this, obj);
   90|   965k|        return (*this);
   91|   965k|    }
_ZN10DataStreamlsI12CBlockHeaderEERS_RKT_:
  259|    334|    {
  260|    334|        ::Serialize(*this, obj);
  261|    334|        return (*this);
  262|    334|    }
_ZN10DataStreamrsI13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceEEERS_OT_:
  266|  8.40k|    {
  267|  8.40k|        ::Unserialize(*this, obj);
  268|  8.40k|        return (*this);
  269|  8.40k|    }
_ZN10DataStreamrsIR14CMessageHeaderEERS_OT_:
  266|  24.5k|    {
  267|  24.5k|        ::Unserialize(*this, obj);
  268|  24.5k|        return (*this);
  269|  24.5k|    }
_ZN10DataStreamrsIR12CBloomFilterEERS_OT_:
  266|     34|    {
  267|     34|        ::Unserialize(*this, obj);
  268|     34|        return (*this);
  269|     34|    }
_ZN10DataStreamrsIR17BlockTransactionsEERS_OT_:
  266|     98|    {
  267|     98|        ::Unserialize(*this, obj);
  268|     98|        return (*this);
  269|     98|    }
_ZN10DataStreamrsIR24BlockTransactionsRequestEERS_OT_:
  266|    139|    {
  267|    139|        ::Unserialize(*this, obj);
  268|    139|        return (*this);
  269|    139|    }
_ZN10DataStreamrsIRmEERS_OT_:
  266|  8.67k|    {
  267|  8.67k|        ::Unserialize(*this, obj);
  268|  8.67k|        return (*this);
  269|  8.67k|    }
_ZN10DataStreamlsImEERS_RKT_:
  259|    334|    {
  260|    334|        ::Serialize(*this, obj);
  261|    334|        return (*this);
  262|    334|    }
_ZN10DataStreamrsIRlEERS_OT_:
  266|  8.50k|    {
  267|  8.50k|        ::Unserialize(*this, obj);
  268|  8.50k|        return (*this);
  269|  8.50k|    }
_ZN10DataStreamrsIRiEERS_OT_:
  266|  16.7k|    {
  267|  16.7k|        ::Unserialize(*this, obj);
  268|  16.7k|        return (*this);
  269|  16.7k|    }
_ZN10DataStreamrsIRbEERS_OT_:
  266|  8.43k|    {
  267|  8.43k|        ::Unserialize(*this, obj);
  268|  8.43k|        return (*this);
  269|  8.43k|    }
_ZN12VectorWriterC2IJ13ParamsWrapperI20TransactionSerParamsNSt3__16vectorI6CBlockNS3_9allocatorIS5_EEEEEEEERNS4_IhNS6_IhEEEEmDpOT_:
   70|     45|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|     45|    {
   72|     45|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|     45|    }
_ZN8AutoFilersIRNSt3__15arrayIhLm4EEEEERS_OT_:
  464|     62|    {
  465|     62|        ::Unserialize(*this, obj);
  466|     62|        return *this;
  467|     62|    }
_ZN10DataStreamrsI13ParamsWrapperIN8CAddress9SerParamsE8CNetAddrEEERS_OT_:
  266|  16.4k|    {
  267|  16.4k|        ::Unserialize(*this, obj);
  268|  16.4k|        return (*this);
  269|  16.4k|    }
_ZN10DataStreamrsI13ParamsWrapperI20TransactionSerParamsNSt3__110shared_ptrIK12CTransactionEEEEERS_OT_:
  266|  1.66k|    {
  267|  1.66k|        ::Unserialize(*this, obj);
  268|  1.66k|        return (*this);
  269|  1.66k|    }
_ZN12VectorWriterC2IJRi7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEll13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceElSC_mNSt3__112basic_stringIcNSD_11char_traitsIcEENSD_9allocatorIcEEEEiRbEEERNSD_6vectorIhNSH_IhEEEEmDpOT_:
   70|  8.47k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  8.47k|    {
   72|  8.47k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  8.47k|    }
_ZN12VectorWriterC2IJR14CMessageHeaderEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   70|  66.2k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  66.2k|    {
   72|  66.2k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  66.2k|    }
_ZN12VectorWriterC2IJbRKmEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   70|  6.69k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  6.69k|    {
   72|  6.69k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  6.69k|    }
_ZN12VectorWriterC2IJRNSt3__16vectorI4CInvNS1_9allocatorIS3_EEEEEEERNS2_IhNS4_IhEEEEmDpOT_:
   70|  15.5k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  15.5k|    {
   72|  15.5k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  15.5k|    }
_ZN10DataStreamrsI7WrapperI19CustomUintFormatterILi8ELb0EER12ServiceFlagsEEERS_OT_:
  266|  8.40k|    {
  267|  8.40k|        ::Unserialize(*this, obj);
  268|  8.40k|        return (*this);
  269|  8.40k|    }
_ZN10DataStreamrsI7WrapperI22LimitedStringFormatterILm256EERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEERS_OT_:
  266|  8.35k|    {
  267|  8.35k|        ::Unserialize(*this, obj);
  268|  8.35k|        return (*this);
  269|  8.35k|    }
_ZN12VectorWriterC2IJRKiRmRKlS3_13ParamsWrapperIN8CNetAddr9SerParamsE8CServiceES3_SA_S3_RNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEES2_RKbEEERNSB_6vectorIhNSF_IhEEEEmDpOT_:
   70|  8.47k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  8.47k|    {
   72|  8.47k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  8.47k|    }
_ZN12VectorWriterC2IJRKjRKmEEERNSt3__16vectorIhNS5_9allocatorIhEEEEmDpOT_:
   70|  3.77k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  3.77k|    {
   72|  3.77k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  3.77k|    }
_ZN12VectorWriterC2IJRKNSt3__15arrayISt4byteLm168EEEEEERNS1_6vectorIhNS1_9allocatorIhEEEEmDpOT_:
   70|  1.45k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  1.45k|    {
   72|  1.45k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  1.45k|    }
_ZN10DataStreamrsI13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS2_NS4_9allocatorIS2_EEEEEEERS_OT_:
  266|  1.40k|    {
  267|  1.40k|        ::Unserialize(*this, obj);
  268|  1.40k|        return (*this);
  269|  1.40k|    }
_ZN10DataStreamrsIRNSt3__16vectorI4CInvNS1_9allocatorIS3_EEEEEERS_OT_:
  266|  1.95k|    {
  267|  1.95k|        ::Unserialize(*this, obj);
  268|  1.95k|        return (*this);
  269|  1.95k|    }
_ZN12VectorWriterC2IJRK13CBlockLocator7uint256EEERNSt3__16vectorIhNS5_9allocatorIhEEEEmDpOT_:
   70|  3.80k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  3.80k|    {
   72|  3.80k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  3.80k|    }
_ZN12VectorWriterC2IJ4SpanIhEEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   70|     62|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|     62|    {
   72|     62|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|     62|    }
_ZN12VectorWriterC2IJ13ParamsWrapperI20TransactionSerParamsK6CBlockEEEERNSt3__16vectorIhNS6_9allocatorIhEEEEmDpOT_:
   70|  1.47k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  1.47k|    {
   72|  1.47k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  1.47k|    }
_ZN12VectorWriterC2IJR25CBlockHeaderAndShortTxIDsEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   70|     10|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|     10|    {
   72|     10|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|     10|    }
_ZN12VectorWriterC2IJR17BlockTransactionsEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   70|      2|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|      2|    {
   72|      2|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|      2|    }
_ZN12VectorWriterC2IJR24BlockTransactionsRequestEEERNSt3__16vectorIhNS3_9allocatorIhEEEEmDpOT_:
   70|     71|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|     71|    {
   72|     71|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|     71|    }
_ZN12VectorWriterC2IJRmEEERNSt3__16vectorIhNS2_9allocatorIhEEEEmDpOT_:
   70|  6.76k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  6.76k|    {
   72|  6.76k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  6.76k|    }
_ZN12VectorWriterC2IJ13ParamsWrapperIN8CAddress9SerParamsENSt3__16vectorIS2_NS4_9allocatorIS2_EEEEEEEERNS5_IhNS6_IhEEEEmDpOT_:
   70|    129|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|    129|    {
   72|    129|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|    129|    }
_ZN12VectorWriterC2IJRlEEERNSt3__16vectorIhNS2_9allocatorIhEEEEmDpOT_:
   70|  7.24k|    VectorWriter(std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : VectorWriter{vchDataIn, nPosIn}
   71|  7.24k|    {
   72|  7.24k|        ::SerializeMany(*this, std::forward<Args>(args)...);
   73|  7.24k|    }
_ZN8AutoFilersI13ParamsWrapperI20TransactionSerParams6CBlockEEERS_OT_:
  464|  1.53k|    {
  465|  1.53k|        ::Unserialize(*this, obj);
  466|  1.53k|        return *this;
  467|  1.53k|    }
txdb.cpp:_ZN10DataStreamlsIN12_GLOBAL__N_19CoinEntryEEERS_RKT_:
  259|    552|    {
  260|    552|        ::Serialize(*this, obj);
  261|    552|        return (*this);
  262|    552|    }

_ZN13PoolAllocatorINSt3__111__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEELm144ELm8EE10deallocateEPS7_m:
  325|  1.68k|    {
  326|  1.68k|        m_resource->Deallocate(p, n * sizeof(T), alignof(T));
  327|  1.68k|    }
_ZN12PoolResourceILm144ELm8EE16IsFreeListUsableEmm:
  135|  4.35k|    {
  136|  4.35k|        return alignment <= ELEM_ALIGN_BYTES && bytes <= MAX_BLOCK_SIZE_BYTES;
  ------------------
  |  Branch (136:16): [True: 4.35k, False: 0]
  |  Branch (136:49): [True: 4.35k, False: 2]
  ------------------
  137|  4.35k|    }
_ZN12PoolResourceILm144ELm8EE17NumElemAlignBytesEm:
  127|  7.07k|    {
  128|  7.07k|        return (bytes + ELEM_ALIGN_BYTES - 1) / ELEM_ALIGN_BYTES + (bytes == 0);
  129|  7.07k|    }
_ZN12PoolResourceILm144ELm8EE10DeallocateEPvmm:
  242|  2.37k|    {
  243|  2.37k|        if (IsFreeListUsable(bytes, alignment)) {
  ------------------
  |  Branch (243:13): [True: 2.37k, False: 2]
  ------------------
  244|  2.37k|            const std::size_t num_alignments = NumElemAlignBytes(bytes);
  245|       |            // put the memory block into the linked list. We can placement construct the FreeList
  246|       |            // into the memory since we can be sure the alignment is correct.
  247|  2.37k|            PlacementAddToList(p, m_free_lists[num_alignments]);
  248|  2.37k|        } else {
  249|       |            // Can't use the pool => forward deallocation to ::operator delete().
  250|      2|            ::operator delete (p, std::align_val_t{alignment});
  251|      2|        }
  252|  2.37k|    }
_ZN12PoolResourceILm144ELm8EE18PlacementAddToListEPvRPNS0_8ListNodeE:
  143|  2.37k|    {
  144|  2.37k|        node = new (p) ListNode{node};
  145|  2.37k|    }
_ZN13PoolAllocatorIPNSt3__116__hash_node_baseIPNS0_11__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEEEELm144ELm8EE10deallocateEPSB_m:
  325|    695|    {
  326|    695|        m_resource->Deallocate(p, n * sizeof(T), alignof(T));
  327|    695|    }
_ZN12PoolResourceILm144ELm8EE8ListNodeC2EPS1_:
   81|  2.37k|        explicit ListNode(ListNode* next) : m_next(next) {}
_ZN12PoolResourceILm144ELm8EED2Ev:
  201|  2.72k|    {
  202|  2.72k|        for (std::byte* chunk : m_allocated_chunks) {
  ------------------
  |  Branch (202:31): [True: 2.72k, False: 2.72k]
  ------------------
  203|  2.72k|            std::destroy(chunk, chunk + m_chunk_size_bytes);
  204|  2.72k|            ::operator delete ((void*)chunk, std::align_val_t{ELEM_ALIGN_BYTES});
  205|  2.72k|        }
  206|  2.72k|    }
_ZN12PoolResourceILm144ELm8EEC2Ev:
  187|  2.72k|    PoolResource() : PoolResource(262144) {}
_ZN12PoolResourceILm144ELm8EEC2Em:
  178|  2.72k|        : m_chunk_size_bytes(NumElemAlignBytes(chunk_size_bytes) * ELEM_ALIGN_BYTES)
  179|  2.72k|    {
  180|  2.72k|        assert(m_chunk_size_bytes >= MAX_BLOCK_SIZE_BYTES);
  181|  2.72k|        AllocateChunk();
  182|  2.72k|    }
_ZN12PoolResourceILm144ELm8EE13AllocateChunkEv:
  154|  2.72k|    {
  155|       |        // if there is still any available memory left, put it into the freelist.
  156|  2.72k|        size_t remaining_available_bytes = std::distance(m_available_memory_it, m_available_memory_end);
  157|  2.72k|        if (0 != remaining_available_bytes) {
  ------------------
  |  Branch (157:13): [True: 0, False: 2.72k]
  ------------------
  158|      0|            PlacementAddToList(m_available_memory_it, m_free_lists[remaining_available_bytes / ELEM_ALIGN_BYTES]);
  159|      0|        }
  160|       |
  161|  2.72k|        void* storage = ::operator new (m_chunk_size_bytes, std::align_val_t{ELEM_ALIGN_BYTES});
  162|  2.72k|        m_available_memory_it = new (storage) std::byte[m_chunk_size_bytes];
  163|  2.72k|        m_available_memory_end = m_available_memory_it + m_chunk_size_bytes;
  164|  2.72k|        m_allocated_chunks.emplace_back(m_available_memory_it);
  165|  2.72k|    }
_ZN13PoolAllocatorINSt3__14pairIK9COutPoint16CCoinsCacheEntryEELm144ELm8EEC2EP12PoolResourceILm144ELm8EE:
  291|  2.72k|        : m_resource(resource)
  292|  2.72k|    {
  293|  2.72k|    }
_ZN13PoolAllocatorINSt3__117__hash_value_typeI9COutPoint16CCoinsCacheEntryEELm144ELm8EEC2INS0_4pairIKS2_S3_EEEERKS_IT_Lm144ELm8EE:
  300|  2.72k|        : m_resource(other.resource())
  301|  2.72k|    {
  302|  2.72k|    }
_ZNK13PoolAllocatorINSt3__14pairIK9COutPoint16CCoinsCacheEntryEELm144ELm8EE8resourceEv:
  330|  5.44k|    {
  331|  5.44k|        return m_resource;
  332|  5.44k|    }
_ZN13PoolAllocatorIPNSt3__116__hash_node_baseIPNS0_11__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEEEELm144ELm8EEC2IS6_EERKS_IT_Lm144ELm8EE:
  300|  2.72k|        : m_resource(other.resource())
  301|  2.72k|    {
  302|  2.72k|    }
_ZNK13PoolAllocatorINSt3__117__hash_value_typeI9COutPoint16CCoinsCacheEntryEELm144ELm8EE8resourceEv:
  330|  5.44k|    {
  331|  5.44k|        return m_resource;
  332|  5.44k|    }
_ZN13PoolAllocatorINSt3__111__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEELm144ELm8EEC2IS5_EERKS_IT_Lm144ELm8EE:
  300|  2.72k|        : m_resource(other.resource())
  301|  2.72k|    {
  302|  2.72k|    }
_ZN13PoolAllocatorIPNSt3__116__hash_node_baseIPNS0_11__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEEEELm144ELm8EE8allocateEm:
  317|    693|    {
  318|    693|        return static_cast<T*>(m_resource->Allocate(n * sizeof(T), alignof(T)));
  319|    693|    }
_ZN12PoolResourceILm144ELm8EE8AllocateEmm:
  213|  1.97k|    {
  214|  1.97k|        if (IsFreeListUsable(bytes, alignment)) {
  ------------------
  |  Branch (214:13): [True: 1.97k, False: 0]
  ------------------
  215|  1.97k|            const std::size_t num_alignments = NumElemAlignBytes(bytes);
  216|  1.97k|            if (nullptr != m_free_lists[num_alignments]) {
  ------------------
  |  Branch (216:17): [True: 551, False: 1.42k]
  ------------------
  217|       |                // we've already got data in the pool's freelist, unlink one element and return the pointer
  218|       |                // to the unlinked memory. Since FreeList is trivially destructible we can just treat it as
  219|       |                // uninitialized memory.
  220|    551|                return std::exchange(m_free_lists[num_alignments], m_free_lists[num_alignments]->m_next);
  221|    551|            }
  222|       |
  223|       |            // freelist is empty: get one allocation from allocated chunk memory.
  224|  1.42k|            const std::ptrdiff_t round_bytes = static_cast<std::ptrdiff_t>(num_alignments * ELEM_ALIGN_BYTES);
  225|  1.42k|            if (round_bytes > m_available_memory_end - m_available_memory_it) {
  ------------------
  |  Branch (225:17): [True: 0, False: 1.42k]
  ------------------
  226|       |                // slow path, only happens when a new chunk needs to be allocated
  227|      0|                AllocateChunk();
  228|      0|            }
  229|       |
  230|       |            // Make sure we use the right amount of bytes for that freelist (might be rounded up),
  231|  1.42k|            return std::exchange(m_available_memory_it, m_available_memory_it + round_bytes);
  232|  1.97k|        }
  233|       |
  234|       |        // Can't use the pool => use operator new()
  235|      0|        return ::operator new (bytes, std::align_val_t{alignment});
  236|  1.97k|    }
_ZN13PoolAllocatorINSt3__111__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEELm144ELm8EE8allocateEm:
  317|  1.28k|    {
  318|  1.28k|        return static_cast<T*>(m_resource->Allocate(n * sizeof(T), alignof(T)));
  319|  1.28k|    }
_ZN13PoolAllocatorINSt3__14pairIK9COutPoint16CCoinsCacheEntryEELm144ELm8EEC2INS0_11__hash_nodeINS0_17__hash_value_typeIS2_S4_EEPvEEEERKS_IT_Lm144ELm8EE:
  300|  2.72k|        : m_resource(other.resource())
  301|  2.72k|    {
  302|  2.72k|    }
_ZNK13PoolAllocatorINSt3__111__hash_nodeINS0_17__hash_value_typeI9COutPoint16CCoinsCacheEntryEEPvEELm144ELm8EE8resourceEv:
  330|  2.72k|    {
  331|  2.72k|        return m_resource;
  332|  2.72k|    }
_ZNK12PoolResourceILm144ELm8EE18NumAllocatedChunksEv:
  258|  5.44k|    {
  259|  5.44k|        return m_allocated_chunks.size();
  260|  5.44k|    }
_ZNK12PoolResourceILm144ELm8EE14ChunkSizeBytesEv:
  266|  2.72k|    {
  267|  2.72k|        return m_chunk_size_bytes;
  268|  2.72k|    }

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

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

_Z17MaybeCheckNotHeldR14AnnotatedMixinINSt3__15mutexEE:
  247|  9.54M|inline Mutex& MaybeCheckNotHeld(Mutex& cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) LOCK_RETURNED(cs) { return cs; }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEEC2ERS3_PKcS7_ib:
  177|  7.67M|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  178|  7.67M|    {
  179|  7.67M|        if (fTry)
  ------------------
  |  Branch (179:13): [True: 0, False: 7.67M]
  ------------------
  180|      0|            TryEnter(pszName, pszFile, nLine);
  181|  7.67M|        else
  182|  7.67M|            Enter(pszName, pszFile, nLine);
  183|  7.67M|    }
_Z13EnterCriticalINSt3__15mutexEEvPKcS3_iPT_b:
   75|  7.69M|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_Z13LeaveCriticalv:
   76|  14.0M|inline void LeaveCritical() {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEE5EnterEPKcS6_i:
  157|  7.67M|    {
  158|  7.67M|        EnterCritical(pszName, pszFile, nLine, Base::mutex());
  159|       |#ifdef DEBUG_LOCKCONTENTION
  160|       |        if (Base::try_lock()) return;
  161|       |        LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
  162|       |#endif
  163|  7.67M|        Base::lock();
  164|  7.67M|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEED2Ev:
  197|  7.68M|    {
  198|  7.68M|        if (Base::owns_lock())
  ------------------
  |  Branch (198:13): [True: 7.67M, False: 8.47k]
  ------------------
  199|  7.67M|            LeaveCritical();
  200|  7.68M|    }
_Z17CheckLastCriticalPvRNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_i:
   77|  8.47k|inline void CheckLastCritical(void* cs, std::string& lockname, const char* guardname, const char* file, int line) {}
_Z10DeleteLockPv:
   82|   130k|inline void DeleteLock(void* cs) {}
_Z23AssertLockNotHeldInlinePKcS0_iP14AnnotatedMixinINSt3__15mutexEE:
  144|  1.94M|inline void AssertLockNotHeldInline(const char* name, const char* file, int line, Mutex* cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) { AssertLockNotHeldInternal(name, file, line, cs); }
_Z23AssertLockNotHeldInlinePKcS0_iP14AnnotatedMixinINSt3__115recursive_mutexEE:
  145|   442k|inline void AssertLockNotHeldInline(const char* name, const char* file, int line, RecursiveMutex* cs) LOCKS_EXCLUDED(cs) { AssertLockNotHeldInternal(name, file, line, cs); }
_ZN15CSemaphoreGrant7ReleaseEv:
  369|  8.47k|    {
  370|  8.47k|        if (!fHaveGrant) {
  ------------------
  |  Branch (370:13): [True: 8.47k, False: 0]
  ------------------
  371|  8.47k|            return;
  372|  8.47k|        }
  373|      0|        sem->post();
  374|      0|        fHaveGrant = false;
  375|      0|    }
_ZN15CSemaphoreGrantC2Ev:
  408|  8.47k|    CSemaphoreGrant() noexcept : sem(nullptr), fHaveGrant(false) {}
_ZN15CSemaphoreGrantD2Ev:
  420|  8.47k|    {
  421|  8.47k|        Release();
  422|  8.47k|    }
_Z25AssertLockNotHeldInternalI14AnnotatedMixinINSt3__15mutexEEEvPKcS5_iPT_:
   81|  1.94M|void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) LOCKS_EXCLUDED(cs) {}
_Z25AssertLockNotHeldInternalI14AnnotatedMixinINSt3__115recursive_mutexEEEvPKcS5_iPT_:
   81|   442k|void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) LOCKS_EXCLUDED(cs) {}
_Z17MaybeCheckNotHeldI14AnnotatedMixinINSt3__115recursive_mutexEEERT_S5_:
  253|  6.37M|inline MutexType& MaybeCheckNotHeld(MutexType& m) LOCKS_EXCLUDED(m) LOCK_RETURNED(m) { return m; }
_Z13EnterCriticalINSt3__115recursive_mutexEEvPKcS3_iPT_b:
   75|  6.34M|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEE5EnterEPKcS6_i:
  157|  6.34M|    {
  158|  6.34M|        EnterCritical(pszName, pszFile, nLine, Base::mutex());
  159|       |#ifdef DEBUG_LOCKCONTENTION
  160|       |        if (Base::try_lock()) return;
  161|       |        LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
  162|       |#endif
  163|  6.34M|        Base::lock();
  164|  6.34M|    }
_Z22AssertLockHeldInternalI14AnnotatedMixinINSt3__15mutexEEEvPKcS5_iPT_:
   79|  2.29M|inline void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) EXCLUSIVE_LOCKS_REQUIRED(cs) {}
_Z22AssertLockHeldInternalI14AnnotatedMixinINSt3__115recursive_mutexEEEvPKcS5_iPT_:
   79|   515k|inline void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) EXCLUSIVE_LOCKS_REQUIRED(cs) {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEEC2ERS3_PKcS7_ib:
  177|  6.34M|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  178|  6.34M|    {
  179|  6.34M|        if (fTry)
  ------------------
  |  Branch (179:13): [True: 0, False: 6.34M]
  ------------------
  180|      0|            TryEnter(pszName, pszFile, nLine);
  181|  6.34M|        else
  182|  6.34M|            Enter(pszName, pszFile, nLine);
  183|  6.34M|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEED2Ev:
  197|  6.34M|    {
  198|  6.34M|        if (Base::owns_lock())
  ------------------
  |  Branch (198:13): [True: 6.34M, False: 0]
  ------------------
  199|  6.34M|            LeaveCritical();
  200|  6.34M|    }
_ZN14AnnotatedMixinINSt3__15mutexEED2Ev:
   94|   118k|    ~AnnotatedMixin() {
   95|   118k|        DeleteLock((void*)this);
   96|   118k|    }
_ZN14AnnotatedMixinINSt3__115recursive_mutexEED2Ev:
   94|  11.7k|    ~AnnotatedMixin() {
   95|  11.7k|        DeleteLock((void*)this);
   96|  11.7k|    }
_Z17MaybeCheckNotHeldI11GlobalMutexERT_S2_:
  253|  7.61k|inline MutexType& MaybeCheckNotHeld(MutexType& m) LOCKS_EXCLUDED(m) LOCK_RETURNED(m) { return m; }
_ZN10UniqueLockI11GlobalMutexEC2ERS0_PKcS4_ib:
  177|  7.61k|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  178|  7.61k|    {
  179|  7.61k|        if (fTry)
  ------------------
  |  Branch (179:13): [True: 0, False: 7.61k]
  ------------------
  180|      0|            TryEnter(pszName, pszFile, nLine);
  181|  7.61k|        else
  182|  7.61k|            Enter(pszName, pszFile, nLine);
  183|  7.61k|    }
_ZN10UniqueLockI11GlobalMutexE5EnterEPKcS3_i:
  157|  7.61k|    {
  158|  7.61k|        EnterCritical(pszName, pszFile, nLine, Base::mutex());
  159|       |#ifdef DEBUG_LOCKCONTENTION
  160|       |        if (Base::try_lock()) return;
  161|       |        LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
  162|       |#endif
  163|  7.61k|        Base::lock();
  164|  7.61k|    }
_ZN10UniqueLockI11GlobalMutexED2Ev:
  197|  7.61k|    {
  198|  7.61k|        if (Base::owns_lock())
  ------------------
  |  Branch (198:13): [True: 7.61k, False: 0]
  ------------------
  199|  7.61k|            LeaveCritical();
  200|  7.61k|    }
_ZZNK11V1Transport23ReceivedMessageCompleteEvENKUlvE_clEv:
  301|  40.4k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  40.4k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  40.4k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  40.4k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  40.4k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_ZZN10CScheduler4stopEvENKUlvE_clEv:
  301|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net.cpp:_ZZN8CConnman9StopNodesEvENK3$_0clEv:
  301|  8.47k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_14Peer10GetTxRelayEvENKUlvE_clEv:
  301|  1.80M|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  1.80M|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.80M|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.80M|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.80M|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZNK12_GLOBAL__N_115PeerManagerImpl17GetNodeStateStatsElR15CNodeStateStatsENK3$_0clEv:
  301|  5.82k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  5.82k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.82k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.82k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.82k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_0clEv:
  301|  5.23k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  5.23k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.23k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.23k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.23k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_2clEv:
  301|     55|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|     55|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     55|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     55|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     55|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_3clEv:
  301|  4.38k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  4.38k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  4.38k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  4.38k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  4.38k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_5clEv:
  301|      7|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|      7|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      7|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      7|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      7|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl21ProcessHeadersMessageER5CNodeRNS_4PeerEONSt3__16vectorI12CBlockHeaderNS5_9allocatorIS7_EEEEbENK3$_0clEv:
  301|    372|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|    372|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    372|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    372|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    372|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl25HandleUnconnectingHeadersER5CNodeRNS_4PeerERKNSt3__16vectorI12CBlockHeaderNS5_9allocatorIS7_EEEEENK3$_0clEv:
  301|     12|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|     12|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     12|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     12|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     12|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl25HandleUnconnectingHeadersER5CNodeRNS_4PeerERKNSt3__16vectorI12CBlockHeaderNS5_9allocatorIS7_EEEEENK3$_1clEv:
  301|     12|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|     12|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     12|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     12|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     12|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_6clEv:
  301|    138|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|    138|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    138|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    138|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    138|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_7clEv:
  301|     22|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|     22|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     22|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     22|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     22|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14InitializeNodeERK5CNode12ServiceFlagsENK3$_0clEv:
  301|  8.47k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl12FinalizeNodeERK5CNodeENK3$_0clEv:
  301|  8.47k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
warnings.cpp:_ZZN4node8Warnings3SetENSt3__17variantIJN6kernel7WarningENS_7WarningEEEE13bilingual_strENK3$_0clEv:
  301|  3.18k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  3.18k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.18k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.18k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.18k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
warnings.cpp:_ZZN4node8Warnings5UnsetENSt3__17variantIJN6kernel7WarningENS_7WarningEEEEENK3$_0clEv:
  301|      4|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|      4|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      4|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      4|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      4|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
validation.cpp:_ZZN10Chainstate17ActivateBestChainER20BlockValidationStateNSt3__110shared_ptrIK6CBlockEEENK3$_0clEv:
  301|  1.54k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|  1.54k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.54k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.54k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.54k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_Z17MaybeCheckNotHeldI14AnnotatedMixinINSt3__115recursive_mutexEEEPT_S5_:
  255|  1.54k|inline MutexType* MaybeCheckNotHeld(MutexType* m) LOCKS_EXCLUDED(m) LOCK_RETURNED(m) { return m; }
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEEC2EPS3_PKcS7_ib:
  186|  1.54k|    {
  187|  1.54k|        if (!pmutexIn) return;
  ------------------
  |  Branch (187:13): [True: 0, False: 1.54k]
  ------------------
  188|       |
  189|  1.54k|        *static_cast<Base*>(this) = Base(*pmutexIn, std::defer_lock);
  190|  1.54k|        if (fTry)
  ------------------
  |  Branch (190:13): [True: 0, False: 1.54k]
  ------------------
  191|      0|            TryEnter(pszName, pszFile, nLine);
  192|  1.54k|        else
  193|  1.54k|            Enter(pszName, pszFile, nLine);
  194|  1.54k|    }
_ZZN11CCheckQueueI12CScriptCheckNSt3__14pairI13ScriptError_tNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEED1EvENKUlvE_clEv:
  301|      2|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEE12reverse_lockC2ERS4_PKcS8_i:
  217|  8.47k|        explicit reverse_lock(UniqueLock& _lock, const char* _guardname, const char* _file, int _line) : lock(_lock), file(_file), line(_line) {
  218|  8.47k|            CheckLastCritical((void*)lock.mutex(), lockname, _guardname, _file, _line);
  219|  8.47k|            lock.unlock();
  220|  8.47k|            LeaveCritical();
  221|  8.47k|            lock.swap(templock);
  222|  8.47k|        }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEEC2Ev:
  209|  8.47k|    UniqueLock() = default;
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEE12reverse_lockD2Ev:
  224|  8.47k|        ~reverse_lock() {
  225|  8.47k|            templock.swap(lock);
  226|  8.47k|            EnterCritical(lockname.c_str(), file.c_str(), line, lock.mutex());
  227|  8.47k|            lock.lock();
  228|  8.47k|        }

_ZN18FuzzedDataProviderC2EPKhm:
   37|  8.47k|      : data_ptr_(data), remaining_bytes_(size) {}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIlEET_S1_S1_:
  205|  35.8k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  35.8k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|  35.8k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  35.8k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 35.8k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  35.8k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  35.8k|  uint64_t result = 0;
  215|  35.8k|  size_t offset = 0;
  216|       |
  217|   148k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 140k, False: 8.40k]
  |  Branch (217:43): [True: 117k, False: 22.5k]
  ------------------
  218|   148k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 112k, False: 4.88k]
  ------------------
  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|   112k|    --remaining_bytes_;
  226|   112k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|   112k|    offset += CHAR_BIT;
  228|   112k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  35.8k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 35.8k, False: 0]
  ------------------
  232|  35.8k|    result = result % (range + 1);
  233|       |
  234|  35.8k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  35.8k|}
_ZN18FuzzedDataProvider15ConsumeIntegralImEET_v:
  195|  29.2k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  29.2k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  29.2k|                                std::numeric_limits<T>::max());
  198|  29.2k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeImEET_S1_S1_:
  205|  85.2k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  85.2k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|  85.2k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  85.2k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 85.2k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  85.2k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  85.2k|  uint64_t result = 0;
  215|  85.2k|  size_t offset = 0;
  216|       |
  217|   347k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 321k, False: 26.3k]
  |  Branch (217:43): [True: 270k, False: 51.1k]
  ------------------
  218|   347k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 262k, False: 7.76k]
  ------------------
  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|   262k|    --remaining_bytes_;
  226|   262k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|   262k|    offset += CHAR_BIT;
  228|   262k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  85.2k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 56.0k, False: 29.2k]
  ------------------
  232|  56.0k|    result = result % (range + 1);
  233|       |
  234|  85.2k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  85.2k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIiEET_S1_S1_:
  205|  8.47k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  8.47k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|  8.47k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  8.47k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 8.47k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  8.47k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  8.47k|  uint64_t result = 0;
  215|  8.47k|  size_t offset = 0;
  216|       |
  217|  40.0k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 32.1k, False: 7.89k]
  |  Branch (217:43): [True: 32.1k, False: 0]
  ------------------
  218|  40.0k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 31.6k, False: 577]
  ------------------
  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|  31.6k|    --remaining_bytes_;
  226|  31.6k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  31.6k|    offset += CHAR_BIT;
  228|  31.6k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  8.47k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 8.47k, False: 0]
  ------------------
  232|  8.47k|    result = result % (range + 1);
  233|       |
  234|  8.47k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  8.47k|}
_ZN18FuzzedDataProvider15ConsumeIntegralIjEET_v:
  195|  21.0k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  21.0k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  21.0k|                                std::numeric_limits<T>::max());
  198|  21.0k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIjEET_S1_S1_:
  205|  29.5k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  29.5k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|  29.5k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  29.5k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 29.5k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  29.5k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  29.5k|  uint64_t result = 0;
  215|  29.5k|  size_t offset = 0;
  216|       |
  217|   116k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 96.7k, False: 19.6k]
  |  Branch (217:43): [True: 88.3k, False: 8.40k]
  ------------------
  218|   116k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 86.8k, False: 1.49k]
  ------------------
  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|  86.8k|    --remaining_bytes_;
  226|  86.8k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  86.8k|    offset += CHAR_BIT;
  228|  86.8k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  29.5k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 29.5k, False: 0]
  ------------------
  232|  29.5k|    result = result % (range + 1);
  233|       |
  234|  29.5k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  29.5k|}
_ZN18FuzzedDataProvider15ConsumeIntegralItEET_v:
  195|  16.9k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  16.9k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  16.9k|                                std::numeric_limits<T>::max());
  198|  16.9k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeItEET_S1_S1_:
  205|  16.9k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  16.9k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|  16.9k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  16.9k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 16.9k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  16.9k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  16.9k|  uint64_t result = 0;
  215|  16.9k|  size_t offset = 0;
  216|       |
  217|  49.1k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 33.0k, False: 16.1k]
  |  Branch (217:43): [True: 33.0k, False: 0]
  ------------------
  218|  49.1k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 32.2k, False: 846]
  ------------------
  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|  32.2k|    --remaining_bytes_;
  226|  32.2k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  32.2k|    offset += CHAR_BIT;
  228|  32.2k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  16.9k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 16.9k, False: 0]
  ------------------
  232|  16.9k|    result = result % (range + 1);
  233|       |
  234|  16.9k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  16.9k|}
_ZN18FuzzedDataProvider15ConsumeIntegralIhEET_v:
  195|   133k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|   133k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|   133k|                                std::numeric_limits<T>::max());
  198|   133k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIhEET_S1_S1_:
  205|   133k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|   133k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|   133k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|   133k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 133k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|   133k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|   133k|  uint64_t result = 0;
  215|   133k|  size_t offset = 0;
  216|       |
  217|   259k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 133k, False: 125k]
  |  Branch (217:43): [True: 133k, False: 0]
  ------------------
  218|   259k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 125k, False: 8.08k]
  ------------------
  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|   125k|    --remaining_bytes_;
  226|   125k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|   125k|    offset += CHAR_BIT;
  228|   125k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|   133k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 133k, False: 0]
  ------------------
  232|   133k|    result = result % (range + 1);
  233|       |
  234|   133k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|   133k|}
_ZN18FuzzedDataProvider20ConsumeBytesAsStringEm:
  137|  8.93k|inline std::string FuzzedDataProvider::ConsumeBytesAsString(size_t num_bytes) {
  138|  8.93k|  static_assert(sizeof(std::string::value_type) == sizeof(uint8_t),
  139|  8.93k|                "ConsumeBytesAsString cannot convert the data to a string.");
  140|       |
  141|  8.93k|  num_bytes = std::min(num_bytes, remaining_bytes_);
  142|  8.93k|  std::string result(
  143|  8.93k|      reinterpret_cast<const std::string::value_type *>(data_ptr_), num_bytes);
  144|  8.93k|  Advance(num_bytes);
  145|  8.93k|  return result;
  146|  8.93k|}
_ZN18FuzzedDataProvider25ConsumeRandomLengthStringEm:
  153|  16.9k|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|  16.9k|  std::string result;
  161|       |
  162|       |  // Reserve the anticipated capacity to prevent several reallocations.
  163|  16.9k|  result.reserve(std::min(max_length, remaining_bytes_));
  164|   163M|  for (size_t i = 0; i < max_length && remaining_bytes_ != 0; ++i) {
  ------------------
  |  Branch (164:22): [True: 163M, False: 2.79k]
  |  Branch (164:40): [True: 163M, False: 8.13k]
  ------------------
  165|   163M|    char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
  166|   163M|    Advance(1);
  167|   163M|    if (next == '\\' && remaining_bytes_ != 0) {
  ------------------
  |  Branch (167:9): [True: 6.99k, False: 163M]
  |  Branch (167:25): [True: 6.97k, False: 17]
  ------------------
  168|  6.97k|      next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
  169|  6.97k|      Advance(1);
  170|  6.97k|      if (next != '\\')
  ------------------
  |  Branch (170:11): [True: 6.02k, False: 953]
  ------------------
  171|  6.02k|        break;
  172|  6.97k|    }
  173|   163M|    result += next;
  174|   163M|  }
  175|       |
  176|  16.9k|  result.shrink_to_fit();
  177|  16.9k|  return result;
  178|  16.9k|}
_ZN18FuzzedDataProvider11ConsumeBoolEv:
  289|   133k|inline bool FuzzedDataProvider::ConsumeBool() {
  290|   133k|  return 1 & ConsumeIntegral<uint8_t>();
  291|   133k|}
_ZN18FuzzedDataProvider14CopyAndAdvanceEPvm:
  339|  15.9k|                                               size_t num_bytes) {
  340|  15.9k|  std::memcpy(destination, data_ptr_, num_bytes);
  341|  15.9k|  Advance(num_bytes);
  342|  15.9k|}
_ZN18FuzzedDataProvider7AdvanceEm:
  344|   163M|inline void FuzzedDataProvider::Advance(size_t num_bytes) {
  345|   163M|  if (num_bytes > remaining_bytes_)
  ------------------
  |  Branch (345:7): [True: 0, False: 163M]
  ------------------
  346|      0|    abort();
  347|       |
  348|   163M|  data_ptr_ += num_bytes;
  349|   163M|  remaining_bytes_ -= num_bytes;
  350|   163M|}
_ZN18FuzzedDataProvider23ConvertUnsignedToSignedIchEET_T0_:
  379|   163M|TS FuzzedDataProvider::ConvertUnsignedToSigned(TU value) {
  380|   163M|  static_assert(sizeof(TS) == sizeof(TU), "Incompatible data types.");
  381|   163M|  static_assert(!std::numeric_limits<TU>::is_signed,
  382|   163M|                "Source type must be unsigned.");
  383|       |
  384|       |  // TODO(Dor1s): change to `if constexpr` once C++17 becomes mainstream.
  385|   163M|  if (std::numeric_limits<TS>::is_modulo)
  ------------------
  |  Branch (385:7): [Folded - Ignored]
  ------------------
  386|      0|    return static_cast<TS>(value);
  387|       |
  388|       |  // Avoid using implementation-defined unsigned to signed conversions.
  389|       |  // To learn more, see https://stackoverflow.com/questions/13150449.
  390|   163M|  if (value <= std::numeric_limits<TS>::max()) {
  ------------------
  |  Branch (390:7): [True: 138M, False: 24.7M]
  ------------------
  391|   138M|    return static_cast<TS>(value);
  392|   138M|  } else {
  393|  24.7M|    constexpr auto TS_min = std::numeric_limits<TS>::min();
  394|  24.7M|    return TS_min + static_cast<TS>(value - TS_min);
  395|  24.7M|  }
  396|   163M|}
_ZN18FuzzedDataProvider12ConsumeBytesIhEENSt3__16vectorIT_NS1_9allocatorIS3_EEEEm:
  109|  16.4k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
  110|  16.4k|  num_bytes = std::min(num_bytes, remaining_bytes_);
  111|  16.4k|  return ConsumeBytes<T>(num_bytes, num_bytes);
  112|  16.4k|}
_ZN18FuzzedDataProvider12ConsumeBytesIhEENSt3__16vectorIT_NS1_9allocatorIS3_EEEEmm:
  353|  16.4k|std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
  354|  16.4k|  static_assert(sizeof(T) == sizeof(uint8_t), "Incompatible data type.");
  355|       |
  356|       |  // The point of using the size-based constructor below is to increase the
  357|       |  // odds of having a vector object with capacity being equal to the length.
  358|       |  // That part is always implementation specific, but at least both libc++ and
  359|       |  // libstdc++ allocate the requested number of bytes in that constructor,
  360|       |  // which seems to be a natural choice for other implementations as well.
  361|       |  // To increase the odds even more, we also call |shrink_to_fit| below.
  362|  16.4k|  std::vector<T> result(size);
  363|  16.4k|  if (size == 0) {
  ------------------
  |  Branch (363:7): [True: 515, False: 15.9k]
  ------------------
  364|    515|    if (num_bytes != 0)
  ------------------
  |  Branch (364:9): [True: 0, False: 515]
  ------------------
  365|      0|      abort();
  366|    515|    return result;
  367|    515|  }
  368|       |
  369|  15.9k|  CopyAndAdvance(result.data(), num_bytes);
  370|       |
  371|       |  // Even though |shrink_to_fit| is also implementation specific, we expect it
  372|       |  // to provide an additional assurance in case vector's constructor allocated
  373|       |  // a buffer which is larger than the actual amount of data we put inside it.
  374|  15.9k|  result.shrink_to_fit();
  375|  15.9k|  return result;
  376|  16.4k|}
_ZN18FuzzedDataProvider16PickValueInArrayI12ServiceFlagsLm7EEET_RAT0__KS2_:
  304|  21.6k|T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
  305|  21.6k|  static_assert(size > 0, "The array must be non empty.");
  306|  21.6k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  307|  21.6k|}
_ZN18FuzzedDataProvider16PickValueInArrayI14ConnectionTypeLm6EEET_RAT0__KS2_:
  304|  8.47k|T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
  305|  8.47k|  static_assert(size > 0, "The array must be non empty.");
  306|  8.47k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  307|  8.47k|}
_ZN18FuzzedDataProvider16PickValueInArrayI18NetPermissionFlagsLm10EEET_RAT0__KS2_:
  304|  4.38k|T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
  305|  4.38k|  static_assert(size > 0, "The array must be non empty.");
  306|  4.38k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  307|  4.38k|}
_ZN18FuzzedDataProvider16PickValueInArrayIiLm18EEET_RKNSt3__15arrayIS1_XT0_EEE:
  310|  4.63k|T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
  311|  4.63k|  static_assert(size > 0, "The array must be non empty.");
  312|  4.63k|  return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
  313|  4.63k|}

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

_Z27process_message_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   54|  8.47k|{
   55|  8.47k|    SeedRandomStateForTest(SeedRand::ZEROS);
   56|  8.47k|    FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
   57|       |
   58|  8.47k|    ConnmanTestMsg& connman = *static_cast<ConnmanTestMsg*>(g_setup->m_node.connman.get());
   59|  8.47k|    auto& chainman = static_cast<TestChainstateManager&>(*g_setup->m_node.chainman);
   60|  8.47k|    SetMockTime(1610000000); // any time to successfully reset ibd
   61|  8.47k|    chainman.ResetIbd();
   62|       |
   63|  8.47k|    LOCK(NetEventsInterface::g_msgproc_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|       |
   65|  8.47k|    const std::string random_message_type{fuzzed_data_provider.ConsumeBytesAsString(CMessageHeader::MESSAGE_TYPE_SIZE).c_str()};
   66|  8.47k|    if (!LIMIT_TO_MESSAGE_TYPE.empty() && random_message_type != LIMIT_TO_MESSAGE_TYPE) {
  ------------------
  |  Branch (66:9): [True: 0, False: 8.47k]
  |  Branch (66:43): [True: 0, False: 0]
  ------------------
   67|      0|        return;
   68|      0|    }
   69|  8.47k|    CNode& p2p_node = *ConsumeNodeAsUniquePtr(fuzzed_data_provider).release();
   70|       |
   71|  8.47k|    connman.AddTestNode(p2p_node);
   72|  8.47k|    FillNode(fuzzed_data_provider, connman, p2p_node);
   73|       |
   74|  8.47k|    const auto mock_time = ConsumeTime(fuzzed_data_provider);
   75|  8.47k|    SetMockTime(mock_time);
   76|       |
   77|  8.47k|    CSerializedNetMsg net_msg;
   78|  8.47k|    net_msg.m_type = random_message_type;
   79|  8.47k|    net_msg.data = ConsumeRandomLengthByteVector(fuzzed_data_provider, MAX_PROTOCOL_MESSAGE_LENGTH);
   80|       |
   81|  8.47k|    connman.FlushSendBuffer(p2p_node);
   82|  8.47k|    (void)connman.ReceiveMsgFrom(p2p_node, std::move(net_msg));
   83|       |
   84|  8.47k|    bool more_work{true};
   85|   446k|    while (more_work) {
  ------------------
  |  Branch (85:12): [True: 438k, False: 8.47k]
  ------------------
   86|   438k|        p2p_node.fPauseSend = false;
   87|   438k|        try {
   88|   438k|            more_work = connman.ProcessMessagesOnce(p2p_node);
   89|   438k|        } catch (const std::ios_base::failure&) {
   90|      0|        }
   91|   438k|        g_setup->m_node.peerman->SendMessages(&p2p_node);
   92|   438k|    }
   93|  8.47k|    g_setup->m_node.validation_signals->SyncWithValidationInterfaceQueue();
   94|  8.47k|    g_setup->m_node.connman->StopNodes();
   95|  8.47k|}

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

_Z29ConsumeRandomLengthByteVectorIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEER18FuzzedDataProviderRKNS0_8optionalImEE:
   58|  8.47k|{
   59|  8.47k|    static_assert(sizeof(B) == 1);
   60|  8.47k|    const std::string s = max_length ?
  ------------------
  |  Branch (60:27): [True: 8.47k, False: 0]
  ------------------
   61|  8.47k|                              fuzzed_data_provider.ConsumeRandomLengthString(*max_length) :
   62|  8.47k|                              fuzzed_data_provider.ConsumeRandomLengthString();
   63|  8.47k|    std::vector<B> ret(s.size());
   64|  8.47k|    std::copy(s.begin(), s.end(), reinterpret_cast<char*>(ret.data()));
   65|  8.47k|    return ret;
   66|  8.47k|}
_Z15ConsumeWeakEnumI12ServiceFlagsLm7EET_R18FuzzedDataProviderRAT0__KS1_:
  134|  33.8k|{
  135|  33.8k|    return fuzzed_data_provider.ConsumeBool() ?
  ------------------
  |  Branch (135:12): [True: 21.6k, False: 12.2k]
  ------------------
  136|  21.6k|               fuzzed_data_provider.PickValueInArray<WeakEnumType>(all_types) :
  137|  33.8k|               WeakEnumType(fuzzed_data_provider.ConsumeIntegral<typename std::underlying_type<WeakEnumType>::type>());
  138|  33.8k|}
_Z15ConsumeWeakEnumI18NetPermissionFlagsLm10EET_R18FuzzedDataProviderRAT0__KS1_:
  134|  8.47k|{
  135|  8.47k|    return fuzzed_data_provider.ConsumeBool() ?
  ------------------
  |  Branch (135:12): [True: 4.38k, False: 4.08k]
  ------------------
  136|  4.38k|               fuzzed_data_provider.PickValueInArray<WeakEnumType>(all_types) :
  137|  8.47k|               WeakEnumType(fuzzed_data_provider.ConsumeIntegral<typename std::underlying_type<WeakEnumType>::type>());
  138|  8.47k|}
_Z14SetFuzzedErrNoIiLm18EEvR18FuzzedDataProviderRKNSt3__15arrayIT_XT0_EEE:
  237|  4.63k|{
  238|  4.63k|    errno = fuzzed_data_provider.PickValueInArray(errnos);
  239|  4.63k|}

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

_Z14ConsumeNetAddrR18FuzzedDataProviderP17FastRandomContext:
   29|  16.9k|{
   30|  16.9k|    struct NetAux {
   31|  16.9k|        Network net;
   32|  16.9k|        CNetAddr::BIP155Network bip155;
   33|  16.9k|        size_t len;
   34|  16.9k|    };
   35|       |
   36|  16.9k|    static constexpr std::array<NetAux, 6> nets{
   37|  16.9k|        NetAux{.net = Network::NET_IPV4, .bip155 = CNetAddr::BIP155Network::IPV4, .len = ADDR_IPV4_SIZE},
   38|  16.9k|        NetAux{.net = Network::NET_IPV6, .bip155 = CNetAddr::BIP155Network::IPV6, .len = ADDR_IPV6_SIZE},
   39|  16.9k|        NetAux{.net = Network::NET_ONION, .bip155 = CNetAddr::BIP155Network::TORV3, .len = ADDR_TORV3_SIZE},
   40|  16.9k|        NetAux{.net = Network::NET_I2P, .bip155 = CNetAddr::BIP155Network::I2P, .len = ADDR_I2P_SIZE},
   41|  16.9k|        NetAux{.net = Network::NET_CJDNS, .bip155 = CNetAddr::BIP155Network::CJDNS, .len = ADDR_CJDNS_SIZE},
   42|  16.9k|        NetAux{.net = Network::NET_INTERNAL, .bip155 = CNetAddr::BIP155Network{0}, .len = 0},
   43|  16.9k|    };
   44|       |
   45|  16.9k|    const size_t nets_index{rand == nullptr
  ------------------
  |  Branch (45:29): [True: 16.9k, False: 0]
  ------------------
   46|  16.9k|        ? fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, nets.size() - 1)
   47|  16.9k|        : static_cast<size_t>(rand->randrange(nets.size()))};
   48|       |
   49|  16.9k|    const auto& aux = nets[nets_index];
   50|       |
   51|  16.9k|    CNetAddr addr;
   52|       |
   53|  16.9k|    if (aux.net == Network::NET_INTERNAL) {
  ------------------
  |  Branch (53:9): [True: 463, False: 16.4k]
  ------------------
   54|    463|        if (rand == nullptr) {
  ------------------
  |  Branch (54:13): [True: 463, False: 0]
  ------------------
   55|    463|            addr.SetInternal(fuzzed_data_provider.ConsumeBytesAsString(32));
   56|    463|        } else {
   57|      0|            const auto v = rand->randbytes(32);
   58|      0|            addr.SetInternal(std::string{v.begin(), v.end()});
   59|      0|        }
   60|    463|        return addr;
   61|    463|    }
   62|       |
   63|  16.4k|    DataStream s;
   64|       |
   65|  16.4k|    s << static_cast<uint8_t>(aux.bip155);
   66|       |
   67|  16.4k|    std::vector<uint8_t> addr_bytes;
   68|  16.4k|    if (rand == nullptr) {
  ------------------
  |  Branch (68:9): [True: 16.4k, False: 0]
  ------------------
   69|  16.4k|        addr_bytes = fuzzed_data_provider.ConsumeBytes<uint8_t>(aux.len);
   70|  16.4k|        addr_bytes.resize(aux.len);
   71|  16.4k|    } else {
   72|      0|        addr_bytes = rand->randbytes(aux.len);
   73|      0|    }
   74|  16.4k|    if (aux.net == NET_IPV6 && addr_bytes[0] == CJDNS_PREFIX) { // Avoid generating IPv6 addresses that look like CJDNS.
  ------------------
  |  Branch (74:9): [True: 1.33k, False: 15.1k]
  |  Branch (74:32): [True: 4, False: 1.33k]
  ------------------
   75|      4|        addr_bytes[0] = 0x55; // Just an arbitrary number, anything != CJDNS_PREFIX would do.
   76|      4|    }
   77|  16.4k|    if (aux.net == NET_CJDNS) { // Avoid generating CJDNS addresses that don't start with CJDNS_PREFIX because those are !IsValid().
  ------------------
  |  Branch (77:9): [True: 681, False: 15.8k]
  ------------------
   78|    681|        addr_bytes[0] = CJDNS_PREFIX;
   79|    681|    }
   80|  16.4k|    s << addr_bytes;
   81|       |
   82|  16.4k|    s >> CAddress::V2_NETWORK(addr);
   83|       |
   84|  16.4k|    return addr;
   85|  16.9k|}
_Z14ConsumeAddressR18FuzzedDataProvider:
   88|  16.9k|{
   89|  16.9k|    return {ConsumeService(fuzzed_data_provider), ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS), NodeSeconds{std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<uint32_t>()}}};
   90|  16.9k|}
_ZN10FuzzedSockC2ER18FuzzedDataProvider:
  114|  8.47k|    : Sock{fuzzed_data_provider.ConsumeIntegralInRange<SOCKET>(INVALID_SOCKET - 1, INVALID_SOCKET)},
  ------------------
  |  |   56|  8.47k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
                  : Sock{fuzzed_data_provider.ConsumeIntegralInRange<SOCKET>(INVALID_SOCKET - 1, INVALID_SOCKET)},
  ------------------
  |  |   56|  8.47k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  115|  8.47k|      m_fuzzed_data_provider{fuzzed_data_provider},
  116|  8.47k|      m_selectable{fuzzed_data_provider.ConsumeBool()}
  117|  8.47k|{
  118|  8.47k|}
_ZN10FuzzedSockD2Ev:
  121|  8.47k|{
  122|       |    // Sock::~Sock() will be called after FuzzedSock::~FuzzedSock() and it will call
  123|       |    // close(m_socket) if m_socket is not INVALID_SOCKET.
  124|       |    // Avoid closing an arbitrary file descriptor (m_socket is just a random very high number which
  125|       |    // theoretically may concide with a real opened file descriptor).
  126|  8.47k|    m_socket = INVALID_SOCKET;
  ------------------
  |  |   56|  8.47k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  127|  8.47k|}
_ZNK10FuzzedSock4SendEPKvmi:
  136|  60.8k|{
  137|  60.8k|    constexpr std::array send_errnos{
  138|  60.8k|        EACCES,
  139|  60.8k|        EAGAIN,
  140|  60.8k|        EALREADY,
  141|  60.8k|        EBADF,
  142|  60.8k|        ECONNRESET,
  143|  60.8k|        EDESTADDRREQ,
  144|  60.8k|        EFAULT,
  145|  60.8k|        EINTR,
  146|  60.8k|        EINVAL,
  147|  60.8k|        EISCONN,
  148|  60.8k|        EMSGSIZE,
  149|  60.8k|        ENOBUFS,
  150|  60.8k|        ENOMEM,
  151|  60.8k|        ENOTCONN,
  152|  60.8k|        ENOTSOCK,
  153|  60.8k|        EOPNOTSUPP,
  154|  60.8k|        EPIPE,
  155|  60.8k|        EWOULDBLOCK,
  156|  60.8k|    };
  157|  60.8k|    if (m_fuzzed_data_provider.ConsumeBool()) {
  ------------------
  |  Branch (157:9): [True: 41.9k, False: 18.9k]
  ------------------
  158|  41.9k|        return len;
  159|  41.9k|    }
  160|  18.9k|    const ssize_t r = m_fuzzed_data_provider.ConsumeIntegralInRange<ssize_t>(-1, len);
  161|  18.9k|    if (r == -1) {
  ------------------
  |  Branch (161:9): [True: 4.63k, False: 14.2k]
  ------------------
  162|  4.63k|        SetFuzzedErrNo(m_fuzzed_data_provider, send_errnos);
  163|  4.63k|    }
  164|  18.9k|    return r;
  165|  60.8k|}
_Z8FillNodeR18FuzzedDataProviderR14ConnmanTestMsgR5CNode:
  416|  8.47k|{
  417|  8.47k|    auto successfully_connected = fuzzed_data_provider.ConsumeBool();
  418|  8.47k|    auto remote_services = ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS);
  419|  8.47k|    auto local_services = ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS);
  420|  8.47k|    auto version = fuzzed_data_provider.ConsumeIntegralInRange<int32_t>(MIN_PEER_PROTO_VERSION, std::numeric_limits<int32_t>::max());
  421|  8.47k|    auto relay_txs = fuzzed_data_provider.ConsumeBool();
  422|  8.47k|    connman.Handshake(node, successfully_connected, remote_services, local_services, version, relay_txs);
  423|  8.47k|}

_Z14ConsumeServiceR18FuzzedDataProvider:
  214|  16.9k|{
  215|  16.9k|    return {ConsumeNetAddr(fuzzed_data_provider), fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
  216|  16.9k|}
_Z11ConsumeNodeILb1EEDaR18FuzzedDataProviderRKNSt3__18optionalIlEE:
  222|  8.47k|{
  223|  8.47k|    const NodeId node_id = node_id_in.value_or(fuzzed_data_provider.ConsumeIntegralInRange<NodeId>(0, std::numeric_limits<NodeId>::max()));
  224|  8.47k|    const auto sock = std::make_shared<FuzzedSock>(fuzzed_data_provider);
  225|  8.47k|    const CAddress address = ConsumeAddress(fuzzed_data_provider);
  226|  8.47k|    const uint64_t keyed_net_group = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  227|  8.47k|    const uint64_t local_host_nonce = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
  228|  8.47k|    const CAddress addr_bind = ConsumeAddress(fuzzed_data_provider);
  229|  8.47k|    const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
  230|  8.47k|    const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES);
  231|  8.47k|    const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
  ------------------
  |  Branch (231:30): [True: 5.16k, False: 3.31k]
  ------------------
  232|  8.47k|    NetPermissionFlags permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
  233|  8.47k|    if constexpr (ReturnUniquePtr) {
  234|  8.47k|        return std::make_unique<CNode>(node_id,
  235|  8.47k|                                       sock,
  236|  8.47k|                                       address,
  237|  8.47k|                                       keyed_net_group,
  238|  8.47k|                                       local_host_nonce,
  239|  8.47k|                                       addr_bind,
  240|  8.47k|                                       addr_name,
  241|  8.47k|                                       conn_type,
  242|  8.47k|                                       inbound_onion,
  243|  8.47k|                                       CNodeOptions{ .permission_flags = permission_flags });
  244|       |    } else {
  245|       |        return CNode{node_id,
  246|       |                     sock,
  247|       |                     address,
  248|       |                     keyed_net_group,
  249|       |                     local_host_nonce,
  250|       |                     addr_bind,
  251|       |                     addr_name,
  252|       |                     conn_type,
  253|       |                     inbound_onion,
  254|       |                     CNodeOptions{ .permission_flags = permission_flags }};
  255|       |    }
  256|  8.47k|}
_Z22ConsumeNodeAsUniquePtrR18FuzzedDataProviderRKNSt3__18optionalIlEE:
  257|  8.47k|inline std::unique_ptr<CNode> ConsumeNodeAsUniquePtr(FuzzedDataProvider& fdp, const std::optional<NodeId>& node_id_in = std::nullopt) { return ConsumeNode<true>(fdp, node_id_in); }

_ZN14ConnmanTestMsg9HandshakeER5CNodeb12ServiceFlagsS2_ib:
   29|  8.47k|{
   30|  8.47k|    auto& peerman{static_cast<PeerManager&>(*m_msgproc)};
   31|  8.47k|    auto& connman{*this};
   32|       |
   33|  8.47k|    peerman.InitializeNode(node, local_services);
   34|  8.47k|    peerman.SendMessages(&node);
   35|  8.47k|    FlushSendBuffer(node); // Drop the version message added by SendMessages.
   36|       |
   37|  8.47k|    CSerializedNetMsg msg_version{
   38|  8.47k|        NetMsg::Make(NetMsgType::VERSION,
   39|  8.47k|                version,                                        //
   40|  8.47k|                Using<CustomUintFormatter<8>>(remote_services), //
   41|  8.47k|                int64_t{},                                      // dummy time
   42|  8.47k|                int64_t{},                                      // ignored service bits
   43|  8.47k|                CNetAddr::V1(CService{}),                       // dummy
   44|  8.47k|                int64_t{},                                      // ignored service bits
   45|  8.47k|                CNetAddr::V1(CService{}),                       // ignored
   46|  8.47k|                uint64_t{1},                                    // dummy nonce
   47|  8.47k|                std::string{},                                  // dummy subver
   48|  8.47k|                int32_t{},                                      // dummy starting_height
   49|  8.47k|                relay_txs),
   50|  8.47k|    };
   51|       |
   52|  8.47k|    (void)connman.ReceiveMsgFrom(node, std::move(msg_version));
   53|  8.47k|    node.fPauseSend = false;
   54|  8.47k|    connman.ProcessMessagesOnce(node);
   55|  8.47k|    peerman.SendMessages(&node);
   56|  8.47k|    FlushSendBuffer(node); // Drop the verack message added by SendMessages.
   57|  8.47k|    if (node.fDisconnect) return;
  ------------------
  |  Branch (57:9): [True: 731, False: 7.74k]
  ------------------
   58|  7.74k|    assert(node.nVersion == version);
   59|  7.74k|    assert(node.GetCommonVersion() == std::min(version, PROTOCOL_VERSION));
   60|  7.74k|    CNodeStateStats statestats;
   61|  7.74k|    assert(peerman.GetNodeStateStats(node.GetId(), statestats));
   62|  7.74k|    assert(statestats.m_relay_txs == (relay_txs && !node.IsBlockOnlyConn()));
   63|  7.74k|    assert(statestats.their_services == remote_services);
   64|  7.74k|    if (successfully_connected) {
  ------------------
  |  Branch (64:9): [True: 7.57k, False: 171]
  ------------------
   65|  7.57k|        CSerializedNetMsg msg_verack{NetMsg::Make(NetMsgType::VERACK)};
   66|  7.57k|        (void)connman.ReceiveMsgFrom(node, std::move(msg_verack));
   67|  7.57k|        node.fPauseSend = false;
   68|  7.57k|        connman.ProcessMessagesOnce(node);
   69|  7.57k|        peerman.SendMessages(&node);
   70|  7.57k|        assert(node.fSuccessfullyConnected == true);
   71|  7.57k|    }
   72|  7.74k|}
_ZNK14ConnmanTestMsg19NodeReceiveMsgBytesER5CNode4SpanIKhERb:
   75|  40.4k|{
   76|  40.4k|    assert(node.ReceiveMsgBytes(msg_bytes, complete));
   77|  40.4k|    if (complete) {
  ------------------
  |  Branch (77:9): [True: 24.1k, False: 16.2k]
  ------------------
   78|  24.1k|        node.MarkReceivedMsgsForProcessing();
   79|  24.1k|    }
   80|  40.4k|}
_ZNK14ConnmanTestMsg15FlushSendBufferER5CNode:
   83|  25.4k|{
   84|  25.4k|    LOCK(node.cs_vSend);
  ------------------
  |  |  257|  25.4k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  25.4k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  25.4k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  25.4k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|  25.4k|    node.vSendMsg.clear();
   86|  25.4k|    node.m_send_memusage = 0;
   87|  49.5k|    while (true) {
  ------------------
  |  Branch (87:12): [Folded - Ignored]
  ------------------
   88|  49.5k|        const auto& [to_send, _more, _msg_type] = node.m_transport->GetBytesToSend(false);
   89|  49.5k|        if (to_send.empty()) break;
  ------------------
  |  Branch (89:13): [True: 25.4k, False: 24.1k]
  ------------------
   90|  24.1k|        node.m_transport->MarkBytesSent(to_send.size());
   91|  24.1k|    }
   92|  25.4k|}
_ZNK14ConnmanTestMsg14ReceiveMsgFromER5CNodeO17CSerializedNetMsg:
   95|  24.5k|{
   96|  24.5k|    bool queued = node.m_transport->SetMessageToSend(ser_msg);
   97|  24.5k|    assert(queued);
   98|  24.5k|    bool complete{false};
   99|  65.0k|    while (true) {
  ------------------
  |  Branch (99:12): [Folded - Ignored]
  ------------------
  100|  65.0k|        const auto& [to_send, _more, _msg_type] = node.m_transport->GetBytesToSend(false);
  101|  65.0k|        if (to_send.empty()) break;
  ------------------
  |  Branch (101:13): [True: 24.5k, False: 40.4k]
  ------------------
  102|  40.4k|        NodeReceiveMsgBytes(node, to_send, complete);
  103|  40.4k|        node.m_transport->MarkBytesSent(to_send.size());
  104|  40.4k|    }
  105|  24.5k|    return complete;
  106|  24.5k|}

_ZN14ConnmanTestMsg11AddTestNodeER5CNode:
   55|  8.47k|    {
   56|  8.47k|        LOCK(m_nodes_mutex);
  ------------------
  |  |  257|  8.47k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  8.47k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  8.47k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  8.47k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|  8.47k|        m_nodes.push_back(&node);
   58|       |
   59|  8.47k|        if (node.IsManualOrFullOutboundConn()) ++m_network_conn_counts[node.addr.GetNetwork()];
  ------------------
  |  Branch (59:13): [True: 2.94k, False: 5.53k]
  ------------------
   60|  8.47k|    }
_ZN14ConnmanTestMsg19ProcessMessagesOnceER5CNode:
   80|   454k|    {
   81|   454k|        return m_msgproc->ProcessMessages(&node, flagInterruptMsgProc);
   82|   454k|    }

_Z22SeedRandomStateForTest8SeedRand:
   20|  8.47k|{
   21|  8.47k|    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|  8.47k|    static const auto g_ctx_seed = []() -> std::optional<uint256> {
   28|  8.47k|        if constexpr (G_FUZZING) return {};
   29|       |        // If RANDOM_CTX_SEED is set, use that as seed.
   30|  8.47k|        if (const char* num{std::getenv(RANDOM_CTX_SEED)}) {
   31|  8.47k|            if (auto num_parsed{uint256::FromUserHex(num)}) {
   32|  8.47k|                return *num_parsed;
   33|  8.47k|            } else {
   34|  8.47k|                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|  8.47k|                std::abort();
   36|  8.47k|            }
   37|  8.47k|        }
   38|       |        // Otherwise use a (truly) random value.
   39|  8.47k|        return GetRandHash();
   40|  8.47k|    }();
   41|       |
   42|  8.47k|    g_seeded_g_prng_zero = seedtype == SeedRand::ZEROS;
   43|  8.47k|    if constexpr (G_FUZZING) {
   44|  8.47k|        Assert(g_seeded_g_prng_zero); // Only SeedRandomStateForTest(SeedRand::ZEROS) is allowed in fuzz tests
  ------------------
  |  |   85|  8.47k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   45|  8.47k|        Assert(!g_used_g_prng);       // The global PRNG must not have been used before SeedRandomStateForTest(SeedRand::ZEROS)
  ------------------
  |  |   85|  8.47k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   46|  8.47k|    }
   47|  8.47k|    const uint256& seed{seedtype == SeedRand::FIXED_SEED ? g_ctx_seed.value() : uint256::ZERO};
  ------------------
  |  Branch (47:25): [True: 0, False: 8.47k]
  ------------------
   48|  8.47k|    LogInfo("Setting random seed for current tests to %s=%s\n", RANDOM_CTX_SEED, seed.GetHex());
  ------------------
  |  |  261|  8.47k|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|  8.47k|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
   49|  8.47k|    MakeRandDeterministicDANGEROUS(seed);
   50|  8.47k|}

_ZN17BasicTestingSetupD2Ev:
  199|      2|{
  200|      2|    m_node.ecc_context.reset();
  201|      2|    m_node.kernel.reset();
  202|       |    if constexpr (!G_FUZZING) {
  203|       |        SetMockTime(0s); // Reset mocktime for following tests
  204|       |    }
  205|      2|    LogInstance().DisconnectTestLogger();
  206|      2|    if (m_has_custom_datadir) {
  ------------------
  |  Branch (206:9): [True: 0, False: 2]
  ------------------
  207|       |        // Only remove the lock file, preserve the data directory.
  208|      0|        UnlockDirectory(m_path_lock, ".lock");
  209|      0|        fs::remove(m_path_lock / ".lock");
  210|      2|    } else {
  211|      2|        fs::remove_all(m_path_root);
  212|      2|    }
  213|      2|    gArgs.ClearArgs();
  214|      2|}
_ZN17ChainTestingSetupD2Ev:
  267|      2|{
  268|      2|    if (m_node.scheduler) m_node.scheduler->stop();
  ------------------
  |  Branch (268:9): [True: 2, False: 0]
  ------------------
  269|      2|    if (m_node.validation_signals) m_node.validation_signals->FlushBackgroundCallbacks();
  ------------------
  |  Branch (269:9): [True: 2, False: 0]
  ------------------
  270|      2|    m_node.connman.reset();
  271|      2|    m_node.banman.reset();
  272|      2|    m_node.addrman.reset();
  273|      2|    m_node.netgroupman.reset();
  274|      2|    m_node.args = nullptr;
  275|      2|    m_node.mempool.reset();
  276|      2|    Assert(!m_node.fee_estimator); // Each test must create a local object, if they wish to use the fee_estimator
  ------------------
  |  |   85|      2|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  277|      2|    m_node.chainman.reset();
  278|      2|    m_node.validation_signals.reset();
  279|      2|    m_node.scheduler.reset();
  280|      2|}

_ZN21TestChainstateManager8ResetIbdEv:
   13|  8.47k|{
   14|  8.47k|    m_cached_finished_ibd = false;
   15|  8.47k|    assert(IsInitialBlockDownload());
   16|  8.47k|}

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

_ZN10tinyformat13RuntimeFormatC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  3.18k|    explicit RuntimeFormat(LIFETIMEBOUND const std::string& str) : fmt{str} {}
_ZNK10tinyformat6detail9FormatArg6formatERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_i:
  541|  25.1k|        {
  542|  25.1k|            TINYFORMAT_ASSERT(m_value);
  ------------------
  |  |  153|  25.1k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  543|  25.1k|            TINYFORMAT_ASSERT(m_formatImpl);
  ------------------
  |  |  153|  25.1k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  544|  25.1k|            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);
  545|  25.1k|        }
_ZN10tinyformat10FormatListC2EPNS_6detail9FormatArgEi:
  966|  14.8k|            : m_args(args), m_N(N) { }
_ZN10tinyformat11formatValueERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcS7_ih:
  385|  8.77k|                        const char* fmtEnd, int /**/, charType value) \
  386|  8.77k|{                                                                     \
  387|  8.77k|    switch (*(fmtEnd-1)) {                                            \
  388|  8.77k|        case 'u': case 'd': case 'i': case 'o': case 'X': case 'x':   \
  ------------------
  |  Branch (388:9): [True: 8.77k, False: 0]
  |  Branch (388:19): [True: 0, False: 8.77k]
  |  Branch (388:29): [True: 0, False: 8.77k]
  |  Branch (388:39): [True: 0, False: 8.77k]
  |  Branch (388:49): [True: 0, False: 8.77k]
  |  Branch (388:59): [True: 0, False: 8.77k]
  ------------------
  389|  8.77k|            out << static_cast<int>(value); break;                    \
  390|  8.77k|        default:                                                      \
  ------------------
  |  Branch (390:9): [True: 0, False: 8.77k]
  ------------------
  391|      0|            out << value;                   break;                    \
  392|  8.77k|    }                                                                 \
  393|  8.77k|}
_ZN10tinyformat6detail18parseIntAndAdvanceERPKc:
  578|  1.75k|{
  579|  1.75k|    int i = 0;
  580|  5.27k|    for (;*c >= '0' && *c <= '9'; ++c)
  ------------------
  |  Branch (580:11): [True: 5.27k, False: 0]
  |  Branch (580:24): [True: 3.51k, False: 1.75k]
  ------------------
  581|  3.51k|        i = 10*i + (*c - '0');
  582|  1.75k|    return i;
  583|  1.75k|}
_ZN10tinyformat6detail21parseWidthOrPrecisionERiRPKcbPKNS0_9FormatArgES1_i:
  593|  23.3k|{
  594|  23.3k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (594:9): [True: 23.3k, False: 0]
  |  Branch (594:22): [True: 0, False: 23.3k]
  ------------------
  595|      0|        n = parseIntAndAdvance(c);
  596|      0|    }
  597|  23.3k|    else if (*c == '*') {
  ------------------
  |  Branch (597:14): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|    else {
  618|  23.3k|        return false;
  619|  23.3k|    }
  620|      0|    return true;
  621|  23.3k|}
_ZN10tinyformat6detail24printFormatStringLiteralERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKc:
  629|  39.9k|{
  630|  39.9k|    const char* c = fmt;
  631|  3.25M|    for (;; ++c) {
  632|  3.25M|        if (*c == '\0') {
  ------------------
  |  Branch (632:13): [True: 14.8k, False: 3.23M]
  ------------------
  633|  14.8k|            out.write(fmt, c - fmt);
  634|  14.8k|            return c;
  635|  14.8k|        }
  636|  3.23M|        else if (*c == '%') {
  ------------------
  |  Branch (636:18): [True: 25.1k, False: 3.21M]
  ------------------
  637|  25.1k|            out.write(fmt, c - fmt);
  638|  25.1k|            if (*(c+1) != '%')
  ------------------
  |  Branch (638:17): [True: 25.1k, False: 0]
  ------------------
  639|  25.1k|                return c;
  640|       |            // for "%%", tack trailing % onto next literal section.
  641|      0|            fmt = ++c;
  642|      0|        }
  643|  3.25M|    }
  644|  39.9k|}
_ZN10tinyformat6detail21streamStateFromFormatERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERbS7_RiPKcPKNS0_9FormatArgES8_i:
  685|  25.1k|{
  686|  25.1k|    TINYFORMAT_ASSERT(*fmtStart == '%');
  ------------------
  |  |  153|  25.1k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  687|       |    // Reset stream state to defaults.
  688|  25.1k|    out.width(0);
  689|  25.1k|    out.precision(6);
  690|  25.1k|    out.fill(' ');
  691|       |    // Reset most flags; ignore irrelevant unitbuf & skipws.
  692|  25.1k|    out.unsetf(std::ios::adjustfield | std::ios::basefield |
  693|  25.1k|               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |
  694|  25.1k|               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);
  695|  25.1k|    bool precisionSet = false;
  696|  25.1k|    bool widthSet = false;
  697|  25.1k|    int widthExtra = 0;
  698|  25.1k|    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|  25.1k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (702:9): [True: 25.1k, False: 0]
  |  Branch (702:22): [True: 1.75k, False: 23.3k]
  ------------------
  703|  1.75k|        const char tmpc = *c;
  704|  1.75k|        int value = parseIntAndAdvance(c);
  705|  1.75k|        if (*c == '$') {
  ------------------
  |  Branch (705:13): [True: 0, False: 1.75k]
  ------------------
  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|  1.75k|        else if (positionalMode) {
  ------------------
  |  Branch (714:18): [True: 0, False: 1.75k]
  ------------------
  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|  1.75k|        else {
  718|  1.75k|            if (tmpc == '0') {
  ------------------
  |  Branch (718:17): [True: 1.75k, False: 0]
  ------------------
  719|       |                // Use internal padding so that numeric values are
  720|       |                // formatted correctly, eg -00010 rather than 000-10
  721|  1.75k|                out.fill('0');
  722|  1.75k|                out.setf(std::ios::internal, std::ios::adjustfield);
  723|  1.75k|            }
  724|  1.75k|            if (value != 0) {
  ------------------
  |  Branch (724:17): [True: 1.75k, False: 0]
  ------------------
  725|       |                // Nonzero value means that we parsed width.
  726|  1.75k|                widthSet = true;
  727|  1.75k|                out.width(value);
  728|  1.75k|            }
  729|  1.75k|        }
  730|  1.75k|    }
  731|  23.3k|    else if (positionalMode) {
  ------------------
  |  Branch (731:14): [True: 0, False: 23.3k]
  ------------------
  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|  25.1k|    if (!widthSet) {
  ------------------
  |  Branch (735:9): [True: 23.3k, False: 1.75k]
  ------------------
  736|       |        // Parse flags
  737|  23.3k|        for (;; ++c) {
  738|  23.3k|            switch (*c) {
  739|      0|                case '#':
  ------------------
  |  Branch (739:17): [True: 0, False: 23.3k]
  ------------------
  740|      0|                    out.setf(std::ios::showpoint | std::ios::showbase);
  741|      0|                    continue;
  742|      0|                case '0':
  ------------------
  |  Branch (742:17): [True: 0, False: 23.3k]
  ------------------
  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: 23.3k]
  ------------------
  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: 23.3k]
  ------------------
  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: 23.3k]
  ------------------
  761|      0|                    out.setf(std::ios::showpos);
  762|      0|                    spacePadPositive = false;
  763|      0|                    widthExtra = 1;
  764|      0|                    continue;
  765|  23.3k|                default:
  ------------------
  |  Branch (765:17): [True: 23.3k, False: 0]
  ------------------
  766|  23.3k|                    break;
  767|  23.3k|            }
  768|  23.3k|            break;
  769|  23.3k|        }
  770|       |        // Parse width
  771|  23.3k|        int width = 0;
  772|  23.3k|        widthSet = parseWidthOrPrecision(width, c, positionalMode,
  773|  23.3k|                                         args, argIndex, numArgs);
  774|  23.3k|        if (widthSet) {
  ------------------
  |  Branch (774:13): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|    }
  784|       |    // 3) Parse precision
  785|  25.1k|    if (*c == '.') {
  ------------------
  |  Branch (785:9): [True: 0, False: 25.1k]
  ------------------
  786|      0|        ++c;
  787|      0|        int precision = 0;
  788|      0|        parseWidthOrPrecision(precision, c, positionalMode,
  789|      0|                              args, argIndex, numArgs);
  790|       |        // Presence of `.` indicates precision set, unless the inferred value
  791|       |        // was negative in which case the default is used.
  792|      0|        precisionSet = precision >= 0;
  793|      0|        if (precisionSet)
  ------------------
  |  Branch (793:13): [True: 0, False: 0]
  ------------------
  794|      0|            out.precision(precision);
  795|      0|    }
  796|       |    // 4) Ignore any C99 length modifier
  797|  25.1k|    while (*c == 'l' || *c == 'h' || *c == 'L' ||
  ------------------
  |  Branch (797:12): [True: 0, False: 25.1k]
  |  Branch (797:25): [True: 0, False: 25.1k]
  |  Branch (797:38): [True: 0, False: 25.1k]
  ------------------
  798|  25.1k|           *c == 'j' || *c == 'z' || *c == 't') {
  ------------------
  |  Branch (798:12): [True: 0, False: 25.1k]
  |  Branch (798:25): [True: 0, False: 25.1k]
  |  Branch (798:38): [True: 0, False: 25.1k]
  ------------------
  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|  25.1k|    bool intConversion = false;
  805|  25.1k|    switch (*c) {
  806|  20.0k|        case 'u': case 'd': case 'i':
  ------------------
  |  Branch (806:9): [True: 13.1k, False: 11.9k]
  |  Branch (806:19): [True: 6.90k, False: 18.2k]
  |  Branch (806:29): [True: 0, False: 25.1k]
  ------------------
  807|  20.0k|            out.setf(std::ios::dec, std::ios::basefield);
  808|  20.0k|            intConversion = true;
  809|  20.0k|            break;
  810|      0|        case 'o':
  ------------------
  |  Branch (810:9): [True: 0, False: 25.1k]
  ------------------
  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: 25.1k]
  ------------------
  815|      0|            out.setf(std::ios::uppercase);
  816|      0|            [[fallthrough]];
  817|  1.55k|        case 'x': case 'p':
  ------------------
  |  Branch (817:9): [True: 1.55k, False: 23.5k]
  |  Branch (817:19): [True: 0, False: 25.1k]
  ------------------
  818|  1.55k|            out.setf(std::ios::hex, std::ios::basefield);
  819|  1.55k|            intConversion = true;
  820|  1.55k|            break;
  821|      0|        case 'E':
  ------------------
  |  Branch (821:9): [True: 0, False: 25.1k]
  ------------------
  822|      0|            out.setf(std::ios::uppercase);
  823|      0|            [[fallthrough]];
  824|      0|        case 'e':
  ------------------
  |  Branch (824:9): [True: 0, False: 25.1k]
  ------------------
  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: 25.1k]
  ------------------
  829|      0|            out.setf(std::ios::uppercase);
  830|      0|            [[fallthrough]];
  831|      0|        case 'f':
  ------------------
  |  Branch (831:9): [True: 0, False: 25.1k]
  ------------------
  832|      0|            out.setf(std::ios::fixed, std::ios::floatfield);
  833|      0|            break;
  834|      0|        case 'A':
  ------------------
  |  Branch (834:9): [True: 0, False: 25.1k]
  ------------------
  835|      0|            out.setf(std::ios::uppercase);
  836|      0|            [[fallthrough]];
  837|      0|        case 'a':
  ------------------
  |  Branch (837:9): [True: 0, False: 25.1k]
  ------------------
  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: 25.1k]
  ------------------
  847|      0|            out.setf(std::ios::uppercase);
  848|      0|            [[fallthrough]];
  849|      0|        case 'g':
  ------------------
  |  Branch (849:9): [True: 0, False: 25.1k]
  ------------------
  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: 25.1k]
  ------------------
  855|       |            // Handled as special case inside formatValue()
  856|      0|            break;
  857|  3.52k|        case 's':
  ------------------
  |  Branch (857:9): [True: 3.52k, False: 21.5k]
  ------------------
  858|  3.52k|            if (precisionSet)
  ------------------
  |  Branch (858:17): [True: 0, False: 3.52k]
  ------------------
  859|      0|                ntrunc = static_cast<int>(out.precision());
  860|       |            // Make %s print Booleans as "true" and "false"
  861|  3.52k|            out.setf(std::ios::boolalpha);
  862|  3.52k|            break;
  863|      0|        case 'n':
  ------------------
  |  Branch (863:9): [True: 0, False: 25.1k]
  ------------------
  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: 25.1k]
  ------------------
  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: 25.1k]
  ------------------
  872|      0|            break;
  873|  25.1k|    }
  874|  25.1k|    if (intConversion && precisionSet && !widthSet) {
  ------------------
  |  Branch (874:9): [True: 21.5k, False: 3.52k]
  |  Branch (874:26): [True: 0, False: 21.5k]
  |  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|  25.1k|    return c+1;
  884|  25.1k|}
_ZN10tinyformat6detail10formatImplERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcPKNS0_9FormatArgEi:
  891|  14.8k|{
  892|       |    // Saved stream state
  893|  14.8k|    std::streamsize origWidth = out.width();
  894|  14.8k|    std::streamsize origPrecision = out.precision();
  895|  14.8k|    std::ios::fmtflags origFlags = out.flags();
  896|  14.8k|    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|  14.8k|    bool positionalMode = false;
  901|  14.8k|    int argIndex = 0;
  902|  39.9k|    while (true) {
  ------------------
  |  Branch (902:12): [Folded - Ignored]
  ------------------
  903|  39.9k|        fmt = printFormatStringLiteral(out, fmt);
  904|  39.9k|        if (*fmt == '\0') {
  ------------------
  |  Branch (904:13): [True: 14.8k, False: 25.1k]
  ------------------
  905|  14.8k|            if (!positionalMode && argIndex < numArgs) {
  ------------------
  |  Branch (905:17): [True: 14.8k, False: 0]
  |  Branch (905:36): [True: 0, False: 14.8k]
  ------------------
  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|  14.8k|            break;
  909|  14.8k|        }
  910|  25.1k|        bool spacePadPositive = false;
  911|  25.1k|        int ntrunc = -1;
  912|  25.1k|        const char* fmtEnd = streamStateFromFormat(out, positionalMode, spacePadPositive, ntrunc, fmt,
  913|  25.1k|                                                   args, argIndex, numArgs);
  914|       |        // NB: argIndex may be incremented by reading variable width/precision
  915|       |        // in `streamStateFromFormat`, so do the bounds check here.
  916|  25.1k|        if (argIndex >= numArgs) {
  ------------------
  |  Branch (916:13): [True: 0, False: 25.1k]
  ------------------
  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|  25.1k|        const FormatArg& arg = args[argIndex];
  921|       |        // Format the arg into the stream.
  922|  25.1k|        if (!spacePadPositive) {
  ------------------
  |  Branch (922:13): [True: 25.1k, False: 0]
  ------------------
  923|  25.1k|            arg.format(out, fmt, fmtEnd, ntrunc);
  924|  25.1k|        }
  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|  25.1k|        if (!positionalMode)
  ------------------
  |  Branch (941:13): [True: 25.1k, False: 0]
  ------------------
  942|  25.1k|            ++argIndex;
  943|  25.1k|        fmt = fmtEnd;
  944|  25.1k|    }
  945|       |
  946|       |    // Restore stream state
  947|  14.8k|    out.width(origWidth);
  948|  14.8k|    out.precision(origPrecision);
  949|  14.8k|    out.flags(origFlags);
  950|  14.8k|    out.fill(origFill);
  951|  14.8k|}
_ZN10tinyformat7vformatERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcRKNS_10FormatListE:
 1070|  14.8k|{
 1071|  14.8k|    detail::formatImpl(out, fmt, list.m_args, list.m_N);
 1072|  14.8k|}
_ZN10tinyformat6formatIJiEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     34|{
 1089|     34|    std::ostringstream oss;
 1090|     34|    format(oss, fmt, args...);
 1091|     34|    return oss.str();
 1092|     34|}
_ZN10tinyformat6formatIJiEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     34|{
 1081|     34|    vformat(out, fmt, makeFormatList(args...));
 1082|     34|}
_ZN10tinyformat17FormatStringCheckILj1EEcvPKcEv:
  197|  9.07k|    operator const char*() { return fmt; }
_ZN10tinyformat14makeFormatListIJiEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     34|{
 1045|     34|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     34|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJiEEEDpRKT_:
  990|     34|            : FormatList(&m_formatterStore[0], N),
  991|     34|            m_formatterStore { FormatArg(args)... }
  992|     34|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IiEERKT_:
  534|  1.88k|            : m_value(static_cast<const void*>(&value)),
  535|  1.88k|            m_formatImpl(&formatImpl<T>),
  536|  1.88k|            m_toIntImpl(&toIntImpl<T>)
  537|  1.88k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIiEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  1.88k|        {
  559|  1.88k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  1.88k|        }
_ZN10tinyformat11formatValueIiEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  1.88k|{
  352|  1.88k|#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.88k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  1.88k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  1.88k|#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.88k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  1.88k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  1.88k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 1.88k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  1.88k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  1.88k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 1.88k]
  ------------------
  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.88k|    else
  378|  1.88k|        out << value;
  379|  1.88k|}
_ZN10tinyformat17FormatStringCheckILj1EEC2EN4util21ConstevalFormatStringILj1EEE:
  196|  3.18k|    FormatStringCheck(util::ConstevalFormatString<num_params> str) : fmt{str.fmt} {}
_ZN10tinyformat6formatIJmmEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     42|{
 1089|     42|    std::ostringstream oss;
 1090|     42|    format(oss, fmt, args...);
 1091|     42|    return oss.str();
 1092|     42|}
_ZN10tinyformat6formatIJmmEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     42|{
 1081|     42|    vformat(out, fmt, makeFormatList(args...));
 1082|     42|}
_ZN10tinyformat17FormatStringCheckILj2EEcvPKcEv:
  197|  3.62k|    operator const char*() { return fmt; }
_ZN10tinyformat14makeFormatListIJmmEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     42|{
 1045|     42|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     42|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJmmEEEDpRKT_:
  990|     42|            : FormatList(&m_formatterStore[0], N),
  991|     42|            m_formatterStore { FormatArg(args)... }
  992|     42|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2ImEERKT_:
  534|     85|            : m_value(static_cast<const void*>(&value)),
  535|     85|            m_formatImpl(&formatImpl<T>),
  536|     85|            m_toIntImpl(&toIntImpl<T>)
  537|     85|        { }
_ZN10tinyformat6detail9FormatArg10formatImplImEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|     85|        {
  559|     85|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|     85|        }
_ZN10tinyformat11formatValueImEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|     85|{
  352|     85|#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|     85|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|     85|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|     85|#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|     85|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|     85|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|     85|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 85]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|     85|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|     85|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 85]
  ------------------
  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|     85|    else
  378|     85|        out << value;
  379|     85|}
_ZN10tinyformat6formatIJtEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  2.65k|{
 1089|  2.65k|    std::ostringstream oss;
 1090|  2.65k|    format(oss, fmt, args...);
 1091|  2.65k|    return oss.str();
 1092|  2.65k|}
_ZN10tinyformat6formatIJtEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  2.65k|{
 1081|  2.65k|    vformat(out, fmt, makeFormatList(args...));
 1082|  2.65k|}
_ZN10tinyformat14makeFormatListIJtEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  2.65k|{
 1045|  2.65k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  2.65k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJtEEEDpRKT_:
  990|  2.65k|            : FormatList(&m_formatterStore[0], N),
  991|  2.65k|            m_formatterStore { FormatArg(args)... }
  992|  2.65k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2ItEERKT_:
  534|  4.18k|            : m_value(static_cast<const void*>(&value)),
  535|  4.18k|            m_formatImpl(&formatImpl<T>),
  536|  4.18k|            m_toIntImpl(&toIntImpl<T>)
  537|  4.18k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplItEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  4.18k|        {
  559|  4.18k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  4.18k|        }
_ZN10tinyformat11formatValueItEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  4.18k|{
  352|  4.18k|#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.18k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  4.18k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  4.18k|#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.18k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  4.18k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  4.18k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 4.18k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  4.18k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  4.18k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 4.18k]
  ------------------
  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.18k|    else
  378|  4.18k|        out << value;
  379|  4.18k|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     72|{
 1089|     72|    std::ostringstream oss;
 1090|     72|    format(oss, fmt, args...);
 1091|     72|    return oss.str();
 1092|     72|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     72|{
 1081|     72|    vformat(out, fmt, makeFormatList(args...));
 1082|     72|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     72|{
 1045|     72|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     72|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESA_EEEDpRKT_:
  990|     72|            : FormatList(&m_formatterStore[0], N),
  991|     72|            m_formatterStore { FormatArg(args)... }
  992|     72|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERKT_:
  534|    403|            : m_value(static_cast<const void*>(&value)),
  535|    403|            m_formatImpl(&formatImpl<T>),
  536|    403|            m_toIntImpl(&toIntImpl<T>)
  537|    403|        { }
_ZN10tinyformat6detail9FormatArg10formatImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEvRNS3_13basic_ostreamIcS6_EEPKcSE_iPKv:
  558|    403|        {
  559|    403|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|    403|        }
_ZN10tinyformat11formatValueINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRNS1_13basic_ostreamIcS4_EEPKcSC_iRKT_:
  351|    403|{
  352|    403|#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|    403|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|    403|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|    403|#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|    403|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|    403|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|    403|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 0]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|    403|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|    403|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 403]
  ------------------
  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|    403|    else
  378|    403|        out << value;
  379|    403|}
_ZN10tinyformat6formatIJlEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  6.37k|{
 1089|  6.37k|    std::ostringstream oss;
 1090|  6.37k|    format(oss, fmt, args...);
 1091|  6.37k|    return oss.str();
 1092|  6.37k|}
_ZN10tinyformat6formatIJlEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  6.37k|{
 1081|  6.37k|    vformat(out, fmt, makeFormatList(args...));
 1082|  6.37k|}
_ZN10tinyformat14makeFormatListIJlEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  6.37k|{
 1045|  6.37k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  6.37k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJlEEEDpRKT_:
  990|  6.37k|            : FormatList(&m_formatterStore[0], N),
  991|  6.37k|            m_formatterStore { FormatArg(args)... }
  992|  6.37k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IlEERKT_:
  534|  6.64k|            : m_value(static_cast<const void*>(&value)),
  535|  6.64k|            m_formatImpl(&formatImpl<T>),
  536|  6.64k|            m_toIntImpl(&toIntImpl<T>)
  537|  6.64k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIlEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  6.64k|        {
  559|  6.64k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  6.64k|        }
_ZN10tinyformat11formatValueIlEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  6.64k|{
  352|  6.64k|#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|  6.64k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  6.64k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  6.64k|#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|  6.64k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  6.64k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  6.64k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 6.64k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  6.64k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  6.64k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 6.64k]
  ------------------
  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|  6.64k|    else
  378|  6.64k|        out << value;
  379|  6.64k|}
_ZN10tinyformat17FormatStringCheckILj1EEC2ERKNS_13RuntimeFormatE:
  195|  3.18k|    FormatStringCheck(LIFETIMEBOUND const RuntimeFormat& run) : fmt{run.fmt.c_str()} {}
_ZN10tinyformat6detail9FormatArgC2IPKcEERKT_:
  534|  3.11k|            : m_value(static_cast<const void*>(&value)),
  535|  3.11k|            m_formatImpl(&formatImpl<T>),
  536|  3.11k|            m_toIntImpl(&toIntImpl<T>)
  537|  3.11k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIPKcEEvRNSt3__113basic_ostreamIcNS5_11char_traitsIcEEEES4_S4_iPKv:
  558|  3.11k|        {
  559|  3.11k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  3.11k|        }
_ZN10tinyformat11formatValueIPKcEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEES2_S2_iRKT_:
  351|  3.11k|{
  352|  3.11k|#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|  3.11k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  3.11k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  3.11k|#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|  3.11k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  3.11k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  3.11k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 0]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  3.11k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 3.11k]
  ------------------
  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|  3.11k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 3.11k]
  ------------------
  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|  3.11k|    else
  378|  3.11k|        out << value;
  379|  3.11k|}
_ZN10tinyformat6detail9FormatArgC2IhEERKT_:
  534|  8.77k|            : m_value(static_cast<const void*>(&value)),
  535|  8.77k|            m_formatImpl(&formatImpl<T>),
  536|  8.77k|            m_toIntImpl(&toIntImpl<T>)
  537|  8.77k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIhEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  8.77k|        {
  559|  8.77k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  8.77k|        }
_ZN10tinyformat6formatIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     10|{
 1089|     10|    std::ostringstream oss;
 1090|     10|    format(oss, fmt, args...);
 1091|     10|    return oss.str();
 1092|     10|}
_ZN10tinyformat6formatIJjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     10|{
 1081|     10|    vformat(out, fmt, makeFormatList(args...));
 1082|     10|}
_ZN10tinyformat14makeFormatListIJjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     10|{
 1045|     10|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     10|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJjEEEDpRKT_:
  990|     10|            : FormatList(&m_formatterStore[0], N),
  991|     10|            m_formatterStore { FormatArg(args)... }
  992|     10|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IjEERKT_:
  534|     10|            : m_value(static_cast<const void*>(&value)),
  535|     10|            m_formatImpl(&formatImpl<T>),
  536|     10|            m_toIntImpl(&toIntImpl<T>)
  537|     10|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIjEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|     10|        {
  559|     10|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|     10|        }
_ZN10tinyformat11formatValueIjEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|     10|{
  352|     10|#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|     10|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|     10|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|     10|#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|     10|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|     10|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|     10|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 10]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|     10|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|     10|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 10]
  ------------------
  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|     10|    else
  378|     10|        out << value;
  379|     10|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|    258|{
 1089|    258|    std::ostringstream oss;
 1090|    258|    format(oss, fmt, args...);
 1091|    258|    return oss.str();
 1092|    258|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|    258|{
 1081|    258|    vformat(out, fmt, makeFormatList(args...));
 1082|    258|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|    258|{
 1045|    258|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|    258|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEiEEEDpRKT_:
  990|    258|            : FormatList(&m_formatterStore[0], N),
  991|    258|            m_formatterStore { FormatArg(args)... }
  992|    258|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat17FormatStringCheckILj4EEcvPKcEv:
  197|  2.19k|    operator const char*() { return fmt; }
_ZN10tinyformat6formatIJhhhhEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  2.19k|{
 1089|  2.19k|    std::ostringstream oss;
 1090|  2.19k|    format(oss, fmt, args...);
 1091|  2.19k|    return oss.str();
 1092|  2.19k|}
_ZN10tinyformat6formatIJhhhhEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  2.19k|{
 1081|  2.19k|    vformat(out, fmt, makeFormatList(args...));
 1082|  2.19k|}
_ZN10tinyformat14makeFormatListIJhhhhEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  2.19k|{
 1045|  2.19k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  2.19k|}
_ZN10tinyformat6detail11FormatListNILi4EEC2IJhhhhEEEDpRKT_:
  990|  2.19k|            : FormatList(&m_formatterStore[0], N),
  991|  2.19k|            m_formatterStore { FormatArg(args)... }
  992|  2.19k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJPKctEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  1.52k|{
 1089|  1.52k|    std::ostringstream oss;
 1090|  1.52k|    format(oss, fmt, args...);
 1091|  1.52k|    return oss.str();
 1092|  1.52k|}
_ZN10tinyformat6formatIJPKctEEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  1.52k|{
 1081|  1.52k|    vformat(out, fmt, makeFormatList(args...));
 1082|  1.52k|}
_ZN10tinyformat14makeFormatListIJPKctEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  1.52k|{
 1045|  1.52k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  1.52k|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJPKctEEEDpRKT_:
  990|  1.52k|            : FormatList(&m_formatterStore[0], N),
  991|  1.52k|            m_formatterStore { FormatArg(args)... }
  992|  1.52k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJllEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|    134|{
 1089|    134|    std::ostringstream oss;
 1090|    134|    format(oss, fmt, args...);
 1091|    134|    return oss.str();
 1092|    134|}
_ZN10tinyformat6formatIJllEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|    134|{
 1081|    134|    vformat(out, fmt, makeFormatList(args...));
 1082|    134|}
_ZN10tinyformat14makeFormatListIJllEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|    134|{
 1045|    134|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|    134|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJllEEEDpRKT_:
  990|    134|            : FormatList(&m_formatterStore[0], N),
  991|    134|            m_formatterStore { FormatArg(args)... }
  992|    134|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJPKciEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  1.59k|{
 1089|  1.59k|    std::ostringstream oss;
 1090|  1.59k|    format(oss, fmt, args...);
 1091|  1.59k|    return oss.str();
 1092|  1.59k|}
_ZN10tinyformat6formatIJPKciEEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  1.59k|{
 1081|  1.59k|    vformat(out, fmt, makeFormatList(args...));
 1082|  1.59k|}
_ZN10tinyformat14makeFormatListIJPKciEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  1.59k|{
 1045|  1.59k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  1.59k|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJPKciEEEDpRKT_:
  990|  1.59k|            : FormatList(&m_formatterStore[0], N),
  991|  1.59k|            m_formatterStore { FormatArg(args)... }
  992|  1.59k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmEEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|      1|{
 1089|      1|    std::ostringstream oss;
 1090|      1|    format(oss, fmt, args...);
 1091|      1|    return oss.str();
 1092|      1|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmEEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|      1|{
 1081|      1|    vformat(out, fmt, makeFormatList(args...));
 1082|      1|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|      1|{
 1045|      1|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|      1|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEmEEEDpRKT_:
  990|      1|            : FormatList(&m_formatterStore[0], N),
  991|      1|            m_formatterStore { FormatArg(args)... }
  992|      1|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJA23_cEEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|      5|{
 1089|      5|    std::ostringstream oss;
 1090|      5|    format(oss, fmt, args...);
 1091|      5|    return oss.str();
 1092|      5|}
_ZN10tinyformat6formatIJA23_cEEEvRNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|      5|{
 1081|      5|    vformat(out, fmt, makeFormatList(args...));
 1082|      5|}
_ZN10tinyformat14makeFormatListIJA23_cEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|      5|{
 1045|      5|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|      5|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJA23_cEEEDpRKT_:
  990|      5|            : FormatList(&m_formatterStore[0], N),
  991|      5|            m_formatterStore { FormatArg(args)... }
  992|      5|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IA23_cEERKT_:
  534|      5|            : m_value(static_cast<const void*>(&value)),
  535|      5|            m_formatImpl(&formatImpl<T>),
  536|      5|            m_toIntImpl(&toIntImpl<T>)
  537|      5|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIA23_cEEvRNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEPKcSB_iPKv:
  558|      5|        {
  559|      5|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|      5|        }
_ZN10tinyformat11formatValueIA23_cEEvRNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_iRKT_:
  351|      5|{
  352|      5|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|      5|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|      5|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|      5|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|      5|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|      5|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|      5|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 0]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|      5|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 5]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|      5|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 5]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|      5|    else
  378|      5|        out << value;
  379|      5|}

_ZNK12CCoinsViewDB7GetCoinERK9COutPoint:
   69|    552|{
   70|    552|    if (Coin coin; m_db->Read(CoinEntry(&outpoint), coin)) return coin;
  ------------------
  |  Branch (70:20): [True: 0, False: 552]
  ------------------
   71|    552|    return std::nullopt;
   72|    552|}
txdb.cpp:_ZN12_GLOBAL__N_19CoinEntryC2EPK9COutPoint:
   42|    552|    explicit CoinEntry(const COutPoint* ptr) : outpoint(const_cast<COutPoint*>(ptr)), key(DB_COIN)  {}
txdb.cpp:_ZN12_GLOBAL__N_19CoinEntry16SerializationOpsI10DataStreamKS0_15ActionSerializeEEvRT0_RT_T1_:
   44|    552|    SERIALIZE_METHODS(CoinEntry, obj) { READWRITE(obj.key, obj.outpoint->hash, VARINT(obj.outpoint->n)); }
  ------------------
  |  |  156|    552|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------

_ZNK10CTxMemPool5checkERK15CCoinsViewCachel:
  693|  1.36k|{
  694|  1.36k|    if (m_opts.check_ratio == 0) return;
  ------------------
  |  Branch (694:9): [True: 0, False: 1.36k]
  ------------------
  695|       |
  696|  1.36k|    if (FastRandomContext().randrange(m_opts.check_ratio) >= 1) return;
  ------------------
  |  Branch (696:9): [True: 0, False: 1.36k]
  ------------------
  697|       |
  698|  1.36k|    AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  699|  1.36k|    LOCK(cs);
  ------------------
  |  |  257|  1.36k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.36k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.36k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.36k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  1.36k|    LogDebug(BCLog::MEMPOOL, "Checking mempool with %u transactions and %u inputs\n", (unsigned int)mapTx.size(), (unsigned int)mapNextTx.size());
  ------------------
  |  |  280|  1.36k|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|  1.36k|    do {                                                  \
  |  |  |  |  274|  1.36k|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1.36k]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|  1.36k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|       |
  702|  1.36k|    uint64_t checkTotal = 0;
  703|  1.36k|    CAmount check_total_fee{0};
  704|  1.36k|    uint64_t innerUsage = 0;
  705|  1.36k|    uint64_t prev_ancestor_count{0};
  706|       |
  707|  1.36k|    CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(&active_coins_tip));
  708|       |
  709|  1.36k|    for (const auto& it : GetSortedDepthAndScore()) {
  ------------------
  |  Branch (709:25): [True: 0, False: 1.36k]
  ------------------
  710|      0|        checkTotal += it->GetTxSize();
  711|      0|        check_total_fee += it->GetFee();
  712|      0|        innerUsage += it->DynamicMemoryUsage();
  713|      0|        const CTransaction& tx = it->GetTx();
  714|      0|        innerUsage += memusage::DynamicUsage(it->GetMemPoolParentsConst()) + memusage::DynamicUsage(it->GetMemPoolChildrenConst());
  715|      0|        CTxMemPoolEntry::Parents setParentCheck;
  716|      0|        for (const CTxIn &txin : tx.vin) {
  ------------------
  |  Branch (716:32): [True: 0, False: 0]
  ------------------
  717|       |            // Check that every mempool transaction's inputs refer to available coins, or other mempool tx's.
  718|      0|            indexed_transaction_set::const_iterator it2 = mapTx.find(txin.prevout.hash);
  719|      0|            if (it2 != mapTx.end()) {
  ------------------
  |  Branch (719:17): [True: 0, False: 0]
  ------------------
  720|      0|                const CTransaction& tx2 = it2->GetTx();
  721|      0|                assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull());
  722|      0|                setParentCheck.insert(*it2);
  723|      0|            }
  724|       |            // We are iterating through the mempool entries sorted in order by ancestor count.
  725|       |            // All parents must have been checked before their children and their coins added to
  726|       |            // the mempoolDuplicate coins cache.
  727|      0|            assert(mempoolDuplicate.HaveCoin(txin.prevout));
  728|       |            // Check whether its inputs are marked in mapNextTx.
  729|      0|            auto it3 = mapNextTx.find(txin.prevout);
  730|      0|            assert(it3 != mapNextTx.end());
  731|      0|            assert(it3->first == &txin.prevout);
  732|      0|            assert(it3->second == &tx);
  733|      0|        }
  734|      0|        auto comp = [](const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) -> bool {
  735|      0|            return a.GetTx().GetHash() == b.GetTx().GetHash();
  736|      0|        };
  737|      0|        assert(setParentCheck.size() == it->GetMemPoolParentsConst().size());
  738|      0|        assert(std::equal(setParentCheck.begin(), setParentCheck.end(), it->GetMemPoolParentsConst().begin(), comp));
  739|       |        // Verify ancestor state is correct.
  740|      0|        auto ancestors{AssumeCalculateMemPoolAncestors(__func__, *it, Limits::NoLimits())};
  741|      0|        uint64_t nCountCheck = ancestors.size() + 1;
  742|      0|        int32_t nSizeCheck = it->GetTxSize();
  743|      0|        CAmount nFeesCheck = it->GetModifiedFee();
  744|      0|        int64_t nSigOpCheck = it->GetSigOpCost();
  745|       |
  746|      0|        for (txiter ancestorIt : ancestors) {
  ------------------
  |  Branch (746:32): [True: 0, False: 0]
  ------------------
  747|      0|            nSizeCheck += ancestorIt->GetTxSize();
  748|      0|            nFeesCheck += ancestorIt->GetModifiedFee();
  749|      0|            nSigOpCheck += ancestorIt->GetSigOpCost();
  750|      0|        }
  751|       |
  752|      0|        assert(it->GetCountWithAncestors() == nCountCheck);
  753|      0|        assert(it->GetSizeWithAncestors() == nSizeCheck);
  754|      0|        assert(it->GetSigOpCostWithAncestors() == nSigOpCheck);
  755|      0|        assert(it->GetModFeesWithAncestors() == nFeesCheck);
  756|       |        // Sanity check: we are walking in ascending ancestor count order.
  757|      0|        assert(prev_ancestor_count <= it->GetCountWithAncestors());
  758|      0|        prev_ancestor_count = it->GetCountWithAncestors();
  759|       |
  760|       |        // Check children against mapNextTx
  761|      0|        CTxMemPoolEntry::Children setChildrenCheck;
  762|      0|        auto iter = mapNextTx.lower_bound(COutPoint(it->GetTx().GetHash(), 0));
  763|      0|        int32_t child_sizes{0};
  764|      0|        for (; iter != mapNextTx.end() && iter->first->hash == it->GetTx().GetHash(); ++iter) {
  ------------------
  |  Branch (764:16): [True: 0, False: 0]
  |  Branch (764:16): [True: 0, False: 0]
  |  Branch (764:43): [True: 0, False: 0]
  ------------------
  765|      0|            txiter childit = mapTx.find(iter->second->GetHash());
  766|      0|            assert(childit != mapTx.end()); // mapNextTx points to in-mempool transactions
  767|      0|            if (setChildrenCheck.insert(*childit).second) {
  ------------------
  |  Branch (767:17): [True: 0, False: 0]
  ------------------
  768|      0|                child_sizes += childit->GetTxSize();
  769|      0|            }
  770|      0|        }
  771|      0|        assert(setChildrenCheck.size() == it->GetMemPoolChildrenConst().size());
  772|      0|        assert(std::equal(setChildrenCheck.begin(), setChildrenCheck.end(), it->GetMemPoolChildrenConst().begin(), comp));
  773|       |        // Also check to make sure size is greater than sum with immediate children.
  774|       |        // just a sanity check, not definitive that this calc is correct...
  775|      0|        assert(it->GetSizeWithDescendants() >= child_sizes + it->GetTxSize());
  776|       |
  777|      0|        TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass
  778|      0|        CAmount txfee = 0;
  779|      0|        assert(!tx.IsCoinBase());
  780|      0|        assert(Consensus::CheckTxInputs(tx, dummy_state, mempoolDuplicate, spendheight, txfee));
  781|      0|        for (const auto& input: tx.vin) mempoolDuplicate.SpendCoin(input.prevout);
  ------------------
  |  Branch (781:31): [True: 0, False: 0]
  ------------------
  782|      0|        AddCoins(mempoolDuplicate, tx, std::numeric_limits<int>::max());
  783|      0|    }
  784|  1.36k|    for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) {
  ------------------
  |  Branch (784:40): [True: 0, False: 1.36k]
  ------------------
  785|      0|        uint256 hash = it->second->GetHash();
  786|      0|        indexed_transaction_set::const_iterator it2 = mapTx.find(hash);
  787|      0|        const CTransaction& tx = it2->GetTx();
  788|      0|        assert(it2 != mapTx.end());
  789|      0|        assert(&tx == it->second);
  790|      0|    }
  791|       |
  792|  1.36k|    assert(totalTxSize == checkTotal);
  793|  1.36k|    assert(m_total_fee == check_total_fee);
  794|  1.36k|    assert(innerUsage == cachedInnerUsage);
  795|  1.36k|}
_ZNK10CTxMemPool22GetSortedDepthAndScoreEv:
  834|  1.36k|{
  835|  1.36k|    std::vector<indexed_transaction_set::const_iterator> iters;
  836|  1.36k|    AssertLockHeld(cs);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  837|       |
  838|  1.36k|    iters.reserve(mapTx.size());
  839|       |
  840|  1.36k|    for (indexed_transaction_set::iterator mi = mapTx.begin(); mi != mapTx.end(); ++mi) {
  ------------------
  |  Branch (840:64): [True: 0, False: 1.36k]
  ------------------
  841|      0|        iters.push_back(mi);
  842|      0|    }
  843|  1.36k|    std::sort(iters.begin(), iters.end(), DepthAndScoreComparator());
  844|  1.36k|    return iters;
  845|  1.36k|}
_ZNK10CTxMemPool7infoAllEv:
  864|      3|{
  865|      3|    LOCK(cs);
  ------------------
  |  |  257|      3|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      3|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      3|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      3|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  866|      3|    auto iters = GetSortedDepthAndScore();
  867|       |
  868|      3|    std::vector<TxMempoolInfo> ret;
  869|      3|    ret.reserve(mapTx.size());
  870|      3|    for (auto it : iters) {
  ------------------
  |  Branch (870:18): [True: 0, False: 3]
  ------------------
  871|      0|        ret.push_back(GetInfo(it));
  872|      0|    }
  873|       |
  874|      3|    return ret;
  875|      3|}
_ZNK10CTxMemPool3getERK7uint256:
  885|    732|{
  886|    732|    LOCK(cs);
  ------------------
  |  |  257|    732|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    732|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    732|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    732|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  887|    732|    indexed_transaction_set::const_iterator i = mapTx.find(hash);
  888|    732|    if (i == mapTx.end())
  ------------------
  |  Branch (888:9): [True: 732, False: 0]
  ------------------
  889|    732|        return nullptr;
  890|      0|    return i->GetSharedTx();
  891|    732|}
_ZNK10CTxMemPool14info_for_relayERK7GenTxidm:
  903|  44.1k|{
  904|  44.1k|    LOCK(cs);
  ------------------
  |  |  257|  44.1k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  44.1k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  44.1k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  44.1k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  905|  44.1k|    indexed_transaction_set::const_iterator i = (gtxid.IsWtxid() ? get_iter_from_wtxid(gtxid.GetHash()) : mapTx.find(gtxid.GetHash()));
  ------------------
  |  Branch (905:50): [True: 13.4k, False: 30.7k]
  ------------------
  906|  44.1k|    if (i != mapTx.end() && i->GetSequence() < last_sequence) {
  ------------------
  |  Branch (906:9): [True: 0, False: 44.1k]
  |  Branch (906:9): [True: 0, False: 44.1k]
  |  Branch (906:29): [True: 0, False: 0]
  ------------------
  907|      0|        return GetInfo(i);
  908|  44.1k|    } else {
  909|  44.1k|        return TxMempoolInfo();
  910|  44.1k|    }
  911|  44.1k|}
_ZNK10CTxMemPool13GetConflictTxERK9COutPoint:
  982|  3.19k|{
  983|  3.19k|    const auto it = mapNextTx.find(prevout);
  984|  3.19k|    return it == mapNextTx.end() ? nullptr : it->second;
  ------------------
  |  Branch (984:12): [True: 3.19k, False: 0]
  ------------------
  985|  3.19k|}
_ZN17CCoinsViewMemPoolC2EP10CCoinsViewRK10CTxMemPool:
 1025|  1.36k|CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }
_ZNK17CCoinsViewMemPool7GetCoinERK9COutPoint:
 1028|    732|{
 1029|       |    // Check to see if the inputs are made available by another tx in the package.
 1030|       |    // These Coins would not be available in the underlying CoinsView.
 1031|    732|    if (auto it = m_temp_added.find(outpoint); it != m_temp_added.end()) {
  ------------------
  |  Branch (1031:48): [True: 0, False: 732]
  ------------------
 1032|      0|        return it->second;
 1033|      0|    }
 1034|       |
 1035|       |    // If an entry in the mempool exists, always return that one, as it's guaranteed to never
 1036|       |    // conflict with the underlying cache, and it cannot have pruned entries (as it contains full)
 1037|       |    // transactions. First checking the underlying cache risks returning a pruned entry instead.
 1038|    732|    CTransactionRef ptx = mempool.get(outpoint.hash);
 1039|    732|    if (ptx) {
  ------------------
  |  Branch (1039:9): [True: 0, False: 732]
  ------------------
 1040|      0|        if (outpoint.n < ptx->vout.size()) {
  ------------------
  |  Branch (1040:13): [True: 0, False: 0]
  ------------------
 1041|      0|            Coin coin(ptx->vout[outpoint.n], MEMPOOL_HEIGHT, false);
 1042|      0|            m_non_base_coins.emplace(outpoint);
 1043|      0|            return coin;
 1044|      0|        }
 1045|      0|        return std::nullopt;
 1046|      0|    }
 1047|    732|    return base->GetCoin(outpoint);
 1048|    732|}
_ZNK10CTxMemPool18DynamicMemoryUsageEv:
 1063|  1.36k|size_t CTxMemPool::DynamicMemoryUsage() const {
 1064|  1.36k|    LOCK(cs);
  ------------------
  |  |  257|  1.36k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.36k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.36k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.36k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1065|       |    // Estimate the overhead of mapTx to be 15 pointers + an allocation, as no exact formula for boost::multi_index_contained is implemented.
 1066|  1.36k|    return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + 15 * sizeof(void*)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + memusage::DynamicUsage(mapDeltas) + memusage::DynamicUsage(txns_randomized) + cachedInnerUsage;
 1067|  1.36k|}
_ZNK10CTxMemPool9GetMinFeeEm:
 1126|   408k|CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {
 1127|   408k|    LOCK(cs);
  ------------------
  |  |  257|   408k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   408k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   408k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   408k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1128|   408k|    if (!blockSinceLastRollingFeeBump || rollingMinimumFeeRate == 0)
  ------------------
  |  Branch (1128:9): [True: 0, False: 408k]
  |  Branch (1128:42): [True: 408k, False: 0]
  ------------------
 1129|   408k|        return CFeeRate(llround(rollingMinimumFeeRate));
 1130|       |
 1131|      0|    int64_t time = GetTime();
 1132|      0|    if (time > lastRollingFeeUpdate + 10) {
  ------------------
  |  Branch (1132:9): [True: 0, False: 0]
  ------------------
 1133|      0|        double halflife = ROLLING_FEE_HALFLIFE;
 1134|      0|        if (DynamicMemoryUsage() < sizelimit / 4)
  ------------------
  |  Branch (1134:13): [True: 0, False: 0]
  ------------------
 1135|      0|            halflife /= 4;
 1136|      0|        else if (DynamicMemoryUsage() < sizelimit / 2)
  ------------------
  |  Branch (1136:18): [True: 0, False: 0]
  ------------------
 1137|      0|            halflife /= 2;
 1138|       |
 1139|      0|        rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife);
 1140|      0|        lastRollingFeeUpdate = time;
 1141|       |
 1142|      0|        if (rollingMinimumFeeRate < (double)m_opts.incremental_relay_feerate.GetFeePerK() / 2) {
  ------------------
  |  Branch (1142:13): [True: 0, False: 0]
  ------------------
 1143|      0|            rollingMinimumFeeRate = 0;
 1144|      0|            return CFeeRate(0);
 1145|      0|        }
 1146|      0|    }
 1147|      0|    return std::max(CFeeRate(llround(rollingMinimumFeeRate)), m_opts.incremental_relay_feerate);
 1148|      0|}

_ZNK10CTxMemPool9GetMinFeeEv:
  596|   408k|    CFeeRate GetMinFee() const {
  597|   408k|        return GetMinFee(m_opts.max_size_bytes);
  598|   408k|    }
_ZNK10CTxMemPool6existsERK7GenTxid:
  648|  1.75M|    {
  649|  1.75M|        LOCK(cs);
  ------------------
  |  |  257|  1.75M|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.75M|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.75M|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.75M|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  650|  1.75M|        if (gtxid.IsWtxid()) {
  ------------------
  |  Branch (650:13): [True: 2.02k, False: 1.75M]
  ------------------
  651|  2.02k|            return (mapTx.get<index_by_wtxid>().count(gtxid.GetHash()) != 0);
  652|  2.02k|        }
  653|  1.75M|        return (mapTx.count(gtxid.GetHash()) != 0);
  654|  1.75M|    }
_ZNK10CTxMemPool19get_iter_from_wtxidERK7uint256:
  660|  13.4k|    {
  661|  13.4k|        AssertLockHeld(cs);
  ------------------
  |  |  142|  13.4k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  662|  13.4k|        return mapTx.project<0>(mapTx.get<index_by_wtxid>().find(wtxid));
  663|  13.4k|    }
_ZNK10CTxMemPool11GetSequenceEv:
  705|  26.3k|    uint64_t GetSequence() const EXCLUSIVE_LOCKS_REQUIRED(cs) {
  706|  26.3k|        return m_sequence_number;
  707|  26.3k|    }

_ZN11TxOrphanage5AddTxERKNSt3__110shared_ptrIK12CTransactionEEl:
   16|    552|{
   17|    552|    const Txid& hash = tx->GetHash();
   18|    552|    const Wtxid& wtxid = tx->GetWitnessHash();
   19|    552|    if (auto it{m_orphans.find(wtxid)}; it != m_orphans.end()) {
  ------------------
  |  Branch (19:41): [True: 0, False: 552]
  ------------------
   20|      0|        AddAnnouncer(wtxid, peer);
   21|       |        // No new orphan entry was created. An announcer may have been added.
   22|      0|        return false;
   23|      0|    }
   24|       |
   25|       |    // Ignore big transactions, to avoid a
   26|       |    // send-big-orphans memory exhaustion attack. If a peer has a legitimate
   27|       |    // large transaction with a missing parent then we assume
   28|       |    // it will rebroadcast it later, after the parent transaction(s)
   29|       |    // have been mined or received.
   30|       |    // 100 orphans, each of which is at most 100,000 bytes big is
   31|       |    // at most 10 megabytes of orphans and somewhat more byprev index (in the worst case):
   32|    552|    unsigned int sz = GetTransactionWeight(*tx);
   33|    552|    if (sz > MAX_STANDARD_TX_WEIGHT)
  ------------------
  |  Branch (33:9): [True: 0, False: 552]
  ------------------
   34|      0|    {
   35|      0|        LogDebug(BCLog::TXPACKAGES, "ignoring large orphan tx (size: %u, txid: %s, wtxid: %s)\n", sz, hash.ToString(), wtxid.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|      0|        return false;
   37|      0|    }
   38|       |
   39|    552|    auto ret = m_orphans.emplace(wtxid, OrphanTx{{tx, {peer}, Now<NodeSeconds>() + ORPHAN_TX_EXPIRE_TIME}, m_orphan_list.size()});
   40|    552|    assert(ret.second);
   41|    552|    m_orphan_list.push_back(ret.first);
   42|  3.08k|    for (const CTxIn& txin : tx->vin) {
  ------------------
  |  Branch (42:28): [True: 3.08k, False: 552]
  ------------------
   43|  3.08k|        m_outpoint_to_orphan_it[txin.prevout].insert(ret.first);
   44|  3.08k|    }
   45|    552|    m_total_orphan_usage += sz;
   46|    552|    m_total_announcements += 1;
   47|    552|    auto& peer_info = m_peer_orphanage_info.try_emplace(peer).first->second;
   48|    552|    peer_info.m_total_usage += sz;
   49|       |
   50|    552|    LogDebug(BCLog::TXPACKAGES, "stored orphan tx %s (wtxid=%s), weight: %u (mapsz %u outsz %u)\n", hash.ToString(), wtxid.ToString(), sz,
  ------------------
  |  |  280|    552|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    552|    do {                                                  \
  |  |  |  |  274|    552|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 552]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    552|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|    552|             m_orphans.size(), m_outpoint_to_orphan_it.size());
   52|    552|    return true;
   53|    552|}
_ZN11TxOrphanage7EraseTxERK22transaction_identifierILb1EE:
   73|  1.36k|{
   74|  1.36k|    std::map<Wtxid, OrphanTx>::iterator it = m_orphans.find(wtxid);
   75|  1.36k|    if (it == m_orphans.end())
  ------------------
  |  Branch (75:9): [True: 809, False: 552]
  ------------------
   76|    809|        return 0;
   77|    552|    for (const CTxIn& txin : it->second.tx->vin)
  ------------------
  |  Branch (77:28): [True: 3.08k, False: 552]
  ------------------
   78|  3.08k|    {
   79|  3.08k|        auto itPrev = m_outpoint_to_orphan_it.find(txin.prevout);
   80|  3.08k|        if (itPrev == m_outpoint_to_orphan_it.end())
  ------------------
  |  Branch (80:13): [True: 0, False: 3.08k]
  ------------------
   81|      0|            continue;
   82|  3.08k|        itPrev->second.erase(it);
   83|  3.08k|        if (itPrev->second.empty())
  ------------------
  |  Branch (83:13): [True: 3.08k, False: 0]
  ------------------
   84|  3.08k|            m_outpoint_to_orphan_it.erase(itPrev);
   85|  3.08k|    }
   86|       |
   87|    552|    const auto tx_size{it->second.GetUsage()};
   88|    552|    m_total_orphan_usage -= tx_size;
   89|    552|    m_total_announcements -= it->second.announcers.size();
   90|       |    // Decrement each announcer's m_total_usage
   91|    552|    for (const auto& peer : it->second.announcers) {
  ------------------
  |  Branch (91:27): [True: 0, False: 552]
  ------------------
   92|      0|        auto peer_it = m_peer_orphanage_info.find(peer);
   93|      0|        if (Assume(peer_it != m_peer_orphanage_info.end())) {
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  |  |  ------------------
  |  |  |  Branch (97:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   94|      0|            peer_it->second.m_total_usage -= tx_size;
   95|      0|        }
   96|      0|    }
   97|       |
   98|    552|    size_t old_pos = it->second.list_pos;
   99|    552|    assert(m_orphan_list[old_pos] == it);
  100|    552|    if (old_pos + 1 != m_orphan_list.size()) {
  ------------------
  |  Branch (100:9): [True: 0, False: 552]
  ------------------
  101|       |        // Unless we're deleting the last entry in m_orphan_list, move the last
  102|       |        // entry to the position we're deleting.
  103|      0|        auto it_last = m_orphan_list.back();
  104|      0|        m_orphan_list[old_pos] = it_last;
  105|      0|        it_last->second.list_pos = old_pos;
  106|      0|    }
  107|    552|    const auto& txid = it->second.tx->GetHash();
  108|       |    // Time spent in orphanage = difference between current and entry time.
  109|       |    // Entry time is equal to ORPHAN_TX_EXPIRE_TIME earlier than entry's expiry.
  110|    552|    LogDebug(BCLog::TXPACKAGES, "   removed orphan tx %s (wtxid=%s) after %ds\n", txid.ToString(), wtxid.ToString(),
  ------------------
  |  |  280|    552|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    552|    do {                                                  \
  |  |  |  |  274|    552|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 552]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    552|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|    552|             Ticks<std::chrono::seconds>(NodeClock::now() + ORPHAN_TX_EXPIRE_TIME - it->second.nTimeExpire));
  112|    552|    m_orphan_list.pop_back();
  113|       |
  114|    552|    m_orphans.erase(it);
  115|    552|    return 1;
  116|    552|}
_ZN11TxOrphanage12EraseForPeerEl:
  119|  8.47k|{
  120|       |    // Zeroes out this peer's m_total_usage.
  121|  8.47k|    m_peer_orphanage_info.erase(peer);
  122|       |
  123|  8.47k|    int nErased = 0;
  124|  8.47k|    std::map<Wtxid, OrphanTx>::iterator iter = m_orphans.begin();
  125|  9.02k|    while (iter != m_orphans.end())
  ------------------
  |  Branch (125:12): [True: 552, False: 8.47k]
  ------------------
  126|    552|    {
  127|       |        // increment to avoid iterator becoming invalid after erasure
  128|    552|        auto& [wtxid, orphan] = *iter++;
  129|    552|        auto orphan_it = orphan.announcers.find(peer);
  130|    552|        if (orphan_it != orphan.announcers.end()) {
  ------------------
  |  Branch (130:13): [True: 552, False: 0]
  ------------------
  131|    552|            orphan.announcers.erase(peer);
  132|    552|            m_total_announcements -= 1;
  133|       |
  134|       |            // No remaining announcers: clean up entry
  135|    552|            if (orphan.announcers.empty()) {
  ------------------
  |  Branch (135:17): [True: 552, False: 0]
  ------------------
  136|    552|                nErased += EraseTx(orphan.tx->GetWitnessHash());
  137|    552|            }
  138|    552|        }
  139|    552|    }
  140|  8.47k|    if (nErased > 0) LogDebug(BCLog::TXPACKAGES, "Erased %d orphan transaction(s) from peer=%d\n", nErased, peer);
  ------------------
  |  |  280|    552|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    552|    do {                                                  \
  |  |  |  |  274|    552|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 552]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    552|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (140:9): [True: 552, False: 7.92k]
  ------------------
  141|  8.47k|}
_ZN11TxOrphanage12LimitOrphansEjR17FastRandomContext:
  144|    552|{
  145|    552|    unsigned int nEvicted = 0;
  146|    552|    auto nNow{Now<NodeSeconds>()};
  147|    552|    if (m_next_sweep <= nNow) {
  ------------------
  |  Branch (147:9): [True: 9, False: 543]
  ------------------
  148|       |        // Sweep out expired orphan pool entries:
  149|      9|        int nErased = 0;
  150|      9|        auto nMinExpTime{nNow + ORPHAN_TX_EXPIRE_TIME - ORPHAN_TX_EXPIRE_INTERVAL};
  151|      9|        std::map<Wtxid, OrphanTx>::iterator iter = m_orphans.begin();
  152|     18|        while (iter != m_orphans.end())
  ------------------
  |  Branch (152:16): [True: 9, False: 9]
  ------------------
  153|      9|        {
  154|      9|            std::map<Wtxid, OrphanTx>::iterator maybeErase = iter++;
  155|      9|            if (maybeErase->second.nTimeExpire <= nNow) {
  ------------------
  |  Branch (155:17): [True: 0, False: 9]
  ------------------
  156|      0|                nErased += EraseTx(maybeErase->first);
  157|      9|            } else {
  158|      9|                nMinExpTime = std::min(maybeErase->second.nTimeExpire, nMinExpTime);
  159|      9|            }
  160|      9|        }
  161|       |        // Sweep again 5 minutes after the next entry that expires in order to batch the linear scan.
  162|      9|        m_next_sweep = nMinExpTime + ORPHAN_TX_EXPIRE_INTERVAL;
  163|      9|        if (nErased > 0) LogDebug(BCLog::TXPACKAGES, "Erased %d orphan tx due to expiration\n", nErased);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (163:13): [True: 0, False: 9]
  ------------------
  164|      9|    }
  165|    552|    while (m_orphans.size() > max_orphans)
  ------------------
  |  Branch (165:12): [True: 0, False: 552]
  ------------------
  166|      0|    {
  167|       |        // Evict a random orphan:
  168|      0|        size_t randompos = rng.randrange(m_orphan_list.size());
  169|      0|        EraseTx(m_orphan_list[randompos]->first);
  170|      0|        ++nEvicted;
  171|      0|    }
  172|    552|    if (nEvicted > 0) LogDebug(BCLog::TXPACKAGES, "orphanage overflow, removed %u tx\n", nEvicted);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (172:9): [True: 0, False: 552]
  ------------------
  173|    552|}
_ZNK11TxOrphanage6HaveTxERK22transaction_identifierILb1EE:
  204|  1.75M|{
  205|  1.75M|    return m_orphans.count(wtxid);
  206|  1.75M|}
_ZNK11TxOrphanage14HaveTxFromPeerERK22transaction_identifierILb1EEl:
  215|    552|{
  216|    552|    auto it = m_orphans.find(wtxid);
  217|    552|    return (it != m_orphans.end() && it->second.announcers.contains(peer));
  ------------------
  |  Branch (217:13): [True: 0, False: 552]
  |  Branch (217:38): [True: 0, False: 0]
  ------------------
  218|    552|}
_ZN11TxOrphanage17GetTxToReconsiderEl:
  221|   454k|{
  222|   454k|    auto peer_it = m_peer_orphanage_info.find(peer);
  223|   454k|    if (peer_it == m_peer_orphanage_info.end()) return nullptr;
  ------------------
  |  Branch (223:9): [True: 454k, False: 0]
  ------------------
  224|       |
  225|      0|    auto& work_set = peer_it->second.m_work_set;
  226|      0|    while (!work_set.empty()) {
  ------------------
  |  Branch (226:12): [True: 0, False: 0]
  ------------------
  227|      0|        Wtxid wtxid = *work_set.begin();
  228|      0|        work_set.erase(work_set.begin());
  229|       |
  230|      0|        const auto orphan_it = m_orphans.find(wtxid);
  231|      0|        if (orphan_it != m_orphans.end()) {
  ------------------
  |  Branch (231:13): [True: 0, False: 0]
  ------------------
  232|      0|            return orphan_it->second.tx;
  233|      0|        }
  234|      0|    }
  235|      0|    return nullptr;
  236|      0|}
_ZN11TxOrphanage18HaveTxToReconsiderEl:
  239|  22.2k|{
  240|  22.2k|    auto peer_it = m_peer_orphanage_info.find(peer);
  241|  22.2k|    if (peer_it == m_peer_orphanage_info.end()) return false;
  ------------------
  |  Branch (241:9): [True: 21.6k, False: 552]
  ------------------
  242|       |
  243|    552|    auto& work_set = peer_it->second.m_work_set;
  244|    552|    return !work_set.empty();
  245|  22.2k|}

_ZNK11TxOrphanage4SizeEv:
   77|  8.47k|    {
   78|  8.47k|        return m_orphans.size();
   79|  8.47k|    }
_ZNK11TxOrphanage12OrphanTxBase8GetUsageEv:
   89|    552|        unsigned int GetUsage() const {
   90|    552|            return GetTransactionWeight(*tx);
   91|    552|        }
_ZNK11TxOrphanage16TotalOrphanUsageEv:
   98|  8.47k|    unsigned int TotalOrphanUsage() const { return m_total_orphan_usage; }
_ZNK11TxOrphanage11UsageByPeerEl:
  103|  8.47k|    unsigned int UsageByPeer(NodeId peer) const {
  104|  8.47k|        auto peer_it = m_peer_orphanage_info.find(peer);
  105|  8.47k|        return peer_it == m_peer_orphanage_info.end() ? 0 : peer_it->second.m_total_usage;
  ------------------
  |  Branch (105:16): [True: 8.47k, False: 0]
  ------------------
  106|  8.47k|    }
_ZNK11TxOrphanage18IteratorComparatorclINSt3__114__map_iteratorINS2_15__tree_iteratorINS2_12__value_typeI22transaction_identifierILb1EENS_8OrphanTxEEEPNS2_11__tree_nodeIS9_PvEElEEEEEEbRKT_SI_:
  150|  6.17k|        {
  151|  6.17k|            return a->first < b->first;
  152|  6.17k|        }

_ZN16TxRequestTrackerD2Ev:
  725|      2|TxRequestTracker::~TxRequestTracker() = default;
_ZN16TxRequestTracker12ForgetTxHashERK7uint256:
  727|  1.91k|void TxRequestTracker::ForgetTxHash(const uint256& txhash) { m_impl->ForgetTxHash(txhash); }
_ZN16TxRequestTracker16DisconnectedPeerEl:
  728|  8.47k|void TxRequestTracker::DisconnectedPeer(NodeId peer) { m_impl->DisconnectedPeer(peer); }
_ZNK16TxRequestTracker13CountInFlightEl:
  729|   147k|size_t TxRequestTracker::CountInFlight(NodeId peer) const { return m_impl->CountInFlight(peer); }
_ZNK16TxRequestTracker5CountEl:
  731|   158k|size_t TxRequestTracker::Count(NodeId peer) const { return m_impl->Count(peer); }
_ZNK16TxRequestTracker4SizeEv:
  732|  8.47k|size_t TxRequestTracker::Size() const { return m_impl->Size(); }
_ZNK16TxRequestTracker17GetCandidatePeersERK7uint256RNSt3__16vectorIlNS3_9allocatorIlEEEE:
  733|    687|void TxRequestTracker::GetCandidatePeers(const uint256& txhash, std::vector<NodeId>& result_peers) const { return m_impl->GetCandidatePeers(txhash, result_peers); }
_ZN16TxRequestTracker11ReceivedInvElRK7GenTxidbNSt3__16chrono8durationIxNS3_5ratioILl1ELl1000000EEEEE:
  743|   907k|{
  744|   907k|    m_impl->ReceivedInv(peer, gtxid, preferred, reqtime);
  745|   907k|}
_ZN16TxRequestTracker11RequestedTxElRK7uint256NSt3__16chrono8durationIxNS3_5ratioILl1ELl1000000EEEEE:
  748|   841k|{
  749|   841k|    m_impl->RequestedTx(peer, txhash, expiry);
  750|   841k|}
_ZN16TxRequestTracker16ReceivedResponseElRK7uint256:
  753|  2.40k|{
  754|  2.40k|    m_impl->ReceivedResponse(peer, txhash);
  755|  2.40k|}
_ZN16TxRequestTracker14GetRequestableElNSt3__16chrono8durationIxNS0_5ratioILl1ELl1000000EEEEEPNS0_6vectorINS0_4pairIl7GenTxidEENS0_9allocatorIS9_EEEE:
  759|   442k|{
  760|   442k|    return m_impl->GetRequestable(peer, now, expired);
  761|   442k|}
_ZN16TxRequestTracker4Impl12ForgetTxHashERK7uint256:
  570|  1.91k|    {
  571|  1.91k|        auto it = m_index.get<ByTxHash>().lower_bound(ByTxHashView{txhash, State::CANDIDATE_DELAYED, 0});
  572|  1.91k|        while (it != m_index.get<ByTxHash>().end() && it->m_txhash == txhash) {
  ------------------
  |  Branch (572:16): [True: 582, False: 1.33k]
  |  Branch (572:16): [True: 0, False: 1.91k]
  |  Branch (572:55): [True: 0, False: 582]
  ------------------
  573|      0|            it = Erase<ByTxHash>(it);
  574|      0|        }
  575|  1.91k|    }
txrequest.cpp:_ZNK12_GLOBAL__N_121ByTxHashViewExtractorclERKNS_12AnnouncementE:
  173|  26.2M|    {
  174|  26.2M|        const Priority prio = (ann.GetState() == State::CANDIDATE_READY) ? m_computer(ann) : 0;
  ------------------
  |  Branch (174:31): [True: 1.68M, False: 24.5M]
  ------------------
  175|  26.2M|        return ByTxHashView{ann.m_txhash, ann.GetState(), prio};
  176|  26.2M|    }
txrequest.cpp:_ZNK12_GLOBAL__N_112Announcement8GetStateEv:
   77|   296M|    State GetState() const { return m_state; }
txrequest.cpp:_ZNK12_GLOBAL__N_116PriorityComputerclERKNS_12AnnouncementE:
  126|  1.68M|    {
  127|  1.68M|        return operator()(ann.m_txhash, ann.m_peer, ann.m_preferred);
  128|  1.68M|    }
txrequest.cpp:_ZNK12_GLOBAL__N_116PriorityComputerclERK7uint256lb:
  120|  1.68M|    {
  121|  1.68M|        uint64_t low_bits = CSipHasher(m_k0, m_k1).Write(txhash).Write(peer).Finalize() >> 1;
  122|  1.68M|        return low_bits | uint64_t{preferred} << 63;
  123|  1.68M|    }
txrequest.cpp:_ZN16TxRequestTracker4Impl5EraseIN12_GLOBAL__N_18ByTxHashEEEN5boost11multi_index21multi_index_containerINS2_12AnnouncementENS2_20Announcement_IndicesENSt3__19allocatorIS7_EEE5indexIT_E4type8iteratorESH_:
  378|   889k|    {
  379|   889k|        auto peerit = m_peerinfo.find(it->m_peer);
  380|   889k|        peerit->second.m_completed -= it->GetState() == State::COMPLETED;
  381|   889k|        peerit->second.m_requested -= it->GetState() == State::REQUESTED;
  382|   889k|        if (--peerit->second.m_total == 0) m_peerinfo.erase(peerit);
  ------------------
  |  Branch (382:13): [True: 1.60k, False: 887k]
  ------------------
  383|   889k|        return m_index.get<Tag>().erase(it);
  384|   889k|    }
_ZN16TxRequestTracker4Impl16DisconnectedPeerEl:
  539|  8.47k|    {
  540|  8.47k|        auto& index = m_index.get<ByPeer>();
  541|  8.47k|        auto it = index.lower_bound(ByPeerView{peer, false, uint256::ZERO});
  542|   897k|        while (it != index.end() && it->m_peer == peer) {
  ------------------
  |  Branch (542:16): [True: 889k, False: 8.47k]
  |  Branch (542:16): [True: 889k, False: 8.47k]
  |  Branch (542:37): [True: 889k, False: 0]
  ------------------
  543|       |            // Check what to continue with after this iteration. 'it' will be deleted in what follows, so we need to
  544|       |            // decide what to continue with afterwards. There are a number of cases to consider:
  545|       |            // - std::next(it) is end() or belongs to a different peer. In that case, this is the last iteration
  546|       |            //   of the loop (denote this by setting it_next to end()).
  547|       |            // - 'it' is not the only non-COMPLETED announcement for its txhash. This means it will be deleted, but
  548|       |            //   no other Announcement objects will be modified. Continue with std::next(it) if it belongs to the
  549|       |            //   same peer, but decide this ahead of time (as 'it' may change position in what follows).
  550|       |            // - 'it' is the only non-COMPLETED announcement for its txhash. This means it will be deleted along
  551|       |            //   with all other announcements for the same txhash - which may include std::next(it). However, other
  552|       |            //   than 'it', no announcements for the same peer can be affected (due to (peer, txhash) uniqueness).
  553|       |            //   In other words, the situation where std::next(it) is deleted can only occur if std::next(it)
  554|       |            //   belongs to a different peer but the same txhash as 'it'. This is covered by the first bulletpoint
  555|       |            //   already, and we'll have set it_next to end().
  556|   889k|            auto it_next = (std::next(it) == index.end() || std::next(it)->m_peer != peer) ? index.end() :
  ------------------
  |  Branch (556:29): [True: 1.60k, False: 887k]
  |  Branch (556:61): [True: 0, False: 887k]
  ------------------
  557|   889k|                std::next(it);
  558|       |            // If the announcement isn't already COMPLETED, first make it COMPLETED (which will mark other
  559|       |            // CANDIDATEs as CANDIDATE_BEST, or delete all of a txhash's announcements if no non-COMPLETED ones are
  560|       |            // left).
  561|   889k|            if (MakeCompleted(m_index.project<ByTxHash>(it))) {
  ------------------
  |  Branch (561:17): [True: 0, False: 889k]
  ------------------
  562|       |                // Then actually delete the announcement (unless it was already deleted by MakeCompleted).
  563|      0|                Erase<ByPeer>(it);
  564|      0|            }
  565|   889k|            it = it_next;
  566|   889k|        }
  567|  8.47k|    }
txrequest.cpp:_ZNK12_GLOBAL__N_119ByPeerViewExtractorclERKNS_12AnnouncementE:
  150|  87.3M|    {
  151|  87.3M|        return ByPeerView{ann.m_peer, ann.GetState() == State::CANDIDATE_BEST, ann.m_txhash};
  152|  87.3M|    }
txrequest.cpp:_ZN16TxRequestTracker4Impl13MakeCompletedEN5boost11multi_index9safe_mode13safe_iteratorINS2_6detail19bidir_node_iteratorINS5_18ordered_index_nodeINS5_19null_augment_policyENS7_IS8_NS5_15index_node_baseIN12_GLOBAL__N_112AnnouncementENSt3__19allocatorISB_EEEEEEEEEEEE:
  467|   889k|    {
  468|   889k|        assert(it != m_index.get<ByTxHash>().end());
  469|       |
  470|       |        // Nothing to be done if it's already COMPLETED.
  471|   889k|        if (it->GetState() == State::COMPLETED) return true;
  ------------------
  |  Branch (471:13): [True: 0, False: 889k]
  ------------------
  472|       |
  473|   889k|        if (IsOnlyNonCompleted(it)) {
  ------------------
  |  Branch (473:13): [True: 889k, False: 0]
  ------------------
  474|       |            // This is the last non-COMPLETED announcement for this txhash. Delete all.
  475|   889k|            uint256 txhash = it->m_txhash;
  476|   889k|            do {
  477|   889k|                it = Erase<ByTxHash>(it);
  478|   889k|            } while (it != m_index.get<ByTxHash>().end() && it->m_txhash == txhash);
  ------------------
  |  Branch (478:22): [True: 887k, False: 1.60k]
  |  Branch (478:22): [True: 0, False: 889k]
  |  Branch (478:61): [True: 0, False: 887k]
  ------------------
  479|   889k|            return false;
  480|   889k|        }
  481|       |
  482|       |        // Mark the announcement COMPLETED, and select the next best announcement (the first CANDIDATE_READY) if
  483|       |        // needed.
  484|      0|        ChangeAndReselect(it, State::COMPLETED);
  485|       |
  486|      0|        return true;
  487|   889k|    }
txrequest.cpp:_ZN16TxRequestTracker4Impl18IsOnlyNonCompletedEN5boost11multi_index9safe_mode13safe_iteratorINS2_6detail19bidir_node_iteratorINS5_18ordered_index_nodeINS5_19null_augment_policyENS7_IS8_NS5_15index_node_baseIN12_GLOBAL__N_112AnnouncementENSt3__19allocatorISB_EEEEEEEEEEEE:
  448|   889k|    {
  449|   889k|        assert(it != m_index.get<ByTxHash>().end());
  450|   889k|        assert(it->GetState() != State::COMPLETED); // Not allowed to call this on COMPLETED announcements.
  451|       |
  452|       |        // This announcement has a predecessor that belongs to the same txhash. Due to ordering, and the
  453|       |        // fact that 'it' is not COMPLETED, its predecessor cannot be COMPLETED here.
  454|   889k|        if (it != m_index.get<ByTxHash>().begin() && std::prev(it)->m_txhash == it->m_txhash) return false;
  ------------------
  |  Branch (454:13): [True: 0, False: 889k]
  |  Branch (454:13): [True: 0, False: 889k]
  |  Branch (454:54): [True: 0, False: 0]
  ------------------
  455|       |
  456|       |        // This announcement has a successor that belongs to the same txhash, and is not COMPLETED.
  457|   889k|        if (std::next(it) != m_index.get<ByTxHash>().end() && std::next(it)->m_txhash == it->m_txhash &&
  ------------------
  |  Branch (457:13): [True: 887k, False: 1.60k]
  |  Branch (457:13): [True: 0, False: 889k]
  |  Branch (457:63): [True: 0, False: 887k]
  ------------------
  458|   889k|            std::next(it)->GetState() != State::COMPLETED) return false;
  ------------------
  |  Branch (458:13): [True: 0, False: 0]
  ------------------
  459|       |
  460|   889k|        return true;
  461|   889k|    }
txrequest.cpp:_ZN12_GLOBAL__N_112Announcement8SetStateENS_5StateE:
   78|  2.52M|    void SetState(State state) { m_state = state; }
txrequest.cpp:_ZNK12_GLOBAL__N_119ByTimeViewExtractorclERKNS_12AnnouncementE:
  210|  56.6M|    {
  211|  56.6M|        return ByTimeView{GetWaitState(ann), ann.m_time};
  212|  56.6M|    }
txrequest.cpp:_ZN12_GLOBAL__N_112GetWaitStateERKNS_12AnnouncementE:
  189|  56.6M|{
  190|  56.6M|    if (ann.IsWaiting()) return WaitState::FUTURE_EVENT;
  ------------------
  |  Branch (190:9): [True: 34.7M, False: 21.9M]
  ------------------
  191|  21.9M|    if (ann.IsSelectable()) return WaitState::PAST_EVENT;
  ------------------
  |  Branch (191:9): [True: 21.9M, False: 0]
  ------------------
  192|      0|    return WaitState::NO_EVENT;
  193|  21.9M|}
txrequest.cpp:_ZNK12_GLOBAL__N_112Announcement9IsWaitingEv:
   88|  56.6M|    {
   89|  56.6M|        return GetState() == State::REQUESTED || GetState() == State::CANDIDATE_DELAYED;
  ------------------
  |  Branch (89:16): [True: 15.3M, False: 41.2M]
  |  Branch (89:50): [True: 19.3M, False: 21.9M]
  ------------------
   90|  56.6M|    }
txrequest.cpp:_ZNK12_GLOBAL__N_112Announcement12IsSelectableEv:
   94|  21.9M|    {
   95|  21.9M|        return GetState() == State::CANDIDATE_READY || GetState() == State::CANDIDATE_BEST;
  ------------------
  |  Branch (95:16): [True: 1.68M, False: 20.2M]
  |  Branch (95:56): [True: 20.2M, False: 393]
  ------------------
   96|  21.9M|    }
_ZNK16TxRequestTracker4Impl13CountInFlightEl:
  691|   147k|    {
  692|   147k|        auto it = m_peerinfo.find(peer);
  693|   147k|        if (it != m_peerinfo.end()) return it->second.m_requested;
  ------------------
  |  Branch (693:13): [True: 146k, False: 947]
  ------------------
  694|    947|        return 0;
  695|   147k|    }
_ZNK16TxRequestTracker4Impl5CountEl:
  705|   158k|    {
  706|   158k|        auto it = m_peerinfo.find(peer);
  707|   158k|        if (it != m_peerinfo.end()) return it->second.m_total;
  ------------------
  |  Branch (707:13): [True: 148k, False: 9.42k]
  ------------------
  708|  9.42k|        return 0;
  709|   158k|    }
_ZNK16TxRequestTracker4Impl4SizeEv:
  712|  8.47k|    size_t Size() const { return m_index.size(); }
_ZNK16TxRequestTracker4Impl17GetCandidatePeersERK7uint256RNSt3__16vectorIlNS4_9allocatorIlEEEE:
  578|    687|    {
  579|    687|        auto it = m_index.get<ByTxHash>().lower_bound(ByTxHashView{txhash, State::CANDIDATE_DELAYED, 0});
  580|    687|        while (it != m_index.get<ByTxHash>().end() && it->m_txhash == txhash && it->GetState() != State::COMPLETED) {
  ------------------
  |  Branch (580:16): [True: 0, False: 687]
  |  Branch (580:16): [True: 0, False: 687]
  |  Branch (580:55): [True: 0, False: 0]
  |  Branch (580:81): [True: 0, False: 0]
  ------------------
  581|      0|            result_peers.push_back(it->m_peer);
  582|      0|            ++it;
  583|      0|        }
  584|    687|    }
_ZN16TxRequestTracker4Impl11ReceivedInvElRK7GenTxidbNSt3__16chrono8durationIxNS4_5ratioILl1ELl1000000EEEEE:
  588|   907k|    {
  589|       |        // Bail out if we already have a CANDIDATE_BEST announcement for this (txhash, peer) combination. The case
  590|       |        // where there is a non-CANDIDATE_BEST announcement already will be caught by the uniqueness property of the
  591|       |        // ByPeer index when we try to emplace the new object below.
  592|   907k|        if (m_index.get<ByPeer>().count(ByPeerView{peer, true, gtxid.GetHash()})) return;
  ------------------
  |  Branch (592:13): [True: 0, False: 907k]
  ------------------
  593|       |
  594|       |        // Try creating the announcement with CANDIDATE_DELAYED state (which will fail due to the uniqueness
  595|       |        // of the ByPeer index if a non-CANDIDATE_BEST announcement already exists with the same txhash and peer).
  596|       |        // Bail out in that case.
  597|   907k|        auto ret = m_index.get<ByPeer>().emplace(gtxid, peer, preferred, reqtime, m_current_sequence);
  598|   907k|        if (!ret.second) return;
  ------------------
  |  Branch (598:13): [True: 17.7k, False: 889k]
  ------------------
  599|       |
  600|       |        // Update accounting metadata.
  601|   889k|        ++m_peerinfo[peer].m_total;
  602|   889k|        ++m_current_sequence;
  603|   889k|    }
txrequest.cpp:_ZN12_GLOBAL__N_112AnnouncementC2ERK7GenTxidlbNSt3__16chrono8durationIxNS4_5ratioILl1ELl1000000EEEEEm:
  101|   907k|        : m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred),
  102|   907k|          m_is_wtxid{gtxid.IsWtxid()} {}
_ZN16TxRequestTracker4Impl11RequestedTxElRK7uint256NSt3__16chrono8durationIxNS4_5ratioILl1ELl1000000EEEEE:
  636|   841k|    {
  637|   841k|        auto it = m_index.get<ByPeer>().find(ByPeerView{peer, true, txhash});
  638|   841k|        if (it == m_index.get<ByPeer>().end()) {
  ------------------
  |  Branch (638:13): [True: 0, False: 841k]
  ------------------
  639|       |            // There is no CANDIDATE_BEST announcement, look for a _READY or _DELAYED instead. If the caller only
  640|       |            // ever invokes RequestedTx with the values returned by GetRequestable, and no other non-const functions
  641|       |            // other than ForgetTxHash and GetRequestable in between, this branch will never execute (as txhashes
  642|       |            // returned by GetRequestable always correspond to CANDIDATE_BEST announcements).
  643|       |
  644|      0|            it = m_index.get<ByPeer>().find(ByPeerView{peer, false, txhash});
  645|      0|            if (it == m_index.get<ByPeer>().end() || (it->GetState() != State::CANDIDATE_DELAYED &&
  ------------------
  |  Branch (645:17): [True: 0, False: 0]
  |  Branch (645:17): [True: 0, False: 0]
  |  Branch (645:55): [True: 0, False: 0]
  ------------------
  646|      0|                                                      it->GetState() != State::CANDIDATE_READY)) {
  ------------------
  |  Branch (646:55): [True: 0, False: 0]
  ------------------
  647|       |                // There is no CANDIDATE announcement tracked for this peer, so we have nothing to do. Either this
  648|       |                // txhash wasn't tracked at all (and the caller should have called ReceivedInv), or it was already
  649|       |                // requested and/or completed for other reasons and this is just a superfluous RequestedTx call.
  650|      0|                return;
  651|      0|            }
  652|       |
  653|       |            // Look for an existing CANDIDATE_BEST or REQUESTED with the same txhash. We only need to do this if the
  654|       |            // found announcement had a different state than CANDIDATE_BEST. If it did, invariants guarantee that no
  655|       |            // other CANDIDATE_BEST or REQUESTED can exist.
  656|      0|            auto it_old = m_index.get<ByTxHash>().lower_bound(ByTxHashView{txhash, State::CANDIDATE_BEST, 0});
  657|      0|            if (it_old != m_index.get<ByTxHash>().end() && it_old->m_txhash == txhash) {
  ------------------
  |  Branch (657:17): [True: 0, False: 0]
  |  Branch (657:17): [True: 0, False: 0]
  |  Branch (657:60): [True: 0, False: 0]
  ------------------
  658|      0|                if (it_old->GetState() == State::CANDIDATE_BEST) {
  ------------------
  |  Branch (658:21): [True: 0, False: 0]
  ------------------
  659|       |                    // The data structure's invariants require that there can be at most one CANDIDATE_BEST or one
  660|       |                    // REQUESTED announcement per txhash (but not both simultaneously), so we have to convert any
  661|       |                    // existing CANDIDATE_BEST to another CANDIDATE_* when constructing another REQUESTED.
  662|       |                    // It doesn't matter whether we pick CANDIDATE_READY or _DELAYED here, as SetTimePoint()
  663|       |                    // will correct it at GetRequestable() time. If time only goes forward, it will always be
  664|       |                    // _READY, so pick that to avoid extra work in SetTimePoint().
  665|      0|                    Modify<ByTxHash>(it_old, [](Announcement& ann) { ann.SetState(State::CANDIDATE_READY); });
  666|      0|                } else if (it_old->GetState() == State::REQUESTED) {
  ------------------
  |  Branch (666:28): [True: 0, False: 0]
  ------------------
  667|       |                    // As we're no longer waiting for a response to the previous REQUESTED announcement, convert it
  668|       |                    // to COMPLETED. This also helps guaranteeing progress.
  669|      0|                    Modify<ByTxHash>(it_old, [](Announcement& ann) { ann.SetState(State::COMPLETED); });
  670|      0|                }
  671|      0|            }
  672|      0|        }
  673|       |
  674|   841k|        Modify<ByPeer>(it, [expiry](Announcement& ann) {
  675|   841k|            ann.SetState(State::REQUESTED);
  676|   841k|            ann.m_time = expiry;
  677|   841k|        });
  678|   841k|    }
txrequest.cpp:_ZN16TxRequestTracker4Impl6ModifyIN12_GLOBAL__N_16ByPeerEZNS0_11RequestedTxElRK7uint256NSt3__16chrono8durationIxNS7_5ratioILl1ELl1000000EEEEEEUlRNS2_12AnnouncementEE1_EEvN5boost11multi_index21multi_index_containerISD_NS2_20Announcement_IndicesENS7_9allocatorISD_EEE5indexIT_E4type8iteratorET0_:
  389|   841k|    {
  390|   841k|        auto peerit = m_peerinfo.find(it->m_peer);
  391|   841k|        peerit->second.m_completed -= it->GetState() == State::COMPLETED;
  392|   841k|        peerit->second.m_requested -= it->GetState() == State::REQUESTED;
  393|   841k|        m_index.get<Tag>().modify(it, std::move(modifier));
  394|   841k|        peerit->second.m_completed += it->GetState() == State::COMPLETED;
  395|   841k|        peerit->second.m_requested += it->GetState() == State::REQUESTED;
  396|   841k|    }
txrequest.cpp:_ZZN16TxRequestTracker4Impl11RequestedTxElRK7uint256NSt3__16chrono8durationIxNS4_5ratioILl1ELl1000000EEEEEENKUlRN12_GLOBAL__N_112AnnouncementEE1_clESC_:
  674|   841k|        Modify<ByPeer>(it, [expiry](Announcement& ann) {
  675|   841k|            ann.SetState(State::REQUESTED);
  676|   841k|            ann.m_time = expiry;
  677|   841k|        });
_ZN16TxRequestTracker4Impl16ReceivedResponseElRK7uint256:
  681|  2.40k|    {
  682|       |        // We need to search the ByPeer index for both (peer, false, txhash) and (peer, true, txhash).
  683|  2.40k|        auto it = m_index.get<ByPeer>().find(ByPeerView{peer, false, txhash});
  684|  2.40k|        if (it == m_index.get<ByPeer>().end()) {
  ------------------
  |  Branch (684:13): [True: 2.40k, False: 0]
  ------------------
  685|  2.40k|            it = m_index.get<ByPeer>().find(ByPeerView{peer, true, txhash});
  686|  2.40k|        }
  687|  2.40k|        if (it != m_index.get<ByPeer>().end()) MakeCompleted(m_index.project<ByTxHash>(it));
  ------------------
  |  Branch (687:13): [True: 0, False: 2.40k]
  ------------------
  688|  2.40k|    }
_ZN16TxRequestTracker4Impl14GetRequestableElNSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEEPNS1_6vectorINS1_4pairIl7GenTxidEENS1_9allocatorISA_EEEE:
  608|   442k|    {
  609|       |        // Move time.
  610|   442k|        SetTimePoint(now, expired);
  611|       |
  612|       |        // Find all CANDIDATE_BEST announcements for this peer.
  613|   442k|        std::vector<const Announcement*> selected;
  614|   442k|        auto it_peer = m_index.get<ByPeer>().lower_bound(ByPeerView{peer, true, uint256::ZERO});
  615|  1.28M|        while (it_peer != m_index.get<ByPeer>().end() && it_peer->m_peer == peer &&
  ------------------
  |  Branch (615:16): [True: 841k, False: 442k]
  |  Branch (615:16): [True: 841k, False: 442k]
  |  Branch (615:58): [True: 841k, False: 0]
  ------------------
  616|  1.28M|            it_peer->GetState() == State::CANDIDATE_BEST) {
  ------------------
  |  Branch (616:13): [True: 841k, False: 0]
  ------------------
  617|   841k|            selected.emplace_back(&*it_peer);
  618|   841k|            ++it_peer;
  619|   841k|        }
  620|       |
  621|       |        // Sort by sequence number.
  622|   442k|        std::sort(selected.begin(), selected.end(), [](const Announcement* a, const Announcement* b) {
  623|   442k|            return a->m_sequence < b->m_sequence;
  624|   442k|        });
  625|       |
  626|       |        // Convert to GenTxid and return.
  627|   442k|        std::vector<GenTxid> ret;
  628|   442k|        ret.reserve(selected.size());
  629|   442k|        std::transform(selected.begin(), selected.end(), std::back_inserter(ret), [](const Announcement* ann) {
  630|   442k|            return ToGenTxid(*ann);
  631|   442k|        });
  632|   442k|        return ret;
  633|   442k|    }
_ZN16TxRequestTracker4Impl12SetTimePointENSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEEPNS1_6vectorINS1_4pairIl7GenTxidEENS1_9allocatorISA_EEEE:
  494|   442k|    {
  495|   442k|        if (expired) expired->clear();
  ------------------
  |  Branch (495:13): [True: 442k, False: 0]
  ------------------
  496|       |
  497|       |        // Iterate over all CANDIDATE_DELAYED and REQUESTED from old to new, as long as they're in the past,
  498|       |        // and convert them to CANDIDATE_READY and COMPLETED respectively.
  499|  1.28M|        while (!m_index.empty()) {
  ------------------
  |  Branch (499:16): [True: 843k, False: 440k]
  ------------------
  500|   843k|            auto it = m_index.get<ByTime>().begin();
  501|   843k|            if (it->GetState() == State::CANDIDATE_DELAYED && it->m_time <= now) {
  ------------------
  |  Branch (501:17): [True: 841k, False: 1.20k]
  |  Branch (501:63): [True: 841k, False: 393]
  ------------------
  502|   841k|                PromoteCandidateReady(m_index.project<ByTxHash>(it));
  503|   841k|            } else if (it->GetState() == State::REQUESTED && it->m_time <= now) {
  ------------------
  |  Branch (503:24): [True: 0, False: 1.60k]
  |  Branch (503:62): [True: 0, False: 0]
  ------------------
  504|      0|                if (expired) expired->emplace_back(it->m_peer, ToGenTxid(*it));
  ------------------
  |  Branch (504:21): [True: 0, False: 0]
  ------------------
  505|      0|                MakeCompleted(m_index.project<ByTxHash>(it));
  506|  1.60k|            } else {
  507|  1.60k|                break;
  508|  1.60k|            }
  509|   843k|        }
  510|       |
  511|   442k|        while (!m_index.empty()) {
  ------------------
  |  Branch (511:16): [True: 1.60k, False: 440k]
  ------------------
  512|       |            // If time went backwards, we may need to demote CANDIDATE_BEST and CANDIDATE_READY announcements back
  513|       |            // to CANDIDATE_DELAYED. This is an unusual edge case, and unlikely to matter in production. However,
  514|       |            // it makes it much easier to specify and test TxRequestTracker::Impl's behaviour.
  515|  1.60k|            auto it = std::prev(m_index.get<ByTime>().end());
  516|  1.60k|            if (it->IsSelectable() && it->m_time > now) {
  ------------------
  |  Branch (516:17): [True: 1.20k, False: 393]
  |  Branch (516:39): [True: 0, False: 1.20k]
  ------------------
  517|      0|                ChangeAndReselect(m_index.project<ByTxHash>(it), State::CANDIDATE_DELAYED);
  518|  1.60k|            } else {
  519|  1.60k|                break;
  520|  1.60k|            }
  521|  1.60k|        }
  522|   442k|    }
txrequest.cpp:_ZN16TxRequestTracker4Impl21PromoteCandidateReadyEN5boost11multi_index9safe_mode13safe_iteratorINS2_6detail19bidir_node_iteratorINS5_18ordered_index_nodeINS5_19null_augment_policyENS7_IS8_NS5_15index_node_baseIN12_GLOBAL__N_112AnnouncementENSt3__19allocatorISB_EEEEEEEEEEEE:
  402|   841k|    {
  403|   841k|        assert(it != m_index.get<ByTxHash>().end());
  404|   841k|        assert(it->GetState() == State::CANDIDATE_DELAYED);
  405|       |        // Convert CANDIDATE_DELAYED to CANDIDATE_READY first.
  406|   841k|        Modify<ByTxHash>(it, [](Announcement& ann){ ann.SetState(State::CANDIDATE_READY); });
  407|       |        // The following code relies on the fact that the ByTxHash is sorted by txhash, and then by state (first
  408|       |        // _DELAYED, then _READY, then _BEST/REQUESTED). Within the _READY announcements, the best one (highest
  409|       |        // priority) comes last. Thus, if an existing _BEST exists for the same txhash that this announcement may
  410|       |        // be preferred over, it must immediately follow the newly created _READY.
  411|   841k|        auto it_next = std::next(it);
  412|   841k|        if (it_next == m_index.get<ByTxHash>().end() || it_next->m_txhash != it->m_txhash ||
  ------------------
  |  Branch (412:13): [True: 1.20k, False: 840k]
  |  Branch (412:13): [True: 841k, False: 0]
  |  Branch (412:57): [True: 840k, False: 0]
  ------------------
  413|   841k|            it_next->GetState() == State::COMPLETED) {
  ------------------
  |  Branch (413:13): [True: 0, False: 0]
  ------------------
  414|       |            // This is the new best CANDIDATE_READY, and there is no IsSelected() announcement for this txhash
  415|       |            // already.
  416|   841k|            Modify<ByTxHash>(it, [](Announcement& ann){ ann.SetState(State::CANDIDATE_BEST); });
  417|   841k|        } else if (it_next->GetState() == State::CANDIDATE_BEST) {
  ------------------
  |  Branch (417:20): [True: 0, False: 0]
  ------------------
  418|      0|            Priority priority_old = m_computer(*it_next);
  419|      0|            Priority priority_new = m_computer(*it);
  420|      0|            if (priority_new > priority_old) {
  ------------------
  |  Branch (420:17): [True: 0, False: 0]
  ------------------
  421|       |                // There is a CANDIDATE_BEST announcement already, but this one is better.
  422|      0|                Modify<ByTxHash>(it_next, [](Announcement& ann){ ann.SetState(State::CANDIDATE_READY); });
  423|      0|                Modify<ByTxHash>(it, [](Announcement& ann){ ann.SetState(State::CANDIDATE_BEST); });
  424|      0|            }
  425|      0|        }
  426|   841k|    }
txrequest.cpp:_ZN16TxRequestTracker4Impl6ModifyIN12_GLOBAL__N_18ByTxHashEZNS0_21PromoteCandidateReadyEN5boost11multi_index9safe_mode13safe_iteratorINS5_6detail19bidir_node_iteratorINS8_18ordered_index_nodeINS8_19null_augment_policyENSA_ISB_NS8_15index_node_baseINS2_12AnnouncementENSt3__19allocatorISD_EEEEEEEEEEEEEUlRSD_E_EEvNS5_21multi_index_containerISD_NS2_20Announcement_IndicesESG_E5indexIT_E4type8iteratorET0_:
  389|   841k|    {
  390|   841k|        auto peerit = m_peerinfo.find(it->m_peer);
  391|   841k|        peerit->second.m_completed -= it->GetState() == State::COMPLETED;
  392|   841k|        peerit->second.m_requested -= it->GetState() == State::REQUESTED;
  393|   841k|        m_index.get<Tag>().modify(it, std::move(modifier));
  394|   841k|        peerit->second.m_completed += it->GetState() == State::COMPLETED;
  395|   841k|        peerit->second.m_requested += it->GetState() == State::REQUESTED;
  396|   841k|    }
txrequest.cpp:_ZZN16TxRequestTracker4Impl21PromoteCandidateReadyEN5boost11multi_index9safe_mode13safe_iteratorINS2_6detail19bidir_node_iteratorINS5_18ordered_index_nodeINS5_19null_augment_policyENS7_IS8_NS5_15index_node_baseIN12_GLOBAL__N_112AnnouncementENSt3__19allocatorISB_EEEEEEEEEEEEENKUlRSB_E_clESK_:
  406|   841k|        Modify<ByTxHash>(it, [](Announcement& ann){ ann.SetState(State::CANDIDATE_READY); });
txrequest.cpp:_ZN16TxRequestTracker4Impl6ModifyIN12_GLOBAL__N_18ByTxHashEZNS0_21PromoteCandidateReadyEN5boost11multi_index9safe_mode13safe_iteratorINS5_6detail19bidir_node_iteratorINS8_18ordered_index_nodeINS8_19null_augment_policyENSA_ISB_NS8_15index_node_baseINS2_12AnnouncementENSt3__19allocatorISD_EEEEEEEEEEEEEUlRSD_E0_EEvNS5_21multi_index_containerISD_NS2_20Announcement_IndicesESG_E5indexIT_E4type8iteratorET0_:
  389|   841k|    {
  390|   841k|        auto peerit = m_peerinfo.find(it->m_peer);
  391|   841k|        peerit->second.m_completed -= it->GetState() == State::COMPLETED;
  392|   841k|        peerit->second.m_requested -= it->GetState() == State::REQUESTED;
  393|   841k|        m_index.get<Tag>().modify(it, std::move(modifier));
  394|   841k|        peerit->second.m_completed += it->GetState() == State::COMPLETED;
  395|   841k|        peerit->second.m_requested += it->GetState() == State::REQUESTED;
  396|   841k|    }
txrequest.cpp:_ZZN16TxRequestTracker4Impl21PromoteCandidateReadyEN5boost11multi_index9safe_mode13safe_iteratorINS2_6detail19bidir_node_iteratorINS5_18ordered_index_nodeINS5_19null_augment_policyENS7_IS8_NS5_15index_node_baseIN12_GLOBAL__N_112AnnouncementENSt3__19allocatorISB_EEEEEEEEEEEEENKUlRSB_E0_clESK_:
  416|   841k|            Modify<ByTxHash>(it, [](Announcement& ann){ ann.SetState(State::CANDIDATE_BEST); });
txrequest.cpp:_ZN12_GLOBAL__N_19ToGenTxidERKNS_12AnnouncementE:
  303|   841k|{
  304|   841k|    return ann.m_is_wtxid ? GenTxid::Wtxid(ann.m_txhash) : GenTxid::Txid(ann.m_txhash);
  ------------------
  |  Branch (304:12): [True: 0, False: 841k]
  ------------------
  305|   841k|}
txrequest.cpp:_ZZN16TxRequestTracker4Impl14GetRequestableElNSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEEPNS1_6vectorINS1_4pairIl7GenTxidEENS1_9allocatorISA_EEEEENKUlPKN12_GLOBAL__N_112AnnouncementESI_E_clESI_SI_:
  622|  27.1M|        std::sort(selected.begin(), selected.end(), [](const Announcement* a, const Announcement* b) {
  623|  27.1M|            return a->m_sequence < b->m_sequence;
  624|  27.1M|        });
txrequest.cpp:_ZZN16TxRequestTracker4Impl14GetRequestableElNSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEEPNS1_6vectorINS1_4pairIl7GenTxidEENS1_9allocatorISA_EEEEENKUlPKN12_GLOBAL__N_112AnnouncementEE_clESI_:
  629|   841k|        std::transform(selected.begin(), selected.end(), std::back_inserter(ret), [](const Announcement* ann) {
  630|   841k|            return ToGenTxid(*ann);
  631|   841k|        });

_ZNK9base_blobILj256EE6GetHexEv:
   12|  8.78k|{
   13|  8.78k|    uint8_t m_data_rev[WIDTH];
   14|   289k|    for (int i = 0; i < WIDTH; ++i) {
  ------------------
  |  Branch (14:21): [True: 281k, False: 8.78k]
  ------------------
   15|   281k|        m_data_rev[i] = m_data[WIDTH - 1 - i];
   16|   281k|    }
   17|  8.78k|    return HexStr(m_data_rev);
   18|  8.78k|}
_ZNK9base_blobILj256EE8ToStringEv:
   48|    313|{
   49|    313|    return (GetHex());
   50|    313|}

_ZN9base_blobILj256EE5beginEv:
  115|   815k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE6IsNullEv:
   49|   766k|    {
   50|   766k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   51|   766k|            return val == 0;
   52|   766k|        });
   53|   766k|    }
_ZNK9base_blobILj256EE5beginEv:
  118|  33.0k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  121|  7.04M|    static constexpr unsigned int size() { return WIDTH; }
_ZNK9base_blobILj256EE7CompareERKS0_:
   64|   134M|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZeqRK9base_blobILj256EES2_:
   66|  1.80M|    friend constexpr bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; }
_ZneRK9base_blobILj256EES2_:
   67|   841k|    friend constexpr bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; }
_ZltRK9base_blobILj256EES2_:
   68|   131M|    friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
_ZN9base_blobILj256EE7SetNullEv:
   56|  3.04M|    {
   57|  3.04M|        std::fill(m_data.begin(), m_data.end(), 0);
   58|  3.04M|    }
_ZNK9base_blobILj256EE4dataEv:
  112|  6.89M|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj256EE4dataEv:
  113|   159k|    constexpr unsigned char* data() { return m_data.data(); }
_ZN7uint256C2Ev:
  205|  3.39M|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   35|  3.39M|    constexpr base_blob() : m_data() {}
_ZNK9base_blobILj256EE9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
  127|  40.6k|    {
  128|  40.6k|        s << Span(m_data);
  129|  40.6k|    }
_ZN9base_blobILj256EE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
  133|  61.3k|    {
  134|  61.3k|        s.read(MakeWritableByteSpan(m_data));
  135|  61.3k|    }
_ZN9base_blobILj256EE11UnserializeI10DataStreamEEvRT_:
  133|  2.95M|    {
  134|  2.95M|        s.read(MakeWritableByteSpan(m_data));
  135|  2.95M|    }
_ZZNK9base_blobILj256EE6IsNullEvENKUlhE_clEh:
   50|  24.2M|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   51|  24.2M|            return val == 0;
   52|  24.2M|        });
_ZNK9base_blobILj256EE9GetUint64Ei:
  123|  7.23M|    constexpr uint64_t GetUint64(int pos) const { return ReadLE64(m_data.data() + pos * 8); }
_ZNK9base_blobILj256EE9SerializeI10DataStreamEEvRT_:
  127|  1.22k|    {
  128|  1.22k|        s << Span(m_data);
  129|  1.22k|    }
_ZNK9base_blobILj256EE9SerializeI12VectorWriterEEvRT_:
  127|   965k|    {
  128|   965k|        s << Span(m_data);
  129|   965k|    }
_ZNK9base_blobILj256EE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
  127|  14.2k|    {
  128|  14.2k|        s << Span(m_data);
  129|  14.2k|    }
_ZNK9base_blobILj256EE9SerializeI10HashWriterEEvRT_:
  127|   152k|    {
  128|   152k|        s << Span(m_data);
  129|   152k|    }
_ZN9base_blobILj256EE11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
  133|  4.59k|    {
  134|  4.59k|        s.read(MakeWritableByteSpan(m_data));
  135|  4.59k|    }
_ZNK9base_blobILj256EE9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
  127|  74.3k|    {
  128|  74.3k|        s << Span(m_data);
  129|  74.3k|    }

_ZN8UniValueC2Ev:
   31|  83.8k|    UniValue() { typ = VNULL; }
_ZNK8UniValue6isNullEv:
   79|  83.8k|    bool isNull() const { return (typ == VNULL); }

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

_Z22inline_assertion_checkILb0EbEOT0_S1_PKciS3_S3_:
   52|  1.18M|{
   53|  1.18M|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  1.18M|    ) {
   58|  1.18M|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 1.18M]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  1.18M|    }
   62|  1.18M|    return std::forward<T>(val);
   63|  1.18M|}
_Z22inline_assertion_checkILb1ERKNSt3__110unique_ptrI14LevelDBContextNS0_14default_deleteIS2_EEEEEOT0_S9_PKciSB_SB_:
   52|  1.14k|{
   53|  1.14k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  1.14k|    ) {
   58|  1.14k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 1.14k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  1.14k|    }
   62|  1.14k|    return std::forward<T>(val);
   63|  1.14k|}
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI10CoinsViewsNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_:
   52|  8.01k|{
   53|  8.01k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  8.01k|    ) {
   58|  8.01k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 8.01k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  8.01k|    }
   62|  8.01k|    return std::forward<T>(val);
   63|  8.01k|}
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI15CCoinsViewCacheNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_:
   52|  8.01k|{
   53|  8.01k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  8.01k|    ) {
   58|  8.01k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 8.01k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  8.01k|    }
   62|  8.01k|    return std::forward<T>(val);
   63|  8.01k|}
_Z22inline_assertion_checkILb1ERKNSt3__18optionalI13arith_uint256EEEOT0_S7_PKciS9_S9_:
   52|   508k|{
   53|   508k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|   508k|    ) {
   58|   508k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 508k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|   508k|    }
   62|   508k|    return std::forward<T>(val);
   63|   508k|}
_Z22inline_assertion_checkILb1EbEOT0_S1_PKciS3_S3_:
   52|  33.8k|{
   53|  33.8k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  33.8k|    ) {
   58|  33.8k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 33.8k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  33.8k|    }
   62|  33.8k|    return std::forward<T>(val);
   63|  33.8k|}
_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_PKciSD_SD_:
   52|  8.47k|{
   53|  8.47k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  8.47k|    ) {
   58|  8.47k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 8.47k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  8.47k|    }
   62|  8.47k|    return std::forward<T>(val);
   63|  8.47k|}
_Z22inline_assertion_checkILb1ERNSt3__16atomicIbEEEOT0_S5_PKciS7_S7_:
   52|  8.47k|{
   53|  8.47k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  8.47k|    ) {
   58|  8.47k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 8.47k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  8.47k|    }
   62|  8.47k|    return std::forward<T>(val);
   63|  8.47k|}
_Z22inline_assertion_checkILb1EPK11CBlockIndexEOT0_S4_PKciS6_S6_:
   52|     20|{
   53|     20|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|     20|    ) {
   58|     20|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 20]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|     20|    }
   62|     20|    return std::forward<T>(val);
   63|     20|}
_Z22inline_assertion_checkILb1EP11CBlockIndexEOT0_S3_PKciS5_S5_:
   52|    835|{
   53|    835|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|    835|    ) {
   58|    835|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 835]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|    835|    }
   62|    835|    return std::forward<T>(val);
   63|    835|}
net_processing.cpp:_Z22inline_assertion_checkILb1EPN12_GLOBAL__N_110CNodeStateEEOT0_S4_PKciS6_S6_:
   52|    275|{
   53|    275|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|    275|    ) {
   58|    275|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 275]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|    275|    }
   62|    275|    return std::forward<T>(val);
   63|    275|}
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_1clEv:
   97|  17.1k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (97:51): [True: 5.70k, False: 0]
  |  Branch (97:51): [True: 5.70k, False: 0]
  ------------------
_Z22inline_assertion_checkILb0ERKbEOT0_S3_PKciS5_S5_:
   52|  1.36k|{
   53|  1.36k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  1.36k|    ) {
   58|  1.36k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 1.36k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  1.36k|    }
   62|  1.36k|    return std::forward<T>(val);
   63|  1.36k|}
_Z22inline_assertion_checkILb1ERKNSt3__18optionalIiEEEOT0_S6_PKciS8_S8_:
   52|    731|{
   53|    731|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|    731|    ) {
   58|    731|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 731]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|    731|    }
   62|    731|    return std::forward<T>(val);
   63|    731|}

bloom.cpp:_ZL11FastRange32jj:
   20|  20.9M|{
   21|  20.9M|    return (uint64_t{x} * n) >> 32;
   22|  20.9M|}

_ZN8fsbridge5fopenERKN2fs4pathEPKc:
   27|  1.59k|{
   28|  1.59k|#ifndef WIN32
   29|  1.59k|    return ::fopen(p.c_str(), mode);
   30|       |#else
   31|       |    std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t> utf8_cvt;
   32|       |    return ::_wfopen(p.wstring().c_str(), utf8_cvt.from_bytes(mode).c_str());
   33|       |#endif
   34|  1.59k|}

_ZN2fs4pathC2ENSt3__14__fs10filesystem4pathE:
   38|  1.59k|    path(std::filesystem::path path) : std::filesystem::path::path(std::move(path)) {}
_ZN2fs4pathdVERKNSt3__14__fs10filesystem4pathE:
   40|  1.59k|    path& operator/=(const std::filesystem::path& path) { std::filesystem::path::operator/=(path); return *this; }
flatfile.cpp:_ZN2fsL6u8pathERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   76|  1.59k|{
   77|  1.59k|    return std::filesystem::path(std::u8string{utf8_str.begin(), utf8_str.end()});
   78|  1.59k|}
flatfile.cpp:_ZN2fsdvENS_4pathERKS0_:
  102|  1.59k|{
  103|  1.59k|    p1 /= p2;
  104|  1.59k|    return p1;
  105|  1.59k|}
flatfile.cpp:_ZN2fsL18create_directoriesERKNSt3__14__fs10filesystem4pathE:
  191|  1.59k|{
  192|  1.59k|    if (std::filesystem::is_symlink(p) && std::filesystem::is_directory(p)) {
  ------------------
  |  Branch (192:9): [True: 0, False: 1.59k]
  |  Branch (192:43): [True: 0, False: 0]
  ------------------
  193|      0|        return false;
  194|      0|    }
  195|  1.59k|    return std::filesystem::create_directories(p);
  196|  1.59k|}

_ZN20SaltedOutpointHasherC2Eb:
   15|  5.44k|    k0{deterministic ? 0x8e819f2607a18de6 : FastRandomContext().rand64()},
  ------------------
  |  Branch (15:8): [True: 0, False: 5.44k]
  ------------------
   16|  5.44k|    k1{deterministic ? 0xf4020d2e3983b0eb : FastRandomContext().rand64()}
  ------------------
  |  Branch (16:8): [True: 0, False: 5.44k]
  ------------------
   17|  5.44k|{}

_ZNK16SaltedTxidHasherclERK7uint256:
   26|  1.79M|    size_t operator()(const uint256& txid) const {
   27|  1.79M|        return SipHashUint256(k0, k1, txid);
   28|  1.79M|    }
_ZNK20SaltedOutpointHasherclERK9COutPoint:
   49|  4.62k|    size_t operator()(const COutPoint& id) const noexcept {
   50|  4.62k|        return SipHashUint256Extra(k0, k1, id.hash, id.n);
   51|  4.62k|    }
_ZNK11BlockHasherclERK7uint256:
   85|  29.1k|    size_t operator()(const uint256& hash) const { return ReadLE64(hash.begin()); }

_Z11FormatMoneyl:
   20|    134|{
   21|       |    // Note: not using straight sprintf here because we do NOT want
   22|       |    // localized number formatting.
   23|    134|    static_assert(COIN > 1);
   24|    134|    int64_t quotient = n / COIN;
   25|    134|    int64_t remainder = n % COIN;
   26|    134|    if (n < 0) {
  ------------------
  |  Branch (26:9): [True: 0, False: 134]
  ------------------
   27|      0|        quotient = -quotient;
   28|      0|        remainder = -remainder;
   29|      0|    }
   30|    134|    std::string str = strprintf("%d.%08d", quotient, remainder);
  ------------------
  |  | 1172|    134|#define strprintf tfm::format
  ------------------
   31|       |
   32|       |    // Right-trim excess zeros before the decimal point:
   33|    134|    int nTrim = 0;
   34|    557|    for (int i = str.size()-1; (str[i] == '0' && IsDigit(str[i-2])); --i)
  ------------------
  |  Branch (34:33): [True: 491, False: 66]
  |  Branch (34:50): [True: 423, False: 68]
  ------------------
   35|    423|        ++nTrim;
   36|    134|    if (nTrim)
  ------------------
  |  Branch (36:9): [True: 80, False: 54]
  ------------------
   37|     80|        str.erase(str.size()-nTrim, nTrim);
   38|       |
   39|    134|    if (n < 0)
  ------------------
  |  Branch (39:9): [True: 0, False: 134]
  ------------------
   40|      0|        str.insert(uint32_t{0}, 1, '-');
   41|    134|    return str;
   42|    134|}

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

_ZN4SockC2Ej:
   27|  8.47k|Sock::Sock(SOCKET s) : m_socket(s) {}
_ZN4SockD2Ev:
   35|  8.47k|Sock::~Sock() { Close(); }
_ZN4Sock5CloseEv:
  402|  8.47k|{
  403|  8.47k|    if (m_socket == INVALID_SOCKET) {
  ------------------
  |  |   56|  8.47k|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  |  Branch (403:9): [True: 8.47k, False: 0]
  ------------------
  404|  8.47k|        return;
  405|  8.47k|    }
  406|       |#ifdef WIN32
  407|       |    int ret = closesocket(m_socket);
  408|       |#else
  409|      0|    int ret = close(m_socket);
  410|      0|#endif
  411|      0|    if (ret) {
  ------------------
  |  Branch (411:9): [True: 0, False: 0]
  ------------------
  412|      0|        LogPrintf("Error closing socket %d: %s\n", m_socket, NetworkErrorString(WSAGetLastError()));
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  413|      0|    }
  414|      0|    m_socket = INVALID_SOCKET;
  ------------------
  |  |   56|      0|#define INVALID_SOCKET      (SOCKET)(~0)
  ------------------
  415|      0|}

_Z14SanitizeStringNSt3__117basic_string_viewIcNS_11char_traitsIcEEEEi:
   31|  8.35k|{
   32|  8.35k|    std::string result;
   33|  8.35k|    for (char c : str) {
  ------------------
  |  Branch (33:17): [True: 0, False: 8.35k]
  ------------------
   34|      0|        if (SAFE_CHARS[rule].find(c) != std::string::npos) {
  ------------------
  |  Branch (34:13): [True: 0, False: 0]
  ------------------
   35|      0|            result.push_back(c);
   36|      0|        }
   37|      0|    }
   38|  8.35k|    return result;
   39|  8.35k|}
_Z12EncodeBase324SpanIKhEb:
  146|    134|{
  147|    134|    static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567";
  148|       |
  149|    134|    std::string str;
  150|    134|    str.reserve(((input.size() + 4) / 5) * 8);
  151|    134|    ConvertBits<8, 5, true>([&](int v) { str += pbase32[v]; }, input.begin(), input.end());
  152|    134|    if (pad) {
  ------------------
  |  Branch (152:9): [True: 98, False: 36]
  ------------------
  153|     98|        while (str.size() % 8) {
  ------------------
  |  Branch (153:16): [True: 0, False: 98]
  ------------------
  154|      0|            str += '=';
  155|      0|        }
  156|     98|    }
  157|    134|    return str;
  158|    134|}
strencodings.cpp:_ZZ12EncodeBase324SpanIKhEbENK3$_0clEi:
  151|  5.36k|    ConvertBits<8, 5, true>([&](int v) { str += pbase32[v]; }, input.begin(), input.end());

_Z7IsDigitc:
  151|    491|{
  152|    491|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (152:12): [True: 423, False: 68]
  |  Branch (152:24): [True: 423, False: 0]
  ------------------
  153|    491|}
strencodings.cpp:_ZNK12_GLOBAL__N_111IntIdentityclEi:
  263|  3.33k|    [[maybe_unused]] int operator()(int x) const { return x; }
strencodings.cpp:_Z11ConvertBitsILi8ELi5ELb1EZ12EncodeBase324SpanIKhEbE3$_0PS1_N12_GLOBAL__N_111IntIdentityEEbT2_T3_S8_T4_:
  270|    134|bool ConvertBits(O outfn, It it, It end, I infn = {}) {
  271|    134|    size_t acc = 0;
  272|    134|    size_t bits = 0;
  273|    134|    constexpr size_t maxv = (1 << tobits) - 1;
  274|    134|    constexpr size_t max_acc = (1 << (frombits + tobits - 1)) - 1;
  275|  3.46k|    while (it != end) {
  ------------------
  |  Branch (275:12): [True: 3.33k, False: 134]
  ------------------
  276|  3.33k|        int v = infn(*it);
  277|  3.33k|        if (v < 0) return false;
  ------------------
  |  Branch (277:13): [True: 0, False: 3.33k]
  ------------------
  278|  3.33k|        acc = ((acc << frombits) | v) & max_acc;
  279|  3.33k|        bits += frombits;
  280|  8.65k|        while (bits >= tobits) {
  ------------------
  |  Branch (280:16): [True: 5.32k, False: 3.33k]
  ------------------
  281|  5.32k|            bits -= tobits;
  282|  5.32k|            outfn((acc >> bits) & maxv);
  283|  5.32k|        }
  284|  3.33k|        ++it;
  285|  3.33k|    }
  286|    134|    if (pad) {
  ------------------
  |  Branch (286:9): [Folded - Ignored]
  ------------------
  287|    134|        if (bits) outfn((acc << (tobits - bits)) & maxv);
  ------------------
  |  Branch (287:13): [True: 36, False: 98]
  ------------------
  288|    134|    } else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {
  ------------------
  |  Branch (288:16): [True: 0, False: 0]
  |  Branch (288:36): [True: 0, False: 0]
  ------------------
  289|      0|        return false;
  290|      0|    }
  291|    134|    return true;
  292|    134|}
_Z10ToIntegralIhENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|     10|{
  181|     10|    static_assert(std::is_integral<T>::value);
  182|     10|    T result;
  183|     10|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|     10|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 0, False: 10]
  |  Branch (184:57): [True: 0, False: 10]
  ------------------
  185|      0|        return std::nullopt;
  186|      0|    }
  187|     10|    return result;
  188|     10|}
_Z10ToIntegralItENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|      2|{
  181|      2|    static_assert(std::is_integral<T>::value);
  182|      2|    T result;
  183|      2|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|      2|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 0, False: 2]
  |  Branch (184:57): [True: 0, False: 2]
  ------------------
  185|      0|        return std::nullopt;
  186|      0|    }
  187|      2|    return result;
  188|      2|}

_ZN4util9HasPrefixI9prevectorILj16EhjiELm6EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|  23.4k|{
  248|  23.4k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 23.4k, False: 0]
  ------------------
  249|  23.4k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 726, False: 22.6k]
  ------------------
  250|  23.4k|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm12EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|   414k|{
  248|   414k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 414k, False: 0]
  ------------------
  249|   414k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 15.2k, False: 398k]
  ------------------
  250|   414k|}
_ZN4util9HasPrefixI4SpanIKhELm12EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|   113k|{
  248|   113k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 113k, False: 0]
  ------------------
  249|   113k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 835, False: 112k]
  ------------------
  250|   113k|}
_ZN4util9HasPrefixI4SpanIKhELm6EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|   225k|{
  248|   225k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 225k, False: 0]
  ------------------
  249|   225k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 288, False: 224k]
  ------------------
  250|   225k|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm2EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|   254k|{
  248|   254k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 254k, False: 0]
  ------------------
  249|   254k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 2.47k, False: 252k]
  ------------------
  250|   254k|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm3EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|  1.36M|{
  248|  1.36M|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 1.36M, False: 0]
  ------------------
  249|  1.36M|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 22.6k, False: 1.33M]
  ------------------
  250|  1.36M|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm4EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|   842k|{
  248|   842k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 842k, False: 0]
  ------------------
  249|   842k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 5.58k, False: 837k]
  ------------------
  250|   842k|}
_ZN4util9HasPrefixI9prevectorILj16EhjiELm8EEEbRKT_RKNSt3__15arrayIhXT0_EEE:
  247|   593k|{
  248|   593k|    return obj.size() >= PREFIX_LEN &&
  ------------------
  |  Branch (248:12): [True: 593k, False: 0]
  ------------------
  249|   593k|           std::equal(std::begin(prefix), std::end(prefix), std::begin(obj));
  ------------------
  |  Branch (249:12): [True: 775, False: 592k]
  ------------------
  250|   593k|}

_ZN4util19TaskRunnerInterfaceD2Ev:
   22|      2|    virtual ~TaskRunnerInterface() = default;

_ZN16CThreadInterruptclEv:
   23|      4|{
   24|      4|    {
   25|      4|        LOCK(mut);
  ------------------
  |  |  257|      4|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      4|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      4|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      4|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   26|      4|        flag.store(true, std::memory_order_release);
   27|      4|    }
   28|      4|    cond.notify_all();
   29|      4|}

_ZN9NodeClock3nowEv:
   27|  1.71M|{
   28|  1.71M|    const auto mocktime{g_mock_time.load(std::memory_order_relaxed)};
   29|  1.71M|    if (!mocktime.count()) {
  ------------------
  |  Branch (29:9): [True: 1, False: 1.71M]
  ------------------
   30|      1|        g_used_system_time = true;
   31|      1|    }
   32|  1.71M|    const auto ret{
   33|  1.71M|        mocktime.count() ?
  ------------------
  |  Branch (33:9): [True: 1.71M, False: 1]
  ------------------
   34|  1.71M|            mocktime :
   35|  1.71M|            std::chrono::system_clock::now().time_since_epoch()};
   36|  1.71M|    assert(ret > 0s);
   37|  1.71M|    return time_point{ret};
   38|  1.71M|};
_Z11SetMockTimel:
   40|  16.9k|void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
_Z11SetMockTimeNSt3__16chrono8durationIxNS_5ratioILl1ELl1EEEEE:
   42|  25.4k|{
   43|  25.4k|    Assert(mock_time_in >= 0s);
  ------------------
  |  |   85|  25.4k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   44|  25.4k|    g_mock_time.store(mock_time_in, std::memory_order_relaxed);
   45|  25.4k|}
_Z7GetTimev:
   76|  74.0k|int64_t GetTime() { return GetTime<std::chrono::seconds>().count(); }
_Z20ParseISO8601DateTimeNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
   96|      2|{
   97|      2|    constexpr auto FMT_SIZE{std::string_view{"2000-01-01T01:01:01Z"}.size()};
   98|      2|    if (str.size() != FMT_SIZE || str[4] != '-' || str[7] != '-' || str[10] != 'T' || str[13] != ':' || str[16] != ':' || str[19] != 'Z') {
  ------------------
  |  Branch (98:9): [True: 0, False: 2]
  |  Branch (98:35): [True: 0, False: 2]
  |  Branch (98:52): [True: 0, False: 2]
  |  Branch (98:69): [True: 0, False: 2]
  |  Branch (98:87): [True: 0, False: 2]
  |  Branch (98:105): [True: 0, False: 2]
  |  Branch (98:123): [True: 0, False: 2]
  ------------------
   99|      0|        return {};
  100|      0|    }
  101|      2|    const auto year{ToIntegral<uint16_t>(str.substr(0, 4))};
  102|      2|    const auto month{ToIntegral<uint8_t>(str.substr(5, 2))};
  103|      2|    const auto day{ToIntegral<uint8_t>(str.substr(8, 2))};
  104|      2|    const auto hour{ToIntegral<uint8_t>(str.substr(11, 2))};
  105|      2|    const auto min{ToIntegral<uint8_t>(str.substr(14, 2))};
  106|      2|    const auto sec{ToIntegral<uint8_t>(str.substr(17, 2))};
  107|      2|    if (!year || !month || !day || !hour || !min || !sec) {
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  |  Branch (107:18): [True: 0, False: 2]
  |  Branch (107:28): [True: 0, False: 2]
  |  Branch (107:36): [True: 0, False: 2]
  |  Branch (107:45): [True: 0, False: 2]
  |  Branch (107:53): [True: 0, False: 2]
  ------------------
  108|      0|        return {};
  109|      0|    }
  110|      2|    const std::chrono::year_month_day ymd{std::chrono::year{*year}, std::chrono::month{*month}, std::chrono::day{*day}};
  111|      2|    if (!ymd.ok()) {
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  ------------------
  112|      0|        return {};
  113|      0|    }
  114|      2|    const auto time{std::chrono::hours{*hour} + std::chrono::minutes{*min} + std::chrono::seconds{*sec}};
  115|      2|    const auto tp{std::chrono::sys_days{ymd} + time};
  116|      2|    return int64_t{TicksSinceEpoch<std::chrono::seconds>(tp)};
  117|      2|}

_Z13count_secondsNSt3__16chrono8durationIxNS_5ratioILl1ELl1EEEEE:
   81|  8.62k|constexpr int64_t count_seconds(std::chrono::seconds t) { return t.count(); }
_Z15TicksSinceEpochINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEENS1_10time_pointI9NodeClockS5_EEEDaT0_:
   78|  19.6k|{
   79|  19.6k|    return Ticks<Duration>(t.time_since_epoch());
   80|  19.6k|}
_Z5TicksINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEES5_EDaT0_:
   73|  19.6k|{
   74|  19.6k|    return std::chrono::duration_cast<Dur1>(d).count();
   75|  19.6k|}
_Z3NowINSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1EEEEEEEET_v:
  119|  1.17M|{
  120|  1.17M|    return std::chrono::time_point_cast<typename T::duration>(T::clock::now());
  121|  1.17M|}
_Z15TicksSinceEpochINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEENS1_10time_pointINS1_12system_clockES5_EEEDaT0_:
   78|      2|{
   79|      2|    return Ticks<Duration>(t.time_since_epoch());
   80|      2|}
_Z7GetTimeINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEEET_v:
  125|   625k|{
  126|   625k|    return Now<std::chrono::time_point<NodeClock, T>>().time_since_epoch();
  127|   625k|}
_Z5TicksINSt3__16chrono8durationIxNS0_5ratioILl1ELl1EEEEENS2_IxNS3_ILl1ELl1000000EEEEEEDaT0_:
   73|  3.73k|{
   74|  3.73k|    return std::chrono::duration_cast<Dur1>(d).count();
   75|  3.73k|}
_Z7GetTimeINSt3__16chrono8durationIxNS0_5ratioILl1ELl1000000EEEEEET_v:
  125|   496k|{
  126|   496k|    return Now<std::chrono::time_point<NodeClock, T>>().time_since_epoch();
  127|   496k|}
_Z3NowINSt3__16chrono10time_pointI9NodeClockNS1_8durationIxNS0_5ratioILl1ELl1000000EEEEEEEET_v:
  119|   496k|{
  120|   496k|    return std::chrono::time_point_cast<typename T::duration>(T::clock::now());
  121|   496k|}
_Z5TicksINSt3__16chrono8durationIdNS0_5ratioILl1ELl1EEEEENS2_IxNS3_ILl1ELl1000000EEEEEEDaT0_:
   73|    611|{
   74|    611|    return std::chrono::duration_cast<Dur1>(d).count();
   75|    611|}
_Z5TicksINSt3__16chrono8durationIlNS0_5ratioILl60ELl1EEEEES5_EDaT0_:
   73|  3.18k|{
   74|  3.18k|    return std::chrono::duration_cast<Dur1>(d).count();
   75|  3.18k|}

_ZN12TokenPipeEndD2Ev:
   34|      4|{
   35|      4|    Close();
   36|      4|}
_ZN12TokenPipeEnd5CloseEv:
   77|      4|{
   78|      4|    if (m_fd != -1) close(m_fd);
  ------------------
  |  Branch (78:9): [True: 4, False: 0]
  ------------------
   79|      4|    m_fd = -1;
   80|      4|}

_ZNK22transaction_identifierILb0EE6IsNullEv:
   43|  8.07k|    constexpr bool IsNull() const { return m_wrapped.IsNull(); }
_ZNK22transaction_identifierILb0EE7CompareERKS0_:
   21|   140k|    constexpr int Compare(const transaction_identifier<has_witness>& other) const { return m_wrapped.Compare(other.m_wrapped); }
_ZNK22transaction_identifierILb0EEltIS0_EEbRKT_:
   37|   137k|    bool operator<(const Other& other) const { return Compare(other) < 0; }
_ZNK22transaction_identifierILb0EEeqIS0_EEbRKT_:
   33|  3.21k|    bool operator==(const Other& other) const { return Compare(other) == 0; }
_ZNK22transaction_identifierILb0EEcvRK7uint256Ev:
   67|  30.1k|    operator const uint256&() const LIFETIMEBOUND { return m_wrapped; }
_ZNK22transaction_identifierILb0EE9SerializeI12ParamsStreamIR12SizeComputer20TransactionSerParamsEEEvRT_:
   57|  40.4k|    template <typename Stream> void Serialize(Stream& s) const { m_wrapped.Serialize(s); }
_ZN22transaction_identifierILb0EEC2Ev:
   30|  65.2k|    transaction_identifier() : m_wrapped{} {}
_ZN22transaction_identifierILb0EE11UnserializeI12ParamsStreamIR10DataStream20TransactionSerParamsEEEvRT_:
   58|  60.9k|    template <typename Stream> void Unserialize(Stream& s) { m_wrapped.Unserialize(s); }
_ZNK22transaction_identifierILb1EEcvRK7uint256Ev:
   67|  11.8k|    operator const uint256&() const LIFETIMEBOUND { return m_wrapped; }
_ZN22transaction_identifierILb0EE11FromUint256ERK7uint256:
   40|  37.3k|    static transaction_identifier FromUint256(const uint256& id) { return {id}; }
_ZN22transaction_identifierILb0EEC2ERK7uint256:
   16|  37.3k|    transaction_identifier(const uint256& wrapped) : m_wrapped{wrapped} {}
_ZNK22transaction_identifierILb0EE9SerializeI10DataStreamEEvRT_:
   57|    552|    template <typename Stream> void Serialize(Stream& s) const { m_wrapped.Serialize(s); }
_ZN22transaction_identifierILb1EE11FromUint256ERK7uint256:
   40|  1.78M|    static transaction_identifier FromUint256(const uint256& id) { return {id}; }
_ZN22transaction_identifierILb1EEC2ERK7uint256:
   16|  1.78M|    transaction_identifier(const uint256& wrapped) : m_wrapped{wrapped} {}
_ZNK22transaction_identifierILb0EE9SerializeI12ParamsStreamIR12VectorWriter20TransactionSerParamsEEEvRT_:
   57|  1.48k|    template <typename Stream> void Serialize(Stream& s) const { m_wrapped.Serialize(s); }
_ZNK22transaction_identifierILb0EE9ToUint256Ev:
   39|  36.4k|    const uint256& ToUint256() const LIFETIMEBOUND { return m_wrapped; }
_ZNK22transaction_identifierILb1EE9ToUint256Ev:
   39|  1.49k|    const uint256& ToUint256() const LIFETIMEBOUND { return m_wrapped; }
_ZNK22transaction_identifierILb0EE8ToStringEv:
   52|      8|    std::string ToString() const { return m_wrapped.ToString(); }
_ZNK22transaction_identifierILb1EE8ToStringEv:
   52|      3|    std::string ToString() const { return m_wrapped.ToString(); }
_ZNK22transaction_identifierILb1EE7CompareERKS0_:
   21|  8.96k|    constexpr int Compare(const transaction_identifier<has_witness>& other) const { return m_wrapped.Compare(other.m_wrapped); }
_ZN22transaction_identifierILb0EE11UnserializeI12ParamsStreamIR8AutoFile20TransactionSerParamsEEEvRT_:
   58|  1.53k|    template <typename Stream> void Unserialize(Stream& s) { m_wrapped.Unserialize(s); }
_ZNK22transaction_identifierILb1EEltIS0_EEbRKT_:
   37|  8.96k|    bool operator<(const Other& other) const { return Compare(other) < 0; }
_ZNK22transaction_identifierILb0EE9SerializeI12ParamsStreamIR10HashWriter20TransactionSerParamsEEEvRT_:
   57|  74.3k|    template <typename Stream> void Serialize(Stream& s) const { m_wrapped.Serialize(s); }

_ZNK4util17TranslatedLiteralcvNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEv:
   60|  3.18k|    operator std::string() const { return translate_fn && *translate_fn ? (*translate_fn)(original) : original; }
  ------------------
  |  Branch (60:43): [True: 3.18k, False: 0]
  |  Branch (60:59): [True: 0, False: 3.18k]
  ------------------
_ZN10tinyformat6formatIJlEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_:
   88|  3.18k|{
   89|  3.18k|    const auto original_arg{[](const auto& arg) -> const auto& {
   90|  3.18k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
   91|  3.18k|            return arg.original;
   92|  3.18k|        } else if constexpr (std::is_same_v<decltype(arg), const util::TranslatedLiteral&>) {
   93|  3.18k|            return arg.original;
   94|  3.18k|        } else {
   95|  3.18k|            return arg;
   96|  3.18k|        }
   97|  3.18k|    }};
   98|  3.18k|    const auto translated_arg{[](const auto& arg) -> const auto& {
   99|  3.18k|        if constexpr (std::is_same_v<decltype(arg), const bilingual_str&>) {
  100|  3.18k|            return arg.translated;
  101|  3.18k|        } else {
  102|  3.18k|            return arg;
  103|  3.18k|        }
  104|  3.18k|    }};
  105|  3.18k|    return bilingual_str{tfm::format(fmt.original, original_arg(args)...),
  106|  3.18k|                         tfm::format(RuntimeFormat{std::string{fmt.lit}}, translated_arg(args)...)};
  107|  3.18k|}
_ZZN10tinyformat6formatIJlEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E_clIlEERKDaSB_:
   89|  3.18k|    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|  3.18k|        } else {
   95|  3.18k|            return arg;
   96|  3.18k|        }
   97|  3.18k|    }};
_ZZN10tinyformat6formatIJlEEE13bilingual_strN4util12BilingualFmtIXsZT_EEEDpRKT_ENKUlRKT_E0_clIlEERKDaSB_:
   98|  3.18k|    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|  3.18k|        } else {
  102|  3.18k|            return arg;
  103|  3.18k|        }
  104|  3.18k|    }};

_Z11ClearShrinkINSt3__16vectorIhNS0_9allocatorIhEEEEEvRT_:
   57|  44.0k|{
   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|  44.0k|    V{}.swap(v);
   70|  44.0k|}

_ZNK10Chainstate21FindForkInGlobalIndexERK13CBlockLocator:
  120|     86|{
  121|     86|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|     86|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  122|       |
  123|       |    // Find the latest block common to locator and chain - we expect that
  124|       |    // locator.vHave is sorted descending by height.
  125|  1.00k|    for (const uint256& hash : locator.vHave) {
  ------------------
  |  Branch (125:30): [True: 1.00k, False: 54]
  ------------------
  126|  1.00k|        const CBlockIndex* pindex{m_blockman.LookupBlockIndex(hash)};
  127|  1.00k|        if (pindex) {
  ------------------
  |  Branch (127:13): [True: 43, False: 960]
  ------------------
  128|     43|            if (m_chain.Contains(pindex)) {
  ------------------
  |  Branch (128:17): [True: 32, False: 11]
  ------------------
  129|     32|                return pindex;
  130|     32|            }
  131|     11|            if (pindex->GetAncestor(m_chain.Height()) == m_chain.Tip()) {
  ------------------
  |  Branch (131:17): [True: 0, False: 11]
  ------------------
  132|      0|                return m_chain.Tip();
  133|      0|            }
  134|     11|        }
  135|  1.00k|    }
  136|     54|    return m_chain.Genesis();
  137|     86|}
_Z17CheckFinalTxAtTipRK11CBlockIndexRK12CTransaction:
  147|    726|{
  148|    726|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|    726|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  149|       |
  150|       |    // CheckFinalTxAtTip() uses active_chain_tip.Height()+1 to evaluate
  151|       |    // nLockTime because when IsFinalTx() is called within
  152|       |    // AcceptBlock(), the height of the block *being*
  153|       |    // evaluated is what is used. Thus if we want to know if a
  154|       |    // transaction can be part of the *next* block, we need to call
  155|       |    // IsFinalTx() with one more than active_chain_tip.Height().
  156|    726|    const int nBlockHeight = active_chain_tip.nHeight + 1;
  157|       |
  158|       |    // BIP113 requires that time-locked transactions have nLockTime set to
  159|       |    // less than the median time of the previous block they're contained in.
  160|       |    // When the next block is created its previous block will be the current
  161|       |    // chain tip, so we use that to calculate the median time passed to
  162|       |    // IsFinalTx().
  163|    726|    const int64_t nBlockTime{active_chain_tip.GetMedianTimePast()};
  164|       |
  165|    726|    return IsFinalTx(tx, nBlockHeight, nBlockTime);
  166|    726|}
_Z24CalculateLockPointsAtTipP11CBlockIndexRK10CCoinsViewRK12CTransaction:
  204|    109|{
  205|    109|    assert(tip);
  206|       |
  207|    109|    auto prev_heights{CalculatePrevHeights(*tip, coins_view, tx)};
  208|    109|    if (!prev_heights.has_value()) return std::nullopt;
  ------------------
  |  Branch (208:9): [True: 0, False: 109]
  ------------------
  209|       |
  210|    109|    CBlockIndex next_tip;
  211|    109|    next_tip.pprev = tip;
  212|       |    // When SequenceLocks() is called within ConnectBlock(), the height
  213|       |    // of the block *being* evaluated is what is used.
  214|       |    // Thus if we want to know if a transaction can be part of the
  215|       |    // *next* block, we need to use one more than active_chainstate.m_chain.Height()
  216|    109|    next_tip.nHeight = tip->nHeight + 1;
  217|    109|    const auto [min_height, min_time] = CalculateSequenceLocks(tx, STANDARD_LOCKTIME_VERIFY_FLAGS, prev_heights.value(), next_tip);
  218|       |
  219|       |    // Also store the hash of the block with the highest height of
  220|       |    // all the blocks which have sequence locked prevouts.
  221|       |    // This hash needs to still be on the chain
  222|       |    // for these LockPoint calculations to be valid
  223|       |    // Note: It is impossible to correctly calculate a maxInputBlock
  224|       |    // if any of the sequence locked inputs depend on unconfirmed txs,
  225|       |    // except in the special case where the relative lock time/height
  226|       |    // is 0, which is equivalent to no sequence lock. Since we assume
  227|       |    // input height of tip+1 for mempool txs and test the resulting
  228|       |    // min_height and min_time from CalculateSequenceLocks against tip+1.
  229|    109|    int max_input_height{0};
  230|    109|    for (const int height : prev_heights.value()) {
  ------------------
  |  Branch (230:27): [True: 109, False: 109]
  ------------------
  231|       |        // Can ignore mempool inputs since we'll fail if they had non-zero locks
  232|    109|        if (height != next_tip.nHeight) {
  ------------------
  |  Branch (232:13): [True: 109, False: 0]
  ------------------
  233|    109|            max_input_height = std::max(max_input_height, height);
  234|    109|        }
  235|    109|    }
  236|       |
  237|       |    // tip->GetAncestor(max_input_height) should never return a nullptr
  238|       |    // because max_input_height is always less than the tip height.
  239|       |    // It would, however, be a bad bug to continue execution, since a
  240|       |    // LockPoints object with the maxInputBlock member set to nullptr
  241|       |    // signifies no relative lock time.
  242|    109|    return LockPoints{min_height, min_time, Assert(tip->GetAncestor(max_input_height))};
  ------------------
  |  |   85|    109|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  243|    109|}
_Z23CheckSequenceLocksAtTipP11CBlockIndexRK10LockPoints:
  247|    109|{
  248|    109|    assert(tip != nullptr);
  249|       |
  250|    109|    CBlockIndex index;
  251|    109|    index.pprev = tip;
  252|       |    // CheckSequenceLocksAtTip() uses active_chainstate.m_chain.Height()+1 to evaluate
  253|       |    // height based locks because when SequenceLocks() is called within
  254|       |    // ConnectBlock(), the height of the block *being*
  255|       |    // evaluated is what is used.
  256|       |    // Thus if we want to know if a transaction can be part of the
  257|       |    // *next* block, we need to use one more than active_chainstate.m_chain.Height()
  258|    109|    index.nHeight = tip->nHeight + 1;
  259|       |
  260|    109|    return EvaluateSequenceLocks(index, {lock_points.height, lock_points.time});
  261|    109|}
_Z18AcceptToMemoryPoolR10ChainstateRKNSt3__110shared_ptrIK12CTransactionEElbb:
 1880|  1.36k|{
 1881|  1.36k|    AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1882|  1.36k|    const CChainParams& chainparams{active_chainstate.m_chainman.GetParams()};
 1883|  1.36k|    assert(active_chainstate.GetMempool() != nullptr);
 1884|  1.36k|    CTxMemPool& pool{*active_chainstate.GetMempool()};
 1885|       |
 1886|  1.36k|    std::vector<COutPoint> coins_to_uncache;
 1887|  1.36k|    auto args = MemPoolAccept::ATMPArgs::SingleAccept(chainparams, accept_time, bypass_limits, coins_to_uncache, test_accept);
 1888|  1.36k|    MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
 1889|  1.36k|    if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
  ------------------
  |  Branch (1889:9): [True: 1.36k, False: 0]
  ------------------
 1890|       |        // Remove coins that were not present in the coins cache before calling
 1891|       |        // AcceptSingleTransaction(); this is to prevent memory DoS in case we receive a large
 1892|       |        // number of invalid transactions that attempt to overrun the in-memory coins cache
 1893|       |        // (`CCoinsViewCache::cacheCoins`).
 1894|       |
 1895|  1.36k|        for (const COutPoint& hashTx : coins_to_uncache)
  ------------------
  |  Branch (1895:38): [True: 552, False: 1.36k]
  ------------------
 1896|    552|            active_chainstate.CoinsTip().Uncache(hashTx);
 1897|  1.36k|        TRACEPOINT(mempool, rejected,
 1898|  1.36k|                tx->GetHash().data(),
 1899|  1.36k|                result.m_state.GetRejectReason().c_str()
 1900|  1.36k|        );
 1901|  1.36k|    }
 1902|       |    // After we've (potentially) uncached entries, ensure our coins cache is still within its size limits
 1903|  1.36k|    BlockValidationState state_dummy;
 1904|  1.36k|    active_chainstate.FlushStateToDisk(state_dummy, FlushStateMode::PERIODIC);
 1905|  1.36k|    return result;
 1906|  1.36k|}
_ZN10Chainstate12SnapshotBaseEv:
 1974|    752|{
 1975|    752|    if (!m_from_snapshot_blockhash) return nullptr;
  ------------------
  |  Branch (1975:9): [True: 752, False: 0]
  ------------------
 1976|      0|    if (!m_cached_snapshot_base) m_cached_snapshot_base = Assert(m_chainman.m_blockman.LookupBlockIndex(*m_from_snapshot_blockhash));
  ------------------
  |  |   85|      0|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (1976:9): [True: 0, False: 0]
  ------------------
 1977|      0|    return m_cached_snapshot_base;
 1978|    752|}
_ZNK17ChainstateManager22IsInitialBlockDownloadEv:
 2017|  1.54M|{
 2018|       |    // Optimization: pre-test latch before taking the lock.
 2019|  1.54M|    if (m_cached_finished_ibd.load(std::memory_order_relaxed))
  ------------------
  |  Branch (2019:9): [True: 1.03M, False: 507k]
  ------------------
 2020|  1.03M|        return false;
 2021|       |
 2022|   507k|    LOCK(cs_main);
  ------------------
  |  |  257|   507k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   507k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   507k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   507k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2023|   507k|    if (m_cached_finished_ibd.load(std::memory_order_relaxed))
  ------------------
  |  Branch (2023:9): [True: 0, False: 507k]
  ------------------
 2024|      0|        return false;
 2025|   507k|    if (m_blockman.LoadingBlocks()) {
  ------------------
  |  Branch (2025:9): [True: 0, False: 507k]
  ------------------
 2026|      0|        return true;
 2027|      0|    }
 2028|   507k|    CChain& chain{ActiveChain()};
 2029|   507k|    if (chain.Tip() == nullptr) {
  ------------------
  |  Branch (2029:9): [True: 0, False: 507k]
  ------------------
 2030|      0|        return true;
 2031|      0|    }
 2032|   507k|    if (chain.Tip()->nChainWork < MinimumChainWork()) {
  ------------------
  |  Branch (2032:9): [True: 0, False: 507k]
  ------------------
 2033|      0|        return true;
 2034|      0|    }
 2035|   507k|    if (chain.Tip()->Time() < Now<NodeSeconds>() - m_options.max_tip_age) {
  ------------------
  |  Branch (2035:9): [True: 503k, False: 3.80k]
  ------------------
 2036|   503k|        return true;
 2037|   503k|    }
 2038|  3.80k|    LogPrintf("Leaving InitialBlockDownload (latching to false)\n");
  ------------------
  |  |  266|  3.80k|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|  3.80k|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|  3.80k|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2039|  3.80k|    m_cached_finished_ibd.store(true, std::memory_order_relaxed);
 2040|  3.80k|    return false;
 2041|   507k|}
_ZN10Chainstate22GetCoinsCacheSizeStateEv:
 2789|  1.36k|{
 2790|  1.36k|    AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2791|  1.36k|    return this->GetCoinsCacheSizeState(
 2792|  1.36k|        m_coinstip_cache_size_bytes,
 2793|  1.36k|        m_mempool ? m_mempool->m_opts.max_size_bytes : 0);
  ------------------
  |  Branch (2793:9): [True: 1.36k, False: 0]
  ------------------
 2794|  1.36k|}
_ZN10Chainstate22GetCoinsCacheSizeStateEmm:
 2799|  1.36k|{
 2800|  1.36k|    AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 2801|  1.36k|    const int64_t nMempoolUsage = m_mempool ? m_mempool->DynamicMemoryUsage() : 0;
  ------------------
  |  Branch (2801:35): [True: 1.36k, False: 0]
  ------------------
 2802|  1.36k|    int64_t cacheSize = CoinsTip().DynamicMemoryUsage();
 2803|  1.36k|    int64_t nTotalSpace =
 2804|  1.36k|        max_coins_cache_size_bytes + std::max<int64_t>(int64_t(max_mempool_size_bytes) - nMempoolUsage, 0);
 2805|       |
 2806|       |    //! No need to periodic flush if at least this much space still available.
 2807|  1.36k|    static constexpr int64_t MAX_BLOCK_COINSDB_USAGE_BYTES = 10 * 1024 * 1024;  // 10MB
 2808|  1.36k|    int64_t large_threshold =
 2809|  1.36k|        std::max((9 * nTotalSpace) / 10, nTotalSpace - MAX_BLOCK_COINSDB_USAGE_BYTES);
 2810|       |
 2811|  1.36k|    if (cacheSize > nTotalSpace) {
  ------------------
  |  Branch (2811:9): [True: 0, False: 1.36k]
  ------------------
 2812|      0|        LogPrintf("Cache size (%s) exceeds total space (%s)\n", cacheSize, nTotalSpace);
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2813|      0|        return CoinsCacheSizeState::CRITICAL;
 2814|  1.36k|    } else if (cacheSize > large_threshold) {
  ------------------
  |  Branch (2814:16): [True: 0, False: 1.36k]
  ------------------
 2815|      0|        return CoinsCacheSizeState::LARGE;
 2816|      0|    }
 2817|  1.36k|    return CoinsCacheSizeState::OK;
 2818|  1.36k|}
_ZN10Chainstate16FlushStateToDiskER20BlockValidationState14FlushStateModei:
 2824|  1.36k|{
 2825|  1.36k|    LOCK(cs_main);
  ------------------
  |  |  257|  1.36k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.36k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.36k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.36k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2826|  1.36k|    assert(this->CanFlushToDisk());
 2827|  1.36k|    std::set<int> setFilesToPrune;
 2828|  1.36k|    bool full_flush_completed = false;
 2829|       |
 2830|  1.36k|    const size_t coins_count = CoinsTip().GetCacheSize();
 2831|  1.36k|    const size_t coins_mem_usage = CoinsTip().DynamicMemoryUsage();
 2832|       |
 2833|  1.36k|    try {
 2834|  1.36k|    {
 2835|  1.36k|        bool fFlushForPrune = false;
 2836|  1.36k|        bool fDoFullFlush = false;
 2837|       |
 2838|  1.36k|        CoinsCacheSizeState cache_state = GetCoinsCacheSizeState();
 2839|  1.36k|        LOCK(m_blockman.cs_LastBlockFile);
  ------------------
  |  |  257|  1.36k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.36k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.36k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.36k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2840|  1.36k|        if (m_blockman.IsPruneMode() && (m_blockman.m_check_for_pruning || nManualPruneHeight > 0) && m_chainman.m_blockman.m_blockfiles_indexed) {
  ------------------
  |  Branch (2840:13): [True: 0, False: 1.36k]
  |  Branch (2840:42): [True: 0, False: 0]
  |  Branch (2840:76): [True: 0, False: 0]
  |  Branch (2840:103): [True: 0, False: 0]
  ------------------
 2841|       |            // make sure we don't prune above any of the prune locks bestblocks
 2842|       |            // pruning is height-based
 2843|      0|            int last_prune{m_chain.Height()}; // last height we can prune
 2844|      0|            std::optional<std::string> limiting_lock; // prune lock that actually was the limiting factor, only used for logging
 2845|       |
 2846|      0|            for (const auto& prune_lock : m_blockman.m_prune_locks) {
  ------------------
  |  Branch (2846:41): [True: 0, False: 0]
  ------------------
 2847|      0|                if (prune_lock.second.height_first == std::numeric_limits<int>::max()) continue;
  ------------------
  |  Branch (2847:21): [True: 0, False: 0]
  ------------------
 2848|       |                // Remove the buffer and one additional block here to get actual height that is outside of the buffer
 2849|      0|                const int lock_height{prune_lock.second.height_first - PRUNE_LOCK_BUFFER - 1};
 2850|      0|                last_prune = std::max(1, std::min(last_prune, lock_height));
 2851|      0|                if (last_prune == lock_height) {
  ------------------
  |  Branch (2851:21): [True: 0, False: 0]
  ------------------
 2852|      0|                    limiting_lock = prune_lock.first;
 2853|      0|                }
 2854|      0|            }
 2855|       |
 2856|      0|            if (limiting_lock) {
  ------------------
  |  Branch (2856:17): [True: 0, False: 0]
  ------------------
 2857|      0|                LogDebug(BCLog::PRUNE, "%s limited pruning to height %d\n", limiting_lock.value(), last_prune);
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2858|      0|            }
 2859|       |
 2860|      0|            if (nManualPruneHeight > 0) {
  ------------------
  |  Branch (2860:17): [True: 0, False: 0]
  ------------------
 2861|      0|                LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune (manual)", BCLog::BENCH);
  ------------------
  |  |  104|      0|    BCLog::Timer<std::chrono::milliseconds> UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2862|       |
 2863|      0|                m_blockman.FindFilesToPruneManual(
 2864|      0|                    setFilesToPrune,
 2865|      0|                    std::min(last_prune, nManualPruneHeight),
 2866|      0|                    *this, m_chainman);
 2867|      0|            } else {
 2868|      0|                LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune", BCLog::BENCH);
  ------------------
  |  |  104|      0|    BCLog::Timer<std::chrono::milliseconds> UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|       |
 2870|      0|                m_blockman.FindFilesToPrune(setFilesToPrune, last_prune, *this, m_chainman);
 2871|      0|                m_blockman.m_check_for_pruning = false;
 2872|      0|            }
 2873|      0|            if (!setFilesToPrune.empty()) {
  ------------------
  |  Branch (2873:17): [True: 0, False: 0]
  ------------------
 2874|      0|                fFlushForPrune = true;
 2875|      0|                if (!m_blockman.m_have_pruned) {
  ------------------
  |  Branch (2875:21): [True: 0, False: 0]
  ------------------
 2876|      0|                    m_blockman.m_block_tree_db->WriteFlag("prunedblockfiles", true);
 2877|      0|                    m_blockman.m_have_pruned = true;
 2878|      0|                }
 2879|      0|            }
 2880|      0|        }
 2881|  1.36k|        const auto nNow{SteadyClock::now()};
 2882|       |        // Avoid writing/flushing immediately after startup.
 2883|  1.36k|        if (m_last_write == decltype(m_last_write){}) {
  ------------------
  |  Branch (2883:13): [True: 0, False: 1.36k]
  ------------------
 2884|      0|            m_last_write = nNow;
 2885|      0|        }
 2886|  1.36k|        if (m_last_flush == decltype(m_last_flush){}) {
  ------------------
  |  Branch (2886:13): [True: 0, False: 1.36k]
  ------------------
 2887|      0|            m_last_flush = nNow;
 2888|      0|        }
 2889|       |        // The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing).
 2890|  1.36k|        bool fCacheLarge = mode == FlushStateMode::PERIODIC && cache_state >= CoinsCacheSizeState::LARGE;
  ------------------
  |  Branch (2890:28): [True: 1.36k, False: 0]
  |  Branch (2890:64): [True: 0, False: 1.36k]
  ------------------
 2891|       |        // The cache is over the limit, we have to write now.
 2892|  1.36k|        bool fCacheCritical = mode == FlushStateMode::IF_NEEDED && cache_state >= CoinsCacheSizeState::CRITICAL;
  ------------------
  |  Branch (2892:31): [True: 0, False: 1.36k]
  |  Branch (2892:68): [True: 0, False: 0]
  ------------------
 2893|       |        // It's been a while since we wrote the block index to disk. Do this frequently, so we don't need to redownload after a crash.
 2894|  1.36k|        bool fPeriodicWrite = mode == FlushStateMode::PERIODIC && nNow > m_last_write + DATABASE_WRITE_INTERVAL;
  ------------------
  |  Branch (2894:31): [True: 1.36k, False: 0]
  |  Branch (2894:67): [True: 0, False: 1.36k]
  ------------------
 2895|       |        // It's been very long since we flushed the cache. Do this infrequently, to optimize cache usage.
 2896|  1.36k|        bool fPeriodicFlush = mode == FlushStateMode::PERIODIC && nNow > m_last_flush + DATABASE_FLUSH_INTERVAL;
  ------------------
  |  Branch (2896:31): [True: 1.36k, False: 0]
  |  Branch (2896:67): [True: 0, False: 1.36k]
  ------------------
 2897|       |        // Combine all conditions that result in a full cache flush.
 2898|  1.36k|        fDoFullFlush = (mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicFlush || fFlushForPrune;
  ------------------
  |  Branch (2898:24): [True: 0, False: 1.36k]
  |  Branch (2898:60): [True: 0, False: 1.36k]
  |  Branch (2898:75): [True: 0, False: 1.36k]
  |  Branch (2898:93): [True: 0, False: 1.36k]
  |  Branch (2898:111): [True: 0, False: 1.36k]
  ------------------
 2899|       |        // Write blocks and block index to disk.
 2900|  1.36k|        if (fDoFullFlush || fPeriodicWrite) {
  ------------------
  |  Branch (2900:13): [True: 0, False: 1.36k]
  |  Branch (2900:29): [True: 0, False: 1.36k]
  ------------------
 2901|       |            // Ensure we can write block index
 2902|      0|            if (!CheckDiskSpace(m_blockman.m_opts.blocks_dir)) {
  ------------------
  |  Branch (2902:17): [True: 0, False: 0]
  ------------------
 2903|      0|                return FatalError(m_chainman.GetNotifications(), state, _("Disk space is too low!"));
 2904|      0|            }
 2905|      0|            {
 2906|      0|                LOG_TIME_MILLIS_WITH_CATEGORY("write block and undo data to disk", BCLog::BENCH);
  ------------------
  |  |  104|      0|    BCLog::Timer<std::chrono::milliseconds> UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2907|       |
 2908|       |                // First make sure all block and undo data is flushed to disk.
 2909|       |                // TODO: Handle return error, or add detailed comment why it is
 2910|       |                // safe to not return an error upon failure.
 2911|      0|                if (!m_blockman.FlushChainstateBlockFile(m_chain.Height())) {
  ------------------
  |  Branch (2911:21): [True: 0, False: 0]
  ------------------
 2912|      0|                    LogPrintLevel(BCLog::VALIDATION, BCLog::Level::Warning, "%s: Failed to flush block file.\n", __func__);
  ------------------
  |  |  273|      0|    do {                                                  \
  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  ------------------
  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  |  |  276|      0|        }                                                 \
  |  |  277|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2913|      0|                }
 2914|      0|            }
 2915|       |
 2916|       |            // Then update all block file information (which may refer to block and undo files).
 2917|      0|            {
 2918|      0|                LOG_TIME_MILLIS_WITH_CATEGORY("write block index to disk", BCLog::BENCH);
  ------------------
  |  |  104|      0|    BCLog::Timer<std::chrono::milliseconds> UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2919|       |
 2920|      0|                if (!m_blockman.WriteBlockIndexDB()) {
  ------------------
  |  Branch (2920:21): [True: 0, False: 0]
  ------------------
 2921|      0|                    return FatalError(m_chainman.GetNotifications(), state, _("Failed to write to block index database."));
 2922|      0|                }
 2923|      0|            }
 2924|       |            // Finally remove any pruned files
 2925|      0|            if (fFlushForPrune) {
  ------------------
  |  Branch (2925:17): [True: 0, False: 0]
  ------------------
 2926|      0|                LOG_TIME_MILLIS_WITH_CATEGORY("unlink pruned files", BCLog::BENCH);
  ------------------
  |  |  104|      0|    BCLog::Timer<std::chrono::milliseconds> UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2927|       |
 2928|      0|                m_blockman.UnlinkPrunedFiles(setFilesToPrune);
 2929|      0|            }
 2930|      0|            m_last_write = nNow;
 2931|      0|        }
 2932|       |        // Flush best chain related state. This can only be done if the blocks / block index write was also done.
 2933|  1.36k|        if (fDoFullFlush && !CoinsTip().GetBestBlock().IsNull()) {
  ------------------
  |  Branch (2933:13): [True: 0, False: 1.36k]
  |  Branch (2933:13): [True: 0, False: 1.36k]
  |  Branch (2933:29): [True: 0, False: 0]
  ------------------
 2934|      0|            if (coins_mem_usage >= WARN_FLUSH_COINS_SIZE) LogWarning("Flushing large (%d GiB) UTXO set to disk, it may take several minutes", coins_mem_usage >> 30);
  ------------------
  |  |  262|      0|#define LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Warning, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
  |  Branch (2934:17): [True: 0, False: 0]
  ------------------
 2935|      0|            LOG_TIME_MILLIS_WITH_CATEGORY(strprintf("write coins cache to disk (%d coins, %.2fKiB)",
  ------------------
  |  |  104|      0|    BCLog::Timer<std::chrono::milliseconds> UNIQUE_NAME(logging_timer)(__func__, end_msg, log_category)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2936|      0|                coins_count, coins_mem_usage >> 10), BCLog::BENCH);
 2937|       |
 2938|       |            // Typical Coin structures on disk are around 48 bytes in size.
 2939|       |            // Pushing a new one to the database can cause it to be written
 2940|       |            // twice (once in the log, and once in the tables). This is already
 2941|       |            // an overestimation, as most will delete an existing entry or
 2942|       |            // overwrite one. Still, use a conservative safety factor of 2.
 2943|      0|            if (!CheckDiskSpace(m_chainman.m_options.datadir, 48 * 2 * 2 * CoinsTip().GetCacheSize())) {
  ------------------
  |  Branch (2943:17): [True: 0, False: 0]
  ------------------
 2944|      0|                return FatalError(m_chainman.GetNotifications(), state, _("Disk space is too low!"));
 2945|      0|            }
 2946|       |            // Flush the chainstate (which may refer to block index entries).
 2947|      0|            const auto empty_cache{(mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical};
  ------------------
  |  Branch (2947:36): [True: 0, False: 0]
  |  Branch (2947:72): [True: 0, False: 0]
  |  Branch (2947:87): [True: 0, False: 0]
  ------------------
 2948|      0|            if (empty_cache ? !CoinsTip().Flush() : !CoinsTip().Sync()) {
  ------------------
  |  Branch (2948:17): [True: 0, False: 0]
  |  Branch (2948:17): [True: 0, False: 0]
  ------------------
 2949|      0|                return FatalError(m_chainman.GetNotifications(), state, _("Failed to write to coin database."));
 2950|      0|            }
 2951|      0|            m_last_flush = nNow;
 2952|      0|            full_flush_completed = true;
 2953|      0|            TRACEPOINT(utxocache, flush,
 2954|      0|                   int64_t{Ticks<std::chrono::microseconds>(SteadyClock::now() - nNow)},
 2955|      0|                   (uint32_t)mode,
 2956|      0|                   (uint64_t)coins_count,
 2957|      0|                   (uint64_t)coins_mem_usage,
 2958|      0|                   (bool)fFlushForPrune);
 2959|      0|        }
 2960|  1.36k|    }
 2961|  1.36k|    if (full_flush_completed && m_chainman.m_options.signals) {
  ------------------
  |  Branch (2961:9): [True: 0, False: 1.36k]
  |  Branch (2961:33): [True: 0, False: 0]
  ------------------
 2962|       |        // Update best block in wallet (so we can detect restored wallets).
 2963|      0|        m_chainman.m_options.signals->ChainStateFlushed(this->GetRole(), m_chain.GetLocator());
 2964|      0|    }
 2965|  1.36k|    } catch (const std::runtime_error& e) {
 2966|      0|        return FatalError(m_chainman.GetNotifications(), state, strprintf(_("System error while flushing: %s"), e.what()));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 2967|      0|    }
 2968|  1.36k|    return true;
 2969|  1.36k|}
_ZN10Chainstate17FindMostWorkChainEv:
 3274|  1.54k|{
 3275|  1.54k|    AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.54k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3276|  1.54k|    do {
 3277|  1.54k|        CBlockIndex *pindexNew = nullptr;
 3278|       |
 3279|       |        // Find the best candidate header.
 3280|  1.54k|        {
 3281|  1.54k|            std::set<CBlockIndex*, CBlockIndexWorkComparator>::reverse_iterator it = setBlockIndexCandidates.rbegin();
 3282|  1.54k|            if (it == setBlockIndexCandidates.rend())
  ------------------
  |  Branch (3282:17): [True: 0, False: 1.54k]
  ------------------
 3283|      0|                return nullptr;
 3284|  1.54k|            pindexNew = *it;
 3285|  1.54k|        }
 3286|       |
 3287|       |        // Check whether all blocks on the path between the currently active chain and the candidate are valid.
 3288|       |        // Just going until the active chain is an optimization, as we know all blocks in it are valid already.
 3289|      0|        CBlockIndex *pindexTest = pindexNew;
 3290|  1.54k|        bool fInvalidAncestor = false;
 3291|  1.54k|        while (pindexTest && !m_chain.Contains(pindexTest)) {
  ------------------
  |  Branch (3291:16): [True: 1.54k, False: 0]
  |  Branch (3291:30): [True: 0, False: 1.54k]
  ------------------
 3292|      0|            assert(pindexTest->HaveNumChainTxs() || pindexTest->nHeight == 0);
 3293|       |
 3294|       |            // Pruned nodes may have entries in setBlockIndexCandidates for
 3295|       |            // which block files have been deleted.  Remove those as candidates
 3296|       |            // for the most work chain if we come across them; we can't switch
 3297|       |            // to a chain unless we have all the non-active-chain parent blocks.
 3298|      0|            bool fFailedChain = pindexTest->nStatus & BLOCK_FAILED_MASK;
 3299|      0|            bool fMissingData = !(pindexTest->nStatus & BLOCK_HAVE_DATA);
 3300|      0|            if (fFailedChain || fMissingData) {
  ------------------
  |  Branch (3300:17): [True: 0, False: 0]
  |  Branch (3300:33): [True: 0, False: 0]
  ------------------
 3301|       |                // Candidate chain is not usable (either invalid or missing data)
 3302|      0|                if (fFailedChain && (m_chainman.m_best_invalid == nullptr || pindexNew->nChainWork > m_chainman.m_best_invalid->nChainWork)) {
  ------------------
  |  Branch (3302:21): [True: 0, False: 0]
  |  Branch (3302:38): [True: 0, False: 0]
  |  Branch (3302:78): [True: 0, False: 0]
  ------------------
 3303|      0|                    m_chainman.m_best_invalid = pindexNew;
 3304|      0|                }
 3305|      0|                CBlockIndex *pindexFailed = pindexNew;
 3306|       |                // Remove the entire chain from the set.
 3307|      0|                while (pindexTest != pindexFailed) {
  ------------------
  |  Branch (3307:24): [True: 0, False: 0]
  ------------------
 3308|      0|                    if (fFailedChain) {
  ------------------
  |  Branch (3308:25): [True: 0, False: 0]
  ------------------
 3309|      0|                        pindexFailed->nStatus |= BLOCK_FAILED_CHILD;
 3310|      0|                        m_blockman.m_dirty_blockindex.insert(pindexFailed);
 3311|      0|                    } else if (fMissingData) {
  ------------------
  |  Branch (3311:32): [True: 0, False: 0]
  ------------------
 3312|       |                        // If we're missing data, then add back to m_blocks_unlinked,
 3313|       |                        // so that if the block arrives in the future we can try adding
 3314|       |                        // to setBlockIndexCandidates again.
 3315|      0|                        m_blockman.m_blocks_unlinked.insert(
 3316|      0|                            std::make_pair(pindexFailed->pprev, pindexFailed));
 3317|      0|                    }
 3318|      0|                    setBlockIndexCandidates.erase(pindexFailed);
 3319|      0|                    pindexFailed = pindexFailed->pprev;
 3320|      0|                }
 3321|      0|                setBlockIndexCandidates.erase(pindexTest);
 3322|      0|                fInvalidAncestor = true;
 3323|      0|                break;
 3324|      0|            }
 3325|      0|            pindexTest = pindexTest->pprev;
 3326|      0|        }
 3327|  1.54k|        if (!fInvalidAncestor)
  ------------------
  |  Branch (3327:13): [True: 1.54k, False: 0]
  ------------------
 3328|  1.54k|            return pindexNew;
 3329|  1.54k|    } while(true);
  ------------------
  |  Branch (3329:13): [Folded - Ignored]
  ------------------
 3330|  1.54k|}
_ZN17ChainstateManager15NotifyHeaderTipEv:
 3443|    408|{
 3444|    408|    bool fNotify = false;
 3445|    408|    bool fInitialBlockDownload = false;
 3446|    408|    CBlockIndex* pindexHeader = nullptr;
 3447|    408|    {
 3448|    408|        LOCK(GetMutex());
  ------------------
  |  |  257|    408|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    408|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    408|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    408|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3449|    408|        pindexHeader = m_best_header;
 3450|       |
 3451|    408|        if (pindexHeader != m_last_notified_header) {
  ------------------
  |  Branch (3451:13): [True: 1, False: 407]
  ------------------
 3452|      1|            fNotify = true;
 3453|      1|            fInitialBlockDownload = IsInitialBlockDownload();
 3454|      1|            m_last_notified_header = pindexHeader;
 3455|      1|        }
 3456|    408|    }
 3457|       |    // Send block tip changed notifications without the lock held
 3458|    408|    if (fNotify) {
  ------------------
  |  Branch (3458:9): [True: 1, False: 407]
  ------------------
 3459|      1|        GetNotifications().headerTip(GetSynchronizationState(fInitialBlockDownload, m_blockman.m_blockfiles_indexed), pindexHeader->nHeight, pindexHeader->nTime, false);
 3460|      1|    }
 3461|    408|    return fNotify;
 3462|    408|}
_ZN10Chainstate17ActivateBestChainER20BlockValidationStateNSt3__110shared_ptrIK6CBlockEE:
 3473|  1.54k|{
 3474|  1.54k|    AssertLockNotHeld(m_chainstate_mutex);
  ------------------
  |  |  147|  1.54k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3475|       |
 3476|       |    // Note that while we're often called here from ProcessNewBlock, this is
 3477|       |    // far from a guarantee. Things in the P2P/RPC will often end up calling
 3478|       |    // us in the middle of ProcessNewBlock - do not assume pblock is set
 3479|       |    // sanely for performance or correctness!
 3480|  1.54k|    AssertLockNotHeld(::cs_main);
  ------------------
  |  |  147|  1.54k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3481|       |
 3482|       |    // ABC maintains a fair degree of expensive-to-calculate internal state
 3483|       |    // because this function periodically releases cs_main so that it does not lock up other threads for too long
 3484|       |    // during large connects - and to allow for e.g. the callback queue to drain
 3485|       |    // we use m_chainstate_mutex to enforce mutual exclusion so that only one caller may execute this function at a time
 3486|  1.54k|    LOCK(m_chainstate_mutex);
  ------------------
  |  |  257|  1.54k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.54k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.54k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.54k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3487|       |
 3488|       |    // Belt-and-suspenders check that we aren't attempting to advance the background
 3489|       |    // chainstate past the snapshot base block.
 3490|  1.54k|    if (WITH_LOCK(::cs_main, return m_disabled)) {
  ------------------
  |  |  301|  1.54k|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  |  |  ------------------
  |  |  |  Branch (301:29): [True: 0, False: 1.54k]
  |  |  ------------------
  ------------------
 3491|      0|        LogPrintf("m_disabled is set - this chainstate should not be in operation. "
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3492|      0|            "Please report this as a bug. %s\n", CLIENT_BUGREPORT);
 3493|      0|        return false;
 3494|      0|    }
 3495|       |
 3496|  1.54k|    CBlockIndex *pindexMostWork = nullptr;
 3497|  1.54k|    CBlockIndex *pindexNewTip = nullptr;
 3498|  1.54k|    bool exited_ibd{false};
 3499|  1.54k|    do {
 3500|       |        // Block until the validation queue drains. This should largely
 3501|       |        // never happen in normal operation, however may happen during
 3502|       |        // reindex, causing memory blowup if we run too far ahead.
 3503|       |        // Note that if a validationinterface callback ends up calling
 3504|       |        // ActivateBestChain this may lead to a deadlock! We should
 3505|       |        // probably have a DEBUG_LOCKORDER test for this in the future.
 3506|  1.54k|        if (m_chainman.m_options.signals) LimitValidationInterfaceQueue(*m_chainman.m_options.signals);
  ------------------
  |  Branch (3506:13): [True: 1.54k, False: 0]
  ------------------
 3507|       |
 3508|  1.54k|        {
 3509|  1.54k|            LOCK(cs_main);
  ------------------
  |  |  257|  1.54k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.54k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.54k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.54k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3510|  1.54k|            {
 3511|       |            // Lock transaction pool for at least as long as it takes for connectTrace to be consumed
 3512|  1.54k|            LOCK(MempoolMutex());
  ------------------
  |  |  257|  1.54k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.54k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.54k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.54k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3513|  1.54k|            const bool was_in_ibd = m_chainman.IsInitialBlockDownload();
 3514|  1.54k|            CBlockIndex* starting_tip = m_chain.Tip();
 3515|  1.54k|            bool blocks_connected = false;
 3516|  1.54k|            do {
 3517|       |                // We absolutely may not unlock cs_main until we've made forward progress
 3518|       |                // (with the exception of shutdown due to hardware issues, low disk space, etc).
 3519|  1.54k|                ConnectTrace connectTrace; // Destructed before cs_main is unlocked
 3520|       |
 3521|  1.54k|                if (pindexMostWork == nullptr) {
  ------------------
  |  Branch (3521:21): [True: 1.54k, False: 0]
  ------------------
 3522|  1.54k|                    pindexMostWork = FindMostWorkChain();
 3523|  1.54k|                }
 3524|       |
 3525|       |                // Whether we have anything to do at all.
 3526|  1.54k|                if (pindexMostWork == nullptr || pindexMostWork == m_chain.Tip()) {
  ------------------
  |  Branch (3526:21): [True: 0, False: 1.54k]
  |  Branch (3526:50): [True: 1.54k, False: 0]
  ------------------
 3527|  1.54k|                    break;
 3528|  1.54k|                }
 3529|       |
 3530|      0|                bool fInvalidFound = false;
 3531|      0|                std::shared_ptr<const CBlock> nullBlockPtr;
 3532|       |                // BlockConnected signals must be sent for the original role;
 3533|       |                // in case snapshot validation is completed during ActivateBestChainStep, the
 3534|       |                // result of GetRole() changes from BACKGROUND to NORMAL.
 3535|      0|               const ChainstateRole chainstate_role{this->GetRole()};
 3536|      0|                if (!ActivateBestChainStep(state, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace)) {
  ------------------
  |  Branch (3536:21): [True: 0, False: 0]
  |  Branch (3536:67): [True: 0, False: 0]
  |  Branch (3536:77): [True: 0, False: 0]
  ------------------
 3537|       |                    // A system error occurred
 3538|      0|                    return false;
 3539|      0|                }
 3540|      0|                blocks_connected = true;
 3541|       |
 3542|      0|                if (fInvalidFound) {
  ------------------
  |  Branch (3542:21): [True: 0, False: 0]
  ------------------
 3543|       |                    // Wipe cache, we may need another branch now.
 3544|      0|                    pindexMostWork = nullptr;
 3545|      0|                }
 3546|      0|                pindexNewTip = m_chain.Tip();
 3547|       |
 3548|      0|                for (const PerBlockConnectTrace& trace : connectTrace.GetBlocksConnected()) {
  ------------------
  |  Branch (3548:56): [True: 0, False: 0]
  ------------------
 3549|      0|                    assert(trace.pblock && trace.pindex);
 3550|      0|                    if (m_chainman.m_options.signals) {
  ------------------
  |  Branch (3550:25): [True: 0, False: 0]
  ------------------
 3551|      0|                        m_chainman.m_options.signals->BlockConnected(chainstate_role, trace.pblock, trace.pindex);
 3552|      0|                    }
 3553|      0|                }
 3554|       |
 3555|       |                // This will have been toggled in
 3556|       |                // ActivateBestChainStep -> ConnectTip -> MaybeCompleteSnapshotValidation,
 3557|       |                // if at all, so we should catch it here.
 3558|       |                //
 3559|       |                // Break this do-while to ensure we don't advance past the base snapshot.
 3560|      0|                if (m_disabled) {
  ------------------
  |  Branch (3560:21): [True: 0, False: 0]
  ------------------
 3561|      0|                    break;
 3562|      0|                }
 3563|      0|            } while (!m_chain.Tip() || (starting_tip && CBlockIndexWorkComparator()(m_chain.Tip(), starting_tip)));
  ------------------
  |  Branch (3563:22): [True: 0, False: 0]
  |  Branch (3563:22): [True: 0, False: 0]
  |  Branch (3563:41): [True: 0, False: 0]
  |  Branch (3563:57): [True: 0, False: 0]
  ------------------
 3564|  1.54k|            if (!blocks_connected) return true;
  ------------------
  |  Branch (3564:17): [True: 1.54k, False: 0]
  ------------------
 3565|       |
 3566|      0|            const CBlockIndex* pindexFork = m_chain.FindFork(starting_tip);
 3567|      0|            bool still_in_ibd = m_chainman.IsInitialBlockDownload();
 3568|       |
 3569|      0|            if (was_in_ibd && !still_in_ibd) {
  ------------------
  |  Branch (3569:17): [True: 0, False: 0]
  |  Branch (3569:31): [True: 0, False: 0]
  ------------------
 3570|       |                // Active chainstate has exited IBD.
 3571|      0|                exited_ibd = true;
 3572|      0|            }
 3573|       |
 3574|       |            // Notify external listeners about the new tip.
 3575|       |            // Enqueue while holding cs_main to ensure that UpdatedBlockTip is called in the order in which blocks are connected
 3576|      0|            if (this == &m_chainman.ActiveChainstate() && pindexFork != pindexNewTip) {
  ------------------
  |  Branch (3576:17): [True: 0, False: 0]
  |  Branch (3576:59): [True: 0, False: 0]
  ------------------
 3577|       |                // Notify ValidationInterface subscribers
 3578|      0|                if (m_chainman.m_options.signals) {
  ------------------
  |  Branch (3578:21): [True: 0, False: 0]
  ------------------
 3579|      0|                    m_chainman.m_options.signals->UpdatedBlockTip(pindexNewTip, pindexFork, still_in_ibd);
 3580|      0|                }
 3581|       |
 3582|      0|                if (kernel::IsInterrupted(m_chainman.GetNotifications().blockTip(GetSynchronizationState(still_in_ibd, m_chainman.m_blockman.m_blockfiles_indexed), *pindexNewTip))) {
  ------------------
  |  Branch (3582:21): [True: 0, False: 0]
  ------------------
 3583|       |                    // Just breaking and returning success for now. This could
 3584|       |                    // be changed to bubble up the kernel::Interrupted value to
 3585|       |                    // the caller so the caller could distinguish between
 3586|       |                    // completed and interrupted operations.
 3587|      0|                    break;
 3588|      0|                }
 3589|      0|            }
 3590|      0|            } // release MempoolMutex
 3591|       |            // Notify external listeners about the new tip, even if pindexFork == pindexNewTip.
 3592|      0|            if (m_chainman.m_options.signals && this == &m_chainman.ActiveChainstate()) {
  ------------------
  |  Branch (3592:17): [True: 0, False: 0]
  |  Branch (3592:49): [True: 0, False: 0]
  ------------------
 3593|      0|                m_chainman.m_options.signals->ActiveTipChange(*Assert(pindexNewTip), m_chainman.IsInitialBlockDownload());
  ------------------
  |  |   85|      0|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 3594|      0|            }
 3595|      0|        } // release cs_main
 3596|       |        // When we reach this point, we switched to a new tip (stored in pindexNewTip).
 3597|       |
 3598|      0|        if (exited_ibd) {
  ------------------
  |  Branch (3598:13): [True: 0, False: 0]
  ------------------
 3599|       |            // If a background chainstate is in use, we may need to rebalance our
 3600|       |            // allocation of caches once a chainstate exits initial block download.
 3601|      0|            LOCK(::cs_main);
  ------------------
  |  |  257|      0|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3602|      0|            m_chainman.MaybeRebalanceCaches();
 3603|      0|        }
 3604|       |
 3605|      0|        if (WITH_LOCK(::cs_main, return m_disabled)) {
  ------------------
  |  |  301|      0|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  |  |  ------------------
  |  |  |  Branch (301:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3606|       |            // Background chainstate has reached the snapshot base block, so exit.
 3607|       |
 3608|       |            // Restart indexes to resume indexing for all blocks unique to the snapshot
 3609|       |            // chain. This resumes indexing "in order" from where the indexing on the
 3610|       |            // background validation chain left off.
 3611|       |            //
 3612|       |            // This cannot be done while holding cs_main (within
 3613|       |            // MaybeCompleteSnapshotValidation) or a cs_main deadlock will occur.
 3614|      0|            if (m_chainman.snapshot_download_completed) {
  ------------------
  |  Branch (3614:17): [True: 0, False: 0]
  ------------------
 3615|      0|                m_chainman.snapshot_download_completed();
 3616|      0|            }
 3617|      0|            break;
 3618|      0|        }
 3619|       |
 3620|       |        // We check interrupt only after giving ActivateBestChainStep a chance to run once so that we
 3621|       |        // never interrupt before connecting the genesis block during LoadChainTip(). Previously this
 3622|       |        // caused an assert() failure during interrupt in such cases as the UTXO DB flushing checks
 3623|       |        // that the best block hash is non-null.
 3624|      0|        if (m_chainman.m_interrupt) break;
  ------------------
  |  Branch (3624:13): [True: 0, False: 0]
  ------------------
 3625|      0|    } while (pindexNewTip != pindexMostWork);
  ------------------
  |  Branch (3625:14): [True: 0, False: 0]
  ------------------
 3626|       |
 3627|      0|    m_chainman.CheckBlockIndex();
 3628|       |
 3629|       |    // Write changes periodically to disk, after relay.
 3630|      0|    if (!FlushStateToDisk(state, FlushStateMode::PERIODIC)) {
  ------------------
  |  Branch (3630:9): [True: 0, False: 0]
  ------------------
 3631|      0|        return false;
 3632|      0|    }
 3633|       |
 3634|      0|    return true;
 3635|      0|}
_Z10CheckBlockRK6CBlockR20BlockValidationStateRKN9Consensus6ParamsEbb:
 4047|    116|{
 4048|       |    // These are checks that are independent of context.
 4049|       |
 4050|    116|    if (block.fChecked)
  ------------------
  |  Branch (4050:9): [True: 0, False: 116]
  ------------------
 4051|      0|        return true;
 4052|       |
 4053|       |    // Check that the header is valid (particularly PoW).  This is mostly
 4054|       |    // redundant with the call in AcceptBlockHeader.
 4055|    116|    if (!CheckBlockHeader(block, state, consensusParams, fCheckPOW))
  ------------------
  |  Branch (4055:9): [True: 9, False: 107]
  ------------------
 4056|      9|        return false;
 4057|       |
 4058|       |    // Signet only: check block solution
 4059|    107|    if (consensusParams.signet_blocks && fCheckPOW && !CheckSignetBlockSolution(block, consensusParams)) {
  ------------------
  |  Branch (4059:9): [True: 0, False: 107]
  |  Branch (4059:42): [True: 0, False: 0]
  |  Branch (4059:55): [True: 0, False: 0]
  ------------------
 4060|      0|        return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-signet-blksig", "signet block signature validation failure");
 4061|      0|    }
 4062|       |
 4063|       |    // Check the merkle root.
 4064|    107|    if (fCheckMerkleRoot && !CheckMerkleRoot(block, state)) {
  ------------------
  |  Branch (4064:9): [True: 107, False: 0]
  |  Branch (4064:29): [True: 35, False: 72]
  ------------------
 4065|     35|        return false;
 4066|     35|    }
 4067|       |
 4068|       |    // All potential-corruption validation must be done before we do any
 4069|       |    // transaction validation, as otherwise we may mark the header as invalid
 4070|       |    // because we receive the wrong transactions for it.
 4071|       |    // Note that witness malleability is checked in ContextualCheckBlock, so no
 4072|       |    // checks that use witness data may be performed here.
 4073|       |
 4074|       |    // Size limits
 4075|     72|    if (block.vtx.empty() || block.vtx.size() * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT || ::GetSerializeSize(TX_NO_WITNESS(block)) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)
  ------------------
  |  Branch (4075:9): [True: 2, False: 70]
  |  Branch (4075:9): [True: 2, False: 70]
  |  Branch (4075:30): [True: 0, False: 70]
  |  Branch (4075:92): [True: 0, False: 70]
  ------------------
 4076|      2|        return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-blk-length", "size limits failed");
 4077|       |
 4078|       |    // First transaction must be coinbase, the rest must not be
 4079|     70|    if (block.vtx.empty() || !block.vtx[0]->IsCoinBase())
  ------------------
  |  Branch (4079:9): [True: 0, False: 70]
  |  Branch (4079:30): [True: 18, False: 52]
  ------------------
 4080|     18|        return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cb-missing", "first tx is not coinbase");
 4081|     55|    for (unsigned int i = 1; i < block.vtx.size(); i++)
  ------------------
  |  Branch (4081:30): [True: 3, False: 52]
  ------------------
 4082|      3|        if (block.vtx[i]->IsCoinBase())
  ------------------
  |  Branch (4082:13): [True: 0, False: 3]
  ------------------
 4083|      0|            return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cb-multiple", "more than one coinbase");
 4084|       |
 4085|       |    // Check transactions
 4086|       |    // Must check for duplicate inputs (see CVE-2018-17144)
 4087|     55|    for (const auto& tx : block.vtx) {
  ------------------
  |  Branch (4087:25): [True: 55, False: 47]
  ------------------
 4088|     55|        TxValidationState tx_state;
 4089|     55|        if (!CheckTransaction(*tx, tx_state)) {
  ------------------
  |  Branch (4089:13): [True: 5, False: 50]
  ------------------
 4090|       |            // CheckBlock() does context-free validation checks. The only
 4091|       |            // possible failures are consensus failures.
 4092|      5|            assert(tx_state.GetResult() == TxValidationResult::TX_CONSENSUS);
 4093|      5|            return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, tx_state.GetRejectReason(),
 4094|      5|                                 strprintf("Transaction check failed (tx hash %s) %s", tx->GetHash().ToString(), tx_state.GetDebugMessage()));
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
 4095|      5|        }
 4096|     55|    }
 4097|     47|    unsigned int nSigOps = 0;
 4098|     47|    for (const auto& tx : block.vtx)
  ------------------
  |  Branch (4098:25): [True: 49, False: 47]
  ------------------
 4099|     49|    {
 4100|     49|        nSigOps += GetLegacySigOpCount(*tx);
 4101|     49|    }
 4102|     47|    if (nSigOps * WITNESS_SCALE_FACTOR > MAX_BLOCK_SIGOPS_COST)
  ------------------
  |  Branch (4102:9): [True: 0, False: 47]
  ------------------
 4103|      0|        return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-blk-sigops", "out-of-bounds SigOpCount");
 4104|       |
 4105|     47|    if (fCheckPOW && fCheckMerkleRoot)
  ------------------
  |  Branch (4105:9): [True: 47, False: 0]
  |  Branch (4105:22): [True: 47, False: 0]
  ------------------
 4106|     47|        block.fChecked = true;
 4107|       |
 4108|     47|    return true;
 4109|     47|}
_Z19HasValidProofOfWorkRKNSt3__16vectorI12CBlockHeaderNS_9allocatorIS1_EEEERKN9Consensus6ParamsE:
 4151|    400|{
 4152|    400|    return std::all_of(headers.cbegin(), headers.cend(),
 4153|    400|            [&](const auto& header) { return CheckProofOfWork(header.GetHash(), header.nBits, consensusParams);});
 4154|    400|}
_Z14IsBlockMutatedRK6CBlockb:
 4157|     46|{
 4158|     46|    BlockValidationState state;
 4159|     46|    if (!CheckMerkleRoot(block, state)) {
  ------------------
  |  Branch (4159:9): [True: 13, False: 33]
  ------------------
 4160|     13|        LogDebug(BCLog::VALIDATION, "Block mutated: %s\n", state.ToString());
  ------------------
  |  |  280|     13|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     13|    do {                                                  \
  |  |  |  |  274|     13|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4161|     13|        return true;
 4162|     13|    }
 4163|       |
 4164|     33|    if (block.vtx.empty() || !block.vtx[0]->IsCoinBase()) {
  ------------------
  |  Branch (4164:9): [True: 4, False: 29]
  |  Branch (4164:30): [True: 16, False: 13]
  ------------------
 4165|       |        // Consider the block mutated if any transaction is 64 bytes in size (see 3.1
 4166|       |        // in "Weaknesses in Bitcoin’s Merkle Root Construction":
 4167|       |        // https://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20190225/a27d8837/attachment-0001.pdf).
 4168|       |        //
 4169|       |        // Note: This is not a consensus change as this only applies to blocks that
 4170|       |        // don't have a coinbase transaction and would therefore already be invalid.
 4171|     20|        return std::any_of(block.vtx.begin(), block.vtx.end(),
 4172|     20|                           [](auto& tx) { return GetSerializeSize(TX_NO_WITNESS(tx)) == 64; });
 4173|     20|    } else {
 4174|       |        // Theoretically it is still possible for a block with a 64 byte
 4175|       |        // coinbase transaction to be mutated but we neglect that possibility
 4176|       |        // here as it requires at least 224 bits of work.
 4177|     13|    }
 4178|       |
 4179|     13|    if (!CheckWitnessMalleation(block, check_witness_root, state)) {
  ------------------
  |  Branch (4179:9): [True: 5, False: 8]
  ------------------
 4180|      5|        LogDebug(BCLog::VALIDATION, "Block mutated: %s\n", state.ToString());
  ------------------
  |  |  280|      5|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      5|    do {                                                  \
  |  |  |  |  274|      5|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      5|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4181|      5|        return true;
 4182|      5|    }
 4183|       |
 4184|      8|    return false;
 4185|     13|}
_Z27CalculateClaimedHeadersWorkNSt3__14spanIK12CBlockHeaderLm18446744073709551615EEE:
 4188|    616|{
 4189|    616|    arith_uint256 total_work{0};
 4190|    620|    for (const CBlockHeader& header : headers) {
  ------------------
  |  Branch (4190:37): [True: 620, False: 616]
  ------------------
 4191|    620|        CBlockIndex dummy(header);
 4192|    620|        total_work += GetBlockProof(dummy);
 4193|    620|    }
 4194|    616|    return total_work;
 4195|    616|}
_ZN17ChainstateManager17AcceptBlockHeaderERK12CBlockHeaderR20BlockValidationStatePP11CBlockIndexb:
 4325|    731|{
 4326|    731|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|    731|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4327|       |
 4328|       |    // Check for duplicate
 4329|    731|    uint256 hash = block.GetHash();
 4330|    731|    BlockMap::iterator miSelf{m_blockman.m_block_index.find(hash)};
 4331|    731|    if (hash != GetConsensus().hashGenesisBlock) {
  ------------------
  |  Branch (4331:9): [True: 731, False: 0]
  ------------------
 4332|    731|        if (miSelf != m_blockman.m_block_index.end()) {
  ------------------
  |  Branch (4332:13): [True: 173, False: 558]
  ------------------
 4333|       |            // Block header is already known.
 4334|    173|            CBlockIndex* pindex = &(miSelf->second);
 4335|    173|            if (ppindex)
  ------------------
  |  Branch (4335:17): [True: 173, False: 0]
  ------------------
 4336|    173|                *ppindex = pindex;
 4337|    173|            if (pindex->nStatus & BLOCK_FAILED_MASK) {
  ------------------
  |  Branch (4337:17): [True: 0, False: 173]
  ------------------
 4338|      0|                LogDebug(BCLog::VALIDATION, "%s: block %s is marked invalid\n", __func__, hash.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4339|      0|                return state.Invalid(BlockValidationResult::BLOCK_CACHED_INVALID, "duplicate-invalid");
 4340|      0|            }
 4341|    173|            return true;
 4342|    173|        }
 4343|       |
 4344|    558|        if (!CheckBlockHeader(block, state, GetConsensus())) {
  ------------------
  |  Branch (4344:13): [True: 25, False: 533]
  ------------------
 4345|     25|            LogDebug(BCLog::VALIDATION, "%s: Consensus::CheckBlockHeader: %s, %s\n", __func__, hash.ToString(), state.ToString());
  ------------------
  |  |  280|     25|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     25|    do {                                                  \
  |  |  |  |  274|     25|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 25]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     25|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4346|     25|            return false;
 4347|     25|        }
 4348|       |
 4349|       |        // Get prev block index
 4350|    533|        CBlockIndex* pindexPrev = nullptr;
 4351|    533|        BlockMap::iterator mi{m_blockman.m_block_index.find(block.hashPrevBlock)};
 4352|    533|        if (mi == m_blockman.m_block_index.end()) {
  ------------------
  |  Branch (4352:13): [True: 43, False: 490]
  ------------------
 4353|     43|            LogDebug(BCLog::VALIDATION, "header %s has prev block not found: %s\n", hash.ToString(), block.hashPrevBlock.ToString());
  ------------------
  |  |  280|     43|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|     43|    do {                                                  \
  |  |  |  |  274|     43|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 43]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|     43|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4354|     43|            return state.Invalid(BlockValidationResult::BLOCK_MISSING_PREV, "prev-blk-not-found");
 4355|     43|        }
 4356|    490|        pindexPrev = &((*mi).second);
 4357|    490|        if (pindexPrev->nStatus & BLOCK_FAILED_MASK) {
  ------------------
  |  Branch (4357:13): [True: 0, False: 490]
  ------------------
 4358|      0|            LogDebug(BCLog::VALIDATION, "header %s has prev block invalid: %s\n", hash.ToString(), block.hashPrevBlock.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4359|      0|            return state.Invalid(BlockValidationResult::BLOCK_INVALID_PREV, "bad-prevblk");
 4360|      0|        }
 4361|    490|        if (!ContextualCheckBlockHeader(block, state, m_blockman, *this, pindexPrev)) {
  ------------------
  |  Branch (4361:13): [True: 231, False: 259]
  ------------------
 4362|    231|            LogDebug(BCLog::VALIDATION, "%s: Consensus::ContextualCheckBlockHeader: %s, %s\n", __func__, hash.ToString(), state.ToString());
  ------------------
  |  |  280|    231|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|    231|    do {                                                  \
  |  |  |  |  274|    231|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 231]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|    231|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4363|    231|            return false;
 4364|    231|        }
 4365|       |
 4366|       |        /* Determine if this block descends from any block which has been found
 4367|       |         * invalid (m_failed_blocks), then mark pindexPrev and any blocks between
 4368|       |         * them as failed. For example:
 4369|       |         *
 4370|       |         *                D3
 4371|       |         *              /
 4372|       |         *      B2 - C2
 4373|       |         *    /         \
 4374|       |         *  A             D2 - E2 - F2
 4375|       |         *    \
 4376|       |         *      B1 - C1 - D1 - E1
 4377|       |         *
 4378|       |         * In the case that we attempted to reorg from E1 to F2, only to find
 4379|       |         * C2 to be invalid, we would mark D2, E2, and F2 as BLOCK_FAILED_CHILD
 4380|       |         * but NOT D3 (it was not in any of our candidate sets at the time).
 4381|       |         *
 4382|       |         * In any case D3 will also be marked as BLOCK_FAILED_CHILD at restart
 4383|       |         * in LoadBlockIndex.
 4384|       |         */
 4385|    259|        if (!pindexPrev->IsValid(BLOCK_VALID_SCRIPTS)) {
  ------------------
  |  Branch (4385:13): [True: 54, False: 205]
  ------------------
 4386|       |            // The above does not mean "invalid": it checks if the previous block
 4387|       |            // hasn't been validated up to BLOCK_VALID_SCRIPTS. This is a performance
 4388|       |            // optimization, in the common case of adding a new block to the tip,
 4389|       |            // we don't need to iterate over the failed blocks list.
 4390|     54|            for (const CBlockIndex* failedit : m_failed_blocks) {
  ------------------
  |  Branch (4390:46): [True: 0, False: 54]
  ------------------
 4391|      0|                if (pindexPrev->GetAncestor(failedit->nHeight) == failedit) {
  ------------------
  |  Branch (4391:21): [True: 0, False: 0]
  ------------------
 4392|      0|                    assert(failedit->nStatus & BLOCK_FAILED_VALID);
 4393|      0|                    CBlockIndex* invalid_walk = pindexPrev;
 4394|      0|                    while (invalid_walk != failedit) {
  ------------------
  |  Branch (4394:28): [True: 0, False: 0]
  ------------------
 4395|      0|                        invalid_walk->nStatus |= BLOCK_FAILED_CHILD;
 4396|      0|                        m_blockman.m_dirty_blockindex.insert(invalid_walk);
 4397|      0|                        invalid_walk = invalid_walk->pprev;
 4398|      0|                    }
 4399|      0|                    LogDebug(BCLog::VALIDATION, "header %s has prev block invalid: %s\n", hash.ToString(), block.hashPrevBlock.ToString());
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4400|      0|                    return state.Invalid(BlockValidationResult::BLOCK_INVALID_PREV, "bad-prevblk");
 4401|      0|                }
 4402|      0|            }
 4403|     54|        }
 4404|    259|    }
 4405|    259|    if (!min_pow_checked) {
  ------------------
  |  Branch (4405:9): [True: 1, False: 258]
  ------------------
 4406|      1|        LogDebug(BCLog::VALIDATION, "%s: not adding new block header %s, missing anti-dos proof-of-work validation\n", __func__, hash.ToString());
  ------------------
  |  |  280|      1|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      1|    do {                                                  \
  |  |  |  |  274|      1|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4407|      1|        return state.Invalid(BlockValidationResult::BLOCK_HEADER_LOW_WORK, "too-little-chainwork");
 4408|      1|    }
 4409|    258|    CBlockIndex* pindex{m_blockman.AddToBlockIndex(block, m_best_header)};
 4410|       |
 4411|    258|    if (ppindex)
  ------------------
  |  Branch (4411:9): [True: 258, False: 0]
  ------------------
 4412|    258|        *ppindex = pindex;
 4413|       |
 4414|       |    // Since this is the earliest point at which we have determined that a
 4415|       |    // header is both new and valid, log here.
 4416|       |    //
 4417|       |    // These messages are valuable for detecting potential selfish mining behavior;
 4418|       |    // if multiple displacing headers are seen near simultaneously across many
 4419|       |    // nodes in the network, this might be an indication of selfish mining. Having
 4420|       |    // this log by default when not in IBD ensures broad availability of this data
 4421|       |    // in case investigation is merited.
 4422|    258|    const auto msg = strprintf(
  ------------------
  |  | 1172|    258|#define strprintf tfm::format
  ------------------
 4423|    258|        "Saw new header hash=%s height=%d", hash.ToString(), pindex->nHeight);
 4424|       |
 4425|    258|    if (IsInitialBlockDownload()) {
  ------------------
  |  Branch (4425:9): [True: 258, False: 0]
  ------------------
 4426|    258|        LogPrintLevel(BCLog::VALIDATION, BCLog::Level::Debug, "%s\n", msg);
  ------------------
  |  |  273|    258|    do {                                                  \
  |  |  274|    258|        if (LogAcceptCategory((category), (level))) {     \
  |  |  ------------------
  |  |  |  Branch (274:13): [True: 0, False: 258]
  |  |  ------------------
  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  |  |  276|      0|        }                                                 \
  |  |  277|    258|    } while (0)
  |  |  ------------------
  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4427|    258|    } else {
 4428|      0|        LogPrintf("%s\n", msg);
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4429|      0|    }
 4430|       |
 4431|    258|    return true;
 4432|    259|}
_ZN17ChainstateManager22ProcessNewBlockHeadersENSt3__14spanIK12CBlockHeaderLm18446744073709551615EEEbR20BlockValidationStatePPK11CBlockIndex:
 4436|    661|{
 4437|    661|    AssertLockNotHeld(cs_main);
  ------------------
  |  |  147|    661|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4438|    661|    {
 4439|    661|        LOCK(cs_main);
  ------------------
  |  |  257|    661|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    661|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    661|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    661|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4440|    684|        for (const CBlockHeader& header : headers) {
  ------------------
  |  Branch (4440:41): [True: 684, False: 408]
  ------------------
 4441|    684|            CBlockIndex *pindex = nullptr; // Use a temp pindex instead of ppindex to avoid a const_cast
 4442|    684|            bool accepted{AcceptBlockHeader(header, state, &pindex, min_pow_checked)};
 4443|    684|            CheckBlockIndex();
 4444|       |
 4445|    684|            if (!accepted) {
  ------------------
  |  Branch (4445:17): [True: 253, False: 431]
  ------------------
 4446|    253|                return false;
 4447|    253|            }
 4448|    431|            if (ppindex) {
  ------------------
  |  Branch (4448:17): [True: 431, False: 0]
  ------------------
 4449|    431|                *ppindex = pindex;
 4450|    431|            }
 4451|    431|        }
 4452|    661|    }
 4453|    408|    if (NotifyHeaderTip()) {
  ------------------
  |  Branch (4453:9): [True: 1, False: 407]
  ------------------
 4454|      1|        if (IsInitialBlockDownload() && ppindex && *ppindex) {
  ------------------
  |  Branch (4454:13): [True: 1, False: 0]
  |  Branch (4454:41): [True: 1, False: 0]
  |  Branch (4454:52): [True: 1, False: 0]
  ------------------
 4455|      1|            const CBlockIndex& last_accepted{**ppindex};
 4456|      1|            int64_t blocks_left{(NodeClock::now() - last_accepted.Time()) / GetConsensus().PowTargetSpacing()};
 4457|      1|            blocks_left = std::max<int64_t>(0, blocks_left);
 4458|      1|            const double progress{100.0 * last_accepted.nHeight / (last_accepted.nHeight + blocks_left)};
 4459|      1|            LogInfo("Synchronizing blockheaders, height: %d (~%.2f%%)\n", last_accepted.nHeight, progress);
  ------------------
  |  |  261|      1|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      1|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 4460|      1|        }
 4461|      1|    }
 4462|    408|    return true;
 4463|    661|}
_ZN17ChainstateManager11AcceptBlockERKNSt3__110shared_ptrIK6CBlockEER20BlockValidationStatePP11CBlockIndexbPK11FlatFilePosPbb:
 4492|     47|{
 4493|     47|    const CBlock& block = *pblock;
 4494|       |
 4495|     47|    if (fNewBlock) *fNewBlock = false;
  ------------------
  |  Branch (4495:9): [True: 47, False: 0]
  ------------------
 4496|     47|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|     47|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4497|       |
 4498|     47|    CBlockIndex *pindexDummy = nullptr;
 4499|     47|    CBlockIndex *&pindex = ppindex ? *ppindex : pindexDummy;
  ------------------
  |  Branch (4499:28): [True: 47, False: 0]
  ------------------
 4500|       |
 4501|     47|    bool accepted_header{AcceptBlockHeader(block, state, &pindex, min_pow_checked)};
 4502|     47|    CheckBlockIndex();
 4503|       |
 4504|     47|    if (!accepted_header)
  ------------------
  |  Branch (4504:9): [True: 47, False: 0]
  ------------------
 4505|     47|        return false;
 4506|       |
 4507|       |    // Check all requested blocks that we do not already have for validity and
 4508|       |    // save them to disk. Skip processing of unrequested blocks as an anti-DoS
 4509|       |    // measure, unless the blocks have more work than the active chain tip, and
 4510|       |    // aren't too far ahead of it, so are likely to be attached soon.
 4511|      0|    bool fAlreadyHave = pindex->nStatus & BLOCK_HAVE_DATA;
 4512|      0|    bool fHasMoreOrSameWork = (ActiveTip() ? pindex->nChainWork >= ActiveTip()->nChainWork : true);
  ------------------
  |  Branch (4512:32): [True: 0, False: 0]
  ------------------
 4513|       |    // Blocks that are too out-of-order needlessly limit the effectiveness of
 4514|       |    // pruning, because pruning will not delete block files that contain any
 4515|       |    // blocks which are too close in height to the tip.  Apply this test
 4516|       |    // regardless of whether pruning is enabled; it should generally be safe to
 4517|       |    // not process unrequested blocks.
 4518|      0|    bool fTooFarAhead{pindex->nHeight > ActiveHeight() + int(MIN_BLOCKS_TO_KEEP)};
 4519|       |
 4520|       |    // TODO: Decouple this function from the block download logic by removing fRequested
 4521|       |    // This requires some new chain data structure to efficiently look up if a
 4522|       |    // block is in a chain leading to a candidate for best tip, despite not
 4523|       |    // being such a candidate itself.
 4524|       |    // Note that this would break the getblockfrompeer RPC
 4525|       |
 4526|       |    // TODO: deal better with return value and error conditions for duplicate
 4527|       |    // and unrequested blocks.
 4528|      0|    if (fAlreadyHave) return true;
  ------------------
  |  Branch (4528:9): [True: 0, False: 0]
  ------------------
 4529|      0|    if (!fRequested) {  // If we didn't ask for it:
  ------------------
  |  Branch (4529:9): [True: 0, False: 0]
  ------------------
 4530|      0|        if (pindex->nTx != 0) return true;    // This is a previously-processed block that was pruned
  ------------------
  |  Branch (4530:13): [True: 0, False: 0]
  ------------------
 4531|      0|        if (!fHasMoreOrSameWork) return true; // Don't process less-work chains
  ------------------
  |  Branch (4531:13): [True: 0, False: 0]
  ------------------
 4532|      0|        if (fTooFarAhead) return true;        // Block height is too high
  ------------------
  |  Branch (4532:13): [True: 0, False: 0]
  ------------------
 4533|       |
 4534|       |        // Protect against DoS attacks from low-work chains.
 4535|       |        // If our tip is behind, a peer could try to send us
 4536|       |        // low-work blocks on a fake chain that we would never
 4537|       |        // request; don't process these.
 4538|      0|        if (pindex->nChainWork < MinimumChainWork()) return true;
  ------------------
  |  Branch (4538:13): [True: 0, False: 0]
  ------------------
 4539|      0|    }
 4540|       |
 4541|      0|    const CChainParams& params{GetParams()};
 4542|       |
 4543|      0|    if (!CheckBlock(block, state, params.GetConsensus()) ||
  ------------------
  |  Branch (4543:9): [True: 0, False: 0]
  ------------------
 4544|      0|        !ContextualCheckBlock(block, state, *this, pindex->pprev)) {
  ------------------
  |  Branch (4544:9): [True: 0, False: 0]
  ------------------
 4545|      0|        if (state.IsInvalid() && state.GetResult() != BlockValidationResult::BLOCK_MUTATED) {
  ------------------
  |  Branch (4545:13): [True: 0, False: 0]
  |  Branch (4545:34): [True: 0, False: 0]
  ------------------
 4546|      0|            pindex->nStatus |= BLOCK_FAILED_VALID;
 4547|      0|            m_blockman.m_dirty_blockindex.insert(pindex);
 4548|      0|        }
 4549|      0|        LogError("%s: %s\n", __func__, state.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 4550|      0|        return false;
 4551|      0|    }
 4552|       |
 4553|       |    // Header is valid/has work, merkle tree and segwit merkle tree are good...RELAY NOW
 4554|       |    // (but if it does not build on our best tip, let the SendMessages loop relay it)
 4555|      0|    if (!IsInitialBlockDownload() && ActiveTip() == pindex->pprev && m_options.signals) {
  ------------------
  |  Branch (4555:9): [True: 0, False: 0]
  |  Branch (4555:38): [True: 0, False: 0]
  |  Branch (4555:70): [True: 0, False: 0]
  ------------------
 4556|      0|        m_options.signals->NewPoWValidBlock(pindex, pblock);
 4557|      0|    }
 4558|       |
 4559|       |    // Write block to history file
 4560|      0|    if (fNewBlock) *fNewBlock = true;
  ------------------
  |  Branch (4560:9): [True: 0, False: 0]
  ------------------
 4561|      0|    try {
 4562|      0|        FlatFilePos blockPos{};
 4563|      0|        if (dbp) {
  ------------------
  |  Branch (4563:13): [True: 0, False: 0]
  ------------------
 4564|      0|            blockPos = *dbp;
 4565|      0|            m_blockman.UpdateBlockInfo(block, pindex->nHeight, blockPos);
 4566|      0|        } else {
 4567|      0|            blockPos = m_blockman.WriteBlock(block, pindex->nHeight);
 4568|      0|            if (blockPos.IsNull()) {
  ------------------
  |  Branch (4568:17): [True: 0, False: 0]
  ------------------
 4569|      0|                state.Error(strprintf("%s: Failed to find position to write new block to disk", __func__));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 4570|      0|                return false;
 4571|      0|            }
 4572|      0|        }
 4573|      0|        ReceivedBlockTransactions(block, pindex, blockPos);
 4574|      0|    } catch (const std::runtime_error& e) {
 4575|      0|        return FatalError(GetNotifications(), state, strprintf(_("System error while saving block to disk: %s"), e.what()));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 4576|      0|    }
 4577|       |
 4578|       |    // TODO: FlushStateToDisk() handles flushing of both block and chainstate
 4579|       |    // data, so we should move this to ChainstateManager so that we can be more
 4580|       |    // intelligent about how we flush.
 4581|       |    // For now, since FlushStateMode::NONE is used, all that can happen is that
 4582|       |    // the block files may be pruned, so we can just call this on one
 4583|       |    // chainstate (particularly if we haven't implemented pruning with
 4584|       |    // background validation yet).
 4585|      0|    ActiveChainstate().FlushStateToDisk(state, FlushStateMode::NONE);
 4586|       |
 4587|      0|    CheckBlockIndex();
 4588|       |
 4589|      0|    return true;
 4590|      0|}
_ZN17ChainstateManager15ProcessNewBlockERKNSt3__110shared_ptrIK6CBlockEEbbPb:
 4593|    116|{
 4594|    116|    AssertLockNotHeld(cs_main);
  ------------------
  |  |  147|    116|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4595|       |
 4596|    116|    {
 4597|    116|        CBlockIndex *pindex = nullptr;
 4598|    116|        if (new_block) *new_block = false;
  ------------------
  |  Branch (4598:13): [True: 116, False: 0]
  ------------------
 4599|    116|        BlockValidationState state;
 4600|       |
 4601|       |        // CheckBlock() does not support multi-threaded block validation because CBlock::fChecked can cause data race.
 4602|       |        // Therefore, the following critical section must include the CheckBlock() call as well.
 4603|    116|        LOCK(cs_main);
  ------------------
  |  |  257|    116|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    116|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    116|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    116|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4604|       |
 4605|       |        // Skipping AcceptBlock() for CheckBlock() failures means that we will never mark a block as invalid if
 4606|       |        // CheckBlock() fails.  This is protective against consensus failure if there are any unknown forms of block
 4607|       |        // malleability that cause CheckBlock() to fail; see e.g. CVE-2012-2459 and
 4608|       |        // https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-February/016697.html.  Because CheckBlock() is
 4609|       |        // not very expensive, the anti-DoS benefits of caching failure (of a definitely-invalid block) are not substantial.
 4610|    116|        bool ret = CheckBlock(*block, state, GetConsensus());
 4611|    116|        if (ret) {
  ------------------
  |  Branch (4611:13): [True: 47, False: 69]
  ------------------
 4612|       |            // Store to disk
 4613|     47|            ret = AcceptBlock(block, state, &pindex, force_processing, nullptr, new_block, min_pow_checked);
 4614|     47|        }
 4615|    116|        if (!ret) {
  ------------------
  |  Branch (4615:13): [True: 116, False: 0]
  ------------------
 4616|    116|            if (m_options.signals) {
  ------------------
  |  Branch (4616:17): [True: 116, False: 0]
  ------------------
 4617|    116|                m_options.signals->BlockChecked(*block, state);
 4618|    116|            }
 4619|    116|            LogError("%s: AcceptBlock FAILED (%s)\n", __func__, state.ToString());
  ------------------
  |  |  263|    116|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|    116|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 4620|    116|            return false;
 4621|    116|        }
 4622|    116|    }
 4623|       |
 4624|      0|    NotifyHeaderTip();
 4625|       |
 4626|      0|    BlockValidationState state; // Only used to report errors, not invalidity - ignore it
 4627|      0|    if (!ActiveChainstate().ActivateBestChain(state, block)) {
  ------------------
  |  Branch (4627:9): [True: 0, False: 0]
  ------------------
 4628|      0|        LogError("%s: ActivateBestChain failed (%s)\n", __func__, state.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 4629|      0|        return false;
 4630|      0|    }
 4631|       |
 4632|      0|    Chainstate* bg_chain{WITH_LOCK(cs_main, return BackgroundSyncInProgress() ? m_ibd_chainstate.get() : nullptr)};
  ------------------
  |  |  301|      0|#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
  ------------------
 4633|      0|    BlockValidationState bg_state;
 4634|      0|    if (bg_chain && !bg_chain->ActivateBestChain(bg_state, block)) {
  ------------------
  |  Branch (4634:9): [True: 0, False: 0]
  |  Branch (4634:9): [True: 0, False: 0]
  |  Branch (4634:21): [True: 0, False: 0]
  ------------------
 4635|      0|        LogError("%s: [background] ActivateBestChain failed (%s)\n", __func__, bg_state.ToString());
  ------------------
  |  |  263|      0|#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
 4636|      0|        return false;
 4637|      0|     }
 4638|       |
 4639|      0|    return true;
 4640|      0|}
_ZN17ChainstateManager18ProcessTransactionERKNSt3__110shared_ptrIK12CTransactionEEb:
 4643|  1.36k|{
 4644|  1.36k|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4645|  1.36k|    Chainstate& active_chainstate = ActiveChainstate();
 4646|  1.36k|    if (!active_chainstate.GetMempool()) {
  ------------------
  |  Branch (4646:9): [True: 0, False: 1.36k]
  ------------------
 4647|      0|        TxValidationState state;
 4648|      0|        state.Invalid(TxValidationResult::TX_NO_MEMPOOL, "no-mempool");
 4649|      0|        return MempoolAcceptResult::Failure(state);
 4650|      0|    }
 4651|  1.36k|    auto result = AcceptToMemoryPool(active_chainstate, tx, GetTime(), /*bypass_limits=*/ false, test_accept);
 4652|  1.36k|    active_chainstate.GetMempool()->check(active_chainstate.CoinsTip(), active_chainstate.m_chain.Height() + 1);
 4653|  1.36k|    return result;
 4654|  1.36k|}
_ZNK17ChainstateManager21ShouldCheckBlockIndexEv:
 5258|    731|{
 5259|       |    // Assert to verify Flatten() has been called.
 5260|    731|    if (!*Assert(m_options.check_block_index)) return false;
  ------------------
  |  |   85|    731|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (5260:9): [True: 0, False: 731]
  ------------------
 5261|    731|    if (FastRandomContext().randrange(*m_options.check_block_index) >= 1) return false;
  ------------------
  |  Branch (5261:9): [True: 0, False: 731]
  ------------------
 5262|    731|    return true;
 5263|    731|}
_ZN17ChainstateManager15CheckBlockIndexEv:
 5266|    731|{
 5267|    731|    if (!ShouldCheckBlockIndex()) {
  ------------------
  |  Branch (5267:9): [True: 0, False: 731]
  ------------------
 5268|      0|        return;
 5269|      0|    }
 5270|       |
 5271|    731|    LOCK(cs_main);
  ------------------
  |  |  257|    731|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|    731|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|    731|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|    731|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5272|       |
 5273|       |    // During a reindex, we read the genesis block and call CheckBlockIndex before ActivateBestChain,
 5274|       |    // so we have the genesis block in m_blockman.m_block_index but no active chain. (A few of the
 5275|       |    // tests when iterating the block tree require that m_chain has been initialized.)
 5276|    731|    if (ActiveChain().Height() < 0) {
  ------------------
  |  Branch (5276:9): [True: 0, False: 731]
  ------------------
 5277|      0|        assert(m_blockman.m_block_index.size() <= 1);
 5278|      0|        return;
 5279|      0|    }
 5280|       |
 5281|       |    // Build forward-pointing data structure for the entire block tree.
 5282|       |    // For performance reasons, indexes of the best header chain are stored in a vector (within CChain).
 5283|       |    // All remaining blocks are stored in a multimap.
 5284|       |    // The best header chain can differ from the active chain: E.g. its entries may belong to blocks that
 5285|       |    // are not yet validated.
 5286|    731|    CChain best_hdr_chain;
 5287|    731|    assert(m_best_header);
 5288|    731|    best_hdr_chain.SetTip(*m_best_header);
 5289|       |
 5290|    731|    std::multimap<CBlockIndex*,CBlockIndex*> forward;
 5291|   270k|    for (auto& [_, block_index] : m_blockman.m_block_index) {
  ------------------
  |  Branch (5291:33): [True: 270k, False: 731]
  ------------------
 5292|       |        // Only save indexes in forward that are not part of the best header chain.
 5293|   270k|        if (!best_hdr_chain.Contains(&block_index)) {
  ------------------
  |  Branch (5293:13): [True: 123k, False: 147k]
  ------------------
 5294|       |            // Only genesis, which must be part of the best header chain, can have a nullptr parent.
 5295|   123k|            assert(block_index.pprev);
 5296|   123k|            forward.emplace(block_index.pprev, &block_index);
 5297|   123k|        }
 5298|   270k|    }
 5299|    731|    assert(forward.size() + best_hdr_chain.Height() + 1 == m_blockman.m_block_index.size());
 5300|       |
 5301|    731|    CBlockIndex* pindex = best_hdr_chain[0];
 5302|    731|    assert(pindex);
 5303|       |    // Iterate over the entire block tree, using depth-first search.
 5304|       |    // Along the way, remember whether there are blocks on the path from genesis
 5305|       |    // block being explored which are the first to have certain properties.
 5306|    731|    size_t nNodes = 0;
 5307|    731|    int nHeight = 0;
 5308|    731|    CBlockIndex* pindexFirstInvalid = nullptr; // Oldest ancestor of pindex which is invalid.
 5309|    731|    CBlockIndex* pindexFirstMissing = nullptr; // Oldest ancestor of pindex which does not have BLOCK_HAVE_DATA, since assumeutxo snapshot if used.
 5310|    731|    CBlockIndex* pindexFirstNeverProcessed = nullptr; // Oldest ancestor of pindex for which nTx == 0, since assumeutxo snapshot if used.
 5311|    731|    CBlockIndex* pindexFirstNotTreeValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_TREE (regardless of being valid or not).
 5312|    731|    CBlockIndex* pindexFirstNotTransactionsValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_TRANSACTIONS (regardless of being valid or not), since assumeutxo snapshot if used.
 5313|    731|    CBlockIndex* pindexFirstNotChainValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_CHAIN (regardless of being valid or not), since assumeutxo snapshot if used.
 5314|    731|    CBlockIndex* pindexFirstNotScriptsValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_SCRIPTS (regardless of being valid or not), since assumeutxo snapshot if used.
 5315|       |
 5316|       |    // After checking an assumeutxo snapshot block, reset pindexFirst pointers
 5317|       |    // to earlier blocks that have not been downloaded or validated yet, so
 5318|       |    // checks for later blocks can assume the earlier blocks were validated and
 5319|       |    // be stricter, testing for more requirements.
 5320|    731|    const CBlockIndex* snap_base{GetSnapshotBaseBlock()};
 5321|    731|    CBlockIndex *snap_first_missing{}, *snap_first_notx{}, *snap_first_notv{}, *snap_first_nocv{}, *snap_first_nosv{};
 5322|    731|    auto snap_update_firsts = [&] {
 5323|    731|        if (pindex == snap_base) {
 5324|    731|            std::swap(snap_first_missing, pindexFirstMissing);
 5325|    731|            std::swap(snap_first_notx, pindexFirstNeverProcessed);
 5326|    731|            std::swap(snap_first_notv, pindexFirstNotTransactionsValid);
 5327|    731|            std::swap(snap_first_nocv, pindexFirstNotChainValid);
 5328|    731|            std::swap(snap_first_nosv, pindexFirstNotScriptsValid);
 5329|    731|        }
 5330|    731|    };
 5331|       |
 5332|   270k|    while (pindex != nullptr) {
  ------------------
  |  Branch (5332:12): [True: 270k, False: 0]
  ------------------
 5333|   270k|        nNodes++;
 5334|   270k|        if (pindexFirstInvalid == nullptr && pindex->nStatus & BLOCK_FAILED_VALID) pindexFirstInvalid = pindex;
  ------------------
  |  Branch (5334:13): [True: 270k, False: 0]
  |  Branch (5334:46): [True: 0, False: 270k]
  ------------------
 5335|   270k|        if (pindexFirstMissing == nullptr && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
  ------------------
  |  Branch (5335:13): [True: 268k, False: 1.97k]
  |  Branch (5335:46): [True: 122k, False: 146k]
  ------------------
 5336|   122k|            pindexFirstMissing = pindex;
 5337|   122k|        }
 5338|   270k|        if (pindexFirstNeverProcessed == nullptr && pindex->nTx == 0) pindexFirstNeverProcessed = pindex;
  ------------------
  |  Branch (5338:13): [True: 268k, False: 1.97k]
  |  Branch (5338:53): [True: 122k, False: 146k]
  ------------------
 5339|   270k|        if (pindex->pprev != nullptr && pindexFirstNotTreeValid == nullptr && (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_TREE) pindexFirstNotTreeValid = pindex;
  ------------------
  |  Branch (5339:13): [True: 270k, False: 731]
  |  Branch (5339:41): [True: 270k, False: 0]
  |  Branch (5339:79): [True: 0, False: 270k]
  ------------------
 5340|       |
 5341|   270k|        if (pindex->pprev != nullptr) {
  ------------------
  |  Branch (5341:13): [True: 270k, False: 731]
  ------------------
 5342|   270k|            if (pindexFirstNotTransactionsValid == nullptr &&
  ------------------
  |  Branch (5342:17): [True: 268k, False: 1.97k]
  ------------------
 5343|   270k|                    (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_TRANSACTIONS) {
  ------------------
  |  Branch (5343:21): [True: 122k, False: 146k]
  ------------------
 5344|   122k|                pindexFirstNotTransactionsValid = pindex;
 5345|   122k|            }
 5346|       |
 5347|   270k|            if (pindexFirstNotChainValid == nullptr &&
  ------------------
  |  Branch (5347:17): [True: 268k, False: 1.97k]
  ------------------
 5348|   270k|                    (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_CHAIN) {
  ------------------
  |  Branch (5348:21): [True: 122k, False: 146k]
  ------------------
 5349|   122k|                pindexFirstNotChainValid = pindex;
 5350|   122k|            }
 5351|       |
 5352|   270k|            if (pindexFirstNotScriptsValid == nullptr &&
  ------------------
  |  Branch (5352:17): [True: 268k, False: 1.97k]
  ------------------
 5353|   270k|                    (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_SCRIPTS) {
  ------------------
  |  Branch (5353:21): [True: 122k, False: 146k]
  ------------------
 5354|   122k|                pindexFirstNotScriptsValid = pindex;
 5355|   122k|            }
 5356|   270k|        }
 5357|       |
 5358|       |        // Begin: actual consistency checks.
 5359|   270k|        if (pindex->pprev == nullptr) {
  ------------------
  |  Branch (5359:13): [True: 731, False: 270k]
  ------------------
 5360|       |            // Genesis block checks.
 5361|    731|            assert(pindex->GetBlockHash() == GetConsensus().hashGenesisBlock); // Genesis block's hash must match.
 5362|    731|            for (auto c : GetAll()) {
  ------------------
  |  Branch (5362:25): [True: 731, False: 731]
  ------------------
 5363|    731|                if (c->m_chain.Genesis() != nullptr) {
  ------------------
  |  Branch (5363:21): [True: 731, False: 0]
  ------------------
 5364|    731|                    assert(pindex == c->m_chain.Genesis()); // The chain's genesis block must be this block.
 5365|    731|                }
 5366|    731|            }
 5367|    731|        }
 5368|   270k|        if (!pindex->HaveNumChainTxs()) assert(pindex->nSequenceId <= 0); // nSequenceId can't be set positive for blocks that aren't linked (negative is used for preciousblock)
  ------------------
  |  Branch (5368:13): [True: 123k, False: 146k]
  ------------------
 5369|       |        // VALID_TRANSACTIONS is equivalent to nTx > 0 for all nodes (whether or not pruning has occurred).
 5370|       |        // HAVE_DATA is only equivalent to nTx > 0 (or VALID_TRANSACTIONS) if no pruning has occurred.
 5371|   270k|        if (!m_blockman.m_have_pruned) {
  ------------------
  |  Branch (5371:13): [True: 270k, False: 0]
  ------------------
 5372|       |            // If we've never pruned, then HAVE_DATA should be equivalent to nTx > 0
 5373|   270k|            assert(!(pindex->nStatus & BLOCK_HAVE_DATA) == (pindex->nTx == 0));
 5374|   270k|            assert(pindexFirstMissing == pindexFirstNeverProcessed);
 5375|   270k|        } else {
 5376|       |            // If we have pruned, then we can only say that HAVE_DATA implies nTx > 0
 5377|      0|            if (pindex->nStatus & BLOCK_HAVE_DATA) assert(pindex->nTx > 0);
  ------------------
  |  Branch (5377:17): [True: 0, False: 0]
  ------------------
 5378|      0|        }
 5379|   270k|        if (pindex->nStatus & BLOCK_HAVE_UNDO) assert(pindex->nStatus & BLOCK_HAVE_DATA);
  ------------------
  |  Branch (5379:13): [True: 146k, False: 124k]
  ------------------
 5380|   270k|        if (snap_base && snap_base->GetAncestor(pindex->nHeight) == pindex) {
  ------------------
  |  Branch (5380:13): [True: 0, False: 270k]
  |  Branch (5380:26): [True: 0, False: 0]
  ------------------
 5381|       |            // Assumed-valid blocks should connect to the main chain.
 5382|      0|            assert((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE);
 5383|      0|        }
 5384|       |        // There should only be an nTx value if we have
 5385|       |        // actually seen a block's transactions.
 5386|   270k|        assert(((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS) == (pindex->nTx > 0)); // This is pruning-independent.
 5387|       |        // All parents having had data (at some point) is equivalent to all parents being VALID_TRANSACTIONS, which is equivalent to HaveNumChainTxs().
 5388|       |        // HaveNumChainTxs will also be set in the assumeutxo snapshot block from snapshot metadata.
 5389|   270k|        assert((pindexFirstNeverProcessed == nullptr || pindex == snap_base) == pindex->HaveNumChainTxs());
 5390|   270k|        assert((pindexFirstNotTransactionsValid == nullptr || pindex == snap_base) == pindex->HaveNumChainTxs());
 5391|   270k|        assert(pindex->nHeight == nHeight); // nHeight must be consistent.
 5392|   270k|        assert(pindex->pprev == nullptr || pindex->nChainWork >= pindex->pprev->nChainWork); // For every block except the genesis block, the chainwork must be larger than the parent's.
 5393|   270k|        assert(nHeight < 2 || (pindex->pskip && (pindex->pskip->nHeight < nHeight))); // The pskip pointer must point back for all but the first 2 blocks.
 5394|   270k|        assert(pindexFirstNotTreeValid == nullptr); // All m_blockman.m_block_index entries must at least be TREE valid
 5395|   270k|        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE) assert(pindexFirstNotTreeValid == nullptr); // TREE valid implies all parents are TREE valid
  ------------------
  |  Branch (5395:13): [True: 270k, False: 0]
  ------------------
 5396|   270k|        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_CHAIN) assert(pindexFirstNotChainValid == nullptr); // CHAIN valid implies all parents are CHAIN valid
  ------------------
  |  Branch (5396:13): [True: 146k, False: 124k]
  ------------------
 5397|   270k|        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_SCRIPTS) assert(pindexFirstNotScriptsValid == nullptr); // SCRIPTS valid implies all parents are SCRIPTS valid
  ------------------
  |  Branch (5397:13): [True: 146k, False: 124k]
  ------------------
 5398|   270k|        if (pindexFirstInvalid == nullptr) {
  ------------------
  |  Branch (5398:13): [True: 270k, False: 0]
  ------------------
 5399|       |            // Checks for not-invalid blocks.
 5400|   270k|            assert((pindex->nStatus & BLOCK_FAILED_MASK) == 0); // The failed mask cannot be set for blocks without invalid parents.
 5401|   270k|        }
 5402|       |        // Make sure m_chain_tx_count sum is correctly computed.
 5403|   270k|        if (!pindex->pprev) {
  ------------------
  |  Branch (5403:13): [True: 731, False: 270k]
  ------------------
 5404|       |            // If no previous block, nTx and m_chain_tx_count must be the same.
 5405|    731|            assert(pindex->m_chain_tx_count == pindex->nTx);
 5406|   270k|        } else if (pindex->pprev->m_chain_tx_count > 0 && pindex->nTx > 0) {
  ------------------
  |  Branch (5406:20): [True: 268k, False: 1.97k]
  |  Branch (5406:59): [True: 146k, False: 122k]
  ------------------
 5407|       |            // If previous m_chain_tx_count is set and number of transactions in block is known, sum must be set.
 5408|   146k|            assert(pindex->m_chain_tx_count == pindex->nTx + pindex->pprev->m_chain_tx_count);
 5409|   146k|        } else {
 5410|       |            // Otherwise m_chain_tx_count should only be set if this is a snapshot
 5411|       |            // block, and must be set if it is.
 5412|   123k|            assert((pindex->m_chain_tx_count != 0) == (pindex == snap_base));
 5413|   123k|        }
 5414|       |
 5415|       |        // Chainstate-specific checks on setBlockIndexCandidates
 5416|   270k|        for (auto c : GetAll()) {
  ------------------
  |  Branch (5416:21): [True: 270k, False: 270k]
  ------------------
 5417|   270k|            if (c->m_chain.Tip() == nullptr) continue;
  ------------------
  |  Branch (5417:17): [True: 0, False: 270k]
  ------------------
 5418|       |            // Two main factors determine whether pindex is a candidate in
 5419|       |            // setBlockIndexCandidates:
 5420|       |            //
 5421|       |            // - If pindex has less work than the chain tip, it should not be a
 5422|       |            //   candidate, and this will be asserted below. Otherwise it is a
 5423|       |            //   potential candidate.
 5424|       |            //
 5425|       |            // - If pindex or one of its parent blocks back to the genesis block
 5426|       |            //   or an assumeutxo snapshot never downloaded transactions
 5427|       |            //   (pindexFirstNeverProcessed is non-null), it should not be a
 5428|       |            //   candidate, and this will be asserted below. The only exception
 5429|       |            //   is if pindex itself is an assumeutxo snapshot block. Then it is
 5430|       |            //   also a potential candidate.
 5431|   270k|            if (!CBlockIndexWorkComparator()(pindex, c->m_chain.Tip()) && (pindexFirstNeverProcessed == nullptr || pindex == snap_base)) {
  ------------------
  |  Branch (5431:17): [True: 20.4k, False: 250k]
  |  Branch (5431:17): [True: 731, False: 270k]
  |  Branch (5431:76): [True: 731, False: 19.7k]
  |  Branch (5431:116): [True: 0, False: 19.7k]
  ------------------
 5432|       |                // If pindex was detected as invalid (pindexFirstInvalid is
 5433|       |                // non-null), it is not required to be in
 5434|       |                // setBlockIndexCandidates.
 5435|    731|                if (pindexFirstInvalid == nullptr) {
  ------------------
  |  Branch (5435:21): [True: 731, False: 0]
  ------------------
 5436|       |                    // If pindex and all its parents back to the genesis block
 5437|       |                    // or an assumeutxo snapshot block downloaded transactions,
 5438|       |                    // and the transactions were not pruned (pindexFirstMissing
 5439|       |                    // is null), it is a potential candidate. The check
 5440|       |                    // excludes pruned blocks, because if any blocks were
 5441|       |                    // pruned between pindex and the current chain tip, pindex will
 5442|       |                    // only temporarily be added to setBlockIndexCandidates,
 5443|       |                    // before being moved to m_blocks_unlinked. This check
 5444|       |                    // could be improved to verify that if all blocks between
 5445|       |                    // the chain tip and pindex have data, pindex must be a
 5446|       |                    // candidate.
 5447|       |                    //
 5448|       |                    // If pindex is the chain tip, it also is a potential
 5449|       |                    // candidate.
 5450|       |                    //
 5451|       |                    // If the chainstate was loaded from a snapshot and pindex
 5452|       |                    // is the base of the snapshot, pindex is also a potential
 5453|       |                    // candidate.
 5454|    731|                    if (pindexFirstMissing == nullptr || pindex == c->m_chain.Tip() || pindex == c->SnapshotBase()) {
  ------------------
  |  Branch (5454:25): [True: 731, False: 0]
  |  Branch (5454:58): [True: 0, False: 0]
  |  Branch (5454:88): [True: 0, False: 0]
  ------------------
 5455|       |                        // If this chainstate is the active chainstate, pindex
 5456|       |                        // must be in setBlockIndexCandidates. Otherwise, this
 5457|       |                        // chainstate is a background validation chainstate, and
 5458|       |                        // pindex only needs to be added if it is an ancestor of
 5459|       |                        // the snapshot that is being validated.
 5460|    731|                        if (c == &ActiveChainstate() || snap_base->GetAncestor(pindex->nHeight) == pindex) {
  ------------------
  |  Branch (5460:29): [True: 731, False: 0]
  |  Branch (5460:57): [True: 0, False: 0]
  ------------------
 5461|    731|                            assert(c->setBlockIndexCandidates.count(pindex));
 5462|    731|                        }
 5463|    731|                    }
 5464|       |                    // If some parent is missing, then it could be that this block was in
 5465|       |                    // setBlockIndexCandidates but had to be removed because of the missing data.
 5466|       |                    // In this case it must be in m_blocks_unlinked -- see test below.
 5467|    731|                }
 5468|   270k|            } else { // If this block sorts worse than the current tip or some ancestor's block has never been seen, it cannot be in setBlockIndexCandidates.
 5469|   270k|                assert(c->setBlockIndexCandidates.count(pindex) == 0);
 5470|   270k|            }
 5471|   270k|        }
 5472|       |        // Check whether this block is in m_blocks_unlinked.
 5473|   270k|        std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> rangeUnlinked = m_blockman.m_blocks_unlinked.equal_range(pindex->pprev);
 5474|   270k|        bool foundInUnlinked = false;
 5475|   270k|        while (rangeUnlinked.first != rangeUnlinked.second) {
  ------------------
  |  Branch (5475:16): [True: 0, False: 270k]
  ------------------
 5476|      0|            assert(rangeUnlinked.first->first == pindex->pprev);
 5477|      0|            if (rangeUnlinked.first->second == pindex) {
  ------------------
  |  Branch (5477:17): [True: 0, False: 0]
  ------------------
 5478|      0|                foundInUnlinked = true;
 5479|      0|                break;
 5480|      0|            }
 5481|      0|            rangeUnlinked.first++;
 5482|      0|        }
 5483|   270k|        if (pindex->pprev && (pindex->nStatus & BLOCK_HAVE_DATA) && pindexFirstNeverProcessed != nullptr && pindexFirstInvalid == nullptr) {
  ------------------
  |  Branch (5483:13): [True: 270k, False: 731]
  |  Branch (5483:30): [True: 146k, False: 123k]
  |  Branch (5483:69): [True: 0, False: 146k]
  |  Branch (5483:109): [True: 0, False: 0]
  ------------------
 5484|       |            // If this block has block data available, some parent was never received, and has no invalid parents, it must be in m_blocks_unlinked.
 5485|      0|            assert(foundInUnlinked);
 5486|      0|        }
 5487|   270k|        if (!(pindex->nStatus & BLOCK_HAVE_DATA)) assert(!foundInUnlinked); // Can't be in m_blocks_unlinked if we don't HAVE_DATA
  ------------------
  |  Branch (5487:13): [True: 123k, False: 146k]
  ------------------
 5488|   270k|        if (pindexFirstMissing == nullptr) assert(!foundInUnlinked); // We aren't missing data for any parent -- cannot be in m_blocks_unlinked.
  ------------------
  |  Branch (5488:13): [True: 146k, False: 123k]
  ------------------
 5489|   270k|        if (pindex->pprev && (pindex->nStatus & BLOCK_HAVE_DATA) && pindexFirstNeverProcessed == nullptr && pindexFirstMissing != nullptr) {
  ------------------
  |  Branch (5489:13): [True: 270k, False: 731]
  |  Branch (5489:30): [True: 146k, False: 123k]
  |  Branch (5489:69): [True: 146k, False: 0]
  |  Branch (5489:109): [True: 0, False: 146k]
  ------------------
 5490|       |            // We HAVE_DATA for this block, have received data for all parents at some point, but we're currently missing data for some parent.
 5491|      0|            assert(m_blockman.m_have_pruned);
 5492|       |            // This block may have entered m_blocks_unlinked if:
 5493|       |            //  - it has a descendant that at some point had more work than the
 5494|       |            //    tip, and
 5495|       |            //  - we tried switching to that descendant but were missing
 5496|       |            //    data for some intermediate block between m_chain and the
 5497|       |            //    tip.
 5498|       |            // So if this block is itself better than any m_chain.Tip() and it wasn't in
 5499|       |            // setBlockIndexCandidates, then it must be in m_blocks_unlinked.
 5500|      0|            for (auto c : GetAll()) {
  ------------------
  |  Branch (5500:25): [True: 0, False: 0]
  ------------------
 5501|      0|                const bool is_active = c == &ActiveChainstate();
 5502|      0|                if (!CBlockIndexWorkComparator()(pindex, c->m_chain.Tip()) && c->setBlockIndexCandidates.count(pindex) == 0) {
  ------------------
  |  Branch (5502:21): [True: 0, False: 0]
  |  Branch (5502:21): [True: 0, False: 0]
  |  Branch (5502:79): [True: 0, False: 0]
  ------------------
 5503|      0|                    if (pindexFirstInvalid == nullptr) {
  ------------------
  |  Branch (5503:25): [True: 0, False: 0]
  ------------------
 5504|      0|                        if (is_active || snap_base->GetAncestor(pindex->nHeight) == pindex) {
  ------------------
  |  Branch (5504:29): [True: 0, False: 0]
  |  Branch (5504:42): [True: 0, False: 0]
  ------------------
 5505|      0|                            assert(foundInUnlinked);
 5506|      0|                        }
 5507|      0|                    }
 5508|      0|                }
 5509|      0|            }
 5510|      0|        }
 5511|       |        // assert(pindex->GetBlockHash() == pindex->GetBlockHeader().GetHash()); // Perhaps too slow
 5512|       |        // End: actual consistency checks.
 5513|       |
 5514|       |
 5515|       |        // Try descending into the first subnode. Always process forks first and the best header chain after.
 5516|   270k|        snap_update_firsts();
 5517|   270k|        std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> range = forward.equal_range(pindex);
 5518|   270k|        if (range.first != range.second) {
  ------------------
  |  Branch (5518:13): [True: 4.36k, False: 266k]
  ------------------
 5519|       |            // A subnode not part of the best header chain was found.
 5520|  4.36k|            pindex = range.first->second;
 5521|  4.36k|            nHeight++;
 5522|  4.36k|            continue;
 5523|   266k|        } else if (best_hdr_chain.Contains(pindex)) {
  ------------------
  |  Branch (5523:20): [True: 143k, False: 122k]
  ------------------
 5524|       |            // Descend further into best header chain.
 5525|   143k|            nHeight++;
 5526|   143k|            pindex = best_hdr_chain[nHeight];
 5527|   143k|            if (!pindex) break; // we are finished, since the best header chain is always processed last
  ------------------
  |  Branch (5527:17): [True: 731, False: 143k]
  ------------------
 5528|   143k|            continue;
 5529|   143k|        }
 5530|       |        // This is a leaf node.
 5531|       |        // Move upwards until we reach a node of which we have not yet visited the last child.
 5532|   123k|        while (pindex) {
  ------------------
  |  Branch (5532:16): [True: 123k, False: 0]
  ------------------
 5533|       |            // We are going to either move to a parent or a sibling of pindex.
 5534|   123k|            snap_update_firsts();
 5535|       |            // If pindex was the first with a certain property, unset the corresponding variable.
 5536|   123k|            if (pindex == pindexFirstInvalid) pindexFirstInvalid = nullptr;
  ------------------
  |  Branch (5536:17): [True: 0, False: 123k]
  ------------------
 5537|   123k|            if (pindex == pindexFirstMissing) pindexFirstMissing = nullptr;
  ------------------
  |  Branch (5537:17): [True: 121k, False: 1.97k]
  ------------------
 5538|   123k|            if (pindex == pindexFirstNeverProcessed) pindexFirstNeverProcessed = nullptr;
  ------------------
  |  Branch (5538:17): [True: 121k, False: 1.97k]
  ------------------
 5539|   123k|            if (pindex == pindexFirstNotTreeValid) pindexFirstNotTreeValid = nullptr;
  ------------------
  |  Branch (5539:17): [True: 0, False: 123k]
  ------------------
 5540|   123k|            if (pindex == pindexFirstNotTransactionsValid) pindexFirstNotTransactionsValid = nullptr;
  ------------------
  |  Branch (5540:17): [True: 121k, False: 1.97k]
  ------------------
 5541|   123k|            if (pindex == pindexFirstNotChainValid) pindexFirstNotChainValid = nullptr;
  ------------------
  |  Branch (5541:17): [True: 121k, False: 1.97k]
  ------------------
 5542|   123k|            if (pindex == pindexFirstNotScriptsValid) pindexFirstNotScriptsValid = nullptr;
  ------------------
  |  Branch (5542:17): [True: 121k, False: 1.97k]
  ------------------
 5543|       |            // Find our parent.
 5544|   123k|            CBlockIndex* pindexPar = pindex->pprev;
 5545|       |            // Find which child we just visited.
 5546|   123k|            std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> rangePar = forward.equal_range(pindexPar);
 5547|  5.68M|            while (rangePar.first->second != pindex) {
  ------------------
  |  Branch (5547:20): [True: 5.55M, False: 123k]
  ------------------
 5548|  5.55M|                assert(rangePar.first != rangePar.second); // Our parent must have at least the node we're coming from as child.
 5549|  5.55M|                rangePar.first++;
 5550|  5.55M|            }
 5551|       |            // Proceed to the next one.
 5552|   123k|            rangePar.first++;
 5553|   123k|            if (rangePar.first != rangePar.second) {
  ------------------
  |  Branch (5553:17): [True: 119k, False: 4.36k]
  ------------------
 5554|       |                // Move to a sibling not part of the best header chain.
 5555|   119k|                pindex = rangePar.first->second;
 5556|   119k|                break;
 5557|   119k|            } else if (pindexPar == best_hdr_chain[nHeight - 1]) {
  ------------------
  |  Branch (5557:24): [True: 3.63k, False: 733]
  ------------------
 5558|       |                // Move to pindex's sibling on the best-chain, if it has one.
 5559|  3.63k|                pindex = best_hdr_chain[nHeight];
 5560|       |                // There will not be a next block if (and only if) parent block is the best header.
 5561|  3.63k|                assert((pindex == nullptr) == (pindexPar == best_hdr_chain.Tip()));
 5562|  3.63k|                break;
 5563|  3.63k|            } else {
 5564|       |                // Move up further.
 5565|    733|                pindex = pindexPar;
 5566|    733|                nHeight--;
 5567|    733|                continue;
 5568|    733|            }
 5569|   123k|        }
 5570|   122k|    }
 5571|       |
 5572|       |    // Check that we actually traversed the entire block index.
 5573|    731|    assert(nNodes == forward.size() + best_hdr_chain.Height() + 1);
 5574|    731|}
_ZN17ChainstateManager6GetAllEv:
 5654|   271k|{
 5655|   271k|    LOCK(::cs_main);
  ------------------
  |  |  257|   271k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   271k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   271k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   271k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5656|   271k|    std::vector<Chainstate*> out;
 5657|       |
 5658|   543k|    for (Chainstate* cs : {m_ibd_chainstate.get(), m_snapshot_chainstate.get()}) {
  ------------------
  |  Branch (5658:25): [True: 543k, False: 271k]
  ------------------
 5659|   543k|        if (this->IsUsable(cs)) out.push_back(cs);
  ------------------
  |  Branch (5659:13): [True: 271k, False: 271k]
  ------------------
 5660|   543k|    }
 5661|       |
 5662|   271k|    return out;
 5663|   271k|}
_ZNK17ChainstateManager16ActiveChainstateEv:
 6241|   528k|{
 6242|   528k|    LOCK(::cs_main);
  ------------------
  |  |  257|   528k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|   528k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|   528k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|   528k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6243|   528k|    assert(m_active_chainstate);
 6244|   528k|    return *m_active_chainstate;
 6245|   528k|}
_ZN17ChainstateManagerD2Ev:
 6319|      2|{
 6320|      2|    LOCK(::cs_main);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6321|       |
 6322|      2|    m_versionbitscache.Clear();
 6323|      2|}
_ZNK17ChainstateManager20GetSnapshotBaseBlockEv:
 6444|    752|{
 6445|    752|    return m_active_chainstate ? m_active_chainstate->SnapshotBase() : nullptr;
  ------------------
  |  Branch (6445:12): [True: 752, False: 0]
  ------------------
 6446|    752|}
validation.cpp:_ZN12_GLOBAL__N_120CalculatePrevHeightsERK11CBlockIndexRK10CCoinsViewRK12CTransaction:
  183|    109|{
  184|    109|    std::vector<int> prev_heights;
  185|    109|    prev_heights.resize(tx.vin.size());
  186|    218|    for (size_t i = 0; i < tx.vin.size(); ++i) {
  ------------------
  |  Branch (186:24): [True: 109, False: 109]
  ------------------
  187|    109|        if (auto coin{coins.GetCoin(tx.vin[i].prevout)}) {
  ------------------
  |  Branch (187:18): [True: 109, False: 0]
  ------------------
  188|    109|            prev_heights[i] = coin->nHeight == MEMPOOL_HEIGHT
  ------------------
  |  Branch (188:31): [True: 0, False: 109]
  ------------------
  189|    109|                              ? tip.nHeight + 1 // Assume all mempool transaction confirm in the next block.
  190|    109|                              : coin->nHeight;
  191|    109|        } else {
  192|      0|            LogPrintf("ERROR: %s: Missing input %d in transaction \'%s\'\n", __func__, i, tx.GetHash().GetHex());
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|      0|            return std::nullopt;
  194|      0|        }
  195|    109|    }
  196|    109|    return prev_heights;
  197|    109|}
validation.cpp:_ZN12_GLOBAL__N_113MemPoolAccept8ATMPArgs12SingleAcceptERK12CChainParamslbRNSt3__16vectorI9COutPointNS5_9allocatorIS7_EEEEb:
  491|  1.36k|                                     bool test_accept) {
  492|  1.36k|            return ATMPArgs{/* m_chainparams */ chainparams,
  493|  1.36k|                            /* m_accept_time */ accept_time,
  494|  1.36k|                            /* m_bypass_limits */ bypass_limits,
  495|  1.36k|                            /* m_coins_to_uncache */ coins_to_uncache,
  496|  1.36k|                            /* m_test_accept */ test_accept,
  497|  1.36k|                            /* m_allow_replacement */ true,
  498|  1.36k|                            /* m_allow_sibling_eviction */ true,
  499|  1.36k|                            /* m_package_submission */ false,
  500|  1.36k|                            /* m_package_feerates */ false,
  501|  1.36k|                            /* m_client_maxfeerate */ {}, // checked by caller
  502|  1.36k|                            /* m_allow_carveouts */ true,
  503|  1.36k|            };
  504|  1.36k|        }
validation.cpp:_ZN12_GLOBAL__N_113MemPoolAccept8ATMPArgsC2ERK12CChainParamslbRNSt3__16vectorI9COutPointNS5_9allocatorIS7_EEEEbbbbbNS5_8optionalI8CFeeRateEEb:
  570|  1.36k|            : m_chainparams{chainparams},
  571|  1.36k|              m_accept_time{accept_time},
  572|  1.36k|              m_bypass_limits{bypass_limits},
  573|  1.36k|              m_coins_to_uncache{coins_to_uncache},
  574|  1.36k|              m_test_accept{test_accept},
  575|  1.36k|              m_allow_replacement{allow_replacement},
  576|  1.36k|              m_allow_sibling_eviction{allow_sibling_eviction},
  577|  1.36k|              m_package_submission{package_submission},
  578|  1.36k|              m_package_feerates{package_feerates},
  579|  1.36k|              m_client_maxfeerate{client_maxfeerate},
  580|  1.36k|              m_allow_carveouts{allow_carveouts}
  581|  1.36k|        {
  582|       |            // If we are using package feerates, we must be doing package submission.
  583|       |            // It also means carveouts and sibling eviction are not permitted.
  584|  1.36k|            if (m_package_feerates) {
  ------------------
  |  Branch (584:17): [True: 0, False: 1.36k]
  ------------------
  585|      0|                Assume(m_package_submission);
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  586|      0|                Assume(!m_allow_carveouts);
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  587|      0|                Assume(!m_allow_sibling_eviction);
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  588|      0|            }
  589|  1.36k|            if (m_allow_sibling_eviction) Assume(m_allow_replacement);
  ------------------
  |  |   97|  1.36k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (589:17): [True: 1.36k, False: 0]
  ------------------
  590|  1.36k|        }
validation.cpp:_ZN12_GLOBAL__N_113MemPoolAcceptC2ER10CTxMemPoolR10Chainstate:
  441|  1.36k|        m_pool(mempool),
  442|  1.36k|        m_view(&m_dummy),
  443|  1.36k|        m_viewmempool(&active_chainstate.CoinsTip(), m_pool),
  444|  1.36k|        m_active_chainstate(active_chainstate)
  445|  1.36k|    {
  446|  1.36k|    }
validation.cpp:_ZN12_GLOBAL__N_113MemPoolAccept23AcceptSingleTransactionERKNSt3__110shared_ptrIK12CTransactionEERNS0_8ATMPArgsE:
 1416|  1.36k|{
 1417|  1.36k|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 1418|  1.36k|    LOCK(m_pool.cs); // mempool "read lock" (held through m_pool.m_opts.signals->TransactionAddedToMempool())
  ------------------
  |  |  257|  1.36k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  1.36k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  1.36k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  1.36k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1419|       |
 1420|  1.36k|    Workspace ws(ptx);
 1421|  1.36k|    const std::vector<Wtxid> single_wtxid{ws.m_ptx->GetWitnessHash()};
 1422|       |
 1423|  1.36k|    if (!PreChecks(args, ws)) {
  ------------------
  |  Branch (1423:9): [True: 1.36k, False: 0]
  ------------------
 1424|  1.36k|        if (ws.m_state.GetResult() == TxValidationResult::TX_RECONSIDERABLE) {
  ------------------
  |  Branch (1424:13): [True: 0, False: 1.36k]
  ------------------
 1425|       |            // Failed for fee reasons. Provide the effective feerate and which tx was included.
 1426|      0|            return MempoolAcceptResult::FeeFailure(ws.m_state, CFeeRate(ws.m_modified_fees, ws.m_vsize), single_wtxid);
 1427|      0|        }
 1428|  1.36k|        return MempoolAcceptResult::Failure(ws.m_state);
 1429|  1.36k|    }
 1430|       |
 1431|      0|    m_subpackage.m_total_vsize = ws.m_vsize;
 1432|      0|    m_subpackage.m_total_modified_fees = ws.m_modified_fees;
 1433|       |
 1434|       |    // Individual modified feerate exceeded caller-defined max; abort
 1435|      0|    if (args.m_client_maxfeerate && CFeeRate(ws.m_modified_fees, ws.m_vsize) > args.m_client_maxfeerate.value()) {
  ------------------
  |  Branch (1435:9): [True: 0, False: 0]
  |  Branch (1435:9): [True: 0, False: 0]
  |  Branch (1435:37): [True: 0, False: 0]
  ------------------
 1436|      0|        ws.m_state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "max feerate exceeded", "");
 1437|      0|        return MempoolAcceptResult::Failure(ws.m_state);
 1438|      0|    }
 1439|       |
 1440|      0|    if (m_pool.m_opts.require_standard) {
  ------------------
  |  Branch (1440:9): [True: 0, False: 0]
  ------------------
 1441|      0|        Txid dummy_txid;
 1442|      0|        if (!CheckEphemeralSpends(/*package=*/{ptx}, m_pool.m_opts.dust_relay_feerate, m_pool, ws.m_state, dummy_txid)) {
  ------------------
  |  Branch (1442:13): [True: 0, False: 0]
  ------------------
 1443|      0|            return MempoolAcceptResult::Failure(ws.m_state);
 1444|      0|        }
 1445|      0|    }
 1446|       |
 1447|      0|    if (m_subpackage.m_rbf && !ReplacementChecks(ws)) {
  ------------------
  |  Branch (1447:9): [True: 0, False: 0]
  |  Branch (1447:31): [True: 0, False: 0]
  ------------------
 1448|      0|        if (ws.m_state.GetResult() == TxValidationResult::TX_RECONSIDERABLE) {
  ------------------
  |  Branch (1448:13): [True: 0, False: 0]
  ------------------
 1449|       |            // Failed for incentives-based fee reasons. Provide the effective feerate and which tx was included.
 1450|      0|            return MempoolAcceptResult::FeeFailure(ws.m_state, CFeeRate(ws.m_modified_fees, ws.m_vsize), single_wtxid);
 1451|      0|        }
 1452|      0|        return MempoolAcceptResult::Failure(ws.m_state);
 1453|      0|    }
 1454|       |
 1455|       |    // Perform the inexpensive checks first and avoid hashing and signature verification unless
 1456|       |    // those checks pass, to mitigate CPU exhaustion denial-of-service attacks.
 1457|      0|    if (!PolicyScriptChecks(args, ws)) return MempoolAcceptResult::Failure(ws.m_state);
  ------------------
  |  Branch (1457:9): [True: 0, False: 0]
  ------------------
 1458|       |
 1459|      0|    if (!ConsensusScriptChecks(args, ws)) return MempoolAcceptResult::Failure(ws.m_state);
  ------------------
  |  Branch (1459:9): [True: 0, False: 0]
  ------------------
 1460|       |
 1461|      0|    const CFeeRate effective_feerate{ws.m_modified_fees, static_cast<uint32_t>(ws.m_vsize)};
 1462|       |    // Tx was accepted, but not added
 1463|      0|    if (args.m_test_accept) {
  ------------------
  |  Branch (1463:9): [True: 0, False: 0]
  ------------------
 1464|      0|        return MempoolAcceptResult::Success(std::move(m_subpackage.m_replaced_transactions), ws.m_vsize,
 1465|      0|                                            ws.m_base_fees, effective_feerate, single_wtxid);
 1466|      0|    }
 1467|       |
 1468|      0|    FinalizeSubpackage(args);
 1469|       |
 1470|       |    // Limit the mempool, if appropriate.
 1471|      0|    if (!args.m_package_submission && !args.m_bypass_limits) {
  ------------------
  |  Branch (1471:9): [True: 0, False: 0]
  |  Branch (1471:39): [True: 0, False: 0]
  ------------------
 1472|      0|        LimitMempoolSize(m_pool, m_active_chainstate.CoinsTip());
 1473|      0|        if (!m_pool.exists(GenTxid::Txid(ws.m_hash))) {
  ------------------
  |  Branch (1473:13): [True: 0, False: 0]
  ------------------
 1474|       |            // The tx no longer meets our (new) mempool minimum feerate but could be reconsidered in a package.
 1475|      0|            ws.m_state.Invalid(TxValidationResult::TX_RECONSIDERABLE, "mempool full");
 1476|      0|            return MempoolAcceptResult::FeeFailure(ws.m_state, CFeeRate(ws.m_modified_fees, ws.m_vsize), {ws.m_ptx->GetWitnessHash()});
 1477|      0|        }
 1478|      0|    }
 1479|       |
 1480|      0|    if (m_pool.m_opts.signals) {
  ------------------
  |  Branch (1480:9): [True: 0, False: 0]
  ------------------
 1481|      0|        const CTransaction& tx = *ws.m_ptx;
 1482|      0|        auto iter = m_pool.GetIter(tx.GetHash());
 1483|      0|        Assume(iter.has_value());
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 1484|      0|        const auto tx_info = NewMempoolTransactionInfo(ws.m_ptx, ws.m_base_fees,
 1485|      0|                                                       ws.m_vsize, (*iter)->GetHeight(),
 1486|      0|                                                       args.m_bypass_limits, args.m_package_submission,
 1487|      0|                                                       IsCurrentForFeeEstimation(m_active_chainstate),
 1488|      0|                                                       m_pool.HasNoInputsOf(tx));
 1489|      0|        m_pool.m_opts.signals->TransactionAddedToMempool(tx_info, m_pool.GetAndIncrementSequence());
 1490|      0|    }
 1491|       |
 1492|      0|    if (!m_subpackage.m_replaced_transactions.empty()) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 0]
  ------------------
 1493|      0|        LogDebug(BCLog::MEMPOOL, "replaced %u mempool transactions with 1 new transaction for %s additional fees, %d delta bytes\n",
  ------------------
  |  |  280|      0|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  273|      0|    do {                                                  \
  |  |  |  |  274|      0|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  277|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1494|      0|                 m_subpackage.m_replaced_transactions.size(),
 1495|      0|                 ws.m_modified_fees - m_subpackage.m_conflicting_fees,
 1496|      0|                 ws.m_vsize - static_cast<int>(m_subpackage.m_conflicting_size));
 1497|      0|    }
 1498|       |
 1499|      0|    return MempoolAcceptResult::Success(std::move(m_subpackage.m_replaced_transactions), ws.m_vsize, ws.m_base_fees,
 1500|      0|                                        effective_feerate, single_wtxid);
 1501|      0|}
validation.cpp:_ZN12_GLOBAL__N_113MemPoolAccept9WorkspaceC2ERKNSt3__110shared_ptrIK12CTransactionEE:
  629|  1.36k|        explicit Workspace(const CTransactionRef& ptx) : m_ptx(ptx), m_hash(ptx->GetHash()) {}
validation.cpp:_ZN12_GLOBAL__N_113MemPoolAccept9PreChecksERNS0_8ATMPArgsERNS0_9WorkspaceE:
  768|  1.36k|{
  769|  1.36k|    AssertLockHeld(cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  770|  1.36k|    AssertLockHeld(m_pool.cs);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  771|  1.36k|    const CTransactionRef& ptx = ws.m_ptx;
  772|  1.36k|    const CTransaction& tx = *ws.m_ptx;
  773|  1.36k|    const Txid& hash = ws.m_hash;
  774|       |
  775|       |    // Copy/alias what we need out of args
  776|  1.36k|    const int64_t nAcceptTime = args.m_accept_time;
  777|  1.36k|    const bool bypass_limits = args.m_bypass_limits;
  778|  1.36k|    std::vector<COutPoint>& coins_to_uncache = args.m_coins_to_uncache;
  779|       |
  780|       |    // Alias what we need out of ws
  781|  1.36k|    TxValidationState& state = ws.m_state;
  782|       |
  783|  1.36k|    if (!CheckTransaction(tx, state)) {
  ------------------
  |  Branch (783:9): [True: 197, False: 1.16k]
  ------------------
  784|    197|        return false; // state filled in by CheckTransaction
  785|    197|    }
  786|       |
  787|       |    // Coinbase is only valid in a block, not as a loose transaction
  788|  1.16k|    if (tx.IsCoinBase())
  ------------------
  |  Branch (788:9): [True: 2, False: 1.16k]
  ------------------
  789|      2|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "coinbase");
  790|       |
  791|       |    // Rather not work on nonstandard transactions (unless -testnet/-regtest)
  792|  1.16k|    std::string reason;
  793|  1.16k|    if (m_pool.m_opts.require_standard && !IsStandardTx(tx, m_pool.m_opts.max_datacarrier_bytes, m_pool.m_opts.permit_bare_multisig, m_pool.m_opts.dust_relay_feerate, reason)) {
  ------------------
  |  Branch (793:9): [True: 1.16k, False: 0]
  |  Branch (793:43): [True: 435, False: 727]
  ------------------
  794|    435|        return state.Invalid(TxValidationResult::TX_NOT_STANDARD, reason);
  795|    435|    }
  796|       |
  797|       |    // Transactions smaller than 65 non-witness bytes are not relayed to mitigate CVE-2017-12842.
  798|    727|    if (::GetSerializeSize(TX_NO_WITNESS(tx)) < MIN_STANDARD_TX_NONWITNESS_SIZE)
  ------------------
  |  Branch (798:9): [True: 1, False: 726]
  ------------------
  799|      1|        return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "tx-size-small");
  800|       |
  801|       |    // Only accept nLockTime-using transactions that can be mined in the next
  802|       |    // block; we don't want our mempool filled up with transactions that can't
  803|       |    // be mined yet.
  804|    726|    if (!CheckFinalTxAtTip(*Assert(m_active_chainstate.m_chain.Tip()), tx)) {
  ------------------
  |  |   85|    726|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  |  Branch (804:9): [True: 65, False: 661]
  ------------------
  805|     65|        return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "non-final");
  806|     65|    }
  807|       |
  808|    661|    if (m_pool.exists(GenTxid::Wtxid(tx.GetWitnessHash()))) {
  ------------------
  |  Branch (808:9): [True: 0, False: 661]
  ------------------
  809|       |        // Exact transaction already exists in the mempool.
  810|      0|        return state.Invalid(TxValidationResult::TX_CONFLICT, "txn-already-in-mempool");
  811|    661|    } else if (m_pool.exists(GenTxid::Txid(tx.GetHash()))) {
  ------------------
  |  Branch (811:16): [True: 0, False: 661]
  ------------------
  812|       |        // Transaction with the same non-witness data but different witness (same txid, different
  813|       |        // wtxid) already exists in the mempool.
  814|      0|        return state.Invalid(TxValidationResult::TX_CONFLICT, "txn-same-nonwitness-data-in-mempool");
  815|      0|    }
  816|       |
  817|       |    // Check for conflicts with in-memory transactions
  818|    661|    for (const CTxIn &txin : tx.vin)
  ------------------
  |  Branch (818:28): [True: 3.19k, False: 661]
  ------------------
  819|  3.19k|    {
  820|  3.19k|        const CTransaction* ptxConflicting = m_pool.GetConflictTx(txin.prevout);
  821|  3.19k|        if (ptxConflicting) {
  ------------------
  |  Branch (821:13): [True: 0, False: 3.19k]
  ------------------
  822|      0|            if (!args.m_allow_replacement) {
  ------------------
  |  Branch (822:17): [True: 0, False: 0]
  ------------------
  823|       |                // Transaction conflicts with a mempool tx, but we're not allowing replacements in this context.
  824|      0|                return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "bip125-replacement-disallowed");
  825|      0|            }
  826|      0|            ws.m_conflicts.insert(ptxConflicting->GetHash());
  827|      0|        }
  828|  3.19k|    }
  829|       |
  830|    661|    m_view.SetBackend(m_viewmempool);
  831|       |
  832|    661|    const CCoinsViewCache& coins_cache = m_active_chainstate.CoinsTip();
  833|       |    // do all inputs exist?
  834|    732|    for (const CTxIn& txin : tx.vin) {
  ------------------
  |  Branch (834:28): [True: 732, False: 109]
  ------------------
  835|    732|        if (!coins_cache.HaveCoinInCache(txin.prevout)) {
  ------------------
  |  Branch (835:13): [True: 552, False: 180]
  ------------------
  836|    552|            coins_to_uncache.push_back(txin.prevout);
  837|    552|        }
  838|       |
  839|       |        // Note: this call may add txin.prevout to the coins cache
  840|       |        // (coins_cache.cacheCoins) by way of FetchCoin(). It should be removed
  841|       |        // later (via coins_to_uncache) if this tx turns out to be invalid.
  842|    732|        if (!m_view.HaveCoin(txin.prevout)) {
  ------------------
  |  Branch (842:13): [True: 552, False: 180]
  ------------------
  843|       |            // Are inputs missing because we already have the tx?
  844|  1.38k|            for (size_t out = 0; out < tx.vout.size(); out++) {
  ------------------
  |  Branch (844:34): [True: 832, False: 552]
  ------------------
  845|       |                // Optimistically just do efficient check of cache for outputs
  846|    832|                if (coins_cache.HaveCoinInCache(COutPoint(hash, out))) {
  ------------------
  |  Branch (846:21): [True: 0, False: 832]
  ------------------
  847|      0|                    return state.Invalid(TxValidationResult::TX_CONFLICT, "txn-already-known");
  848|      0|                }
  849|    832|            }
  850|       |            // Otherwise assume this might be an orphan tx for which we just haven't seen parents yet
  851|    552|            return state.Invalid(TxValidationResult::TX_MISSING_INPUTS, "bad-txns-inputs-missingorspent");
  852|    552|        }
  853|    732|    }
  854|       |
  855|       |    // This is const, but calls into the back end CoinsViews. The CCoinsViewDB at the bottom of the
  856|       |    // hierarchy brings the best block into scope. See CCoinsViewDB::GetBestBlock().
  857|    109|    m_view.GetBestBlock();
  858|       |
  859|       |    // we have all inputs cached now, so switch back to dummy (to protect
  860|       |    // against bugs where we pull more inputs from disk that miss being added
  861|       |    // to coins_to_uncache)
  862|    109|    m_view.SetBackend(m_dummy);
  863|       |
  864|    109|    assert(m_active_chainstate.m_blockman.LookupBlockIndex(m_view.GetBestBlock()) == m_active_chainstate.m_chain.Tip());
  865|       |
  866|       |    // Only accept BIP68 sequence locked transactions that can be mined in the next
  867|       |    // block; we don't want our mempool filled up with transactions that can't
  868|       |    // be mined yet.
  869|       |    // Pass in m_view which has all of the relevant inputs cached. Note that, since m_view's
  870|       |    // backend was removed, it no longer pulls coins from the mempool.
  871|    109|    const std::optional<LockPoints> lock_points{CalculateLockPointsAtTip(m_active_chainstate.m_chain.Tip(), m_view, tx)};
  872|    109|    if (!lock_points.has_value() || !CheckSequenceLocksAtTip(m_active_chainstate.m_chain.Tip(), *lock_points)) {
  ------------------
  |  Branch (872:9): [True: 0, False: 109]
  |  Branch (872:37): [True: 17, False: 92]
  ------------------
  873|     17|        return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "non-BIP68-final");
  874|     17|    }
  875|       |
  876|       |    // The mempool holds txs for the next block, so pass height+1 to CheckTxInputs
  877|     92|    if (!Consensus::CheckTxInputs(tx, state, m_view, m_active_chainstate.m_chain.Height() + 1, ws.m_base_fees)) {
  ------------------
  |  Branch (877:9): [True: 69, False: 23]
  ------------------
  878|     69|        return false; // state filled in by CheckTxInputs
  879|     69|    }
  880|       |
  881|     23|    if (m_pool.m_opts.require_standard && !AreInputsStandard(tx, m_view)) {
  ------------------
  |  Branch (881:9): [True: 23, False: 0]
  |  Branch (881:43): [True: 23, False: 0]
  ------------------
  882|     23|        return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "bad-txns-nonstandard-inputs");
  883|     23|    }
  884|       |
  885|       |    // Check for non-standard witnesses.
  886|      0|    if (tx.HasWitness() && m_pool.m_opts.require_standard && !IsWitnessStandard(tx, m_view)) {
  ------------------
  |  Branch (886:9): [True: 0, False: 0]
  |  Branch (886:28): [True: 0, False: 0]
  |  Branch (886:62): [True: 0, False: 0]
  ------------------
  887|      0|        return state.Invalid(TxValidationResult::TX_WITNESS_MUTATED, "bad-witness-nonstandard");
  888|      0|    }
  889|       |
  890|      0|    int64_t nSigOpsCost = GetTransactionSigOpCost(tx, m_view, STANDARD_SCRIPT_VERIFY_FLAGS);
  891|       |
  892|       |    // Keep track of transactions that spend a coinbase, which we re-scan
  893|       |    // during reorgs to ensure COINBASE_MATURITY is still met.
  894|      0|    bool fSpendsCoinbase = false;
  895|      0|    for (const CTxIn &txin : tx.vin) {
  ------------------
  |  Branch (895:28): [True: 0, False: 0]
  ------------------
  896|      0|        const Coin &coin = m_view.AccessCoin(txin.prevout);
  897|      0|        if (coin.IsCoinBase()) {
  ------------------
  |  Branch (897:13): [True: 0, False: 0]
  ------------------
  898|      0|            fSpendsCoinbase = true;
  899|      0|            break;
  900|      0|        }
  901|      0|    }
  902|       |
  903|       |    // Set entry_sequence to 0 when bypass_limits is used; this allows txs from a block
  904|       |    // reorg to be marked earlier than any child txs that were already in the mempool.
  905|      0|    const uint64_t entry_sequence = bypass_limits ? 0 : m_pool.GetSequence();
  ------------------
  |  Branch (905:37): [True: 0, False: 0]
  ------------------
  906|      0|    if (!m_subpackage.m_changeset) {
  ------------------
  |  Branch (906:9): [True: 0, False: 0]
  ------------------
  907|      0|        m_subpackage.m_changeset = m_pool.GetChangeSet();
  908|      0|    }
  909|      0|    ws.m_tx_handle = m_subpackage.m_changeset->StageAddition(ptx, ws.m_base_fees, nAcceptTime, m_active_chainstate.m_chain.Height(), entry_sequence, fSpendsCoinbase, nSigOpsCost, lock_points.value());
  910|       |
  911|       |    // ws.m_modified_fees includes any fee deltas from PrioritiseTransaction
  912|      0|    ws.m_modified_fees = ws.m_tx_handle->GetModifiedFee();
  913|       |
  914|      0|    ws.m_vsize = ws.m_tx_handle->GetTxSize();
  915|       |
  916|       |    // Enforces 0-fee for dust transactions, no incentive to be mined alone
  917|      0|    if (m_pool.m_opts.require_standard) {
  ------------------
  |  Branch (917:9): [True: 0, False: 0]
  ------------------
  918|      0|        if (!PreCheckEphemeralTx(*ptx, m_pool.m_opts.dust_relay_feerate, ws.m_base_fees, ws.m_modified_fees, state)) {
  ------------------
  |  Branch (918:13): [True: 0, False: 0]
  ------------------
  919|      0|            return false; // state filled in by PreCheckEphemeralTx
  920|      0|        }
  921|      0|    }
  922|       |
  923|      0|    if (nSigOpsCost > MAX_STANDARD_TX_SIGOPS_COST)
  ------------------
  |  Branch (923:9): [True: 0, False: 0]
  ------------------
  924|      0|        return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "bad-txns-too-many-sigops",
  925|      0|                strprintf("%d", nSigOpsCost));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  926|       |
  927|       |    // No individual transactions are allowed below the min relay feerate except from disconnected blocks.
  928|       |    // This requirement, unlike CheckFeeRate, cannot be bypassed using m_package_feerates because,
  929|       |    // while a tx could be package CPFP'd when entering the mempool, we do not have a DoS-resistant
  930|       |    // method of ensuring the tx remains bumped. For example, the fee-bumping child could disappear
  931|       |    // due to a replacement.
  932|       |    // The only exception is TRUC transactions.
  933|      0|    if (!bypass_limits && ws.m_ptx->version != TRUC_VERSION && ws.m_modified_fees < m_pool.m_opts.min_relay_feerate.GetFee(ws.m_vsize)) {
  ------------------
  |  Branch (933:9): [True: 0, False: 0]
  |  Branch (933:27): [True: 0, False: 0]
  |  Branch (933:64): [True: 0, False: 0]
  ------------------
  934|       |        // Even though this is a fee-related failure, this result is TX_MEMPOOL_POLICY, not
  935|       |        // TX_RECONSIDERABLE, because it cannot be bypassed using package validation.
  936|      0|        return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "min relay fee not met",
  937|      0|                             strprintf("%d < %d", ws.m_modified_fees, m_pool.m_opts.min_relay_feerate.GetFee(ws.m_vsize)));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  938|      0|    }
  939|       |    // No individual transactions are allowed below the mempool min feerate except from disconnected
  940|       |    // blocks and transactions in a package. Package transactions will be checked using package
  941|       |    // feerate later.
  942|      0|    if (!bypass_limits && !args.m_package_feerates && !CheckFeeRate(ws.m_vsize, ws.m_modified_fees, state)) return false;
  ------------------
  |  Branch (942:9): [True: 0, False: 0]
  |  Branch (942:27): [True: 0, False: 0]
  |  Branch (942:55): [True: 0, False: 0]
  ------------------
  943|       |
  944|      0|    ws.m_iters_conflicting = m_pool.GetIterSet(ws.m_conflicts);
  945|       |
  946|       |    // Note that these modifications are only applicable to single transaction scenarios;
  947|       |    // carve-outs are disabled for multi-transaction evaluations.
  948|      0|    CTxMemPool::Limits maybe_rbf_limits = m_pool.m_opts.limits;
  949|       |
  950|       |    // Calculate in-mempool ancestors, up to a limit.
  951|      0|    if (ws.m_conflicts.size() == 1 && args.m_allow_carveouts) {
  ------------------
  |  Branch (951:9): [True: 0, False: 0]
  |  Branch (951:39): [True: 0, False: 0]
  ------------------
  952|       |        // In general, when we receive an RBF transaction with mempool conflicts, we want to know whether we
  953|       |        // would meet the chain limits after the conflicts have been removed. However, there isn't a practical
  954|       |        // way to do this short of calculating the ancestor and descendant sets with an overlay cache of
  955|       |        // changed mempool entries. Due to both implementation and runtime complexity concerns, this isn't
  956|       |        // very realistic, thus we only ensure a limited set of transactions are RBF'able despite mempool
  957|       |        // conflicts here. Importantly, we need to ensure that some transactions which were accepted using
  958|       |        // the below carve-out are able to be RBF'ed, without impacting the security the carve-out provides
  959|       |        // for off-chain contract systems (see link in the comment below).
  960|       |        //
  961|       |        // Specifically, the subset of RBF transactions which we allow despite chain limits are those which
  962|       |        // conflict directly with exactly one other transaction (but may evict children of said transaction),
  963|       |        // and which are not adding any new mempool dependencies. Note that the "no new mempool dependencies"
  964|       |        // check is accomplished later, so we don't bother doing anything about it here, but if our
  965|       |        // policy changes, we may need to move that check to here instead of removing it wholesale.
  966|       |        //
  967|       |        // Such transactions are clearly not merging any existing packages, so we are only concerned with
  968|       |        // ensuring that (a) no package is growing past the package size (not count) limits and (b) we are
  969|       |        // not allowing something to effectively use the (below) carve-out spot when it shouldn't be allowed
  970|       |        // to.
  971|       |        //
  972|       |        // To check these we first check if we meet the RBF criteria, above, and increment the descendant
  973|       |        // limits by the direct conflict and its descendants (as these are recalculated in
  974|       |        // CalculateMempoolAncestors by assuming the new transaction being added is a new descendant, with no
  975|       |        // removals, of each parent's existing dependent set). The ancestor count limits are unmodified (as
  976|       |        // the ancestor limits should be the same for both our new transaction and any conflicts).
  977|       |        // We don't bother incrementing m_limit_descendants by the full removal count as that limit never comes
  978|       |        // into force here (as we're only adding a single transaction).
  979|      0|        assert(ws.m_iters_conflicting.size() == 1);
  980|      0|        CTxMemPool::txiter conflict = *ws.m_iters_conflicting.begin();
  981|       |
  982|      0|        maybe_rbf_limits.descendant_count += 1;
  983|      0|        maybe_rbf_limits.descendant_size_vbytes += conflict->GetSizeWithDescendants();
  984|      0|    }
  985|       |
  986|      0|    if (auto ancestors{m_subpackage.m_changeset->CalculateMemPoolAncestors(ws.m_tx_handle, maybe_rbf_limits)}) {
  ------------------
  |  Branch (986:14): [True: 0, False: 0]
  ------------------
  987|      0|        ws.m_ancestors = std::move(*ancestors);
  988|      0|    } else {
  989|       |        // If CalculateMemPoolAncestors fails second time, we want the original error string.
  990|      0|        const auto error_message{util::ErrorString(ancestors).original};
  991|       |
  992|       |        // Carve-out is not allowed in this context; fail
  993|      0|        if (!args.m_allow_carveouts) {
  ------------------
  |  Branch (993:13): [True: 0, False: 0]
  ------------------
  994|      0|            return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "too-long-mempool-chain", error_message);
  995|      0|        }
  996|       |
  997|       |        // Contracting/payment channels CPFP carve-out:
  998|       |        // If the new transaction is relatively small (up to 40k weight)
  999|       |        // and has at most one ancestor (ie ancestor limit of 2, including
 1000|       |        // the new transaction), allow it if its parent has exactly the
 1001|       |        // descendant limit descendants. The transaction also cannot be TRUC,
 1002|       |        // as its topology restrictions do not allow a second child.
 1003|       |        //
 1004|       |        // This allows protocols which rely on distrusting counterparties
 1005|       |        // being able to broadcast descendants of an unconfirmed transaction
 1006|       |        // to be secure by simply only having two immediately-spendable
 1007|       |        // outputs - one for each counterparty. For more info on the uses for
 1008|       |        // this, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016518.html
 1009|      0|        CTxMemPool::Limits cpfp_carve_out_limits{
 1010|      0|            .ancestor_count = 2,
 1011|      0|            .ancestor_size_vbytes = maybe_rbf_limits.ancestor_size_vbytes,
 1012|      0|            .descendant_count = maybe_rbf_limits.descendant_count + 1,
 1013|      0|            .descendant_size_vbytes = maybe_rbf_limits.descendant_size_vbytes + EXTRA_DESCENDANT_TX_SIZE_LIMIT,
 1014|      0|        };
 1015|      0|        if (ws.m_vsize > EXTRA_DESCENDANT_TX_SIZE_LIMIT || ws.m_ptx->version == TRUC_VERSION) {
  ------------------
  |  Branch (1015:13): [True: 0, False: 0]
  |  Branch (1015:60): [True: 0, False: 0]
  ------------------
 1016|      0|            return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "too-long-mempool-chain", error_message);
 1017|      0|        }
 1018|      0|        if (auto ancestors_retry{m_subpackage.m_changeset->CalculateMemPoolAncestors(ws.m_tx_handle, cpfp_carve_out_limits)}) {
  ------------------
  |  Branch (1018:18): [True: 0, False: 0]
  ------------------
 1019|      0|            ws.m_ancestors = std::move(*ancestors_retry);
 1020|      0|        } else {
 1021|      0|            return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "too-long-mempool-chain", error_message);
 1022|      0|        }
 1023|      0|    }
 1024|       |
 1025|       |    // Even though just checking direct mempool parents for inheritance would be sufficient, we
 1026|       |    // check using the full ancestor set here because it's more convenient to use what we have
 1027|       |    // already calculated.
 1028|      0|    if (const auto err{SingleTRUCChecks(ws.m_ptx, ws.m_ancestors, ws.m_conflicts, ws.m_vsize)}) {
  ------------------
  |  Branch (1028:20): [True: 0, False: 0]
  ------------------
 1029|       |        // Single transaction contexts only.
 1030|      0|        if (args.m_allow_sibling_eviction && err->second != nullptr) {
  ------------------
  |  Branch (1030:13): [True: 0, False: 0]
  |  Branch (1030:46): [True: 0, False: 0]
  ------------------
 1031|       |            // We should only be considering where replacement is considered valid as well.
 1032|      0|            Assume(args.m_allow_replacement);
  ------------------
  |  |   97|      0|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
 1033|       |
 1034|       |            // Potential sibling eviction. Add the sibling to our list of mempool conflicts to be
 1035|       |            // included in RBF checks.
 1036|      0|            ws.m_conflicts.insert(err->second->GetHash());
 1037|       |            // Adding the sibling to m_iters_conflicting here means that it doesn't count towards
 1038|       |            // RBF Carve Out above. This is correct, since removing to-be-replaced transactions from
 1039|       |            // the descendant count is done separately in SingleTRUCChecks for TRUC transactions.
 1040|      0|            ws.m_iters_conflicting.insert(m_pool.GetIter(err->second->GetHash()).value());
 1041|      0|            ws.m_sibling_eviction = true;
 1042|       |            // The sibling will be treated as part of the to-be-replaced set in ReplacementChecks.
 1043|       |            // Note that we are not checking whether it opts in to replaceability via BIP125 or TRUC
 1044|       |            // (which is normally done in PreChecks). However, the only way a TRUC transaction can
 1045|       |            // have a non-TRUC and non-BIP125 descendant is due to a reorg.
 1046|      0|        } else {
 1047|      0|            return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "TRUC-violation", err->first);
 1048|      0|        }
 1049|      0|    }
 1050|       |
 1051|       |    // A transaction that spends outputs that would be replaced by it is invalid. Now
 1052|       |    // that we have the set of all ancestors we can detect this
 1053|       |    // pathological case by making sure ws.m_conflicts and ws.m_ancestors don't
 1054|       |    // intersect.
 1055|      0|    if (const auto err_string{EntriesAndTxidsDisjoint(ws.m_ancestors, ws.m_conflicts, hash)}) {
  ------------------
  |  Branch (1055:20): [True: 0, False: 0]
  ------------------
 1056|       |        // We classify this as a consensus error because a transaction depending on something it
 1057|       |        // conflicts with would be inconsistent.
 1058|      0|        return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-spends-conflicting-tx", *err_string);
 1059|      0|    }
 1060|       |
 1061|       |    // We want to detect conflicts in any tx in a package to trigger package RBF logic
 1062|      0|    m_subpackage.m_rbf |= !ws.m_conflicts.empty();
 1063|      0|    return true;
 1064|      0|}
_ZN20PerBlockConnectTraceC2Ev:
 3128|  1.54k|    PerBlockConnectTrace() = default;
validation.cpp:_ZL23GetSynchronizationStatebb:
 3436|      1|{
 3437|      1|    if (!init) return SynchronizationState::POST_INIT;
  ------------------
  |  Branch (3437:9): [True: 0, False: 1]
  ------------------
 3438|      1|    if (!blockfiles_indexed) return SynchronizationState::INIT_REINDEX;
  ------------------
  |  Branch (3438:9): [True: 0, False: 1]
  ------------------
 3439|      1|    return SynchronizationState::INIT_DOWNLOAD;
 3440|      1|}
validation.cpp:_ZL29LimitValidationInterfaceQueueR17ValidationSignals:
 3464|  1.54k|static void LimitValidationInterfaceQueue(ValidationSignals& signals) LOCKS_EXCLUDED(cs_main) {
 3465|  1.54k|    AssertLockNotHeld(cs_main);
  ------------------
  |  |  147|  1.54k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
 3466|       |
 3467|  1.54k|    if (signals.CallbacksPending() > 10) {
  ------------------
  |  Branch (3467:9): [True: 0, False: 1.54k]
  ------------------
 3468|      0|        signals.SyncWithValidationInterfaceQueue();
 3469|      0|    }
 3470|  1.54k|}
_ZN12ConnectTraceC2Ev:
 3142|  1.54k|    explicit ConnectTrace() : blocksConnected(1) {}
validation.cpp:_ZL16CheckBlockHeaderRK12CBlockHeaderR20BlockValidationStateRKN9Consensus6ParamsEb:
 3957|    674|{
 3958|       |    // Check proof of work matches claimed amount
 3959|    674|    if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits, consensusParams))
  ------------------
  |  Branch (3959:9): [True: 674, False: 0]
  |  Branch (3959:22): [True: 34, False: 640]
  ------------------
 3960|     34|        return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "high-hash", "proof of work failed");
 3961|       |
 3962|    640|    return true;
 3963|    674|}
validation.cpp:_ZL15CheckMerkleRootRK6CBlockR20BlockValidationState:
 3966|    153|{
 3967|    153|    if (block.m_checked_merkle_root) return true;
  ------------------
  |  Branch (3967:9): [True: 19, False: 134]
  ------------------
 3968|       |
 3969|    134|    bool mutated;
 3970|    134|    uint256 merkle_root = BlockMerkleRoot(block, &mutated);
 3971|    134|    if (block.hashMerkleRoot != merkle_root) {
  ------------------
  |  Branch (3971:9): [True: 46, False: 88]
  ------------------
 3972|     46|        return state.Invalid(
 3973|     46|            /*result=*/BlockValidationResult::BLOCK_MUTATED,
 3974|     46|            /*reject_reason=*/"bad-txnmrklroot",
 3975|     46|            /*debug_message=*/"hashMerkleRoot mismatch");
 3976|     46|    }
 3977|       |
 3978|       |    // Check for merkle tree malleability (CVE-2012-2459): repeating sequences
 3979|       |    // of transactions in a block without affecting the merkle root of a block,
 3980|       |    // while still invalidating it.
 3981|     88|    if (mutated) {
  ------------------
  |  Branch (3981:9): [True: 2, False: 86]
  ------------------
 3982|      2|        return state.Invalid(
 3983|      2|            /*result=*/BlockValidationResult::BLOCK_MUTATED,
 3984|      2|            /*reject_reason=*/"bad-txns-duplicate",
 3985|      2|            /*debug_message=*/"duplicate transaction");
 3986|      2|    }
 3987|       |
 3988|     86|    block.m_checked_merkle_root = true;
 3989|     86|    return true;
 3990|     88|}
validation.cpp:_ZZ19HasValidProofOfWorkRKNSt3__16vectorI12CBlockHeaderNS_9allocatorIS1_EEEERKN9Consensus6ParamsEENK3$_0clIS1_EEDaRKT_:
 4153|    893|            [&](const auto& header) { return CheckProofOfWork(header.GetHash(), header.nBits, consensusParams);});
validation.cpp:_ZZ14IsBlockMutatedRK6CBlockbENK3$_0clIKNSt3__110shared_ptrIK12CTransactionEEEEDaRT_:
 4172|    732|                           [](auto& tx) { return GetSerializeSize(TX_NO_WITNESS(tx)) == 64; });
validation.cpp:_ZL22CheckWitnessMalleationRK6CBlockbR20BlockValidationState:
 3999|     13|{
 4000|     13|    if (expect_witness_commitment) {
  ------------------
  |  Branch (4000:9): [True: 13, False: 0]
  ------------------
 4001|     13|        if (block.m_checked_witness_commitment) return true;
  ------------------
  |  Branch (4001:13): [True: 0, False: 13]
  ------------------
 4002|       |
 4003|     13|        int commitpos = GetWitnessCommitmentIndex(block);
 4004|     13|        if (commitpos != NO_WITNESS_COMMITMENT) {
  ------------------
  |  Branch (4004:13): [True: 3, False: 10]
  ------------------
 4005|      3|            assert(!block.vtx.empty() && !block.vtx[0]->vin.empty());
 4006|      3|            const auto& witness_stack{block.vtx[0]->vin[0].scriptWitness.stack};
 4007|       |
 4008|      3|            if (witness_stack.size() != 1 || witness_stack[0].size() != 32) {
  ------------------
  |  Branch (4008:17): [True: 0, False: 3]
  |  Branch (4008:46): [True: 1, False: 2]
  ------------------
 4009|      1|                return state.Invalid(
 4010|      1|                    /*result=*/BlockValidationResult::BLOCK_MUTATED,
 4011|      1|                    /*reject_reason=*/"bad-witness-nonce-size",
 4012|      1|                    /*debug_message=*/strprintf("%s : invalid witness reserved value size", __func__));
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 4013|      1|            }
 4014|       |
 4015|       |            // The malleation check is ignored; as the transaction tree itself
 4016|       |            // already does not permit it, it is impossible to trigger in the
 4017|       |            // witness tree.
 4018|      2|            uint256 hash_witness = BlockWitnessMerkleRoot(block, /*mutated=*/nullptr);
 4019|       |
 4020|      2|            CHash256().Write(hash_witness).Write(witness_stack[0]).Finalize(hash_witness);
 4021|      2|            if (memcmp(hash_witness.begin(), &block.vtx[0]->vout[commitpos].scriptPubKey[6], 32)) {
  ------------------
  |  Branch (4021:17): [True: 2, False: 0]
  ------------------
 4022|      2|                return state.Invalid(
 4023|      2|                    /*result=*/BlockValidationResult::BLOCK_MUTATED,
 4024|      2|                    /*reject_reason=*/"bad-witness-merkle-match",
 4025|      2|                    /*debug_message=*/strprintf("%s : witness merkle commitment mismatch", __func__));
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 4026|      2|            }
 4027|       |
 4028|      0|            block.m_checked_witness_commitment = true;
 4029|      0|            return true;
 4030|      2|        }
 4031|     13|    }
 4032|       |
 4033|       |    // No witness data is allowed in blocks that don't commit to witness data, as this would otherwise leave room for spam
 4034|     10|    for (const auto& tx : block.vtx) {
  ------------------
  |  Branch (4034:25): [True: 10, False: 8]
  ------------------
 4035|     10|        if (tx->HasWitness()) {
  ------------------
  |  Branch (4035:13): [True: 2, False: 8]
  ------------------
 4036|      2|            return state.Invalid(
 4037|      2|                /*result=*/BlockValidationResult::BLOCK_MUTATED,
 4038|      2|                /*reject_reason=*/"unexpected-witness",
 4039|      2|                /*debug_message=*/strprintf("%s : unexpected witness data found", __func__));
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 4040|      2|        }
 4041|     10|    }
 4042|       |
 4043|      8|    return true;
 4044|     10|}
validation.cpp:_ZL26ContextualCheckBlockHeaderRK12CBlockHeaderR20BlockValidationStateRN4node12BlockManagerERK17ChainstateManagerPK11CBlockIndex:
 4207|    490|{
 4208|    490|    AssertLockHeld(::cs_main);
  ------------------
  |  |  142|    490|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
 4209|    490|    assert(pindexPrev != nullptr);
 4210|    490|    const int nHeight = pindexPrev->nHeight + 1;
 4211|       |
 4212|       |    // Check proof of work
 4213|    490|    const Consensus::Params& consensusParams = chainman.GetConsensus();
 4214|    490|    if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
  ------------------
  |  Branch (4214:9): [True: 133, False: 357]
  ------------------
 4215|    133|        return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "bad-diffbits", "incorrect proof of work");
 4216|       |
 4217|       |    // Check against checkpoints
 4218|    357|    if (chainman.m_options.checkpoints_enabled) {
  ------------------
  |  Branch (4218:9): [True: 357, False: 0]
  ------------------
 4219|       |        // Don't accept any forks from the main chain prior to last checkpoint.
 4220|       |        // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our
 4221|       |        // BlockIndex().
 4222|    357|        const CBlockIndex* pcheckpoint = blockman.GetLastCheckpoint(chainman.GetParams().Checkpoints());
 4223|    357|        if (pcheckpoint && nHeight < pcheckpoint->nHeight) {
  ------------------
  |  Branch (4223:13): [True: 357, False: 0]
  |  Branch (4223:28): [True: 0, False: 357]
  ------------------
 4224|      0|            LogPrintf("ERROR: %s: forked chain older than last checkpoint (height %d)\n", __func__, nHeight);
  ------------------
  |  |  266|      0|#define LogPrintf(...) LogInfo(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  261|      0|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4225|      0|            return state.Invalid(BlockValidationResult::BLOCK_CHECKPOINT, "bad-fork-prior-to-checkpoint");
 4226|      0|        }
 4227|    357|    }
 4228|       |
 4229|       |    // Check timestamp against prev
 4230|    357|    if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
  ------------------
  |  Branch (4230:9): [True: 15, False: 342]
  ------------------
 4231|     15|        return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "time-too-old", "block's timestamp is too early");
 4232|       |
 4233|       |    // Testnet4 and regtest only: Check timestamp against prev for difficulty-adjustment
 4234|       |    // blocks to prevent timewarp attacks (see https://github.com/bitcoin/bitcoin/pull/15482).
 4235|    342|    if (consensusParams.enforce_BIP94) {
  ------------------
  |  Branch (4235:9): [True: 0, False: 342]
  ------------------
 4236|       |        // Check timestamp for the first block of each difficulty adjustment
 4237|       |        // interval, except the genesis block.
 4238|      0|        if (nHeight % consensusParams.DifficultyAdjustmentInterval() == 0) {
  ------------------
  |  Branch (4238:13): [True: 0, False: 0]
  ------------------
 4239|      0|            if (block.GetBlockTime() < pindexPrev->GetBlockTime() - MAX_TIMEWARP) {
  ------------------
  |  Branch (4239:17): [True: 0, False: 0]
  ------------------
 4240|      0|                return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "time-timewarp-attack", "block's timestamp is too early on diff adjustment block");
 4241|      0|            }
 4242|      0|        }
 4243|      0|    }
 4244|       |
 4245|       |    // Check timestamp
 4246|    342|    if (block.Time() > NodeClock::now() + std::chrono::seconds{MAX_FUTURE_BLOCK_TIME}) {
  ------------------
  |  Branch (4246:9): [True: 67, False: 275]
  ------------------
 4247|     67|        return state.Invalid(BlockValidationResult::BLOCK_TIME_FUTURE, "time-too-new", "block timestamp too far in the future");
 4248|     67|    }
 4249|       |
 4250|       |    // Reject blocks with outdated version
 4251|    275|    if ((block.nVersion < 2 && DeploymentActiveAfter(pindexPrev, chainman, Consensus::DEPLOYMENT_HEIGHTINCB)) ||
  ------------------
  |  Branch (4251:10): [True: 10, False: 265]
  |  Branch (4251:32): [True: 10, False: 0]
  ------------------
 4252|    275|        (block.nVersion < 3 && DeploymentActiveAfter(pindexPrev, chainman, Consensus::DEPLOYMENT_DERSIG)) ||
  ------------------
  |  Branch (4252:10): [True: 2, False: 263]
  |  Branch (4252:32): [True: 2, False: 0]
  ------------------
 4253|    275|        (block.nVersion < 4 && DeploymentActiveAfter(pindexPrev, chainman, Consensus::DEPLOYMENT_CLTV))) {
  ------------------
  |  Branch (4253:10): [True: 4, False: 259]
  |  Branch (4253:32): [True: 4, False: 0]
  ------------------
 4254|     16|            return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, strprintf("bad-version(0x%08x)", block.nVersion),
  ------------------
  |  | 1172|     16|#define strprintf tfm::format
  ------------------
 4255|     16|                                 strprintf("rejected nVersion=0x%08x block", block.nVersion));
  ------------------
  |  | 1172|     16|#define strprintf tfm::format
  ------------------
 4256|     16|    }
 4257|       |
 4258|    259|    return true;
 4259|    275|}
validation.cpp:_ZZN17ChainstateManager15CheckBlockIndexEvENK3$_0clEv:
 5322|   394k|    auto snap_update_firsts = [&] {
 5323|   394k|        if (pindex == snap_base) {
  ------------------
  |  Branch (5323:13): [True: 0, False: 394k]
  ------------------
 5324|      0|            std::swap(snap_first_missing, pindexFirstMissing);
 5325|      0|            std::swap(snap_first_notx, pindexFirstNeverProcessed);
 5326|      0|            std::swap(snap_first_notv, pindexFirstNotTransactionsValid);
 5327|      0|            std::swap(snap_first_nocv, pindexFirstNotChainValid);
 5328|      0|            std::swap(snap_first_nosv, pindexFirstNotScriptsValid);
 5329|      0|        }
 5330|   394k|    };

_ZN19MempoolAcceptResult7FailureE17TxValidationState:
  159|  1.36k|    static MempoolAcceptResult Failure(TxValidationState state) {
  160|  1.36k|        return MempoolAcceptResult(state);
  161|  1.36k|    }
_ZN19MempoolAcceptResultC2E17TxValidationState:
  190|  1.36k|        : m_result_type(ResultType::INVALID), m_state(state) {
  191|  1.36k|            Assume(!state.IsValid()); // Can be invalid or error
  ------------------
  |  |   97|  1.36k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  192|  1.36k|        }
_ZNK10Chainstate14CanFlushToDiskEv:
  578|  1.36k|    {
  579|  1.36k|        AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  1.36k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  580|  1.36k|        return m_coins_views && m_coins_views->m_cacheview;
  ------------------
  |  Branch (580:16): [True: 1.36k, False: 0]
  |  Branch (580:33): [True: 1.36k, False: 0]
  ------------------
  581|  1.36k|    }
_ZN10Chainstate8CoinsTipEv:
  612|  8.01k|    {
  613|  8.01k|        AssertLockHeld(::cs_main);
  ------------------
  |  |  142|  8.01k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
  614|  8.01k|        Assert(m_coins_views);
  ------------------
  |  |   85|  8.01k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  615|  8.01k|        return *Assert(m_coins_views->m_cacheview);
  ------------------
  |  |   85|  8.01k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
  616|  8.01k|    }
_ZN10Chainstate10GetMempoolEv:
  627|  5.44k|    {
  628|  5.44k|        return m_mempool;
  629|  5.44k|    }
_ZNK10Chainstate12MempoolMutexEv:
  768|  1.54k|    {
  769|  1.54k|        return m_mempool ? &m_mempool->cs : nullptr;
  ------------------
  |  Branch (769:16): [True: 1.54k, False: 0]
  ------------------
  770|  1.54k|    }
_ZNK17ChainstateManager8IsUsableEPK10Chainstate:
  945|   831k|    bool IsUsable(const Chainstate* const cs) const EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
  946|   831k|        return cs && !cs->m_disabled;
  ------------------
  |  Branch (946:16): [True: 271k, False: 559k]
  |  Branch (946:22): [True: 271k, False: 0]
  ------------------
  947|   831k|    }
_ZNK17ChainstateManager9GetParamsEv:
  976|  1.71k|    const CChainParams& GetParams() const { return m_options.chainparams; }
_ZNK17ChainstateManager12GetConsensusEv:
  977|  2.70k|    const Consensus::Params& GetConsensus() const { return m_options.chainparams.GetConsensus(); }
_ZNK17ChainstateManager16MinimumChainWorkEv:
  979|   508k|    const arith_uint256& MinimumChainWork() const { return *Assert(m_options.minimum_chain_work); }
  ------------------
  |  |   85|   508k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
_ZNK17ChainstateManager16GetNotificationsEv:
  981|      1|    kernel::Notifications& GetNotifications() const { return m_options.notifications; };
_ZNK17ChainstateManager8GetMutexEv:
 1001|    684|    RecursiveMutex& GetMutex() const LOCK_RETURNED(::cs_main) { return ::cs_main; }
_ZNK17ChainstateManager11ActiveChainEv:
 1111|   525k|    CChain& ActiveChain() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChainstate().m_chain; }
_ZNK17ChainstateManager9ActiveTipEv:
 1113|     98|    CBlockIndex* ActiveTip() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChain().Tip(); }
_ZNK17ChainstateManager24BackgroundSyncInProgressEv:
 1116|   288k|    bool BackgroundSyncInProgress() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) {
 1117|   288k|        return IsUsable(m_snapshot_chainstate.get()) && IsUsable(m_ibd_chainstate.get());
  ------------------
  |  Branch (1117:16): [True: 0, False: 288k]
  |  Branch (1117:57): [True: 0, False: 0]
  ------------------
 1118|   288k|    }
_Z18DeploymentActiveAtIN9Consensus16BuriedDeploymentEEbRK11CBlockIndexRK17ChainstateManagerT_:
 1339|     13|{
 1340|     13|    return DeploymentActiveAt(index, chainman.GetConsensus(), dep, chainman.m_versionbitscache);
 1341|     13|}
_Z21DeploymentActiveAfterIN9Consensus16BuriedDeploymentEEbPK11CBlockIndexRK17ChainstateManagerT_:
 1333|     62|{
 1334|     62|    return DeploymentActiveAfter(pindexPrev, chainman.GetConsensus(), dep, chainman.m_versionbitscache);
 1335|     62|}

_ZN17ValidationSignalsD2Ev:
   97|      2|ValidationSignals::~ValidationSignals() = default;
_ZN17ValidationSignals24FlushBackgroundCallbacksEv:
  100|      2|{
  101|      2|    m_internals->m_task_runner->flush();
  102|      2|}
_ZN17ValidationSignals16CallbacksPendingEv:
  105|  1.54k|{
  106|  1.54k|    return m_internals->m_task_runner->size();
  107|  1.54k|}
_ZN17ValidationSignals38CallFunctionInValidationInterfaceQueueENSt3__18functionIFvvEEE:
  139|  8.47k|{
  140|  8.47k|    m_internals->m_task_runner->insert(std::move(func));
  141|  8.47k|}
_ZN17ValidationSignals32SyncWithValidationInterfaceQueueEv:
  144|  8.47k|{
  145|  8.47k|    AssertLockNotHeld(cs_main);
  ------------------
  |  |  147|  8.47k|#define AssertLockNotHeld(cs) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
  ------------------
  146|       |    // Block until the validation queue drains
  147|  8.47k|    std::promise<void> promise;
  148|  8.47k|    CallFunctionInValidationInterfaceQueue([&promise] {
  149|  8.47k|        promise.set_value();
  150|  8.47k|    });
  151|  8.47k|    promise.get_future().wait();
  152|  8.47k|}
_ZN17ValidationSignals12BlockCheckedERK6CBlockRK20BlockValidationState:
  248|    116|void ValidationSignals::BlockChecked(const CBlock& block, const BlockValidationState& state) {
  249|    116|    LOG_EVENT("%s: block hash=%s state=%s", __func__,
  ------------------
  |  |  169|    116|    LogDebug(BCLog::VALIDATION, fmt "\n", __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  280|    116|#define LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  273|    116|    do {                                                  \
  |  |  |  |  |  |  274|    116|        if (LogAcceptCategory((category), (level))) {     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (274:13): [True: 0, False: 116]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  275|      0|            LogPrintLevel_(category, level, __VA_ARGS__); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  255|      0|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  276|      0|        }                                                 \
  |  |  |  |  |  |  277|    116|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (277:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|    116|              block.GetHash().ToString(), state.ToString());
  251|    116|    m_internals->Iterate([&](CValidationInterface& callbacks) { callbacks.BlockChecked(block, state); });
  252|    116|}
validationinterface.cpp:_ZZN17ValidationSignals32SyncWithValidationInterfaceQueueEvENK3$_0clEv:
  148|  8.47k|    CallFunctionInValidationInterfaceQueue([&promise] {
  149|  8.47k|        promise.set_value();
  150|  8.47k|    });
validationinterface.cpp:_ZN21ValidationSignalsImpl7IterateIZN17ValidationSignals12BlockCheckedERK6CBlockRK20BlockValidationStateE3$_0EEvOT_:
   81|    116|    {
   82|    116|        WAIT_LOCK(m_mutex, lock);
  ------------------
  |  |  262|    116|#define WAIT_LOCK(cs, name) UniqueLock name(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  ------------------
   83|    116|        for (auto it = m_list.begin(); it != m_list.end();) {
  ------------------
  |  Branch (83:40): [True: 0, False: 116]
  ------------------
   84|      0|            ++it->count;
   85|      0|            {
   86|      0|                REVERSE_LOCK(lock);
  ------------------
  |  |  243|      0|#define REVERSE_LOCK(g) typename std::decay<decltype(g)>::type::reverse_lock UNIQUE_NAME(revlock)(g, #g, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      0|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      0|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      0|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|      0|                f(*it->callbacks);
   88|      0|            }
   89|      0|            it = --it->count ? std::next(it) : m_list.erase(it);
  ------------------
  |  Branch (89:18): [True: 0, False: 0]
  ------------------
   90|      0|        }
   91|    116|    }

_ZN16VersionBitsCache5ClearEv:
  242|      2|{
  243|      2|    LOCK(m_mutex);
  ------------------
  |  |  257|      2|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|      2|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|      2|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|      2|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|      6|    for (unsigned int d = 0; d < Consensus::MAX_VERSION_BITS_DEPLOYMENTS; d++) {
  ------------------
  |  Branch (244:30): [True: 4, False: 2]
  ------------------
  245|      4|        m_caches[d].clear();
  246|      4|    }
  247|      2|}

