_Z16le32toh_internalj:
   49|    609|{
   50|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(little_endian_32bits);
   51|    609|        else return little_endian_32bits;
   52|    609|}

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

_ZN4CInvC2Ev:
   46|    781|{
   47|    781|    type = 0;
   48|    781|    hash.SetNull();
   49|    781|}
_ZltRK4CInvS1_:
   54|    198|{
   55|    198|    return (a.type < b.type || (a.type == b.type && a.hash < b.hash));
  ------------------
  |  Branch (55:13): [True: 13, False: 185]
  |  Branch (55:33): [True: 140, False: 45]
  |  Branch (55:53): [True: 79, False: 61]
  ------------------
   56|    198|}
_ZNK4CInv14GetMessageTypeEv:
   59|    686|{
   60|    686|    std::string cmd;
   61|    686|    if (type & MSG_WITNESS_FLAG)
  ------------------
  |  Branch (61:9): [True: 182, False: 504]
  ------------------
   62|    182|        cmd.append("witness-");
   63|    686|    int masked = type & MSG_TYPE_MASK;
   64|    686|    switch (masked)
   65|    686|    {
   66|      4|    case MSG_TX:             return cmd.append(NetMsgType::TX);
  ------------------
  |  Branch (66:5): [True: 4, False: 682]
  ------------------
   67|       |    // WTX is not a message type, just an inv type
   68|     10|    case MSG_WTX:            return cmd.append("wtx");
  ------------------
  |  Branch (68:5): [True: 10, False: 676]
  ------------------
   69|      4|    case MSG_BLOCK:          return cmd.append(NetMsgType::BLOCK);
  ------------------
  |  Branch (69:5): [True: 4, False: 682]
  ------------------
   70|      6|    case MSG_FILTERED_BLOCK: return cmd.append(NetMsgType::MERKLEBLOCK);
  ------------------
  |  Branch (70:5): [True: 6, False: 680]
  ------------------
   71|      4|    case MSG_CMPCT_BLOCK:    return cmd.append(NetMsgType::CMPCTBLOCK);
  ------------------
  |  Branch (71:5): [True: 4, False: 682]
  ------------------
   72|    658|    default:
  ------------------
  |  Branch (72:5): [True: 658, False: 28]
  ------------------
   73|    658|        throw std::out_of_range(strprintf("CInv::GetMessageType(): type=%d unknown type", type));
  ------------------
  |  | 1172|    658|#define strprintf tfm::format
  ------------------
   74|    686|    }
   75|    686|}
_ZNK4CInv8ToStringEv:
   78|    343|{
   79|    343|    try {
   80|    343|        return strprintf("%s %s", GetMessageType(), hash.ToString());
  ------------------
  |  | 1172|    343|#define strprintf tfm::format
  ------------------
   81|    343|    } catch(const std::out_of_range &) {
   82|    329|        return strprintf("0x%08x %s", type, hash.ToString());
  ------------------
  |  | 1172|    329|#define strprintf tfm::format
  ------------------
   83|    329|    }
   84|    343|}

_ZN4CInv16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
  499|    781|    SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
  ------------------
  |  |  156|    781|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------

_Z14ser_readdata32I10DataStreamEjRT_:
  102|    781|{
  103|    781|    uint32_t obj;
  104|    781|    s.read(AsWritableBytes(Span{&obj, 1}));
  105|    781|    return le32toh_internal(obj);
  106|    781|}
_Z11UnserializeI10DataStreamR7uint256Q14UnserializableIT0_T_EEvRS4_OS3_:
  762|    609|{
  763|    609|    a.Unserialize(is);
  764|    609|}
_Z11UnserializeI10DataStreamEvRT_Rj:
  277|    781|template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }
_Z11UnserializeI10DataStreamR4CInvQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|    781|{
  763|    781|    a.Unserialize(is);
  764|    781|}
_ZN4CInv11UnserializeI10DataStreamEEvRT_:
  228|    781|    {                                                                                               \
  229|    781|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    781|        Unser(s, *this);                                                                            \
  231|    781|    }
_ZN4CInv5UnserI10DataStreamEEvRT_RS_:
  180|    781|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJRjR7uint256EEEvRT_DpOT0_:
 1033|    781|    {
 1034|    781|        ::UnserializeMany(s, args...);
 1035|    781|    }
_Z15UnserializeManyI10DataStreamJRjR7uint256EEvRT_DpOT0_:
 1001|    781|{
 1002|    781|    (::Unserialize(s, args), ...);
 1003|    781|}

_ZNK4SpanIKSt4byteE4sizeEv:
  187|    781|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKSt4byteE4dataEv:
  174|  1.56k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4sizeEv:
  187|    343|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKhE5beginEv:
  175|    343|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKhE3endEv:
  176|    343|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIhE4dataEv:
  174|    609|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4dataEv:
  174|    781|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanISt4byteE4sizeEv:
  187|  3.93k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanISt4byteE4dataEv:
  174|  1.15k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE10size_bytesEv:
  188|    781|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKhE4SpanIKSt4byteES1_IT_E:
  259|    781|{
  260|    781|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|    781|}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  172|    781|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2IS1_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEEPS6_m:
  119|    781|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIjE4dataEv:
  174|    781|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIjE10size_bytesEv:
  188|    781|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_ZNK4SpanIhE10size_bytesEv:
  188|    609|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_ZN4SpanISt4byteEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  1.39k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesIhE4SpanISt4byteES0_IT_E:
  264|    609|{
  265|    609|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|    609|}
_Z15AsWritableBytesIjE4SpanISt4byteES0_IT_E:
  264|    781|{
  265|    781|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|    781|}
_ZN4SpanIjEC2IjTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_jEE5valueEiE4typeELi0EEEPS4_m:
  119|    781|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z20MakeWritableByteSpanIRNSt3__15arrayIhLm32EEEE4SpanISt4byteEOT_:
  275|    609|{
  276|    609|    return AsWritableBytes(Span{std::forward<V>(v)});
  277|    609|}
_ZN4SpanIhEC2INSt3__15arrayIhLm32EEEEERT_NS2_9enable_ifIXaaaantsr7is_SpanIS5_EE5valuesr3std14is_convertibleIPA_NS2_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  165|    609|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2ILi32EEERAT__S0_:
  151|    343|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}

_ZN10DataStreamC2E4SpanIKhE:
  165|    781|    explicit DataStream(Span<const uint8_t> sp) : DataStream{AsBytes(sp)} {}
_ZN10DataStreamC2E4SpanIKSt4byteE:
  166|    781|    explicit DataStream(Span<const value_type> sp) : vch(sp.data(), sp.data() + sp.size()) {}
_ZN10DataStream4readE4SpanISt4byteE:
  219|  1.39k|    {
  220|  1.39k|        if (dst.size() == 0) return;
  ------------------
  |  Branch (220:13): [True: 0, False: 1.39k]
  ------------------
  221|       |
  222|       |        // Read from the beginning of the buffer
  223|  1.39k|        auto next_read_pos{CheckedAdd(m_read_pos, dst.size())};
  224|  1.39k|        if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
  ------------------
  |  Branch (224:13): [True: 0, False: 1.39k]
  |  Branch (224:43): [True: 240, False: 1.15k]
  ------------------
  225|    240|            throw std::ios_base::failure("DataStream::read(): end of data");
  226|    240|        }
  227|  1.15k|        memcpy(dst.data(), &vch[m_read_pos], dst.size());
  228|  1.15k|        if (next_read_pos.value() == vch.size()) {
  ------------------
  |  Branch (228:13): [True: 373, False: 777]
  ------------------
  229|    373|            m_read_pos = 0;
  230|    373|            vch.clear();
  231|    373|            return;
  232|    373|        }
  233|    777|        m_read_pos = next_read_pos.value();
  234|    777|    }
_ZN10DataStreamrsIR4CInvEERS_OT_:
  266|    781|    {
  267|    781|        ::Unserialize(*this, obj);
  268|    781|        return (*this);
  269|    781|    }

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

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

_ZN18FuzzedDataProviderC2EPKhm:
   37|    438|      : data_ptr_(data), remaining_bytes_(size) {}
_ZN18FuzzedDataProvider25ConsumeRandomLengthStringEm:
  153|    781|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|    781|  std::string result;
  161|       |
  162|       |  // Reserve the anticipated capacity to prevent several reallocations.
  163|    781|  result.reserve(std::min(max_length, remaining_bytes_));
  164|  28.2M|  for (size_t i = 0; i < max_length && remaining_bytes_ != 0; ++i) {
  ------------------
  |  Branch (164:22): [True: 28.2M, False: 459]
  |  Branch (164:40): [True: 28.2M, False: 29]
  ------------------
  165|  28.2M|    char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
  166|  28.2M|    Advance(1);
  167|  28.2M|    if (next == '\\' && remaining_bytes_ != 0) {
  ------------------
  |  Branch (167:9): [True: 30.1k, False: 28.1M]
  |  Branch (167:25): [True: 30.1k, False: 6]
  ------------------
  168|  30.1k|      next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
  169|  30.1k|      Advance(1);
  170|  30.1k|      if (next != '\\')
  ------------------
  |  Branch (170:11): [True: 293, False: 29.8k]
  ------------------
  171|    293|        break;
  172|  30.1k|    }
  173|  28.2M|    result += next;
  174|  28.2M|  }
  175|       |
  176|    781|  result.shrink_to_fit();
  177|    781|  return result;
  178|    781|}
_ZN18FuzzedDataProvider25ConsumeRandomLengthStringEv:
  181|    781|inline std::string FuzzedDataProvider::ConsumeRandomLengthString() {
  182|    781|  return ConsumeRandomLengthString(remaining_bytes_);
  183|    781|}
_ZN18FuzzedDataProvider7AdvanceEm:
  344|  28.2M|inline void FuzzedDataProvider::Advance(size_t num_bytes) {
  345|  28.2M|  if (num_bytes > remaining_bytes_)
  ------------------
  |  Branch (345:7): [True: 0, False: 28.2M]
  ------------------
  346|      0|    abort();
  347|       |
  348|  28.2M|  data_ptr_ += num_bytes;
  349|  28.2M|  remaining_bytes_ -= num_bytes;
  350|  28.2M|}
_ZN18FuzzedDataProvider23ConvertUnsignedToSignedIchEET_T0_:
  379|  28.2M|TS FuzzedDataProvider::ConvertUnsignedToSigned(TU value) {
  380|  28.2M|  static_assert(sizeof(TS) == sizeof(TU), "Incompatible data types.");
  381|  28.2M|  static_assert(!std::numeric_limits<TU>::is_signed,
  382|  28.2M|                "Source type must be unsigned.");
  383|       |
  384|       |  // TODO(Dor1s): change to `if constexpr` once C++17 becomes mainstream.
  385|  28.2M|  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|  28.2M|  if (value <= std::numeric_limits<TS>::max()) {
  ------------------
  |  Branch (390:7): [True: 18.0M, False: 10.2M]
  ------------------
  391|  18.0M|    return static_cast<TS>(value);
  392|  18.0M|  } else {
  393|  10.2M|    constexpr auto TS_min = std::numeric_limits<TS>::min();
  394|  10.2M|    return TS_min + static_cast<TS>(value - TS_min);
  395|  10.2M|  }
  396|  28.2M|}

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

_Z20protocol_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   16|    438|{
   17|    438|    FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
   18|    438|    const std::optional<CInv> inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
   19|    438|    if (!inv) {
  ------------------
  |  Branch (19:9): [True: 95, False: 343]
  ------------------
   20|     95|        return;
   21|     95|    }
   22|    343|    try {
   23|    343|        (void)inv->GetMessageType();
   24|    343|    } catch (const std::out_of_range&) {
   25|    329|    }
   26|    343|    (void)inv->ToString();
   27|    343|    const std::optional<CInv> another_inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
   28|    343|    if (!another_inv) {
  ------------------
  |  Branch (28:9): [True: 145, False: 198]
  ------------------
   29|    145|        return;
   30|    145|    }
   31|    198|    (void)(*inv < *another_inv);
   32|    198|}

_Z29ConsumeRandomLengthByteVectorIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEER18FuzzedDataProviderRKNS0_8optionalImEE:
   58|    781|{
   59|    781|    static_assert(sizeof(B) == 1);
   60|    781|    const std::string s = max_length ?
  ------------------
  |  Branch (60:27): [True: 0, False: 781]
  ------------------
   61|      0|                              fuzzed_data_provider.ConsumeRandomLengthString(*max_length) :
   62|    781|                              fuzzed_data_provider.ConsumeRandomLengthString();
   63|    781|    std::vector<B> ret(s.size());
   64|    781|    std::copy(s.begin(), s.end(), reinterpret_cast<char*>(ret.data()));
   65|    781|    return ret;
   66|    781|}
_Z21ConsumeDeserializableI4CInvENSt3__18optionalIT_EER18FuzzedDataProviderRKNS2_ImEE:
  120|    781|{
  121|    781|    const std::vector<uint8_t> buffer = ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length);
  122|    781|    DataStream ds{buffer};
  123|    781|    T obj;
  124|    781|    try {
  125|    781|        ds >> obj;
  126|    781|    } catch (const std::ios_base::failure&) {
  127|    240|        return std::nullopt;
  128|    240|    }
  129|    541|    return obj;
  130|    781|}

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

_ZNK10tinyformat6detail9FormatArg6formatERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_i:
  541|  1.34k|        {
  542|  1.34k|            TINYFORMAT_ASSERT(m_value);
  ------------------
  |  |  153|  1.34k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  543|  1.34k|            TINYFORMAT_ASSERT(m_formatImpl);
  ------------------
  |  |  153|  1.34k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  544|  1.34k|            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);
  545|  1.34k|        }
_ZN10tinyformat10FormatListC2EPNS_6detail9FormatArgEi:
  966|  1.00k|            : m_args(args), m_N(N) { }
_ZN10tinyformat6detail18parseIntAndAdvanceERPKc:
  578|    329|{
  579|    329|    int i = 0;
  580|    987|    for (;*c >= '0' && *c <= '9'; ++c)
  ------------------
  |  Branch (580:11): [True: 987, False: 0]
  |  Branch (580:24): [True: 658, False: 329]
  ------------------
  581|    658|        i = 10*i + (*c - '0');
  582|    329|    return i;
  583|    329|}
_ZN10tinyformat6detail21parseWidthOrPrecisionERiRPKcbPKNS0_9FormatArgES1_i:
  593|  1.01k|{
  594|  1.01k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (594:9): [True: 1.01k, False: 0]
  |  Branch (594:22): [True: 0, False: 1.01k]
  ------------------
  595|      0|        n = parseIntAndAdvance(c);
  596|      0|    }
  597|  1.01k|    else if (*c == '*') {
  ------------------
  |  Branch (597:14): [True: 0, False: 1.01k]
  ------------------
  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|  1.01k|    else {
  618|  1.01k|        return false;
  619|  1.01k|    }
  620|      0|    return true;
  621|  1.01k|}
_ZN10tinyformat6detail24printFormatStringLiteralERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKc:
  629|  2.34k|{
  630|  2.34k|    const char* c = fmt;
  631|  30.9k|    for (;; ++c) {
  632|  30.9k|        if (*c == '\0') {
  ------------------
  |  Branch (632:13): [True: 1.00k, False: 29.9k]
  ------------------
  633|  1.00k|            out.write(fmt, c - fmt);
  634|  1.00k|            return c;
  635|  1.00k|        }
  636|  29.9k|        else if (*c == '%') {
  ------------------
  |  Branch (636:18): [True: 1.34k, False: 28.6k]
  ------------------
  637|  1.34k|            out.write(fmt, c - fmt);
  638|  1.34k|            if (*(c+1) != '%')
  ------------------
  |  Branch (638:17): [True: 1.34k, False: 0]
  ------------------
  639|  1.34k|                return c;
  640|       |            // for "%%", tack trailing % onto next literal section.
  641|      0|            fmt = ++c;
  642|      0|        }
  643|  30.9k|    }
  644|  2.34k|}
_ZN10tinyformat6detail21streamStateFromFormatERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERbS7_RiPKcPKNS0_9FormatArgES8_i:
  685|  1.34k|{
  686|  1.34k|    TINYFORMAT_ASSERT(*fmtStart == '%');
  ------------------
  |  |  153|  1.34k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  687|       |    // Reset stream state to defaults.
  688|  1.34k|    out.width(0);
  689|  1.34k|    out.precision(6);
  690|  1.34k|    out.fill(' ');
  691|       |    // Reset most flags; ignore irrelevant unitbuf & skipws.
  692|  1.34k|    out.unsetf(std::ios::adjustfield | std::ios::basefield |
  693|  1.34k|               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |
  694|  1.34k|               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);
  695|  1.34k|    bool precisionSet = false;
  696|  1.34k|    bool widthSet = false;
  697|  1.34k|    int widthExtra = 0;
  698|  1.34k|    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|  1.34k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (702:9): [True: 1.34k, False: 0]
  |  Branch (702:22): [True: 329, False: 1.01k]
  ------------------
  703|    329|        const char tmpc = *c;
  704|    329|        int value = parseIntAndAdvance(c);
  705|    329|        if (*c == '$') {
  ------------------
  |  Branch (705:13): [True: 0, False: 329]
  ------------------
  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|    329|        else if (positionalMode) {
  ------------------
  |  Branch (714:18): [True: 0, False: 329]
  ------------------
  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|    329|        else {
  718|    329|            if (tmpc == '0') {
  ------------------
  |  Branch (718:17): [True: 329, False: 0]
  ------------------
  719|       |                // Use internal padding so that numeric values are
  720|       |                // formatted correctly, eg -00010 rather than 000-10
  721|    329|                out.fill('0');
  722|    329|                out.setf(std::ios::internal, std::ios::adjustfield);
  723|    329|            }
  724|    329|            if (value != 0) {
  ------------------
  |  Branch (724:17): [True: 329, False: 0]
  ------------------
  725|       |                // Nonzero value means that we parsed width.
  726|    329|                widthSet = true;
  727|    329|                out.width(value);
  728|    329|            }
  729|    329|        }
  730|    329|    }
  731|  1.01k|    else if (positionalMode) {
  ------------------
  |  Branch (731:14): [True: 0, False: 1.01k]
  ------------------
  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|  1.34k|    if (!widthSet) {
  ------------------
  |  Branch (735:9): [True: 1.01k, False: 329]
  ------------------
  736|       |        // Parse flags
  737|  1.01k|        for (;; ++c) {
  738|  1.01k|            switch (*c) {
  739|      0|                case '#':
  ------------------
  |  Branch (739:17): [True: 0, False: 1.01k]
  ------------------
  740|      0|                    out.setf(std::ios::showpoint | std::ios::showbase);
  741|      0|                    continue;
  742|      0|                case '0':
  ------------------
  |  Branch (742:17): [True: 0, False: 1.01k]
  ------------------
  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: 1.01k]
  ------------------
  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: 1.01k]
  ------------------
  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: 1.01k]
  ------------------
  761|      0|                    out.setf(std::ios::showpos);
  762|      0|                    spacePadPositive = false;
  763|      0|                    widthExtra = 1;
  764|      0|                    continue;
  765|  1.01k|                default:
  ------------------
  |  Branch (765:17): [True: 1.01k, False: 0]
  ------------------
  766|  1.01k|                    break;
  767|  1.01k|            }
  768|  1.01k|            break;
  769|  1.01k|        }
  770|       |        // Parse width
  771|  1.01k|        int width = 0;
  772|  1.01k|        widthSet = parseWidthOrPrecision(width, c, positionalMode,
  773|  1.01k|                                         args, argIndex, numArgs);
  774|  1.01k|        if (widthSet) {
  ------------------
  |  Branch (774:13): [True: 0, False: 1.01k]
  ------------------
  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|  1.01k|    }
  784|       |    // 3) Parse precision
  785|  1.34k|    if (*c == '.') {
  ------------------
  |  Branch (785:9): [True: 0, False: 1.34k]
  ------------------
  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|  1.34k|    while (*c == 'l' || *c == 'h' || *c == 'L' ||
  ------------------
  |  Branch (797:12): [True: 0, False: 1.34k]
  |  Branch (797:25): [True: 0, False: 1.34k]
  |  Branch (797:38): [True: 0, False: 1.34k]
  ------------------
  798|  1.34k|           *c == 'j' || *c == 'z' || *c == 't') {
  ------------------
  |  Branch (798:12): [True: 0, False: 1.34k]
  |  Branch (798:25): [True: 0, False: 1.34k]
  |  Branch (798:38): [True: 0, False: 1.34k]
  ------------------
  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|  1.34k|    bool intConversion = false;
  805|  1.34k|    switch (*c) {
  806|    658|        case 'u': case 'd': case 'i':
  ------------------
  |  Branch (806:9): [True: 0, False: 1.34k]
  |  Branch (806:19): [True: 658, False: 686]
  |  Branch (806:29): [True: 0, False: 1.34k]
  ------------------
  807|    658|            out.setf(std::ios::dec, std::ios::basefield);
  808|    658|            intConversion = true;
  809|    658|            break;
  810|      0|        case 'o':
  ------------------
  |  Branch (810:9): [True: 0, False: 1.34k]
  ------------------
  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: 1.34k]
  ------------------
  815|      0|            out.setf(std::ios::uppercase);
  816|      0|            [[fallthrough]];
  817|    329|        case 'x': case 'p':
  ------------------
  |  Branch (817:9): [True: 329, False: 1.01k]
  |  Branch (817:19): [True: 0, False: 1.34k]
  ------------------
  818|    329|            out.setf(std::ios::hex, std::ios::basefield);
  819|    329|            intConversion = true;
  820|    329|            break;
  821|      0|        case 'E':
  ------------------
  |  Branch (821:9): [True: 0, False: 1.34k]
  ------------------
  822|      0|            out.setf(std::ios::uppercase);
  823|      0|            [[fallthrough]];
  824|      0|        case 'e':
  ------------------
  |  Branch (824:9): [True: 0, False: 1.34k]
  ------------------
  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: 1.34k]
  ------------------
  829|      0|            out.setf(std::ios::uppercase);
  830|      0|            [[fallthrough]];
  831|      0|        case 'f':
  ------------------
  |  Branch (831:9): [True: 0, False: 1.34k]
  ------------------
  832|      0|            out.setf(std::ios::fixed, std::ios::floatfield);
  833|      0|            break;
  834|      0|        case 'A':
  ------------------
  |  Branch (834:9): [True: 0, False: 1.34k]
  ------------------
  835|      0|            out.setf(std::ios::uppercase);
  836|      0|            [[fallthrough]];
  837|      0|        case 'a':
  ------------------
  |  Branch (837:9): [True: 0, False: 1.34k]
  ------------------
  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: 1.34k]
  ------------------
  847|      0|            out.setf(std::ios::uppercase);
  848|      0|            [[fallthrough]];
  849|      0|        case 'g':
  ------------------
  |  Branch (849:9): [True: 0, False: 1.34k]
  ------------------
  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: 1.34k]
  ------------------
  855|       |            // Handled as special case inside formatValue()
  856|      0|            break;
  857|    357|        case 's':
  ------------------
  |  Branch (857:9): [True: 357, False: 987]
  ------------------
  858|    357|            if (precisionSet)
  ------------------
  |  Branch (858:17): [True: 0, False: 357]
  ------------------
  859|      0|                ntrunc = static_cast<int>(out.precision());
  860|       |            // Make %s print Booleans as "true" and "false"
  861|    357|            out.setf(std::ios::boolalpha);
  862|    357|            break;
  863|      0|        case 'n':
  ------------------
  |  Branch (863:9): [True: 0, False: 1.34k]
  ------------------
  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: 1.34k]
  ------------------
  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: 1.34k]
  ------------------
  872|      0|            break;
  873|  1.34k|    }
  874|  1.34k|    if (intConversion && precisionSet && !widthSet) {
  ------------------
  |  Branch (874:9): [True: 987, False: 357]
  |  Branch (874:26): [True: 0, False: 987]
  |  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|  1.34k|    return c+1;
  884|  1.34k|}
_ZN10tinyformat6detail10formatImplERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcPKNS0_9FormatArgEi:
  891|  1.00k|{
  892|       |    // Saved stream state
  893|  1.00k|    std::streamsize origWidth = out.width();
  894|  1.00k|    std::streamsize origPrecision = out.precision();
  895|  1.00k|    std::ios::fmtflags origFlags = out.flags();
  896|  1.00k|    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|  1.00k|    bool positionalMode = false;
  901|  1.00k|    int argIndex = 0;
  902|  2.34k|    while (true) {
  ------------------
  |  Branch (902:12): [Folded - Ignored]
  ------------------
  903|  2.34k|        fmt = printFormatStringLiteral(out, fmt);
  904|  2.34k|        if (*fmt == '\0') {
  ------------------
  |  Branch (904:13): [True: 1.00k, False: 1.34k]
  ------------------
  905|  1.00k|            if (!positionalMode && argIndex < numArgs) {
  ------------------
  |  Branch (905:17): [True: 1.00k, False: 0]
  |  Branch (905:36): [True: 0, False: 1.00k]
  ------------------
  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|  1.00k|            break;
  909|  1.00k|        }
  910|  1.34k|        bool spacePadPositive = false;
  911|  1.34k|        int ntrunc = -1;
  912|  1.34k|        const char* fmtEnd = streamStateFromFormat(out, positionalMode, spacePadPositive, ntrunc, fmt,
  913|  1.34k|                                                   args, argIndex, numArgs);
  914|       |        // NB: argIndex may be incremented by reading variable width/precision
  915|       |        // in `streamStateFromFormat`, so do the bounds check here.
  916|  1.34k|        if (argIndex >= numArgs) {
  ------------------
  |  Branch (916:13): [True: 0, False: 1.34k]
  ------------------
  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|  1.34k|        const FormatArg& arg = args[argIndex];
  921|       |        // Format the arg into the stream.
  922|  1.34k|        if (!spacePadPositive) {
  ------------------
  |  Branch (922:13): [True: 1.34k, False: 0]
  ------------------
  923|  1.34k|            arg.format(out, fmt, fmtEnd, ntrunc);
  924|  1.34k|        }
  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|  1.34k|        if (!positionalMode)
  ------------------
  |  Branch (941:13): [True: 1.34k, False: 0]
  ------------------
  942|  1.34k|            ++argIndex;
  943|  1.34k|        fmt = fmtEnd;
  944|  1.34k|    }
  945|       |
  946|       |    // Restore stream state
  947|  1.00k|    out.width(origWidth);
  948|  1.00k|    out.precision(origPrecision);
  949|  1.00k|    out.flags(origFlags);
  950|  1.00k|    out.fill(origFill);
  951|  1.00k|}
_ZN10tinyformat7vformatERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcRKNS_10FormatListE:
 1070|  1.00k|{
 1071|  1.00k|    detail::formatImpl(out, fmt, list.m_args, list.m_N);
 1072|  1.00k|}
_ZN10tinyformat17FormatStringCheckILj1EEcvPKcEv:
  197|    658|    operator const char*() { return fmt; }
_ZN10tinyformat17FormatStringCheckILj2EEcvPKcEv:
  197|    343|    operator const char*() { return fmt; }
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     14|{
 1089|     14|    std::ostringstream oss;
 1090|     14|    format(oss, fmt, args...);
 1091|     14|    return oss.str();
 1092|     14|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     14|{
 1081|     14|    vformat(out, fmt, makeFormatList(args...));
 1082|     14|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     14|{
 1045|     14|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     14|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESA_EEEDpRKT_:
  990|     14|            : FormatList(&m_formatterStore[0], N),
  991|     14|            m_formatterStore { FormatArg(args)... }
  992|     14|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERKT_:
  534|    357|            : m_value(static_cast<const void*>(&value)),
  535|    357|            m_formatImpl(&formatImpl<T>),
  536|    357|            m_toIntImpl(&toIntImpl<T>)
  537|    357|        { }
_ZN10tinyformat6detail9FormatArg10formatImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEvRNS3_13basic_ostreamIcS6_EEPKcSE_iPKv:
  558|    357|        {
  559|    357|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|    357|        }
_ZN10tinyformat11formatValueINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRNS1_13basic_ostreamIcS4_EEPKcSC_iRKT_:
  351|    357|{
  352|    357|#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|    357|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|    357|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|    357|#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|    357|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|    357|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|    357|    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|    357|    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|    357|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 357]
  ------------------
  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|    357|    else
  378|    357|        out << value;
  379|    357|}
_ZN10tinyformat6formatIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|    658|{
 1089|    658|    std::ostringstream oss;
 1090|    658|    format(oss, fmt, args...);
 1091|    658|    return oss.str();
 1092|    658|}
_ZN10tinyformat6formatIJjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|    658|{
 1081|    658|    vformat(out, fmt, makeFormatList(args...));
 1082|    658|}
_ZN10tinyformat14makeFormatListIJjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|    658|{
 1045|    658|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|    658|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJjEEEDpRKT_:
  990|    658|            : FormatList(&m_formatterStore[0], N),
  991|    658|            m_formatterStore { FormatArg(args)... }
  992|    658|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IjEERKT_:
  534|    987|            : m_value(static_cast<const void*>(&value)),
  535|    987|            m_formatImpl(&formatImpl<T>),
  536|    987|            m_toIntImpl(&toIntImpl<T>)
  537|    987|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIjEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|    987|        {
  559|    987|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|    987|        }
_ZN10tinyformat11formatValueIjEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|    987|{
  352|    987|#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|    987|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|    987|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|    987|#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|    987|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|    987|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|    987|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 987]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|    987|    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|    987|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 987]
  ------------------
  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|    987|    else
  378|    987|        out << value;
  379|    987|}
_ZN10tinyformat6formatIJjNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|    329|{
 1089|    329|    std::ostringstream oss;
 1090|    329|    format(oss, fmt, args...);
 1091|    329|    return oss.str();
 1092|    329|}
_ZN10tinyformat6formatIJjNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|    329|{
 1081|    329|    vformat(out, fmt, makeFormatList(args...));
 1082|    329|}
_ZN10tinyformat14makeFormatListIJjNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|    329|{
 1045|    329|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|    329|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJjNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEDpRKT_:
  990|    329|            : FormatList(&m_formatterStore[0], N),
  991|    329|            m_formatterStore { FormatArg(args)... }
  992|    329|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }

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

_ZNK9base_blobILj256EE7CompareERKS0_:
   64|    140|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZltRK9base_blobILj256EES2_:
   68|    140|    friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
_ZN9base_blobILj256EE7SetNullEv:
   56|    781|    {
   57|    781|        std::fill(m_data.begin(), m_data.end(), 0);
   58|    781|    }
_ZN7uint256C2Ev:
  205|    781|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   35|    781|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EE11UnserializeI10DataStreamEEvRT_:
  133|    609|    {
  134|    609|        s.read(MakeWritableByteSpan(m_data));
  135|    609|    }

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

_Z16AdditionOverflowImEbT_S0_:
   16|  1.39k|{
   17|  1.39k|    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|  1.39k|    return std::numeric_limits<T>::max() - i < j;
   23|  1.39k|}
_Z10CheckedAddImENSt3__18optionalIT_EES2_S2_:
   27|  1.39k|{
   28|  1.39k|    if (AdditionOverflow(i, j)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 1.39k]
  ------------------
   29|      0|        return std::nullopt;
   30|      0|    }
   31|  1.39k|    return i + j;
   32|  1.39k|}

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

