_ZNK11FlatFilePos8ToStringEv:
   24|    274|{
   25|    274|    return strprintf("FlatFilePos(nFile=%i, nPos=%i)", nFile, nPos);
  ------------------
  |  | 1172|    274|#define strprintf tfm::format
  ------------------
   26|    274|}

_ZeqRK11FlatFilePosS1_:
   28|    314|    friend bool operator==(const FlatFilePos &a, const FlatFilePos &b) {
   29|    314|        return (a.nFile == b.nFile && a.nPos == b.nPos);
  ------------------
  |  Branch (29:17): [True: 124, False: 190]
  |  Branch (29:39): [True: 18, False: 106]
  ------------------
   30|    314|    }
_ZneRK11FlatFilePosS1_:
   32|    157|    friend bool operator!=(const FlatFilePos &a, const FlatFilePos &b) {
   33|    157|        return !(a == b);
   34|    157|    }
_ZN11FlatFilePosC2Ev:
   21|    786|    FlatFilePos() = default;
_ZN11FlatFilePos16SerializationOpsI10DataStreamS_17ActionUnserializeEEvRT0_RT_T1_:
   19|    786|    SERIALIZE_METHODS(FlatFilePos, obj) { READWRITE(VARINT_MODE(obj.nFile, VarIntMode::NONNEGATIVE_SIGNED), VARINT(obj.nPos)); }
  ------------------
  |  |  156|    786|#define READWRITE(...) (ser_action.SerReadWriteMany(s, __VA_ARGS__))
  ------------------

_Z13ser_readdata8I10DataStreamEhRT_:
   84|  2.84k|{
   85|  2.84k|    uint8_t obj;
   86|  2.84k|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|  2.84k|    return obj;
   88|  2.84k|}
_Z11UnserializeI10DataStreamR7WrapperI15VarIntFormatterIL10VarIntMode0EERjEQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|    588|{
  763|    588|    a.Unserialize(is);
  764|    588|}
_ZN7WrapperI15VarIntFormatterIL10VarIntMode0EERjE11UnserializeI10DataStreamEEvRT_:
  483|    588|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VarIntFormatterIL10VarIntMode0EE5UnserI10DataStreamjEEvRT_RT0_:
  514|    588|    {
  515|    588|        v = ReadVarInt<Stream,Mode,typename std::remove_cv<I>::type>(s);
  516|    588|    }
_Z10ReadVarIntI10DataStreamL10VarIntMode0EjET1_RT_:
  453|    588|{
  454|    588|    CheckVarIntMode<Mode, I>();
  455|    588|    I n = 0;
  456|  1.39k|    while(true) {
  ------------------
  |  Branch (456:11): [Folded - Ignored]
  ------------------
  457|  1.39k|        unsigned char chData = ser_readdata8(is);
  458|  1.39k|        if (n > (std::numeric_limits<I>::max() >> 7)) {
  ------------------
  |  Branch (458:13): [True: 69, False: 1.32k]
  ------------------
  459|     69|           throw std::ios_base::failure("ReadVarInt(): size too large");
  460|     69|        }
  461|  1.32k|        n = (n << 7) | (chData & 0x7F);
  462|  1.32k|        if (chData & 0x80) {
  ------------------
  |  Branch (462:13): [True: 807, False: 517]
  ------------------
  463|    807|            if (n == std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (463:17): [True: 2, False: 805]
  ------------------
  464|      2|                throw std::ios_base::failure("ReadVarInt(): size too large");
  465|      2|            }
  466|    805|            n++;
  467|    805|        } else {
  468|    517|            return n;
  469|    517|        }
  470|  1.32k|    }
  471|    588|}
_ZN15CheckVarIntModeIL10VarIntMode0EjEC2Ev:
  410|    588|    {
  411|    588|        static_assert(Mode != VarIntMode::DEFAULT || std::is_unsigned<I>::value, "Unsigned type required with mode DEFAULT.");
  412|    588|        static_assert(Mode != VarIntMode::NONNEGATIVE_SIGNED || std::is_signed<I>::value, "Signed type required with mode NONNEGATIVE_SIGNED.");
  413|    588|    }
_ZN7WrapperI15VarIntFormatterIL10VarIntMode0EERjEC2ES3_:
  481|    786|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamR7WrapperI15VarIntFormatterIL10VarIntMode1EERiEQ14UnserializableIT0_T_EEvRS9_OS8_:
  762|    786|{
  763|    786|    a.Unserialize(is);
  764|    786|}
_ZN7WrapperI15VarIntFormatterIL10VarIntMode1EERiE11UnserializeI10DataStreamEEvRT_:
  483|    786|    template<typename Stream> void Unserialize(Stream &s) { Formatter().Unser(s, m_object); }
_ZN15VarIntFormatterIL10VarIntMode1EE5UnserI10DataStreamiEEvRT_RT0_:
  514|    786|    {
  515|    786|        v = ReadVarInt<Stream,Mode,typename std::remove_cv<I>::type>(s);
  516|    786|    }
_Z10ReadVarIntI10DataStreamL10VarIntMode1EiET1_RT_:
  453|    786|{
  454|    786|    CheckVarIntMode<Mode, I>();
  455|    786|    I n = 0;
  456|  1.45k|    while(true) {
  ------------------
  |  Branch (456:11): [Folded - Ignored]
  ------------------
  457|  1.45k|        unsigned char chData = ser_readdata8(is);
  458|  1.45k|        if (n > (std::numeric_limits<I>::max() >> 7)) {
  ------------------
  |  Branch (458:13): [True: 20, False: 1.43k]
  ------------------
  459|     20|           throw std::ios_base::failure("ReadVarInt(): size too large");
  460|     20|        }
  461|  1.43k|        n = (n << 7) | (chData & 0x7F);
  462|  1.43k|        if (chData & 0x80) {
  ------------------
  |  Branch (462:13): [True: 670, False: 765]
  ------------------
  463|    670|            if (n == std::numeric_limits<I>::max()) {
  ------------------
  |  Branch (463:17): [True: 1, False: 669]
  ------------------
  464|      1|                throw std::ios_base::failure("ReadVarInt(): size too large");
  465|      1|            }
  466|    669|            n++;
  467|    765|        } else {
  468|    765|            return n;
  469|    765|        }
  470|  1.43k|    }
  471|    786|}
_ZN15CheckVarIntModeIL10VarIntMode1EiEC2Ev:
  410|    786|    {
  411|    786|        static_assert(Mode != VarIntMode::DEFAULT || std::is_unsigned<I>::value, "Unsigned type required with mode DEFAULT.");
  412|    786|        static_assert(Mode != VarIntMode::NONNEGATIVE_SIGNED || std::is_signed<I>::value, "Signed type required with mode NONNEGATIVE_SIGNED.");
  413|    786|    }
_ZN7WrapperI15VarIntFormatterIL10VarIntMode1EERiEC2ES3_:
  481|    786|    explicit Wrapper(T obj) : m_object(obj) {}
_Z11UnserializeI10DataStreamR11FlatFilePosQ14UnserializableIT0_T_EEvRS4_OS3_:
  762|    786|{
  763|    786|    a.Unserialize(is);
  764|    786|}
_ZN11FlatFilePos11UnserializeI10DataStreamEEvRT_:
  228|    786|    {                                                                                               \
  229|    786|        static_assert(std::is_same<cls&, decltype(*this)>::value, "Unserialize type mismatch");     \
  230|    786|        Unser(s, *this);                                                                            \
  231|    786|    }
_ZN11FlatFilePos5UnserI10DataStreamEEvRT_RS_:
  180|    786|    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
_ZN17ActionUnserialize16SerReadWriteManyI10DataStreamJ7WrapperI15VarIntFormatterIL10VarIntMode1EERiES2_IS3_ILS4_0EERjEEEEvRT_DpOT0_:
 1033|    786|    {
 1034|    786|        ::UnserializeMany(s, args...);
 1035|    786|    }
_Z15UnserializeManyI10DataStreamJR7WrapperI15VarIntFormatterIL10VarIntMode1EERiERS1_IS2_ILS3_0EERjEEEvRT_DpOT0_:
 1001|    786|{
 1002|    786|    (::Unserialize(s, args), ...);
 1003|    786|}
flatfile.cpp:_ZL5UsingI15VarIntFormatterIL10VarIntMode1EERiE7WrapperIT_RT0_EOS6_:
  497|    786|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
flatfile.cpp:_ZL5UsingI15VarIntFormatterIL10VarIntMode0EERjE7WrapperIT_RT0_EOS6_:
  497|    786|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }

_ZNK4SpanIKSt4byteE4sizeEv:
  187|    786|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKSt4byteE4dataEv:
  174|  1.57k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIhE4dataEv:
  174|  2.84k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4dataEv:
  174|    786|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanISt4byteE4sizeEv:
  187|  8.28k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanISt4byteE4dataEv:
  174|  2.58k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE10size_bytesEv:
  188|    786|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKhE4SpanIKSt4byteES1_IT_E:
  259|    786|{
  260|    786|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|    786|}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  172|    786|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2IS1_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEEPS6_m:
  119|    786|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIhE10size_bytesEv:
  188|  2.84k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_ZN4SpanISt4byteEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  2.84k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesIhE4SpanISt4byteES0_IT_E:
  264|  2.84k|{
  265|  2.84k|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|  2.84k|}
_ZN4SpanIhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_hEE5valueEiE4typeELi0EEEPS4_m:
  119|  2.84k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}

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

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

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

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

_Z20flatfile_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   17|    512|{
   18|    512|    FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
   19|    512|    std::optional<FlatFilePos> flat_file_pos = ConsumeDeserializable<FlatFilePos>(fuzzed_data_provider);
   20|    512|    if (!flat_file_pos) {
  ------------------
  |  Branch (20:9): [True: 238, False: 274]
  ------------------
   21|    238|        return;
   22|    238|    }
   23|    274|    std::optional<FlatFilePos> another_flat_file_pos = ConsumeDeserializable<FlatFilePos>(fuzzed_data_provider);
   24|    274|    if (another_flat_file_pos) {
  ------------------
  |  Branch (24:9): [True: 157, False: 117]
  ------------------
   25|    157|        assert((*flat_file_pos == *another_flat_file_pos) != (*flat_file_pos != *another_flat_file_pos));
   26|    157|    }
   27|    274|    (void)flat_file_pos->ToString();
   28|    274|}

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

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

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

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

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

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

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

