_ZN18FuzzedDataProviderC2EPKhm:
   37|    435|      : data_ptr_(data), remaining_bytes_(size) {}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeImEET_S1_S1_:
  205|    435|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|    435|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|    435|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|    435|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 435]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|    435|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|    435|  uint64_t result = 0;
  215|    435|  size_t offset = 0;
  216|       |
  217|    870|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 870, False: 0]
  |  Branch (217:43): [True: 435, False: 435]
  ------------------
  218|    870|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 435, False: 0]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|    435|    --remaining_bytes_;
  226|    435|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|    435|    offset += CHAR_BIT;
  228|    435|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|    435|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 435, False: 0]
  ------------------
  232|    435|    result = result % (range + 1);
  233|       |
  234|    435|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|    435|}
_ZN18FuzzedDataProvider15ConsumeIntegralIjEET_v:
  195|  3.33k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|  3.33k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|  3.33k|                                std::numeric_limits<T>::max());
  198|  3.33k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIjEET_S1_S1_:
  205|  3.33k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  3.33k|  static_assert(std::is_integral<T>::value, "An integral type is required.");
  207|  3.33k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  3.33k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 3.33k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  3.33k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  3.33k|  uint64_t result = 0;
  215|  3.33k|  size_t offset = 0;
  216|       |
  217|  11.0k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 9.14k, False: 1.86k]
  |  Branch (217:43): [True: 9.14k, False: 0]
  ------------------
  218|  11.0k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 7.67k, False: 1.46k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  7.67k|    --remaining_bytes_;
  226|  7.67k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  7.67k|    offset += CHAR_BIT;
  228|  7.67k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  3.33k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 3.33k, False: 0]
  ------------------
  232|  3.33k|    result = result % (range + 1);
  233|       |
  234|  3.33k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  3.33k|}

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

_Z28parse_hd_keypath_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   14|    435|{
   15|    435|    const std::string keypath_str(buffer.begin(), buffer.end());
   16|    435|    std::vector<uint32_t> keypath;
   17|    435|    (void)ParseHDKeypath(keypath_str, keypath);
   18|       |
   19|    435|    FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
   20|    435|    const std::vector<uint32_t> random_keypath = ConsumeRandomLengthIntegralVector<uint32_t>(fuzzed_data_provider);
   21|    435|    (void)FormatHDKeypath(random_keypath, /*apostrophe=*/true); // WriteHDKeypath calls this with false
   22|    435|    (void)WriteHDKeypath(random_keypath);
   23|    435|}

_Z33ConsumeRandomLengthIntegralVectorIjENSt3__16vectorIT_NS0_9allocatorIS2_EEEER18FuzzedDataProviderm:
   91|    435|{
   92|    435|    const size_t n_elements = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, max_vector_size);
   93|    435|    std::vector<T> r;
   94|    435|    r.reserve(n_elements);
   95|  3.76k|    for (size_t i = 0; i < n_elements; ++i) {
  ------------------
  |  Branch (95:24): [True: 3.33k, False: 435]
  ------------------
   96|  3.33k|        r.push_back(fuzzed_data_provider.ConsumeIntegral<T>());
   97|  3.33k|    }
   98|    435|    return r;
   99|    435|}

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

_ZNK10tinyformat6detail9FormatArg6formatERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_i:
  541|  6.66k|        {
  542|  6.66k|            TINYFORMAT_ASSERT(m_value);
  ------------------
  |  |  153|  6.66k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  543|  6.66k|            TINYFORMAT_ASSERT(m_formatImpl);
  ------------------
  |  |  153|  6.66k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  544|  6.66k|            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);
  545|  6.66k|        }
_ZN10tinyformat10FormatListC2EPNS_6detail9FormatArgEi:
  966|  6.66k|            : m_args(args), m_N(N) { }
_ZN10tinyformat6detail21parseWidthOrPrecisionERiRPKcbPKNS0_9FormatArgES1_i:
  593|  6.66k|{
  594|  6.66k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (594:9): [True: 6.66k, False: 0]
  |  Branch (594:22): [True: 0, False: 6.66k]
  ------------------
  595|      0|        n = parseIntAndAdvance(c);
  596|      0|    }
  597|  6.66k|    else if (*c == '*') {
  ------------------
  |  Branch (597:14): [True: 0, False: 6.66k]
  ------------------
  598|      0|        ++c;
  599|      0|        n = 0;
  600|      0|        if (positionalMode) {
  ------------------
  |  Branch (600:13): [True: 0, False: 0]
  ------------------
  601|      0|            int pos = parseIntAndAdvance(c) - 1;
  602|      0|            if (*c != '$')
  ------------------
  |  Branch (602:17): [True: 0, False: 0]
  ------------------
  603|      0|                TINYFORMAT_ERROR("tinyformat: Non-positional argument used after a positional one");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  604|      0|            if (pos >= 0 && pos < numArgs)
  ------------------
  |  Branch (604:17): [True: 0, False: 0]
  |  Branch (604:29): [True: 0, False: 0]
  ------------------
  605|      0|                n = args[pos].toInt();
  606|      0|            else
  607|      0|                TINYFORMAT_ERROR("tinyformat: Positional argument out of range");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  608|      0|            ++c;
  609|      0|        }
  610|      0|        else {
  611|      0|            if (argIndex < numArgs)
  ------------------
  |  Branch (611:17): [True: 0, False: 0]
  ------------------
  612|      0|                n = args[argIndex++].toInt();
  613|      0|            else
  614|      0|                TINYFORMAT_ERROR("tinyformat: Not enough arguments to read variable width or precision");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  615|      0|        }
  616|      0|    }
  617|  6.66k|    else {
  618|  6.66k|        return false;
  619|  6.66k|    }
  620|      0|    return true;
  621|  6.66k|}
_ZN10tinyformat6detail24printFormatStringLiteralERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKc:
  629|  13.3k|{
  630|  13.3k|    const char* c = fmt;
  631|  19.9k|    for (;; ++c) {
  632|  19.9k|        if (*c == '\0') {
  ------------------
  |  Branch (632:13): [True: 6.66k, False: 13.3k]
  ------------------
  633|  6.66k|            out.write(fmt, c - fmt);
  634|  6.66k|            return c;
  635|  6.66k|        }
  636|  13.3k|        else if (*c == '%') {
  ------------------
  |  Branch (636:18): [True: 6.66k, False: 6.66k]
  ------------------
  637|  6.66k|            out.write(fmt, c - fmt);
  638|  6.66k|            if (*(c+1) != '%')
  ------------------
  |  Branch (638:17): [True: 6.66k, False: 0]
  ------------------
  639|  6.66k|                return c;
  640|       |            // for "%%", tack trailing % onto next literal section.
  641|      0|            fmt = ++c;
  642|      0|        }
  643|  19.9k|    }
  644|  13.3k|}
_ZN10tinyformat6detail21streamStateFromFormatERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERbS7_RiPKcPKNS0_9FormatArgES8_i:
  685|  6.66k|{
  686|  6.66k|    TINYFORMAT_ASSERT(*fmtStart == '%');
  ------------------
  |  |  153|  6.66k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  687|       |    // Reset stream state to defaults.
  688|  6.66k|    out.width(0);
  689|  6.66k|    out.precision(6);
  690|  6.66k|    out.fill(' ');
  691|       |    // Reset most flags; ignore irrelevant unitbuf & skipws.
  692|  6.66k|    out.unsetf(std::ios::adjustfield | std::ios::basefield |
  693|  6.66k|               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |
  694|  6.66k|               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);
  695|  6.66k|    bool precisionSet = false;
  696|  6.66k|    bool widthSet = false;
  697|  6.66k|    int widthExtra = 0;
  698|  6.66k|    const char* c = fmtStart + 1;
  699|       |
  700|       |    // 1) Parse an argument index (if followed by '$') or a width possibly
  701|       |    // preceded with '0' flag.
  702|  6.66k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (702:9): [True: 6.66k, False: 0]
  |  Branch (702:22): [True: 0, False: 6.66k]
  ------------------
  703|      0|        const char tmpc = *c;
  704|      0|        int value = parseIntAndAdvance(c);
  705|      0|        if (*c == '$') {
  ------------------
  |  Branch (705:13): [True: 0, False: 0]
  ------------------
  706|       |            // value is an argument index
  707|      0|            if (value > 0 && value <= numArgs)
  ------------------
  |  Branch (707:17): [True: 0, False: 0]
  |  Branch (707:30): [True: 0, False: 0]
  ------------------
  708|      0|                argIndex = value - 1;
  709|      0|            else
  710|      0|                TINYFORMAT_ERROR("tinyformat: Positional argument out of range");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  711|      0|            ++c;
  712|      0|            positionalMode = true;
  713|      0|        }
  714|      0|        else if (positionalMode) {
  ------------------
  |  Branch (714:18): [True: 0, False: 0]
  ------------------
  715|      0|            TINYFORMAT_ERROR("tinyformat: Non-positional argument used after a positional one");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  716|      0|        }
  717|      0|        else {
  718|      0|            if (tmpc == '0') {
  ------------------
  |  Branch (718:17): [True: 0, False: 0]
  ------------------
  719|       |                // Use internal padding so that numeric values are
  720|       |                // formatted correctly, eg -00010 rather than 000-10
  721|      0|                out.fill('0');
  722|      0|                out.setf(std::ios::internal, std::ios::adjustfield);
  723|      0|            }
  724|      0|            if (value != 0) {
  ------------------
  |  Branch (724:17): [True: 0, False: 0]
  ------------------
  725|       |                // Nonzero value means that we parsed width.
  726|      0|                widthSet = true;
  727|      0|                out.width(value);
  728|      0|            }
  729|      0|        }
  730|      0|    }
  731|  6.66k|    else if (positionalMode) {
  ------------------
  |  Branch (731:14): [True: 0, False: 6.66k]
  ------------------
  732|      0|        TINYFORMAT_ERROR("tinyformat: Non-positional argument used after a positional one");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  733|      0|    }
  734|       |    // 2) Parse flags and width if we did not do it in previous step.
  735|  6.66k|    if (!widthSet) {
  ------------------
  |  Branch (735:9): [True: 6.66k, False: 0]
  ------------------
  736|       |        // Parse flags
  737|  6.66k|        for (;; ++c) {
  738|  6.66k|            switch (*c) {
  739|      0|                case '#':
  ------------------
  |  Branch (739:17): [True: 0, False: 6.66k]
  ------------------
  740|      0|                    out.setf(std::ios::showpoint | std::ios::showbase);
  741|      0|                    continue;
  742|      0|                case '0':
  ------------------
  |  Branch (742:17): [True: 0, False: 6.66k]
  ------------------
  743|       |                    // overridden by left alignment ('-' flag)
  744|      0|                    if (!(out.flags() & std::ios::left)) {
  ------------------
  |  Branch (744:25): [True: 0, False: 0]
  ------------------
  745|       |                        // Use internal padding so that numeric values are
  746|       |                        // formatted correctly, eg -00010 rather than 000-10
  747|      0|                        out.fill('0');
  748|      0|                        out.setf(std::ios::internal, std::ios::adjustfield);
  749|      0|                    }
  750|      0|                    continue;
  751|      0|                case '-':
  ------------------
  |  Branch (751:17): [True: 0, False: 6.66k]
  ------------------
  752|      0|                    out.fill(' ');
  753|      0|                    out.setf(std::ios::left, std::ios::adjustfield);
  754|      0|                    continue;
  755|      0|                case ' ':
  ------------------
  |  Branch (755:17): [True: 0, False: 6.66k]
  ------------------
  756|       |                    // overridden by show positive sign, '+' flag.
  757|      0|                    if (!(out.flags() & std::ios::showpos))
  ------------------
  |  Branch (757:25): [True: 0, False: 0]
  ------------------
  758|      0|                        spacePadPositive = true;
  759|      0|                    continue;
  760|      0|                case '+':
  ------------------
  |  Branch (760:17): [True: 0, False: 6.66k]
  ------------------
  761|      0|                    out.setf(std::ios::showpos);
  762|      0|                    spacePadPositive = false;
  763|      0|                    widthExtra = 1;
  764|      0|                    continue;
  765|  6.66k|                default:
  ------------------
  |  Branch (765:17): [True: 6.66k, False: 0]
  ------------------
  766|  6.66k|                    break;
  767|  6.66k|            }
  768|  6.66k|            break;
  769|  6.66k|        }
  770|       |        // Parse width
  771|  6.66k|        int width = 0;
  772|  6.66k|        widthSet = parseWidthOrPrecision(width, c, positionalMode,
  773|  6.66k|                                         args, argIndex, numArgs);
  774|  6.66k|        if (widthSet) {
  ------------------
  |  Branch (774:13): [True: 0, False: 6.66k]
  ------------------
  775|      0|            if (width < 0) {
  ------------------
  |  Branch (775:17): [True: 0, False: 0]
  ------------------
  776|       |                // negative widths correspond to '-' flag set
  777|      0|                out.fill(' ');
  778|      0|                out.setf(std::ios::left, std::ios::adjustfield);
  779|      0|                width = -width;
  780|      0|            }
  781|      0|            out.width(width);
  782|      0|        }
  783|  6.66k|    }
  784|       |    // 3) Parse precision
  785|  6.66k|    if (*c == '.') {
  ------------------
  |  Branch (785:9): [True: 0, False: 6.66k]
  ------------------
  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|  6.66k|    while (*c == 'l' || *c == 'h' || *c == 'L' ||
  ------------------
  |  Branch (797:12): [True: 0, False: 6.66k]
  |  Branch (797:25): [True: 0, False: 6.66k]
  |  Branch (797:38): [True: 0, False: 6.66k]
  ------------------
  798|  6.66k|           *c == 'j' || *c == 'z' || *c == 't') {
  ------------------
  |  Branch (798:12): [True: 0, False: 6.66k]
  |  Branch (798:25): [True: 0, False: 6.66k]
  |  Branch (798:38): [True: 0, False: 6.66k]
  ------------------
  799|      0|        ++c;
  800|      0|    }
  801|       |    // 5) We're up to the conversion specifier character.
  802|       |    // Set stream flags based on conversion specifier (thanks to the
  803|       |    // boost::format class for forging the way here).
  804|  6.66k|    bool intConversion = false;
  805|  6.66k|    switch (*c) {
  806|  6.66k|        case 'u': case 'd': case 'i':
  ------------------
  |  Branch (806:9): [True: 0, False: 6.66k]
  |  Branch (806:19): [True: 0, False: 6.66k]
  |  Branch (806:29): [True: 6.66k, False: 0]
  ------------------
  807|  6.66k|            out.setf(std::ios::dec, std::ios::basefield);
  808|  6.66k|            intConversion = true;
  809|  6.66k|            break;
  810|      0|        case 'o':
  ------------------
  |  Branch (810:9): [True: 0, False: 6.66k]
  ------------------
  811|      0|            out.setf(std::ios::oct, std::ios::basefield);
  812|      0|            intConversion = true;
  813|      0|            break;
  814|      0|        case 'X':
  ------------------
  |  Branch (814:9): [True: 0, False: 6.66k]
  ------------------
  815|      0|            out.setf(std::ios::uppercase);
  816|      0|            [[fallthrough]];
  817|      0|        case 'x': case 'p':
  ------------------
  |  Branch (817:9): [True: 0, False: 6.66k]
  |  Branch (817:19): [True: 0, False: 6.66k]
  ------------------
  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: 6.66k]
  ------------------
  822|      0|            out.setf(std::ios::uppercase);
  823|      0|            [[fallthrough]];
  824|      0|        case 'e':
  ------------------
  |  Branch (824:9): [True: 0, False: 6.66k]
  ------------------
  825|      0|            out.setf(std::ios::scientific, std::ios::floatfield);
  826|      0|            out.setf(std::ios::dec, std::ios::basefield);
  827|      0|            break;
  828|      0|        case 'F':
  ------------------
  |  Branch (828:9): [True: 0, False: 6.66k]
  ------------------
  829|      0|            out.setf(std::ios::uppercase);
  830|      0|            [[fallthrough]];
  831|      0|        case 'f':
  ------------------
  |  Branch (831:9): [True: 0, False: 6.66k]
  ------------------
  832|      0|            out.setf(std::ios::fixed, std::ios::floatfield);
  833|      0|            break;
  834|      0|        case 'A':
  ------------------
  |  Branch (834:9): [True: 0, False: 6.66k]
  ------------------
  835|      0|            out.setf(std::ios::uppercase);
  836|      0|            [[fallthrough]];
  837|      0|        case 'a':
  ------------------
  |  Branch (837:9): [True: 0, False: 6.66k]
  ------------------
  838|       |#           ifdef _MSC_VER
  839|       |            // Workaround https://developercommunity.visualstudio.com/content/problem/520472/hexfloat-stream-output-does-not-ignore-precision-a.html
  840|       |            // by always setting maximum precision on MSVC to avoid precision
  841|       |            // loss for doubles.
  842|       |            out.precision(13);
  843|       |#           endif
  844|      0|            out.setf(std::ios::fixed | std::ios::scientific, std::ios::floatfield);
  845|      0|            break;
  846|      0|        case 'G':
  ------------------
  |  Branch (846:9): [True: 0, False: 6.66k]
  ------------------
  847|      0|            out.setf(std::ios::uppercase);
  848|      0|            [[fallthrough]];
  849|      0|        case 'g':
  ------------------
  |  Branch (849:9): [True: 0, False: 6.66k]
  ------------------
  850|      0|            out.setf(std::ios::dec, std::ios::basefield);
  851|       |            // As in boost::format, let stream decide float format.
  852|      0|            out.flags(out.flags() & ~std::ios::floatfield);
  853|      0|            break;
  854|      0|        case 'c':
  ------------------
  |  Branch (854:9): [True: 0, False: 6.66k]
  ------------------
  855|       |            // Handled as special case inside formatValue()
  856|      0|            break;
  857|      0|        case 's':
  ------------------
  |  Branch (857:9): [True: 0, False: 6.66k]
  ------------------
  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: 6.66k]
  ------------------
  864|       |            // Not supported - will cause problems!
  865|      0|            TINYFORMAT_ERROR("tinyformat: %n conversion spec not supported");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  866|      0|            break;
  867|      0|        case '\0':
  ------------------
  |  Branch (867:9): [True: 0, False: 6.66k]
  ------------------
  868|      0|            TINYFORMAT_ERROR("tinyformat: Conversion spec incorrectly "
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  869|      0|                             "terminated by end of string");
  870|      0|            return c;
  871|      0|        default:
  ------------------
  |  Branch (871:9): [True: 0, False: 6.66k]
  ------------------
  872|      0|            break;
  873|  6.66k|    }
  874|  6.66k|    if (intConversion && precisionSet && !widthSet) {
  ------------------
  |  Branch (874:9): [True: 6.66k, False: 0]
  |  Branch (874:26): [True: 0, False: 6.66k]
  |  Branch (874:42): [True: 0, False: 0]
  ------------------
  875|       |        // "precision" for integers gives the minimum number of digits (to be
  876|       |        // padded with zeros on the left).  This isn't really supported by the
  877|       |        // iostreams, but we can approximately simulate it with the width if
  878|       |        // the width isn't otherwise used.
  879|      0|        out.width(out.precision() + widthExtra);
  880|      0|        out.setf(std::ios::internal, std::ios::adjustfield);
  881|      0|        out.fill('0');
  882|      0|    }
  883|  6.66k|    return c+1;
  884|  6.66k|}
_ZN10tinyformat6detail10formatImplERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcPKNS0_9FormatArgEi:
  891|  6.66k|{
  892|       |    // Saved stream state
  893|  6.66k|    std::streamsize origWidth = out.width();
  894|  6.66k|    std::streamsize origPrecision = out.precision();
  895|  6.66k|    std::ios::fmtflags origFlags = out.flags();
  896|  6.66k|    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|  6.66k|    bool positionalMode = false;
  901|  6.66k|    int argIndex = 0;
  902|  13.3k|    while (true) {
  ------------------
  |  Branch (902:12): [Folded - Ignored]
  ------------------
  903|  13.3k|        fmt = printFormatStringLiteral(out, fmt);
  904|  13.3k|        if (*fmt == '\0') {
  ------------------
  |  Branch (904:13): [True: 6.66k, False: 6.66k]
  ------------------
  905|  6.66k|            if (!positionalMode && argIndex < numArgs) {
  ------------------
  |  Branch (905:17): [True: 6.66k, False: 0]
  |  Branch (905:36): [True: 0, False: 6.66k]
  ------------------
  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|  6.66k|            break;
  909|  6.66k|        }
  910|  6.66k|        bool spacePadPositive = false;
  911|  6.66k|        int ntrunc = -1;
  912|  6.66k|        const char* fmtEnd = streamStateFromFormat(out, positionalMode, spacePadPositive, ntrunc, fmt,
  913|  6.66k|                                                   args, argIndex, numArgs);
  914|       |        // NB: argIndex may be incremented by reading variable width/precision
  915|       |        // in `streamStateFromFormat`, so do the bounds check here.
  916|  6.66k|        if (argIndex >= numArgs) {
  ------------------
  |  Branch (916:13): [True: 0, False: 6.66k]
  ------------------
  917|      0|            TINYFORMAT_ERROR("tinyformat: Too many conversion specifiers in format string");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  918|      0|            return;
  919|      0|        }
  920|  6.66k|        const FormatArg& arg = args[argIndex];
  921|       |        // Format the arg into the stream.
  922|  6.66k|        if (!spacePadPositive) {
  ------------------
  |  Branch (922:13): [True: 6.66k, False: 0]
  ------------------
  923|  6.66k|            arg.format(out, fmt, fmtEnd, ntrunc);
  924|  6.66k|        }
  925|      0|        else {
  926|       |            // The following is a special case with no direct correspondence
  927|       |            // between stream formatting and the printf() behaviour.  Simulate
  928|       |            // it crudely by formatting into a temporary string stream and
  929|       |            // munging the resulting string.
  930|      0|            std::ostringstream tmpStream;
  931|      0|            tmpStream.copyfmt(out);
  932|      0|            tmpStream.setf(std::ios::showpos);
  933|      0|            arg.format(tmpStream, fmt, fmtEnd, ntrunc);
  934|      0|            std::string result = tmpStream.str(); // allocates... yuck.
  935|      0|            for (size_t i = 0, iend = result.size(); i < iend; ++i) {
  ------------------
  |  Branch (935:54): [True: 0, False: 0]
  ------------------
  936|      0|                if (result[i] == '+')
  ------------------
  |  Branch (936:21): [True: 0, False: 0]
  ------------------
  937|      0|                    result[i] = ' ';
  938|      0|            }
  939|      0|            out << result;
  940|      0|        }
  941|  6.66k|        if (!positionalMode)
  ------------------
  |  Branch (941:13): [True: 6.66k, False: 0]
  ------------------
  942|  6.66k|            ++argIndex;
  943|  6.66k|        fmt = fmtEnd;
  944|  6.66k|    }
  945|       |
  946|       |    // Restore stream state
  947|  6.66k|    out.width(origWidth);
  948|  6.66k|    out.precision(origPrecision);
  949|  6.66k|    out.flags(origFlags);
  950|  6.66k|    out.fill(origFill);
  951|  6.66k|}
_ZN10tinyformat7vformatERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcRKNS_10FormatListE:
 1070|  6.66k|{
 1071|  6.66k|    detail::formatImpl(out, fmt, list.m_args, list.m_N);
 1072|  6.66k|}
_ZN10tinyformat17FormatStringCheckILj1EEcvPKcEv:
  197|  6.66k|    operator const char*() { return fmt; }
_ZN10tinyformat6formatIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  6.66k|{
 1089|  6.66k|    std::ostringstream oss;
 1090|  6.66k|    format(oss, fmt, args...);
 1091|  6.66k|    return oss.str();
 1092|  6.66k|}
_ZN10tinyformat6formatIJjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  6.66k|{
 1081|  6.66k|    vformat(out, fmt, makeFormatList(args...));
 1082|  6.66k|}
_ZN10tinyformat14makeFormatListIJjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  6.66k|{
 1045|  6.66k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  6.66k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJjEEEDpRKT_:
  990|  6.66k|            : FormatList(&m_formatterStore[0], N),
  991|  6.66k|            m_formatterStore { FormatArg(args)... }
  992|  6.66k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IjEERKT_:
  534|  6.66k|            : m_value(static_cast<const void*>(&value)),
  535|  6.66k|            m_formatImpl(&formatImpl<T>),
  536|  6.66k|            m_toIntImpl(&toIntImpl<T>)
  537|  6.66k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIjEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  6.66k|        {
  559|  6.66k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  6.66k|        }
_ZN10tinyformat11formatValueIjEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  6.66k|{
  352|  6.66k|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|  6.66k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  6.66k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  6.66k|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|  6.66k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  6.66k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  6.66k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 6.66k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  6.66k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  6.66k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 6.66k]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|  6.66k|    else
  378|  6.66k|        out << value;
  379|  6.66k|}

_Z14ParseHDKeypathRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIjNS3_IjEEEE:
   14|    435|{
   15|    435|    std::stringstream ss(keypath_str);
   16|    435|    std::string item;
   17|    435|    bool first = true;
   18|   527k|    while (std::getline(ss, item, '/')) {
  ------------------
  |  Branch (18:12): [True: 527k, False: 142]
  ------------------
   19|   527k|        if (item.compare("m") == 0) {
  ------------------
  |  Branch (19:13): [True: 4, False: 527k]
  ------------------
   20|      4|            if (first) {
  ------------------
  |  Branch (20:17): [True: 3, False: 1]
  ------------------
   21|      3|                first = false;
   22|      3|                continue;
   23|      3|            }
   24|      1|            return false;
   25|      4|        }
   26|       |        // Finds whether it is hardened
   27|   527k|        uint32_t path = 0;
   28|   527k|        size_t pos = item.find('\'');
   29|   527k|        if (pos != std::string::npos) {
  ------------------
  |  Branch (29:13): [True: 512, False: 526k]
  ------------------
   30|       |            // The hardened tick can only be in the last index of the string
   31|    512|            if (pos != item.size() - 1) {
  ------------------
  |  Branch (31:17): [True: 41, False: 471]
  ------------------
   32|     41|                return false;
   33|     41|            }
   34|    471|            path |= 0x80000000;
   35|    471|            item = item.substr(0, item.size() - 1); // Drop the last character which is the hardened tick
   36|    471|        }
   37|       |
   38|       |        // Ensure this is only numbers
   39|   527k|        if (item.find_first_not_of( "0123456789" ) != std::string::npos) {
  ------------------
  |  Branch (39:13): [True: 165, False: 526k]
  ------------------
   40|    165|            return false;
   41|    165|        }
   42|   526k|        uint32_t number;
   43|   526k|        if (!ParseUInt32(item, &number)) {
  ------------------
  |  Branch (43:13): [True: 86, False: 526k]
  ------------------
   44|     86|            return false;
   45|     86|        }
   46|   526k|        path |= number;
   47|       |
   48|   526k|        keypath.push_back(path);
   49|   526k|        first = false;
   50|   526k|    }
   51|    142|    return true;
   52|    435|}
_Z15FormatHDKeypathRKNSt3__16vectorIjNS_9allocatorIjEEEEb:
   55|    870|{
   56|    870|    std::string ret;
   57|  6.66k|    for (auto i : path) {
  ------------------
  |  Branch (57:17): [True: 6.66k, False: 870]
  ------------------
   58|  6.66k|        ret += strprintf("/%i", (i << 1) >> 1);
  ------------------
  |  | 1172|  6.66k|#define strprintf tfm::format
  ------------------
   59|  6.66k|        if (i >> 31) ret += apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (59:13): [True: 358, False: 6.30k]
  |  Branch (59:29): [True: 179, False: 179]
  ------------------
   60|  6.66k|    }
   61|    870|    return ret;
   62|    870|}
_Z14WriteHDKeypathRKNSt3__16vectorIjNS_9allocatorIjEEEEb:
   65|    435|{
   66|    435|    return "m" + FormatHDKeypath(keypath, apostrophe);
   67|    435|}

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

_Z11ParseUInt32NSt3__117basic_string_viewIcNS_11char_traitsIcEEEEPj:
  245|   526k|{
  246|   526k|    return ParseIntegral<uint32_t>(str, out);
  247|   526k|}
strencodings.cpp:_ZN12_GLOBAL__N_113ParseIntegralIjEEbNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPT_:
  206|   526k|{
  207|   526k|    static_assert(std::is_integral<T>::value);
  208|       |    // Replicate the exact behavior of strtol/strtoll/strtoul/strtoull when
  209|       |    // handling leading +/- for backwards compatibility.
  210|   526k|    if (str.length() >= 2 && str[0] == '+' && str[1] == '-') {
  ------------------
  |  Branch (210:9): [True: 890, False: 526k]
  |  Branch (210:30): [True: 0, False: 890]
  |  Branch (210:47): [True: 0, False: 0]
  ------------------
  211|      0|        return false;
  212|      0|    }
  213|   526k|    const std::optional<T> opt_int = ToIntegral<T>((!str.empty() && str[0] == '+') ? str.substr(1) : str);
  ------------------
  |  Branch (213:53): [True: 526k, False: 27]
  |  Branch (213:69): [True: 0, False: 526k]
  ------------------
  214|   526k|    if (!opt_int) {
  ------------------
  |  Branch (214:9): [True: 86, False: 526k]
  ------------------
  215|     86|        return false;
  216|     86|    }
  217|   526k|    if (out != nullptr) {
  ------------------
  |  Branch (217:9): [True: 526k, False: 0]
  ------------------
  218|   526k|        *out = *opt_int;
  219|   526k|    }
  220|   526k|    return true;
  221|   526k|}

_Z10ToIntegralIjENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|   526k|{
  181|   526k|    static_assert(std::is_integral<T>::value);
  182|   526k|    T result;
  183|   526k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|   526k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 0, False: 526k]
  |  Branch (184:57): [True: 86, False: 526k]
  ------------------
  185|     86|        return std::nullopt;
  186|     86|    }
  187|   526k|    return result;
  188|   526k|}

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

