_ZN8FuzzDataC2EPKhm:
   50|  5.10k|           size_t size) : Data(data),Size(size){}
_ZN8FuzzData16splitIntoStringsEv:
  117|  5.10k|  std::vector<std::string_view> splitIntoStrings() {
  118|  5.10k|    std::vector<std::string_view> ret;
  119|  5.10k|    if(Size>0) {
  ------------------
  |  Branch (119:8): [True: 5.09k, False: 2]
  ------------------
  120|  5.09k|      ret=split(chardata(),Size);
  121|       |      // all data consumed.
  122|  5.09k|      Data+=Size;
  123|  5.09k|      Size=0;
  124|  5.09k|    }
  125|  5.10k|    return ret;
  126|  5.10k|  }
_Z5splitPKcm:
   26|  5.09k|inline std::vector<std::string_view> split(const char* Data, size_t Size) {
   27|       |
   28|  5.09k|  std::vector<std::string_view> ret;
   29|       |
   30|  5.09k|    using namespace std::literals;
   31|  5.09k|    constexpr auto sep="\n~~\n"sv;
   32|       |
   33|  5.09k|    std::string_view all(Data,Size);
   34|  5.09k|    auto pos=all.find(sep);
   35|  1.64M|    while(pos!=std::string_view::npos) {
  ------------------
  |  Branch (35:11): [True: 1.63M, False: 5.09k]
  ------------------
   36|  1.63M|      ret.push_back(all.substr(0,pos));
   37|  1.63M|      all=all.substr(pos+sep.size());
   38|  1.63M|      pos=all.find(sep);
   39|  1.63M|    }
   40|  5.09k|    ret.push_back(all);
   41|  5.09k|    return ret;
   42|  5.09k|}
_ZNK8FuzzData8chardataEv:
  158|  5.09k|  const char* chardata() const {return static_cast<const char*>(static_cast<const void*>(Data));}
_ZN8FuzzData6getIntILi0ELi12EEEiv:
   54|  5.10k|  int getInt() {
   55|  5.10k|    static_assert (Min<Max,"min must be <max");
   56|       |
   57|       |    // make this constexpr, can't overflow because that is UB and is forbidden
   58|       |    // in constexpr evaluation
   59|  5.10k|    constexpr int range=(Max-Min)+1;
   60|  5.10k|    constexpr unsigned int urange=range;
   61|       |
   62|       |    // don't use std::uniform_int_distribution, we don't want to pay for
   63|       |    // over consumption of random data. Accept the slightly non-uniform distribution.
   64|  5.10k|    if(range<256)
  ------------------
  |  Branch (64:8): [Folded - Ignored]
  ------------------
   65|  5.10k|      return Min+static_cast<int>(get<uint8_t>()%urange);
   66|      0|    if(range<65536)
  ------------------
  |  Branch (66:8): [Folded - Ignored]
  ------------------
   67|      0|      return Min+static_cast<int>(get<uint16_t>()%urange);
   68|       |
   69|      0|    return Min+static_cast<int>(get<uint32_t>()%urange);
   70|      0|  }
_ZN8FuzzData3getIhEET_v:
   73|  5.10k|  T get() {
   74|  5.10k|    const auto Nbytes=sizeof(T);
   75|  5.10k|    T ret{};
   76|  5.10k|    if(Size<Nbytes) {
  ------------------
  |  Branch (76:8): [True: 0, False: 5.10k]
  ------------------
   77|       |      //don't throw, signal with null instead.
   78|      0|      Data=nullptr;
   79|      0|      Size=0;
   80|      0|      return ret;
   81|      0|    }
   82|  5.10k|    std::memcpy(&ret,Data,Nbytes);
   83|  5.10k|    Data+=Nbytes;
   84|  5.10k|    Size-=Nbytes;
   85|  5.10k|    return ret;
   86|  5.10k|  }

LLVMFuzzerTestOneInput:
    7|  5.10k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
    8|  5.10k|  FuzzData fd(Data, Size);
    9|  5.10k|  const int action = fd.getInt<0, 12>();
   10|       |
   11|       |  // split the remainder of the document into strings
   12|  5.10k|  auto strings = fd.splitIntoStrings();
   13|  5.10k|  while (strings.size() < 1) {
  ------------------
  |  Branch (13:10): [True: 2, False: 5.10k]
  ------------------
   14|      2|    strings.emplace_back();
   15|      2|  }
   16|  5.10k|#if SIMDJSON_EXCEPTIONS
   17|  5.10k|  try {
   18|  5.10k|#endif
   19|  5.10k|    simdjson::ondemand::parser parser;
   20|  5.10k|    simdjson::padded_string padded(strings[0]);
   21|  5.10k|    auto doc = parser.iterate(padded);
   22|  5.10k|    if (doc.error()) {
  ------------------
  |  Branch (22:9): [True: 1.24k, False: 3.86k]
  ------------------
   23|  1.24k|      return 0;
   24|  1.24k|    }
   25|  39.2k|    for (auto item : doc) {
  ------------------
  |  Branch (25:20): [True: 39.2k, False: 3.86k]
  ------------------
   26|  39.2k|      switch (action) {
   27|  2.00k|      case 0: {
  ------------------
  |  Branch (27:7): [True: 2.00k, False: 37.2k]
  ------------------
   28|  2.00k|        simdjson_unused auto x = item.get_string();
  ------------------
  |  |  113|  2.00k|  #define simdjson_unused __attribute__((unused))
  ------------------
   29|  2.00k|      } break;
   30|  1.01k|      case 1: {
  ------------------
  |  Branch (30:7): [True: 1.01k, False: 38.2k]
  ------------------
   31|  1.01k|        simdjson_unused auto x = item.get_bool();
  ------------------
  |  |  113|  1.01k|  #define simdjson_unused __attribute__((unused))
  ------------------
   32|  1.01k|      } break;
   33|  1.19k|      case 2: {
  ------------------
  |  Branch (33:7): [True: 1.19k, False: 38.0k]
  ------------------
   34|  1.19k|        simdjson_unused auto x = item.get_array();
  ------------------
  |  |  113|  1.19k|  #define simdjson_unused __attribute__((unused))
  ------------------
   35|  1.19k|      } break;
   36|  1.94k|      case 3: {
  ------------------
  |  Branch (36:7): [True: 1.94k, False: 37.3k]
  ------------------
   37|  1.94k|        simdjson_unused auto x = item.get_int64();
  ------------------
  |  |  113|  1.94k|  #define simdjson_unused __attribute__((unused))
  ------------------
   38|  1.94k|      } break;
   39|  22.3k|      case 4: {
  ------------------
  |  Branch (39:7): [True: 22.3k, False: 16.9k]
  ------------------
   40|  22.3k|        simdjson_unused auto x = item.get_double();
  ------------------
  |  |  113|  22.3k|  #define simdjson_unused __attribute__((unused))
  ------------------
   41|  22.3k|      } break;
   42|    859|      case 5: {
  ------------------
  |  Branch (42:7): [True: 859, False: 38.4k]
  ------------------
   43|    859|        simdjson_unused auto x = item.get_object();
  ------------------
  |  |  113|    859|  #define simdjson_unused __attribute__((unused))
  ------------------
   44|    859|      } break;
   45|  4.32k|      case 6: {
  ------------------
  |  Branch (45:7): [True: 4.32k, False: 34.9k]
  ------------------
   46|  4.32k|        simdjson_unused auto x = item.get_uint64();
  ------------------
  |  |  113|  4.32k|  #define simdjson_unused __attribute__((unused))
  ------------------
   47|  4.32k|      } break;
   48|    624|      case 7: {
  ------------------
  |  Branch (48:7): [True: 624, False: 38.6k]
  ------------------
   49|    624|        simdjson_unused auto x = item.get_raw_json_string();
  ------------------
  |  |  113|    624|  #define simdjson_unused __attribute__((unused))
  ------------------
   50|    624|      } break;
   51|    821|      case 8: {
  ------------------
  |  Branch (51:7): [True: 821, False: 38.4k]
  ------------------
   52|    821|        simdjson_unused auto x = item.is_null();
  ------------------
  |  |  113|    821|  #define simdjson_unused __attribute__((unused))
  ------------------
   53|    821|      } break;
   54|  1.00k|      case 9: {
  ------------------
  |  Branch (54:7): [True: 1.00k, False: 38.2k]
  ------------------
   55|  1.00k|        simdjson_unused auto x = item.begin();
  ------------------
  |  |  113|  1.00k|  #define simdjson_unused __attribute__((unused))
  ------------------
   56|  1.00k|      } break;
   57|    256|      case 10: {
  ------------------
  |  Branch (57:7): [True: 256, False: 39.0k]
  ------------------
   58|    256|        simdjson_unused auto x = item.end();
  ------------------
  |  |  113|    256|  #define simdjson_unused __attribute__((unused))
  ------------------
   59|    256|      } break;
   60|  2.49k|      case 11: {
  ------------------
  |  Branch (60:7): [True: 2.49k, False: 36.7k]
  ------------------
   61|  5.01k|        for (auto e : item) {
  ------------------
  |  Branch (61:21): [True: 5.01k, False: 2.49k]
  ------------------
   62|  5.01k|          simdjson_unused auto x = e.is_null();
  ------------------
  |  |  113|  5.01k|  #define simdjson_unused __attribute__((unused))
  ------------------
   63|  5.01k|        }
   64|  2.49k|      } break;
   65|    359|      default:;
  ------------------
  |  Branch (65:7): [True: 359, False: 38.9k]
  ------------------
   66|  39.2k|      }
   67|  39.2k|    }
   68|  3.86k|#if SIMDJSON_EXCEPTIONS
   69|  3.86k|  } catch (...) {
   70|      0|  }
   71|      0|#endif
   72|       |
   73|      0|  return 0;
   74|  5.10k|}

_ZN8simdjson15simdjson_resultIbEC2ENS_10error_codeE:
  175|  6.24k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2ENS_10error_codeE:
  107|  6.24k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EObNS_10error_codeE:
  104|  61.6k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIbEC2EOb:
  178|  55.4k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EOb:
  110|  55.4k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNO8simdjson15simdjson_resultIbE3getERb:
  127|  12.4k|simdjson_warn_unused simdjson_inline error_code simdjson_result<T>::get(T &value) && noexcept {
  128|  12.4k|  return std::forward<internal::simdjson_result_base<T>>(*this).get(value);
  129|  12.4k|}
_ZNO8simdjson8internal20simdjson_result_baseIbE3getERb:
   55|  12.4k|simdjson_warn_unused simdjson_inline error_code simdjson_result_base<T>::get(T &value) && noexcept {
   56|  12.4k|  error_code error;
   57|  12.4k|  std::forward<simdjson_result_base<T>>(*this).tie(value, error);
   58|  12.4k|  return error;
   59|  12.4k|}
_ZNO8simdjson8internal20simdjson_result_baseIbE3tieERbRNS_10error_codeE:
   47|  12.4k|simdjson_inline void simdjson_result_base<T>::tie(T &value, error_code &error) && noexcept {
   48|  12.4k|  error = this->second;
   49|  12.4k|  if (!error) {
  ------------------
  |  Branch (49:7): [True: 9.90k, False: 2.54k]
  ------------------
   50|  9.90k|    value = std::forward<simdjson_result_base<T>>(*this).first;
   51|  9.90k|  }
   52|  12.4k|}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2ENS_10error_codeE:
  175|  1.55k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2ENS_10error_codeE:
  107|  1.55k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_NS_10error_codeE:
  104|  2.00k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2EOS5_:
  178|    446|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_:
  110|    446|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultIbE5errorEv:
  132|  43.3k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  43.3k|  return internal::simdjson_result_base<T>::error();
  134|  43.3k|}
_ZNK8simdjson8internal20simdjson_result_baseIbE5errorEv:
   62|  43.3k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  43.3k|  return this->second;
   64|  43.3k|}
_ZN8simdjson15simdjson_resultIlEC2ENS_10error_codeE:
  175|  1.44k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2ENS_10error_codeE:
  107|  1.44k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2EOlNS_10error_codeE:
  104|  1.94k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIlEC2EOl:
  178|    507|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2EOl:
  110|    507|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultIlE5errorEv:
  132|  1.92k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  1.92k|  return internal::simdjson_result_base<T>::error();
  134|  1.92k|}
_ZNK8simdjson8internal20simdjson_result_baseIlE5errorEv:
   62|  1.92k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  1.92k|  return this->second;
   64|  1.92k|}
_ZN8simdjson15simdjson_resultIdEC2ENS_10error_codeE:
  175|  8.90k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2ENS_10error_codeE:
  107|  8.90k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2EOdNS_10error_codeE:
  104|  22.3k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIdEC2EOd:
  178|  13.4k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2EOd:
  110|  13.4k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultIdE5errorEv:
  132|  22.2k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  22.2k|  return internal::simdjson_result_base<T>::error();
  134|  22.2k|}
_ZNK8simdjson8internal20simdjson_result_baseIdE5errorEv:
   62|  22.2k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  22.2k|  return this->second;
   64|  22.2k|}
_ZN8simdjson15simdjson_resultImEC2ENS_10error_codeE:
  175|  2.45k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2ENS_10error_codeE:
  107|  2.45k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2EOmNS_10error_codeE:
  104|  4.32k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultImEC2EOm:
  178|  1.87k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2EOm:
  110|  1.87k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultImE5errorEv:
  132|  4.29k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  4.29k|  return internal::simdjson_result_base<T>::error();
  134|  4.29k|}
_ZNK8simdjson8internal20simdjson_result_baseImE5errorEv:
   62|  4.29k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  4.29k|  return this->second;
   64|  4.29k|}

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_114leading_zeroesEm:
   29|  4.27k|simdjson_inline int leading_zeroes(uint64_t input_num) {
   30|       |#ifdef _MSC_VER
   31|       |  unsigned long leading_zero = 0;
   32|       |  // Search the mask data from most significant bit (MSB)
   33|       |  // to least significant bit (LSB) for a set bit (1).
   34|       |  if (_BitScanReverse64(&leading_zero, input_num))
   35|       |    return (int)(63 - leading_zero);
   36|       |  else
   37|       |    return 64;
   38|       |#else
   39|  4.27k|  return __builtin_clzll(input_num);
   40|  4.27k|#endif// _MSC_VER
   41|  4.27k|}

_ZN8simdjson8fallback14implementationC2Ev:
   23|      1|  ) {}

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_111atomparsing8str4ncmpEPKhPKc:
   19|  6.12k|simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) {
   20|  6.12k|  uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++)
   21|  6.12k|  static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes");
   22|  6.12k|  std::memcpy(&srcval, src, sizeof(uint32_t));
   23|  6.12k|  return srcval ^ string_to_uint32(atom);
   24|  6.12k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_111atomparsing16string_to_uint32EPKc:
   13|  6.12k|simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; }

_ZN8simdjson7haswell25dom_parser_implementation12set_capacityEm:
   58|  5.10k|inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept {
   59|  5.10k|  if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; }
  ------------------
  |  Branch (59:6): [True: 0, False: 5.10k]
  ------------------
   60|       |  // Stage 1 index output
   61|  5.10k|  size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7;
  ------------------
  |  |   68|  5.10k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   62|  5.10k|  structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] );
   63|  5.10k|  if (!structural_indexes) { _capacity = 0; return MEMALLOC; }
  ------------------
  |  Branch (63:7): [True: 0, False: 5.10k]
  ------------------
   64|  5.10k|  structural_indexes[0] = 0;
   65|  5.10k|  n_structural_indexes = 0;
   66|       |
   67|  5.10k|  _capacity = capacity;
   68|  5.10k|  return SUCCESS;
   69|  5.10k|}
_ZN8simdjson7haswell25dom_parser_implementation13set_max_depthEm:
   71|  5.10k|inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept {
   72|       |  // Stage 2 stacks
   73|  5.10k|  open_containers.reset(new (std::nothrow) open_container[max_depth]);
   74|  5.10k|  is_array.reset(new (std::nothrow) bool[max_depth]);
   75|  5.10k|  if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; }
  ------------------
  |  Branch (75:7): [True: 0, False: 5.10k]
  |  Branch (75:20): [True: 0, False: 5.10k]
  ------------------
   76|       |
   77|  5.10k|  _max_depth = max_depth;
   78|  5.10k|  return SUCCESS;
   79|  5.10k|}
_ZN8simdjson7haswell25dom_parser_implementationC2Ev:
   53|  5.10k|inline dom_parser_implementation::dom_parser_implementation() noexcept = default;

_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEEC2ENS_10error_codeE:
   74|  1.24k|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEEC2EOS3_NS_10error_codeE:
   71|  5.10k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEEC2EOS3_:
   77|  3.86k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEEC2EOS3_NS_10error_codeE:
   71|  7.54k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEEC2ENS_10error_codeE:
   74|  2.14k|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEEC2EOS3_NS_10error_codeE:
   71|  8.32k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEEC2EOS3_:
   77|  6.18k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEE5errorEv:
   24|  8.88k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  8.88k|  return this->second;
   26|  8.88k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEEC2EOS3_:
   77|  5.39k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEE5errorEv:
   24|  93.3k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  93.3k|  return this->second;
   26|  93.3k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEEC2ENS_10error_codeE:
   74|  2.38k|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEEC2EOS3_NS_10error_codeE:
   71|  44.2k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEEC2EOS3_:
   77|  41.8k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEE5errorEv:
   24|  48.9k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  48.9k|  return this->second;
   26|  48.9k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEEC2ENS_10error_codeE:
   74|    760|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEEC2EOS3_NS_10error_codeE:
   71|  2.52k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEEC2EOS3_:
   77|  1.76k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEE5errorEv:
   24|  2.22k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  2.22k|  return this->second;
   26|  2.22k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand6objectEEC2ENS_10error_codeE:
   74|    370|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand6objectEEC2EOS3_NS_10error_codeE:
   71|    859|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand6objectEEC2EOS3_:
   77|    489|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEE5errorEv:
   24|  8.96k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  8.96k|  return this->second;
   26|  8.96k|}

_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEEC2Ev:
   33|  6.42k|  simdjson_inline implementation_simdjson_result_base() noexcept = default;

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113jsoncharutils31is_not_structural_or_whitespaceEh:
   11|  17.2k|simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) {
   12|  17.2k|  return internal::structural_or_whitespace_negated[c];
   13|  17.2k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113jsoncharutils19full_multiplicationEmm:
   95|  6.16k|simdjson_inline value128 full_multiplication(uint64_t value1, uint64_t value2) {
   96|  6.16k|  value128 answer;
   97|       |#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS
   98|       |#ifdef _M_ARM64
   99|       |  // ARM64 has native support for 64-bit multiplications, no need to emultate
  100|       |  answer.high = __umulh(value1, value2);
  101|       |  answer.low = value1 * value2;
  102|       |#else
  103|       |  answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64
  104|       |#endif // _M_ARM64
  105|       |#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS
  106|  6.16k|  __uint128_t r = (static_cast<__uint128_t>(value1)) * value2;
  107|  6.16k|  answer.low = uint64_t(r);
  108|  6.16k|  answer.high = uint64_t(r >> 64);
  109|  6.16k|#endif
  110|  6.16k|  return answer;
  111|  6.16k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113jsoncharutils27is_structural_or_whitespaceEh:
   15|    413|simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) {
   16|    413|  return internal::structural_or_whitespace[c];
   17|    413|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils18hex_to_u32_nocheckEPKh:
   26|  2.20k|    const uint8_t *src) { // strictly speaking, static inline is a C-ism
   27|  2.20k|  uint32_t v1 = internal::digit_to_val32[630 + src[0]];
   28|  2.20k|  uint32_t v2 = internal::digit_to_val32[420 + src[1]];
   29|  2.20k|  uint32_t v3 = internal::digit_to_val32[210 + src[2]];
   30|  2.20k|  uint32_t v4 = internal::digit_to_val32[0 + src[3]];
   31|  2.20k|  return v1 | v2 | v3 | v4;
   32|  2.20k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils17codepoint_to_utf8EjPh:
   46|  1.06k|simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) {
   47|  1.06k|  if (cp <= 0x7F) {
  ------------------
  |  Branch (47:7): [True: 197, False: 870]
  ------------------
   48|    197|    c[0] = uint8_t(cp);
   49|    197|    return 1; // ascii
   50|    197|  }
   51|    870|  if (cp <= 0x7FF) {
  ------------------
  |  Branch (51:7): [True: 207, False: 663]
  ------------------
   52|    207|    c[0] = uint8_t((cp >> 6) + 192);
   53|    207|    c[1] = uint8_t((cp & 63) + 128);
   54|    207|    return 2; // universal plane
   55|       |    //  Surrogates are treated elsewhere...
   56|       |    //} //else if (0xd800 <= cp && cp <= 0xdfff) {
   57|       |    //  return 0; // surrogates // could put assert here
   58|    663|  } else if (cp <= 0xFFFF) {
  ------------------
  |  Branch (58:14): [True: 240, False: 423]
  ------------------
   59|    240|    c[0] = uint8_t((cp >> 12) + 224);
   60|    240|    c[1] = uint8_t(((cp >> 6) & 63) + 128);
   61|    240|    c[2] = uint8_t((cp & 63) + 128);
   62|    240|    return 3;
   63|    423|  } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this
  ------------------
  |  Branch (63:14): [True: 224, False: 199]
  ------------------
   64|       |                               // is not needed
   65|    224|    c[0] = uint8_t((cp >> 18) + 240);
   66|    224|    c[1] = uint8_t(((cp >> 12) & 63) + 128);
   67|    224|    c[2] = uint8_t(((cp >> 6) & 63) + 128);
   68|    224|    c[3] = uint8_t((cp & 63) + 128);
   69|    224|    return 4;
   70|    224|  }
   71|       |  // will return 0 when the code point was too large.
   72|    199|  return 0; // bad r
   73|    870|}

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_113parse_integerEPKh:
  845|  1.92k|simdjson_unused simdjson_inline simdjson_result<int64_t> parse_integer(const uint8_t *src) noexcept {
  846|       |  //
  847|       |  // Check for minus sign
  848|       |  //
  849|  1.92k|  bool negative = (*src == '-');
  850|  1.92k|  const uint8_t *p = src + uint8_t(negative);
  851|       |
  852|       |  //
  853|       |  // Parse the integer part.
  854|       |  //
  855|       |  // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare
  856|  1.92k|  const uint8_t *const start_digits = p;
  857|  1.92k|  uint64_t i = 0;
  858|  2.24M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (858:10): [True: 2.24M, False: 1.92k]
  ------------------
  859|       |
  860|       |  // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error.
  861|       |  // Optimization note: size_t is expected to be unsigned.
  862|  1.92k|  size_t digit_count = size_t(p - start_digits);
  863|       |  // We go from
  864|       |  // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
  865|       |  // so we can never represent numbers that have more than 19 digits.
  866|  1.92k|  size_t longest_digit_count = 19;
  867|       |  // Optimization note: the compiler can probably merge
  868|       |  // ((digit_count == 0) || (digit_count > longest_digit_count))
  869|       |  // into a single  branch since digit_count is unsigned.
  870|  1.92k|  if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (870:7): [True: 438, False: 1.48k]
  |  Branch (870:29): [True: 315, False: 1.16k]
  ------------------
  871|       |  // Here digit_count > 0.
  872|  1.16k|  if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (872:7): [True: 464, False: 704]
  |  Branch (872:33): [True: 201, False: 263]
  ------------------
  873|       |  // We can do the following...
  874|       |  // if (!jsoncharutils::is_structural_or_whitespace(*p)) {
  875|       |  //  return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR;
  876|       |  // }
  877|       |  // as a single table lookup:
  878|    967|  if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); }
  ------------------
  |  Branch (878:6): [True: 211, False: 756]
  ------------------
  879|       |  // Negative numbers have can go down to - INT64_MAX - 1 whereas positive numbers are limited to INT64_MAX.
  880|       |  // Performance note: This check is only needed when digit_count == longest_digit_count but it is
  881|       |  // so cheap that we might as well always make it.
  882|    756|  if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (882:6): [True: 249, False: 507]
  ------------------
  883|    507|  return negative ? (~i+1) : i;
  ------------------
  |  Branch (883:10): [True: 31, False: 476]
  ------------------
  884|    756|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing11parse_digitImEEbhRT_:
  365|  18.9M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  366|  18.9M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  367|  18.9M|  if (digit > 9) {
  ------------------
  |  Branch (367:7): [True: 46.1k, False: 18.8M]
  ------------------
  368|  46.1k|    return false;
  369|  46.1k|  }
  370|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  371|  18.8M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  372|  18.8M|  return true;
  373|  18.9M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_112parse_doubleEPKh:
  972|  22.2k|simdjson_unused simdjson_inline simdjson_result<double> parse_double(const uint8_t * src) noexcept {
  973|       |  //
  974|       |  // Check for minus sign
  975|       |  //
  976|  22.2k|  bool negative = (*src == '-');
  977|  22.2k|  src += uint8_t(negative);
  978|       |
  979|       |  //
  980|       |  // Parse the integer part.
  981|       |  //
  982|  22.2k|  uint64_t i = 0;
  983|  22.2k|  const uint8_t *p = src;
  984|  22.2k|  p += parse_digit(*p, i);
  985|  22.2k|  bool leading_zero = (i == 0);
  986|  13.4M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (986:10): [True: 13.4M, False: 22.2k]
  ------------------
  987|       |  // no integer digits, or 0123 (zero must be solo)
  988|  22.2k|  if ( p == src ) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (988:8): [True: 3.02k, False: 19.2k]
  ------------------
  989|  19.2k|  if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (989:9): [True: 5.04k, False: 14.1k]
  |  Branch (989:25): [True: 909, False: 4.13k]
  ------------------
  990|       |
  991|       |  //
  992|       |  // Parse the decimal part.
  993|       |  //
  994|  18.3k|  int64_t exponent = 0;
  995|  18.3k|  bool overflow;
  996|  18.3k|  if (simdjson_likely(*p == '.')) {
  ------------------
  |  |  117|  18.3k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 6.49k, False: 11.8k]
  |  |  ------------------
  ------------------
  997|  6.49k|    p++;
  998|  6.49k|    const uint8_t *start_decimal_digits = p;
  999|  6.49k|    if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits
  ------------------
  |  Branch (999:9): [True: 295, False: 6.19k]
  ------------------
 1000|  6.19k|    p++;
 1001|  1.23M|    while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (1001:12): [True: 1.22M, False: 6.19k]
  ------------------
 1002|  6.19k|    exponent = -(p - start_decimal_digits);
 1003|       |
 1004|       |    // Overflow check. More than 19 digits (minus the decimal) may be overflow.
 1005|  6.19k|    overflow = p-src-1 > 19;
 1006|  6.19k|    if (simdjson_unlikely(overflow && leading_zero)) {
  ------------------
  |  |  120|  8.01k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 861, False: 5.33k]
  |  |  |  Branch (120:52): [True: 1.81k, False: 4.38k]
  |  |  |  Branch (120:52): [True: 861, False: 955]
  |  |  ------------------
  ------------------
 1007|       |      // Skip leading 0.00000 and see if it still overflows
 1008|    861|      const uint8_t *start_digits = src + 2;
 1009|   538k|      while (*start_digits == '0') { start_digits++; }
  ------------------
  |  Branch (1009:14): [True: 537k, False: 861]
  ------------------
 1010|    861|      overflow = start_digits-src > 19;
 1011|    861|    }
 1012|  11.8k|  } else {
 1013|  11.8k|    overflow = p-src > 19;
 1014|  11.8k|  }
 1015|       |
 1016|       |  //
 1017|       |  // Parse the exponent
 1018|       |  //
 1019|  18.0k|  if (*p == 'e' || *p == 'E') {
  ------------------
  |  Branch (1019:7): [True: 2.90k, False: 15.1k]
  |  Branch (1019:20): [True: 5.26k, False: 9.87k]
  ------------------
 1020|  8.16k|    p++;
 1021|  8.16k|    bool exp_neg = *p == '-';
 1022|  8.16k|    p += exp_neg || *p == '+';
  ------------------
  |  Branch (1022:10): [True: 2.02k, False: 6.13k]
  |  Branch (1022:21): [True: 202, False: 5.93k]
  ------------------
 1023|       |
 1024|  8.16k|    uint64_t exp = 0;
 1025|  8.16k|    const uint8_t *start_exp_digits = p;
 1026|  1.23M|    while (parse_digit(*p, exp)) { p++; }
  ------------------
  |  Branch (1026:12): [True: 1.22M, False: 8.16k]
  ------------------
 1027|       |    // no exp digits, or 20+ exp digits
 1028|  8.16k|    if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; }
  ------------------
  |  Branch (1028:9): [True: 895, False: 7.26k]
  |  Branch (1028:36): [True: 229, False: 7.04k]
  ------------------
 1029|       |
 1030|  7.04k|    exponent += exp_neg ? 0-exp : exp;
  ------------------
  |  Branch (1030:17): [True: 1.82k, False: 5.21k]
  ------------------
 1031|  7.04k|  }
 1032|       |
 1033|  16.9k|  if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (1033:7): [True: 1.62k, False: 15.2k]
  ------------------
 1034|       |
 1035|  15.2k|  overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power;
  ------------------
  |  Branch (1035:14): [True: 4.75k, False: 10.5k]
  |  Branch (1035:26): [True: 894, False: 9.63k]
  |  Branch (1035:75): [True: 2.26k, False: 7.37k]
  ------------------
 1036|       |
 1037|       |  //
 1038|       |  // Assemble (or slow-parse) the float
 1039|       |  //
 1040|  15.2k|  double d;
 1041|  15.2k|  if (simdjson_likely(!overflow)) {
  ------------------
  |  |  117|  15.2k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 7.37k, False: 7.91k]
  |  |  ------------------
  ------------------
 1042|  7.37k|    if (compute_float_64(exponent, i, negative, d)) { return d; }
  ------------------
  |  Branch (1042:9): [True: 6.86k, False: 506]
  ------------------
 1043|  7.37k|  }
 1044|  8.41k|  if (!parse_float_fallback(src - uint8_t(negative), &d)) {
  ------------------
  |  Branch (1044:7): [True: 1.82k, False: 6.59k]
  ------------------
 1045|  1.82k|    return NUMBER_ERROR;
 1046|  1.82k|  }
 1047|  6.59k|  return d;
 1048|  8.41k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing16compute_float_64ElmbRd:
   55|  7.37k|simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) {
   56|       |  // we start with a fast path
   57|       |  // It was described in
   58|       |  // Clinger WD. How to read floating point numbers accurately.
   59|       |  // ACM SIGPLAN Notices. 1990
   60|       |#ifndef FLT_EVAL_METHOD
   61|       |#error "FLT_EVAL_METHOD should be defined, please include cfloat."
   62|       |#endif
   63|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
   64|       |  // We cannot be certain that x/y is rounded to nearest.
   65|       |  if (0 <= power && power <= 22 && i <= 9007199254740991) {
   66|       |#else
   67|  7.37k|  if (-22 <= power && power <= 22 && i <= 9007199254740991) {
  ------------------
  |  Branch (67:7): [True: 6.83k, False: 536]
  |  Branch (67:23): [True: 4.72k, False: 2.11k]
  |  Branch (67:38): [True: 2.86k, False: 1.85k]
  ------------------
   68|  2.86k|#endif
   69|       |    // convert the integer into a double. This is lossless since
   70|       |    // 0 <= i <= 2^53 - 1.
   71|  2.86k|    d = double(i);
   72|       |    //
   73|       |    // The general idea is as follows.
   74|       |    // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then
   75|       |    // 1) Both s and p can be represented exactly as 64-bit floating-point
   76|       |    // values
   77|       |    // (binary64).
   78|       |    // 2) Because s and p can be represented exactly as floating-point values,
   79|       |    // then s * p
   80|       |    // and s / p will produce correctly rounded values.
   81|       |    //
   82|  2.86k|    if (power < 0) {
  ------------------
  |  Branch (82:9): [True: 633, False: 2.23k]
  ------------------
   83|    633|      d = d / simdjson::internal::power_of_ten[-power];
   84|  2.23k|    } else {
   85|  2.23k|      d = d * simdjson::internal::power_of_ten[power];
   86|  2.23k|    }
   87|  2.86k|    if (negative) {
  ------------------
  |  Branch (87:9): [True: 1, False: 2.86k]
  ------------------
   88|      1|      d = -d;
   89|      1|    }
   90|  2.86k|    return true;
   91|  2.86k|  }
   92|       |  // When 22 < power && power <  22 + 16, we could
   93|       |  // hope for another, secondary fast path.  It was
   94|       |  // described by David M. Gay in  "Correctly rounded
   95|       |  // binary-decimal and decimal-binary conversions." (1990)
   96|       |  // If you need to compute i * 10^(22 + x) for x < 16,
   97|       |  // first compute i * 10^x, if you know that result is exact
   98|       |  // (e.g., when i * 10^x < 2^53),
   99|       |  // then you can still proceed and do (i * 10^x) * 10^22.
  100|       |  // Is this worth your time?
  101|       |  // You need  22 < power *and* power <  22 + 16 *and* (i * 10^(x-22) < 2^53)
  102|       |  // for this second fast path to work.
  103|       |  // If you you have 22 < power *and* power <  22 + 16, and then you
  104|       |  // optimistically compute "i * 10^(x-22)", there is still a chance that you
  105|       |  // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of
  106|       |  // this optimization maybe less common than we would like. Source:
  107|       |  // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/
  108|       |  // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html
  109|       |
  110|       |  // The fast path has now failed, so we are failing back on the slower path.
  111|       |
  112|       |  // In the slow path, we need to adjust i so that it is > 1<<63 which is always
  113|       |  // possible, except if i == 0, so we handle i == 0 separately.
  114|  4.50k|  if(i == 0) {
  ------------------
  |  Branch (114:6): [True: 230, False: 4.27k]
  ------------------
  115|    230|    d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (115:9): [True: 0, False: 230]
  ------------------
  116|    230|    return true;
  117|    230|  }
  118|       |
  119|       |
  120|       |  // The exponent is 1024 + 63 + power
  121|       |  //     + floor(log(5**power)/log(2)).
  122|       |  // The 1024 comes from the ieee64 standard.
  123|       |  // The 63 comes from the fact that we use a 64-bit word.
  124|       |  //
  125|       |  // Computing floor(log(5**power)/log(2)) could be
  126|       |  // slow. Instead we use a fast function.
  127|       |  //
  128|       |  // For power in (-400,350), we have that
  129|       |  // (((152170 + 65536) * power ) >> 16);
  130|       |  // is equal to
  131|       |  //  floor(log(5**power)/log(2)) + power when power >= 0
  132|       |  // and it is equal to
  133|       |  //  ceil(log(5**-power)/log(2)) + power when power < 0
  134|       |  //
  135|       |  // The 65536 is (1<<16) and corresponds to
  136|       |  // (65536 * power) >> 16 ---> power
  137|       |  //
  138|       |  // ((152170 * power ) >> 16) is equal to
  139|       |  // floor(log(5**power)/log(2))
  140|       |  //
  141|       |  // Note that this is not magic: 152170/(1<<16) is
  142|       |  // approximatively equal to log(5)/log(2).
  143|       |  // The 1<<16 value is a power of two; we could use a
  144|       |  // larger power of 2 if we wanted to.
  145|       |  //
  146|  4.27k|  int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63;
  147|       |
  148|       |
  149|       |  // We want the most significant bit of i to be 1. Shift if needed.
  150|  4.27k|  int lz = leading_zeroes(i);
  151|  4.27k|  i <<= lz;
  152|       |
  153|       |
  154|       |  // We are going to need to do some 64-bit arithmetic to get a precise product.
  155|       |  // We use a table lookup approach.
  156|       |  // It is safe because
  157|       |  // power >= smallest_power
  158|       |  // and power <= largest_power
  159|       |  // We recover the mantissa of the power, it has a leading 1. It is always
  160|       |  // rounded down.
  161|       |  //
  162|       |  // We want the most significant 64 bits of the product. We know
  163|       |  // this will be non-zero because the most significant bit of i is
  164|       |  // 1.
  165|  4.27k|  const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power);
  166|       |  // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.)
  167|       |  //
  168|       |  // The full_multiplication function computes the 128-bit product of two 64-bit words
  169|       |  // with a returned value of type value128 with a "low component" corresponding to the
  170|       |  // 64-bit least significant bits of the product and with a "high component" corresponding
  171|       |  // to the 64-bit most significant bits of the product.
  172|  4.27k|  simdjson::internal::value128 firstproduct = jsoncharutils::full_multiplication(i, simdjson::internal::power_of_five_128[index]);
  173|       |  // Both i and power_of_five_128[index] have their most significant bit set to 1 which
  174|       |  // implies that the either the most or the second most significant bit of the product
  175|       |  // is 1. We pack values in this manner for efficiency reasons: it maximizes the use
  176|       |  // we make of the product. It also makes it easy to reason about the product: there
  177|       |  // is 0 or 1 leading zero in the product.
  178|       |
  179|       |  // Unless the least significant 9 bits of the high (64-bit) part of the full
  180|       |  // product are all 1s, then we know that the most significant 55 bits are
  181|       |  // exact and no further work is needed. Having 55 bits is necessary because
  182|       |  // we need 53 bits for the mantissa but we have to have one rounding bit and
  183|       |  // we can waste a bit if the most significant bit of the product is zero.
  184|  4.27k|  if((firstproduct.high & 0x1FF) == 0x1FF) {
  ------------------
  |  Branch (184:6): [True: 1.88k, False: 2.38k]
  ------------------
  185|       |    // We want to compute i * 5^q, but only care about the top 55 bits at most.
  186|       |    // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing
  187|       |    // the full computation is wasteful. So we do what is called a "truncated
  188|       |    // multiplication".
  189|       |    // We take the most significant 64-bits, and we put them in
  190|       |    // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q
  191|       |    // to the desired approximation using one multiplication. Sometimes it does not suffice.
  192|       |    // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and
  193|       |    // then we get a better approximation to i * 5^q. In very rare cases, even that
  194|       |    // will not suffice, though it is seemingly very hard to find such a scenario.
  195|       |    //
  196|       |    // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat
  197|       |    // more complicated.
  198|       |    //
  199|       |    // There is an extra layer of complexity in that we need more than 55 bits of
  200|       |    // accuracy in the round-to-even scenario.
  201|       |    //
  202|       |    // The full_multiplication function computes the 128-bit product of two 64-bit words
  203|       |    // with a returned value of type value128 with a "low component" corresponding to the
  204|       |    // 64-bit least significant bits of the product and with a "high component" corresponding
  205|       |    // to the 64-bit most significant bits of the product.
  206|  1.88k|    simdjson::internal::value128 secondproduct = jsoncharutils::full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]);
  207|  1.88k|    firstproduct.low += secondproduct.high;
  208|  1.88k|    if(secondproduct.high > firstproduct.low) { firstproduct.high++; }
  ------------------
  |  Branch (208:8): [True: 1.53k, False: 351]
  ------------------
  209|       |    // At this point, we might need to add at most one to firstproduct, but this
  210|       |    // can only change the value of firstproduct.high if firstproduct.low is maximal.
  211|  1.88k|    if(simdjson_unlikely(firstproduct.low  == 0xFFFFFFFFFFFFFFFF)) {
  ------------------
  |  |  120|  1.88k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 1.88k]
  |  |  ------------------
  ------------------
  212|       |      // This is very unlikely, but if so, we need to do much more work!
  213|      0|      return false;
  214|      0|    }
  215|  1.88k|  }
  216|  4.27k|  uint64_t lower = firstproduct.low;
  217|  4.27k|  uint64_t upper = firstproduct.high;
  218|       |  // The final mantissa should be 53 bits with a leading 1.
  219|       |  // We shift it so that it occupies 54 bits with a leading 1.
  220|       |  ///////
  221|  4.27k|  uint64_t upperbit = upper >> 63;
  222|  4.27k|  uint64_t mantissa = upper >> (upperbit + 9);
  223|  4.27k|  lz += int(1 ^ upperbit);
  224|       |
  225|       |  // Here we have mantissa < (1<<54).
  226|  4.27k|  int64_t real_exponent = exponent - lz;
  227|  4.27k|  if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal?
  ------------------
  |  |  120|  4.27k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 244, False: 4.03k]
  |  |  ------------------
  ------------------
  228|       |    // Here have that real_exponent <= 0 so -real_exponent >= 0
  229|    244|    if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure.
  ------------------
  |  Branch (229:8): [True: 211, False: 33]
  ------------------
  230|    211|      d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (230:11): [True: 0, False: 211]
  ------------------
  231|    211|      return true;
  232|    211|    }
  233|       |    // next line is safe because -real_exponent + 1 < 0
  234|     33|    mantissa >>= -real_exponent + 1;
  235|       |    // Thankfully, we can't have both "round-to-even" and subnormals because
  236|       |    // "round-to-even" only occurs for powers close to 0.
  237|     33|    mantissa += (mantissa & 1); // round up
  238|     33|    mantissa >>= 1;
  239|       |    // There is a weird scenario where we don't have a subnormal but just.
  240|       |    // Suppose we start with 2.2250738585072013e-308, we end up
  241|       |    // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal
  242|       |    // whereas 0x40000000000000 x 2^-1023-53  is normal. Now, we need to round
  243|       |    // up 0x3fffffffffffff x 2^-1023-53  and once we do, we are no longer
  244|       |    // subnormal, but we can only know this after rounding.
  245|       |    // So we only declare a subnormal if we are smaller than the threshold.
  246|     33|    real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1;
  ------------------
  |  Branch (246:21): [True: 33, False: 0]
  ------------------
  247|     33|    d = to_double(mantissa, real_exponent, negative);
  248|     33|    return true;
  249|    244|  }
  250|       |  // We have to round to even. The "to even" part
  251|       |  // is only a problem when we are right in between two floats
  252|       |  // which we guard against.
  253|       |  // If we have lots of trailing zeros, we may fall right between two
  254|       |  // floating-point values.
  255|       |  //
  256|       |  // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54]
  257|       |  // times a power of two. That is, it is right between a number with binary significand
  258|       |  // m and another number with binary significand m+1; and it must be the case
  259|       |  // that it cannot be represented by a float itself.
  260|       |  //
  261|       |  // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p.
  262|       |  // Recall that 10^q = 5^q * 2^q.
  263|       |  // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that
  264|       |  //  5^23 <=  2^54 and it is the last power of five to qualify, so q <= 23.
  265|       |  // When q<0, we have  w  >=  (2m+1) x 5^{-q}.  We must have that w<2^{64} so
  266|       |  // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have
  267|       |  // 2^{53} x 5^{-q} < 2^{64}.
  268|       |  // Hence we have 5^{-q} < 2^{11}$ or q>= -4.
  269|       |  //
  270|       |  // We require lower <= 1 and not lower == 0 because we could not prove that
  271|       |  // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test.
  272|  4.03k|  if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) {
  ------------------
  |  |  120|  18.7k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 490, False: 3.54k]
  |  |  |  Branch (120:52): [True: 2.42k, False: 1.60k]
  |  |  |  Branch (120:52): [True: 2.21k, False: 212]
  |  |  |  Branch (120:52): [True: 1.99k, False: 221]
  |  |  |  Branch (120:52): [True: 490, False: 1.50k]
  |  |  ------------------
  ------------------
  273|    490|    if((mantissa  << (upperbit + 64 - 53 - 2)) ==  upper) {
  ------------------
  |  Branch (273:8): [True: 282, False: 208]
  ------------------
  274|    282|      mantissa &= ~1;             // flip it so that we do not round up
  275|    282|    }
  276|    490|  }
  277|       |
  278|  4.03k|  mantissa += mantissa & 1;
  279|  4.03k|  mantissa >>= 1;
  280|       |
  281|       |  // Here we have mantissa < (1<<53), unless there was an overflow
  282|  4.03k|  if (mantissa >= (1ULL << 53)) {
  ------------------
  |  Branch (282:7): [True: 1.24k, False: 2.78k]
  ------------------
  283|       |    //////////
  284|       |    // This will happen when parsing values such as 7.2057594037927933e+16
  285|       |    ////////
  286|  1.24k|    mantissa = (1ULL << 52);
  287|  1.24k|    real_exponent++;
  288|  1.24k|  }
  289|  4.03k|  mantissa &= ~(1ULL << 52);
  290|       |  // we have to check that real_exponent is in range, otherwise we bail out
  291|  4.03k|  if (simdjson_unlikely(real_exponent > 2046)) {
  ------------------
  |  |  120|  4.03k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 506, False: 3.52k]
  |  |  ------------------
  ------------------
  292|       |    // We have an infinite value!!! We could actually throw an error here if we could.
  293|    506|    return false;
  294|    506|  }
  295|  3.52k|  d = to_double(mantissa, real_exponent, negative);
  296|  3.52k|  return true;
  297|  4.03k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_19to_doubleEmmb:
   40|  3.55k|simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) {
   41|  3.55k|    double d;
   42|  3.55k|    mantissa &= ~(1ULL << 52);
   43|  3.55k|    mantissa |= real_exponent << 52;
   44|  3.55k|    mantissa |= ((static_cast<uint64_t>(negative)) << 63);
   45|  3.55k|    std::memcpy(&d, &mantissa, sizeof(d));
   46|  3.55k|    return d;
   47|  3.55k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing20parse_float_fallbackEPKhPd:
  306|  8.41k|static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) {
  307|  8.41k|  *outDouble = simdjson::internal::from_chars(reinterpret_cast<const char *>(ptr));
  308|       |  // We do not accept infinite values.
  309|       |
  310|       |  // Detecting finite values in a portable manner is ridiculously hard, ideally
  311|       |  // we would want to do:
  312|       |  // return !std::isfinite(*outDouble);
  313|       |  // but that mysteriously fails under legacy/old libc++ libraries, see
  314|       |  // https://github.com/simdjson/simdjson/issues/1286
  315|       |  //
  316|       |  // Therefore, fall back to this solution (the extra parens are there
  317|       |  // to handle that max may be a macro on windows).
  318|  8.41k|  return !(*outDouble > (std::numeric_limits<double>::max)() || *outDouble < std::numeric_limits<double>::lowest());
  ------------------
  |  Branch (318:12): [True: 1.63k, False: 6.78k]
  |  Branch (318:65): [True: 191, False: 6.59k]
  ------------------
  319|  8.41k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_114parse_unsignedEPKh:
  697|  4.29k|simdjson_unused simdjson_inline simdjson_result<uint64_t> parse_unsigned(const uint8_t * const src) noexcept {
  698|  4.29k|  const uint8_t *p = src;
  699|       |  //
  700|       |  // Parse the integer part.
  701|       |  //
  702|       |  // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare
  703|  4.29k|  const uint8_t *const start_digits = p;
  704|  4.29k|  uint64_t i = 0;
  705|   742k|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (705:10): [True: 738k, False: 4.29k]
  ------------------
  706|       |
  707|       |  // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error.
  708|       |  // Optimization note: size_t is expected to be unsigned.
  709|  4.29k|  size_t digit_count = size_t(p - start_digits);
  710|       |  // The longest positive 64-bit number is 20 digits.
  711|       |  // We do it this way so we don't trigger this branch unless we must.
  712|       |  // Optimization note: the compiler can probably merge
  713|       |  // ((digit_count == 0) || (digit_count > 20))
  714|       |  // into a single  branch since digit_count is unsigned.
  715|  4.29k|  if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (715:7): [True: 295, False: 3.99k]
  |  Branch (715:29): [True: 381, False: 3.61k]
  ------------------
  716|       |  // Here digit_count > 0.
  717|  3.61k|  if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (717:7): [True: 633, False: 2.98k]
  |  Branch (717:33): [True: 337, False: 296]
  ------------------
  718|       |  // We can do the following...
  719|       |  // if (!jsoncharutils::is_structural_or_whitespace(*p)) {
  720|       |  //  return (*p == '.' || *p == 'e' || *p == 'E') ? INCORRECT_TYPE : NUMBER_ERROR;
  721|       |  // }
  722|       |  // as a single table lookup:
  723|  3.28k|  if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); }
  ------------------
  |  Branch (723:7): [True: 971, False: 2.30k]
  ------------------
  724|       |
  725|  2.30k|  if (digit_count == 20) {
  ------------------
  |  Branch (725:7): [True: 1.76k, False: 546]
  ------------------
  726|       |    // Positive overflow check:
  727|       |    // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the
  728|       |    //   biggest uint64_t.
  729|       |    // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX.
  730|       |    //   If we got here, it's a 20 digit number starting with the digit "1".
  731|       |    // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller
  732|       |    //   than 1,553,255,926,290,448,384.
  733|       |    // - That is smaller than the smallest possible 20-digit number the user could write:
  734|       |    //   10,000,000,000,000,000,000.
  735|       |    // - Therefore, if the number is positive and lower than that, it's overflow.
  736|       |    // - The value we are looking at is less than or equal to INT64_MAX.
  737|       |    //
  738|  1.76k|    if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (738:9): [True: 196, False: 1.56k]
  |  Branch (738:35): [True: 241, False: 1.32k]
  ------------------
  739|  1.76k|  }
  740|       |
  741|  1.87k|  return i;
  742|  2.30k|}

_ZN8simdjson8fallback8ondemand5array10start_rootERNS1_14value_iteratorE:
   55|  3.86k|simdjson_inline simdjson_result<array> array::start_root(value_iterator &iter) noexcept {
   56|  3.86k|  simdjson_unused bool has_value;
  ------------------
  |  |  113|  3.86k|  #define simdjson_unused __attribute__((unused))
  ------------------
   57|  3.86k|  SIMDJSON_TRY( iter.start_root_array().get(has_value) );
  ------------------
  |  |  279|  3.86k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 177, False: 3.68k]
  |  |  ------------------
  ------------------
   58|  3.68k|  return array(iter);
   59|  3.86k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5arrayEEC2ENS_10error_codeE:
  181|  2.14k|{
  182|  2.14k|}
_ZN8simdjson8fallback8ondemand5arrayC2ERKNS1_14value_iteratorE:
   45|  6.18k|{
   46|  6.18k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5arrayEEC2EOS3_:
  175|  6.18k|{
  176|  6.18k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5arrayEE5beginEv:
  184|  7.13k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array>::begin() noexcept {
  185|  7.13k|  if (error()) { return error(); }
  ------------------
  |  Branch (185:7): [True: 1.74k, False: 5.39k]
  ------------------
  186|  5.39k|  return first.begin();
  187|  7.13k|}
_ZN8simdjson8fallback8ondemand5array5beginEv:
   66|  5.39k|simdjson_inline simdjson_result<array_iterator> array::begin() noexcept {
   67|       |#if SIMDJSON_DEVELOPMENT_CHECKS
   68|       |  if (!iter.is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; }
   69|       |#endif
   70|  5.39k|  return array_iterator(iter);
   71|  5.39k|}
_ZN8simdjson8fallback8ondemand5array5startERNS1_14value_iteratorE:
   48|  4.38k|simdjson_inline simdjson_result<array> array::start(value_iterator &iter) noexcept {
   49|       |  // We don't need to know if the array is empty to start iteration, but we do want to know if there
   50|       |  // is an error--thus `simdjson_unused`.
   51|  4.38k|  simdjson_unused bool has_value;
  ------------------
  |  |  113|  4.38k|  #define simdjson_unused __attribute__((unused))
  ------------------
   52|  4.38k|  SIMDJSON_TRY( iter.start_array().get(has_value) );
  ------------------
  |  |  279|  4.38k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 1.89k, False: 2.49k]
  |  |  ------------------
  ------------------
   53|  2.49k|  return array(iter);
   54|  4.38k|}

_ZN8simdjson8fallback8ondemand5arrayC2Ev:
   20|  2.14k|  simdjson_inline array() noexcept = default;

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEC2ENS_10error_codeE:
   44|  2.15k|{
   45|  2.15k|}
_ZN8simdjson8fallback8ondemand14array_iteratorC2ERKNS1_14value_iteratorE:
    7|  5.39k|{}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEC2EOS3_:
   39|  5.39k|{
   40|  5.39k|  first.iter.assert_is_valid();
   41|  5.39k|}
_ZNK8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEneERKS4_:
   55|  50.6k|simdjson_inline bool simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator!=(const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &other) const noexcept {
   56|  50.6k|  if (!first.iter.is_valid()) { return error(); }
  ------------------
  |  Branch (56:7): [True: 3.19k, False: 47.4k]
  ------------------
   57|  47.4k|  return first != other.first;
   58|  50.6k|}
_ZNK8simdjson8fallback8ondemand14array_iteratorneERKS2_:
   16|  47.4k|simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept {
   17|  47.4k|  return iter.is_open();
   18|  47.4k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEdeEv:
   47|  44.2k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator*() noexcept {
   48|  44.2k|  if (error()) { return error(); }
  ------------------
  |  Branch (48:7): [True: 1.59k, False: 42.6k]
  ------------------
   49|  42.6k|  return *first;
   50|  44.2k|}
_ZN8simdjson8fallback8ondemand14array_iteratordeEv:
    9|  42.6k|simdjson_inline simdjson_result<value> array_iterator::operator*() noexcept {
   10|  42.6k|  if (iter.error()) { iter.abandon(); return iter.error(); }
  ------------------
  |  Branch (10:7): [True: 793, False: 41.8k]
  ------------------
   11|  41.8k|  return value(iter.child());
   12|  42.6k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEppEv:
   59|  44.2k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator++() noexcept {
   60|       |  // Clear the error if there is one, so we don't yield it twice
   61|  44.2k|  if (error()) { second = SUCCESS; return *this; }
  ------------------
  |  Branch (61:7): [True: 1.59k, False: 42.6k]
  ------------------
   62|  42.6k|  ++(first);
   63|  42.6k|  return *this;
   64|  44.2k|}
_ZN8simdjson8fallback8ondemand14array_iteratorppEv:
   19|  42.6k|simdjson_inline array_iterator &array_iterator::operator++() noexcept {
   20|  42.6k|  error_code error;
   21|       |  // PERF NOTE this is a safety rail ... users should exit loops as soon as they receive an error, so we'll never get here.
   22|       |  // However, it does not seem to make a perf difference, so we add it out of an abundance of caution.
   23|  42.6k|  if (( error = iter.error() )) { return *this; }
  ------------------
  |  Branch (23:7): [True: 969, False: 41.7k]
  ------------------
   24|  41.7k|  if (( error = iter.skip_child() )) { return *this; }
  ------------------
  |  Branch (24:7): [True: 135, False: 41.5k]
  ------------------
   25|  41.5k|  if (( error = iter.has_next_element().error() )) { return *this; }
  ------------------
  |  Branch (25:7): [True: 658, False: 40.9k]
  ------------------
   26|  40.9k|  return *this;
   27|  41.5k|}

_ZN8simdjson8fallback8ondemand14array_iteratorC2Ev:
   22|  8.57k|  simdjson_inline array_iterator() noexcept = default;
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEC2Ev:
   78|  6.42k|  simdjson_inline simdjson_result() noexcept = default;

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand8documentEEC2ENS_10error_codeE:
  298|  1.24k|{
  299|  1.24k|}
_ZN8simdjson8fallback8ondemand8document5startEONS1_13json_iteratorE:
   11|  3.86k|simdjson_inline document document::start(json_iterator &&iter) noexcept {
   12|  3.86k|  return document(std::forward<json_iterator>(iter));
   13|  3.86k|}
_ZN8simdjson8fallback8ondemand8documentC2EONS1_13json_iteratorE:
    7|  3.86k|{
    8|  3.86k|  logger::log_start_value(iter, "document");
    9|  3.86k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand8documentEEC2EOS3_:
  290|  3.86k|{
  291|  3.86k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand8documentEE5beginEv:
  317|  3.86k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::document>::begin() & noexcept {
  318|  3.86k|  if (error()) { return error(); }
  ------------------
  |  Branch (318:7): [True: 0, False: 3.86k]
  ------------------
  319|  3.86k|  return first.begin();
  320|  3.86k|}
_ZNR8simdjson8fallback8ondemand8document5beginEv:
  183|  3.86k|simdjson_inline simdjson_result<array_iterator> document::begin() & noexcept {
  184|  3.86k|  return get_array().begin();
  185|  3.86k|}
_ZNR8simdjson8fallback8ondemand8document9get_arrayEv:
   77|  3.86k|simdjson_inline simdjson_result<array> document::get_array() & noexcept {
   78|  3.86k|  auto value = get_root_value_iterator();
   79|  3.86k|  return array::start_root(value);
   80|  3.86k|}
_ZN8simdjson8fallback8ondemand8document23get_root_value_iteratorEv:
   42|  3.86k|simdjson_inline value_iterator document::get_root_value_iterator() noexcept {
   43|  3.86k|  return resume_value_iterator();
   44|  3.86k|}
_ZN8simdjson8fallback8ondemand8document21resume_value_iteratorEv:
   39|  3.86k|simdjson_inline value_iterator document::resume_value_iterator() noexcept {
   40|  3.86k|  return value_iterator(&iter, 1, iter.root_position());
   41|  3.86k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand8documentEE3endEv:
  321|  3.86k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::document>::end() & noexcept {
  322|  3.86k|  return {};
  323|  3.86k|}

_ZN8simdjson8fallback8ondemand8documentC2Ev:
   29|  1.24k|  simdjson_inline document() noexcept = default;
_ZN8simdjson8fallback8ondemand8documentC2EOS2_:
   31|  5.10k|  simdjson_inline document(document &&other) noexcept = default;

_ZN8simdjson8fallback8ondemand13json_iteratorC2EOS2_:
   13|  8.96k|{
   14|  8.96k|  other.parser = nullptr;
   15|  8.96k|}
_ZNK8simdjson8fallback8ondemand13json_iterator8positionEv:
  315|  10.6M|simdjson_inline token_position json_iterator::position() const noexcept {
  316|  10.6M|  return token.position();
  317|  10.6M|}
_ZNK8simdjson8fallback8ondemand13json_iterator5depthEv:
  300|  5.46M|simdjson_inline depth_t json_iterator::depth() const noexcept {
  301|  5.46M|  return _depth;
  302|  5.46M|}
_ZN8simdjson8fallback8ondemand13json_iteratorC2EPKhPNS1_6parserE:
   36|  3.86k|{
   37|  3.86k|  logger::log_headers();
   38|       |#if SIMDJSON_CHECK_EOF
   39|       |  assert_more_tokens();
   40|       |#endif
   41|  3.86k|}
_ZNK8simdjson8fallback8ondemand13json_iterator13root_positionEv:
  165|  3.86k|simdjson_inline token_position json_iterator::root_position() const noexcept {
  166|  3.86k|  return _root;
  167|  3.86k|}
_ZNK8simdjson8fallback8ondemand13json_iterator4peekEPKj:
  260|  3.68k|simdjson_inline const uint8_t *json_iterator::peek(token_position position) const noexcept {
  261|       |  // todo: currently we require end-of-string buffering, but the following
  262|       |  // assert_valid_position should be turned on if/when we lift that condition.
  263|       |  // assert_valid_position(position);
  264|       |  // This is almost surely related to SIMDJSON_CHECK_EOF but given that SIMDJSON_CHECK_EOF
  265|       |  // is ON by default, we have no choice but to disable it for real with a comment.
  266|  3.68k|  return token.peek(position);
  267|  3.68k|}
_ZNK8simdjson8fallback8ondemand13json_iterator4peekEi:
  246|  52.6k|simdjson_inline const uint8_t *json_iterator::peek(int32_t delta) const noexcept {
  247|       |#if SIMDJSON_CHECK_EOF
  248|       |  assert_more_tokens(delta+1);
  249|       |#endif // SIMDJSON_CHECK_EOF
  250|  52.6k|  return token.peek(delta);
  251|  52.6k|}
_ZN8simdjson8fallback8ondemand13json_iterator26return_current_and_advanceEv:
  234|  5.36M|simdjson_inline const uint8_t *json_iterator::return_current_and_advance() noexcept {
  235|       |#if SIMDJSON_CHECK_EOF
  236|       |  assert_more_tokens();
  237|       |#endif // SIMDJSON_CHECK_EOF
  238|  5.36M|  return token.return_current_and_advance();
  239|  5.36M|}
_ZNK8simdjson8fallback8ondemand13json_iterator9streamingEv:
  161|  3.74k|simdjson_inline bool json_iterator::streaming() const noexcept {
  162|  3.74k|  return _streaming;
  163|  3.74k|}
_ZNK8simdjson8fallback8ondemand13json_iterator9peek_lastEv:
  284|  3.74k|simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept {
  285|  3.74k|  return token.peek(last_position());
  286|  3.74k|}
_ZNK8simdjson8fallback8ondemand13json_iterator13last_positionEv:
  276|  3.74k|simdjson_inline token_position json_iterator::last_position() const noexcept {
  277|       |  // The following line fails under some compilers...
  278|       |  // SIMDJSON_ASSUME(parser->implementation->n_structural_indexes > 0);
  279|       |  // since it has side-effects.
  280|  3.74k|  uint32_t n_structural_indexes{parser->implementation->n_structural_indexes};
  281|  3.74k|  SIMDJSON_ASSUME(n_structural_indexes > 0);
  ------------------
  |  |  181|  3.74k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 3.74k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  282|  3.74k|  return &parser->implementation->structural_indexes[n_structural_indexes - 1];
  283|  3.74k|}
_ZN8simdjson8fallback8ondemand13json_iterator7abandonEv:
  229|    853|simdjson_inline void json_iterator::abandon() noexcept {
  230|    853|  parser = nullptr;
  231|    853|  _depth = 0;
  232|    853|}
_ZN8simdjson8fallback8ondemand13json_iterator12report_errorENS_10error_codeEPKc:
  308|    853|simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept {
  309|    853|  SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD);
  ------------------
  |  |  181|  5.11k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:42): [True: 853, False: 0]
  |  |  |  Branch (181:42): [True: 853, False: 0]
  |  |  |  Branch (181:42): [True: 853, False: 0]
  |  |  |  Branch (181:42): [True: 853, False: 0]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  310|    853|  logger::log_error(*this, message);
  311|    853|  error = _error;
  312|    853|  return error;
  313|    853|}
_ZNK8simdjson8fallback8ondemand13json_iterator12end_positionEv:
  196|  5.27M|simdjson_inline token_position json_iterator::end_position() const noexcept {
  197|  5.27M|  uint32_t n_structural_indexes{parser->implementation->n_structural_indexes};
  198|  5.27M|  return &parser->implementation->structural_indexes[n_structural_indexes];
  199|  5.27M|}
_ZN8simdjson8fallback8ondemand13json_iterator9ascend_toEi:
  288|  22.8k|simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept {
  289|  22.8k|  SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1);
  ------------------
  |  |  181|  45.7k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:42): [True: 22.8k, False: 0]
  |  |  |  Branch (181:42): [True: 22.8k, False: 0]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  290|  22.8k|  SIMDJSON_ASSUME(_depth == parent_depth + 1);
  ------------------
  |  |  181|  22.8k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 22.8k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  291|  22.8k|  _depth = parent_depth;
  292|  22.8k|}
_ZN8simdjson8fallback8ondemand13json_iterator10descend_toEi:
  294|  42.8k|simdjson_inline void json_iterator::descend_to(depth_t child_depth) noexcept {
  295|  42.8k|  SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX);
  ------------------
  |  |  181|  85.6k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:42): [True: 42.8k, False: 0]
  |  |  |  Branch (181:42): [True: 42.8k, False: 0]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  296|  42.8k|  SIMDJSON_ASSUME(_depth == child_depth - 1);
  ------------------
  |  |  181|  42.8k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 42.8k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  297|  42.8k|  _depth = child_depth;
  298|  42.8k|}
_ZN8simdjson8fallback8ondemand13json_iterator8unescapeENS1_15raw_json_stringEb:
  319|  1.56k|simdjson_inline simdjson_result<std::string_view> json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept {
  320|  1.56k|  return parser->unescape(in, _string_buf_loc, allow_replacement);
  321|  1.56k|}
_ZN8simdjson8fallback8ondemand13json_iterator10skip_childEi:
   76|  41.7k|simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept {
   77|  41.7k|  if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (77:7): [True: 19.9k, False: 21.7k]
  ------------------
   78|  21.7k|  switch (*return_current_and_advance()) {
   79|       |    // TODO consider whether matching braces is a requirement: if non-matching braces indicates
   80|       |    // *missing* braces, then future lookups are not in the object/arrays they think they are,
   81|       |    // violating the rule "validate enough structure that the user can be confident they are
   82|       |    // looking at the right values."
   83|       |    // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth
   84|       |
   85|       |    // For the first open array/object in a value, we've already incremented depth, so keep it the same
   86|       |    // We never stop at colon, but if we did, it wouldn't affect depth
   87|  1.92k|    case '[': case '{': case ':':
  ------------------
  |  Branch (87:5): [True: 685, False: 21.0k]
  |  Branch (87:15): [True: 570, False: 21.1k]
  |  Branch (87:25): [True: 665, False: 21.0k]
  ------------------
   88|  1.92k|      logger::log_start_value(*this, "skip");
   89|  1.92k|      break;
   90|       |    // If there is a comma, we have just finished a value in an array/object, and need to get back in
   91|    692|    case ',':
  ------------------
  |  Branch (91:5): [True: 692, False: 21.0k]
  ------------------
   92|    692|      logger::log_value(*this, "skip");
   93|    692|      break;
   94|       |    // ] or } means we just finished a value and need to jump out of the array/object
   95|  6.42k|    case ']': case '}':
  ------------------
  |  Branch (95:5): [True: 3.98k, False: 17.7k]
  |  Branch (95:15): [True: 2.43k, False: 19.2k]
  ------------------
   96|  6.42k|      logger::log_end_value(*this, "skip");
   97|  6.42k|      _depth--;
   98|  6.42k|      if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (98:11): [True: 5.83k, False: 590]
  ------------------
   99|       |#if SIMDJSON_CHECK_EOF
  100|       |      // If there are no more tokens, the parent is incomplete.
  101|       |      if (at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "Missing [ or { at start"); }
  102|       |#endif // SIMDJSON_CHECK_EOF
  103|    590|      break;
  104|    800|    case '"':
  ------------------
  |  Branch (104:5): [True: 800, False: 20.9k]
  ------------------
  105|    800|      if(*peek() == ':') {
  ------------------
  |  Branch (105:10): [True: 389, False: 411]
  ------------------
  106|       |        // We are at a key!!!
  107|       |        // This might happen if you just started an object and you skip it immediately.
  108|       |        // Performance note: it would be nice to get rid of this check as it is somewhat
  109|       |        // expensive.
  110|       |        // https://github.com/simdjson/simdjson/issues/1742
  111|    389|        logger::log_value(*this, "key");
  112|    389|        return_current_and_advance(); // eat up the ':'
  113|    389|        break; // important!!!
  114|    389|      }
  115|    800|      simdjson_fallthrough;
  ------------------
  |  |  311|    411|# define simdjson_fallthrough [[fallthrough]]
  ------------------
  116|       |    // Anything else must be a scalar value
  117|  12.3k|    default:
  ------------------
  |  Branch (117:5): [True: 11.8k, False: 9.83k]
  ------------------
  118|       |      // For the first scalar, we will have incremented depth already, so we decrement it here.
  119|  12.3k|      logger::log_value(*this, "skip");
  120|  12.3k|      _depth--;
  121|  12.3k|      if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (121:11): [True: 11.9k, False: 315]
  ------------------
  122|    315|      break;
  123|  21.7k|  }
  124|       |
  125|       |  // Now that we've considered the first value, we only increment/decrement for arrays/objects
  126|  5.27M|  while (position() < end_position()) {
  ------------------
  |  Branch (126:10): [True: 5.27M, False: 135]
  ------------------
  127|  5.27M|    switch (*return_current_and_advance()) {
  128|  5.26M|      case '[': case '{':
  ------------------
  |  Branch (128:7): [True: 127k, False: 5.14M]
  |  Branch (128:17): [True: 5.13M, False: 140k]
  ------------------
  129|  5.26M|        logger::log_start_value(*this, "skip");
  130|  5.26M|        _depth++;
  131|  5.26M|        break;
  132|       |      // TODO consider whether matching braces is a requirement: if non-matching braces indicates
  133|       |      // *missing* braces, then future lookups are not in the object/arrays they think they are,
  134|       |      // violating the rule "validate enough structure that the user can be confident they are
  135|       |      // looking at the right values."
  136|       |      // PERF TODO we can eliminate the switch here with a lookup of how much to add to depth
  137|  6.98k|      case ']': case '}':
  ------------------
  |  Branch (137:7): [True: 5.28k, False: 5.27M]
  |  Branch (137:17): [True: 1.69k, False: 5.27M]
  ------------------
  138|  6.98k|        logger::log_end_value(*this, "skip");
  139|  6.98k|        _depth--;
  140|  6.98k|        if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (140:13): [True: 3.77k, False: 3.20k]
  ------------------
  141|  3.20k|        break;
  142|  5.71k|      default:
  ------------------
  |  Branch (142:7): [True: 5.71k, False: 5.26M]
  ------------------
  143|  5.71k|        logger::log_value(*this, "skip", "");
  144|  5.71k|        break;
  145|  5.27M|    }
  146|  5.27M|  }
  147|       |
  148|    135|  return report_error(TAPE_ERROR, "not enough close braces");
  149|  3.90k|}

_ZN8simdjson8fallback8ondemand13json_iteratorC2Ev:
   64|  1.24k|  simdjson_inline json_iterator() noexcept = default;

fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL15log_start_valueERKNS1_13json_iteratorEPKcii:
   69|  5.26M|inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept {
   70|  5.26M|  log_line(iter, "+", type, "", delta, depth_delta, log_level::LOG_INFO);
   71|  5.26M|  if (LOG_ENABLED) { log_depth++; }
  ------------------
  |  Branch (71:7): [Folded - Ignored]
  ------------------
   72|  5.26M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL8log_lineERKNS1_13json_iteratorEPKcS7_NSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEiiNS2_9log_levelE:
  157|  5.34M|inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta, log_level level) noexcept {
  158|  5.34M|  log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail, level);
  159|  5.34M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL8log_lineERKNS1_13json_iteratorEPKjiPKcS9_NSt3__117basic_string_viewIcNSA_11char_traitsIcEEEENS2_9log_levelE:
  160|  5.41M|inline void log_line(const json_iterator &iter, token_position index, depth_t depth, const char *title_prefix, const char *title, std::string_view detail, log_level level) noexcept {
  161|  5.41M|  if (LOG_ENABLED && simdjson_unlikely(should_log(level))) {
  ------------------
  |  |  120|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (161:7): [Folded - Ignored]
  ------------------
  162|      0|    const int indent = depth*2;
  163|      0|    const auto buf = iter.token.buf;
  164|      0|    printf("| %*s%s%-*s ",
  165|      0|      indent, "",
  166|      0|      title_prefix,
  167|      0|      LOG_EVENT_LEN - indent - int(strlen(title_prefix)), title
  168|      0|      );
  169|      0|    {
  170|       |      // Print the current structural.
  171|      0|      printf("| ");
  172|       |      // Before we begin, the index might point right before the document.
  173|       |      // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938
  174|      0|      if(index < iter._root) {
  ------------------
  |  Branch (174:10): [True: 0, False: 0]
  ------------------
  175|      0|        printf("%*s", LOG_BUFFER_LEN, "");
  176|      0|      } else {
  177|      0|        auto current_structural = &buf[*index];
  178|      0|        for (int i=0;i<LOG_BUFFER_LEN;i++) {
  ------------------
  |  Branch (178:22): [True: 0, False: 0]
  ------------------
  179|      0|            printf("%c", printable_char(current_structural[i]));
  180|      0|        }
  181|      0|      }
  182|      0|      printf(" ");
  183|      0|    }
  184|      0|    {
  185|       |      // Print the next structural.
  186|      0|      printf("| ");
  187|      0|      auto next_structural = &buf[*(index+1)];
  188|      0|      for (int i=0;i<LOG_SMALL_BUFFER_LEN;i++) {
  ------------------
  |  Branch (188:20): [True: 0, False: 0]
  ------------------
  189|      0|        printf("%c", printable_char(next_structural[i]));
  190|      0|      }
  191|      0|      printf(" ");
  192|      0|    }
  193|       |    // printf("| %5u ", *(index+1));
  194|      0|    printf("| %5i ", depth);
  195|      0|    printf("| %6.*s ", int(detail.size()) , detail.data());
  196|      0|    printf("|\n");
  197|      0|    fflush(stdout);
  198|      0|  }
  199|  5.41M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL11log_headersEv:
  106|  3.86k|inline void log_headers() noexcept {
  107|  3.86k|  if (LOG_ENABLED && simdjson_unlikely(should_log(log_level::LOG_INFO))) {
  ------------------
  |  |  120|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (107:7): [Folded - Ignored]
  ------------------
  108|       |    // Technically a static variable is not thread-safe, but if you are using threads
  109|       |    // and logging... well...
  110|      0|    static bool displayed_hint{false};
  111|      0|    log_depth = 0;
  112|      0|    printf("\n");
  113|      0|    if(!displayed_hint) {
  ------------------
  |  Branch (113:8): [True: 0, False: 0]
  ------------------
  114|       |      // We only print this helpful header once.
  115|      0|      printf("# Logging provides the depth and position of the iterator user-visible steps:\n");
  116|      0|      printf("# +array says 'this is where we were when we discovered the start array'\n");
  117|      0|      printf("# -array says 'this is where we were when we ended the array'\n");
  118|      0|      printf("# skip says 'this is a structural or value I am skipping'\n");
  119|      0|      printf("# +/-skip says 'this is a start/end array or object I am skipping'\n");
  120|      0|      printf("#\n");
  121|      0|      printf("# The indentation of the terms (array, string,...) indicates the depth,\n");
  122|      0|      printf("# in addition to the depth being displayed.\n");
  123|      0|      printf("#\n");
  124|      0|      printf("# Every token in the document has a single depth determined by the tokens before it,\n");
  125|      0|      printf("# and is not affected by what the token actually is.\n");
  126|      0|      printf("#\n");
  127|      0|      printf("# Not all structural elements are presented as tokens in the logs.\n");
  128|      0|      printf("#\n");
  129|      0|      printf("# We never give control to the user within an empty array or an empty object.\n");
  130|      0|      printf("#\n");
  131|      0|      printf("# Inside an array, having a depth greater than the array's depth means that\n");
  132|      0|      printf("# we are pointing inside a value.\n");
  133|      0|      printf("# Having a depth equal to the array means that we are pointing right before a value.\n");
  134|      0|      printf("# Having a depth smaller than the array means that we have moved beyond the array.\n");
  135|      0|      displayed_hint = true;
  136|      0|    }
  137|      0|    printf("\n");
  138|      0|    printf("| %-*s ", LOG_EVENT_LEN,        "Event");
  139|      0|    printf("| %-*s ", LOG_BUFFER_LEN,       "Buffer");
  140|      0|    printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next");
  141|       |    // printf("| %-*s ", 5,                    "Next#");
  142|      0|    printf("| %-*s ", 5,                    "Depth");
  143|      0|    printf("| Detail ");
  144|      0|    printf("|\n");
  145|       |
  146|      0|    printf("|%.*s", LOG_EVENT_LEN+2, DASHES);
  147|      0|    printf("|%.*s", LOG_BUFFER_LEN+2, DASHES);
  148|      0|    printf("|%.*s", LOG_SMALL_BUFFER_LEN+2, DASHES);
  149|       |    // printf("|%.*s", 5+2, DASHES);
  150|      0|    printf("|%.*s", 5+2, DASHES);
  151|      0|    printf("|--------");
  152|      0|    printf("|\n");
  153|      0|    fflush(stdout);
  154|      0|  }
  155|  3.86k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL15log_start_valueERKNS1_13json_iteratorEPKjiPKcNSt3__117basic_string_viewIcNSA_11char_traitsIcEEEE:
   65|  9.03k|inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept {
   66|  9.03k|  log_line(iter, index, depth, "+", type, detail, log_level::LOG_INFO);
   67|  9.03k|  if (LOG_ENABLED) { log_depth++; }
  ------------------
  |  Branch (67:7): [Folded - Ignored]
  ------------------
   68|  9.03k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_errorERKNS1_13json_iteratorEPKjiPKcS9_:
   82|  4.09k|inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept {
   83|  4.09k|  log_line(iter, index, depth, "ERROR: ", error, detail, log_level::LOG_ERROR);
   84|  4.09k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_errorERKNS1_13json_iteratorEPKcS7_ii:
   79|    853|inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept {
   80|    853|  log_line(iter, "ERROR: ", error, detail, delta, depth_delta, log_level::LOG_ERROR);
   81|    853|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_valueERKNS1_13json_iteratorEPKcNSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
   61|  20.2k|inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept {
   62|  20.2k|  log_line(iter, "", type, detail, delta, depth_delta, log_level::LOG_INFO);
   63|  20.2k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_valueERKNS1_13json_iteratorEPKjiPKcNSt3__117basic_string_viewIcNSA_11char_traitsIcEEEE:
   58|  54.5k|inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept {
   59|  54.5k|  log_line(iter, index, depth, "", type, detail, log_level::LOG_INFO);
   60|  54.5k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL13log_end_valueERKNS1_13json_iteratorEPKcii:
   74|  16.6k|inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept {
   75|  16.6k|  if (LOG_ENABLED) { log_depth--; }
  ------------------
  |  Branch (75:7): [Folded - Ignored]
  ------------------
   76|  16.6k|  log_line(iter, "-", type, "", delta, depth_delta, log_level::LOG_INFO);
   77|  16.6k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_eventERKNS1_14value_iteratorEPKcNSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
   86|  41.5k|inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept {
   87|  41.5k|  log_event(iter.json_iter(), type, detail, delta, depth_delta);
   88|  41.5k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_eventERKNS1_13json_iteratorEPKcNSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
   54|  41.5k|inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept {
   55|  41.5k|  log_line(iter, "", type, detail, delta, depth_delta, log_level::LOG_INFO);
   56|  41.5k|}

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand6objectEEC2ENS_10error_codeE:
  194|    370|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::object>(error) {}
_ZN8simdjson8fallback8ondemand6object5startERNS1_14value_iteratorE:
   56|    790|simdjson_inline simdjson_result<object> object::start(value_iterator &iter) noexcept {
   57|    790|  SIMDJSON_TRY( iter.start_object().error() );
  ------------------
  |  |  279|    790|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 301, False: 489]
  |  |  ------------------
  ------------------
   58|    489|  return object(iter);
   59|    790|}
_ZN8simdjson8fallback8ondemand6objectC2ERKNS1_14value_iteratorE:
  109|    489|{
  110|    489|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand6objectEEC2EOS3_:
  192|    489|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::object>(std::forward<SIMDJSON_IMPLEMENTATION::ondemand::object>(value)) {}

_ZN8simdjson8fallback8ondemand6objectC2Ev:
   17|    370|  simdjson_inline object() noexcept = default;

_ZN8simdjson8fallback8ondemand6parserC2Em:
    6|  5.10k|  : _max_capacity{max_capacity} {
    7|  5.10k|}
_ZNR8simdjson8fallback8ondemand6parser7iterateENS_18padded_string_viewE:
   31|  5.10k|simdjson_warn_unused simdjson_inline simdjson_result<document> parser::iterate(padded_string_view json) & noexcept {
   32|  5.10k|  if (json.padding() < SIMDJSON_PADDING) { return INSUFFICIENT_PADDING; }
  ------------------
  |  Branch (32:7): [True: 0, False: 5.10k]
  ------------------
   33|       |
   34|       |  // Allocate if needed
   35|  5.10k|  if (capacity() < json.length() || !string_buf) {
  ------------------
  |  Branch (35:7): [True: 4.99k, False: 111]
  |  Branch (35:37): [True: 111, False: 0]
  ------------------
   36|  5.10k|    SIMDJSON_TRY( allocate(json.length(), max_depth()) );
  ------------------
  |  |  279|  5.10k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 5.10k]
  |  |  ------------------
  ------------------
   37|  5.10k|  }
   38|       |
   39|       |  // Run stage 1.
   40|  5.10k|  SIMDJSON_TRY( implementation->stage1(reinterpret_cast<const uint8_t *>(json.data()), json.length(), stage1_mode::regular) );
  ------------------
  |  |  279|  5.10k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 1.24k, False: 3.86k]
  |  |  ------------------
  ------------------
   41|  3.86k|  return document::start({ reinterpret_cast<const uint8_t *>(json.data()), this });
   42|  5.10k|}
_ZNK8simdjson8fallback8ondemand6parser8capacityEv:
  101|  5.10k|simdjson_inline size_t parser::capacity() const noexcept {
  102|  5.10k|  return _capacity;
  103|  5.10k|}
_ZN8simdjson8fallback8ondemand6parser8allocateEmm:
    9|  5.10k|simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
   10|  5.10k|  if (new_capacity > max_capacity()) { return CAPACITY; }
  ------------------
  |  Branch (10:7): [True: 0, False: 5.10k]
  ------------------
   11|  5.10k|  if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
  ------------------
  |  Branch (11:7): [True: 0, False: 5.10k]
  |  Branch (11:21): [True: 0, False: 0]
  |  Branch (11:51): [True: 0, False: 0]
  ------------------
   12|       |
   13|       |  // string_capacity copied from document::allocate
   14|  5.10k|  _capacity = 0;
   15|  5.10k|  size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * new_capacity / 3 + SIMDJSON_PADDING, 64);
  ------------------
  |  |   68|  5.10k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   16|  5.10k|  string_buf.reset(new (std::nothrow) uint8_t[string_capacity]);
   17|       |#if SIMDJSON_DEVELOPMENT_CHECKS
   18|       |  start_positions.reset(new (std::nothrow) token_position[new_max_depth]);
   19|       |#endif
   20|  5.10k|  if (implementation) {
  ------------------
  |  Branch (20:7): [True: 0, False: 5.10k]
  ------------------
   21|      0|    SIMDJSON_TRY( implementation->set_capacity(new_capacity) );
  ------------------
  |  |  279|      0|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   22|      0|    SIMDJSON_TRY( implementation->set_max_depth(new_max_depth) );
  ------------------
  |  |  279|      0|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   23|  5.10k|  } else {
   24|  5.10k|    SIMDJSON_TRY( simdjson::get_active_implementation()->create_dom_parser_implementation(new_capacity, new_max_depth, implementation) );
  ------------------
  |  |  279|  5.10k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 5.10k]
  |  |  ------------------
  ------------------
   25|  5.10k|  }
   26|  5.10k|  _capacity = new_capacity;
   27|  5.10k|  _max_depth = new_max_depth;
   28|  5.10k|  return SUCCESS;
   29|  5.10k|}
_ZNK8simdjson8fallback8ondemand6parser12max_capacityEv:
  104|  5.10k|simdjson_inline size_t parser::max_capacity() const noexcept {
  105|  5.10k|  return _max_capacity;
  106|  5.10k|}
_ZNK8simdjson8fallback8ondemand6parser9max_depthEv:
  107|  5.10k|simdjson_inline size_t parser::max_depth() const noexcept {
  108|  5.10k|  return _max_depth;
  109|  5.10k|}
_ZNK8simdjson8fallback8ondemand6parser8unescapeENS1_15raw_json_stringERPhb:
  119|  1.56k|simdjson_inline simdjson_warn_unused simdjson_result<std::string_view> parser::unescape(raw_json_string in, uint8_t *&dst, bool allow_replacement) const noexcept {
  120|  1.56k|  uint8_t *end = implementation->parse_string(in.buf, dst, allow_replacement);
  121|  1.56k|  if (!end) { return STRING_ERROR; }
  ------------------
  |  Branch (121:7): [True: 1.12k, False: 446]
  ------------------
  122|    446|  std::string_view result(reinterpret_cast<const char *>(dst), end-dst);
  123|    446|  dst = end;
  124|    446|  return result;
  125|  1.56k|}

_ZN8simdjson8fallback8ondemand6parserD2Ev:
   49|  5.10k|  inline ~parser() noexcept = default;

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand15raw_json_stringEEC2ENS_10error_codeE:
  177|    760|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string>(error) {}
_ZN8simdjson8fallback8ondemand15raw_json_stringC2EPKh:
    6|  1.76k|simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand15raw_json_stringEEC2EOS3_:
  175|  1.76k|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string>(std::forward<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string>(value)) {}
_ZNK8simdjson15simdjson_resultINS_8fallback8ondemand15raw_json_stringEE8unescapeERNS2_13json_iteratorEb:
  183|  1.89k|simdjson_inline simdjson_warn_unused simdjson_result<std::string_view> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string>::unescape(SIMDJSON_IMPLEMENTATION::ondemand::json_iterator &iter, bool allow_replacement) const noexcept {
  184|  1.89k|  if (error()) { return error(); }
  ------------------
  |  Branch (184:7): [True: 330, False: 1.56k]
  ------------------
  185|  1.56k|  return first.unescape(iter, allow_replacement);
  186|  1.89k|}
_ZNK8simdjson8fallback8ondemand15raw_json_string8unescapeERNS1_13json_iteratorEb:
  146|  1.56k|simdjson_inline simdjson_warn_unused simdjson_result<std::string_view> raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept {
  147|  1.56k|  return iter.unescape(*this, allow_replacement);
  148|  1.56k|}

_ZN8simdjson8fallback8ondemand15raw_json_stringC2Ev:
   41|    760|  simdjson_inline raw_json_string() noexcept = default;

_ZNK8simdjson8fallback8ondemand14token_iterator8positionEv:
   41|  10.7M|simdjson_inline token_position token_iterator::position() const noexcept {
   42|  10.7M|  return _position;
   43|  10.7M|}
_ZN8simdjson8fallback8ondemand14token_iteratorC2EPKhPKj:
    9|  3.86k|{
   10|  3.86k|}
_ZNK8simdjson8fallback8ondemand14token_iterator4peekEPKj:
   21|  7.42k|simdjson_inline const uint8_t *token_iterator::peek(token_position position) const noexcept {
   22|  7.42k|  return &buf[*position];
   23|  7.42k|}
_ZNK8simdjson8fallback8ondemand14token_iterator4peekEi:
   31|  52.6k|simdjson_inline const uint8_t *token_iterator::peek(int32_t delta) const noexcept {
   32|  52.6k|  return &buf[*(_position+delta)];
   33|  52.6k|}
_ZN8simdjson8fallback8ondemand14token_iterator26return_current_and_advanceEv:
   17|  5.36M|simdjson_inline const uint8_t *token_iterator::return_current_and_advance() noexcept {
   18|  5.36M|  return &buf[*(_position++)];
   19|  5.36M|}

_ZN8simdjson8fallback8ondemand14token_iteratorC2Ev:
   18|  1.24k|  simdjson_inline token_iterator() noexcept = default;

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEEC2ENS_10error_codeE:
  222|  2.38k|{
  223|  2.38k|}
_ZN8simdjson8fallback8ondemand5valueC2ERKNS1_14value_iteratorE:
    7|  41.8k|{
    8|  41.8k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEEC2EOS3_:
  216|  41.8k|{
  217|  41.8k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_stringEb:
  304|  2.00k|simdjson_inline simdjson_result<std::string_view> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_string(bool allow_replacement) noexcept {
  305|  2.00k|  if (error()) { return error(); }
  ------------------
  |  Branch (305:7): [True: 103, False: 1.89k]
  ------------------
  306|  1.89k|  return first.get_string(allow_replacement);
  307|  2.00k|}
_ZN8simdjson8fallback8ondemand5value10get_stringEb:
   33|  1.89k|simdjson_inline simdjson_result<std::string_view> value::get_string(bool allow_replacement) noexcept {
   34|  1.89k|  return iter.get_string(allow_replacement);
   35|  1.89k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE8get_boolEv:
  316|  1.01k|simdjson_inline simdjson_result<bool> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_bool() noexcept {
  317|  1.01k|  if (error()) { return error(); }
  ------------------
  |  Branch (317:7): [True: 53, False: 962]
  ------------------
  318|    962|  return first.get_bool();
  319|  1.01k|}
_ZN8simdjson8fallback8ondemand5value8get_boolEv:
   57|    962|simdjson_inline simdjson_result<bool> value::get_bool() noexcept {
   58|    962|  return iter.get_bool();
   59|    962|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE9get_arrayEv:
  272|  1.19k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_array() noexcept {
  273|  1.19k|  if (error()) { return error(); }
  ------------------
  |  Branch (273:7): [True: 81, False: 1.11k]
  ------------------
  274|  1.11k|  return first.get_array();
  275|  1.19k|}
_ZN8simdjson8fallback8ondemand5value9get_arrayEv:
   16|  4.38k|simdjson_inline simdjson_result<array> value::get_array() noexcept {
   17|  4.38k|  return array::start(iter);
   18|  4.38k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE9get_int64Ev:
  288|  1.94k|simdjson_inline simdjson_result<int64_t> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_int64() noexcept {
  289|  1.94k|  if (error()) { return error(); }
  ------------------
  |  Branch (289:7): [True: 28, False: 1.92k]
  ------------------
  290|  1.92k|  return first.get_int64();
  291|  1.94k|}
_ZN8simdjson8fallback8ondemand5value9get_int64Ev:
   51|  1.92k|simdjson_inline simdjson_result<int64_t> value::get_int64() noexcept {
   52|  1.92k|  return iter.get_int64();
   53|  1.92k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_doubleEv:
  296|  22.3k|simdjson_inline simdjson_result<double> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_double() noexcept {
  297|  22.3k|  if (error()) { return error(); }
  ------------------
  |  Branch (297:7): [True: 100, False: 22.2k]
  ------------------
  298|  22.2k|  return first.get_double();
  299|  22.3k|}
_ZN8simdjson8fallback8ondemand5value10get_doubleEv:
   39|  22.2k|simdjson_inline simdjson_result<double> value::get_double() noexcept {
   40|  22.2k|  return iter.get_double();
   41|  22.2k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_objectEv:
  276|    859|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_object() noexcept {
  277|    859|  if (error()) { return error(); }
  ------------------
  |  Branch (277:7): [True: 69, False: 790]
  ------------------
  278|    790|  return first.get_object();
  279|    859|}
_ZN8simdjson8fallback8ondemand5value10get_objectEv:
   19|    790|simdjson_inline simdjson_result<object> value::get_object() noexcept {
   20|    790|  return object::start(iter);
   21|    790|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_uint64Ev:
  280|  4.32k|simdjson_inline simdjson_result<uint64_t> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_uint64() noexcept {
  281|  4.32k|  if (error()) { return error(); }
  ------------------
  |  Branch (281:7): [True: 33, False: 4.29k]
  ------------------
  282|  4.29k|  return first.get_uint64();
  283|  4.32k|}
_ZN8simdjson8fallback8ondemand5value10get_uint64Ev:
   45|  4.29k|simdjson_inline simdjson_result<uint64_t> value::get_uint64() noexcept {
   46|  4.29k|  return iter.get_uint64();
   47|  4.29k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE19get_raw_json_stringEv:
  312|    624|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_raw_json_string() noexcept {
  313|    624|  if (error()) { return error(); }
  ------------------
  |  Branch (313:7): [True: 21, False: 603]
  ------------------
  314|    603|  return first.get_raw_json_string();
  315|    624|}
_ZN8simdjson8fallback8ondemand5value19get_raw_json_stringEv:
   30|    603|simdjson_inline simdjson_result<raw_json_string> value::get_raw_json_string() noexcept {
   31|    603|  return iter.get_raw_json_string();
   32|    603|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE7is_nullEv:
  320|  5.83k|simdjson_inline simdjson_result<bool> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::is_null() noexcept {
  321|  5.83k|  if (error()) { return error(); }
  ------------------
  |  Branch (321:7): [True: 1.63k, False: 4.20k]
  ------------------
  322|  4.20k|  return first.is_null();
  323|  5.83k|}
_ZN8simdjson8fallback8ondemand5value7is_nullEv:
   60|  4.20k|simdjson_inline simdjson_result<bool> value::is_null() noexcept {
   61|  4.20k|  return iter.is_null();
   62|  4.20k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE5beginEv:
  236|  3.49k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::begin() & noexcept {
  237|  3.49k|  if (error()) { return error(); }
  ------------------
  |  Branch (237:7): [True: 221, False: 3.27k]
  ------------------
  238|  3.27k|  return first.begin();
  239|  3.49k|}
_ZNR8simdjson8fallback8ondemand5value5beginEv:
  104|  3.27k|simdjson_inline simdjson_result<array_iterator> value::begin() & noexcept {
  105|  3.27k|  return get_array().begin();
  106|  3.27k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE3endEv:
  240|  2.74k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::end() & noexcept {
  241|  2.74k|  if (error()) { return error(); }
  ------------------
  |  Branch (241:7): [True: 186, False: 2.56k]
  ------------------
  242|  2.56k|  return {};
  243|  2.74k|}

_ZN8simdjson8fallback8ondemand5valueC2Ev:
   24|  2.38k|  simdjson_inline value() noexcept = default;

_ZN8simdjson8fallback8ondemand14value_iteratorC2EPNS1_13json_iteratorEiPKj:
   10|  45.7k|{
   11|  45.7k|}
_ZN8simdjson8fallback8ondemand14value_iterator16start_root_arrayEv:
  406|  3.86k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::start_root_array() noexcept {
  407|  3.86k|  SIMDJSON_TRY( start_container('[', "Not an array", "array") );
  ------------------
  |  |  279|  3.86k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 117, False: 3.74k]
  |  |  ------------------
  ------------------
  408|  3.74k|  return started_root_array();
  409|  3.86k|}
_ZN8simdjson8fallback8ondemand14value_iterator15start_containerEhPKcS4_:
  839|  9.03k|simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept {
  840|  9.03k|  logger::log_start_value(*_json_iter, start_position(), depth(), type);
  841|       |  // If we're not at the position anymore, we don't want to advance the cursor.
  842|  9.03k|  const uint8_t *json;
  843|  9.03k|  if (!is_at_start()) {
  ------------------
  |  Branch (843:7): [True: 0, False: 9.03k]
  ------------------
  844|       |#if SIMDJSON_DEVELOPMENT_CHECKS
  845|       |    if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; }
  846|       |#endif
  847|      0|    json = peek_start();
  848|      0|    if (*json != start_char) { return incorrect_type_error(incorrect_type_message); }
  ------------------
  |  Branch (848:9): [True: 0, False: 0]
  ------------------
  849|  9.03k|  } else {
  850|  9.03k|    assert_at_start();
  851|       |    /**
  852|       |     * We should be prudent. Let us peek. If it is not the right type, we
  853|       |     * return an error. Only once we have determined that we have the right
  854|       |     * type are we allowed to advance!
  855|       |     */
  856|  9.03k|    json = _json_iter->peek();
  857|  9.03k|    if (*json != start_char) { return incorrect_type_error(incorrect_type_message); }
  ------------------
  |  Branch (857:9): [True: 2.30k, False: 6.73k]
  ------------------
  858|  6.73k|    _json_iter->return_current_and_advance();
  859|  6.73k|  }
  860|       |
  861|       |
  862|  6.73k|  return SUCCESS;
  863|  9.03k|}
_ZNK8simdjson8fallback8ondemand14value_iterator14start_positionEv:
 1003|   131k|simdjson_inline token_position value_iterator::start_position() const noexcept {
 1004|   131k|  return _start_position;
 1005|   131k|}
_ZNK8simdjson8fallback8ondemand14value_iterator5depthEv:
  795|   264k|simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept {
  796|   264k|  return _depth;
  797|   264k|}
_ZNK8simdjson8fallback8ondemand14value_iterator11is_at_startEv:
  903|  63.5k|simdjson_inline bool value_iterator::is_at_start() const noexcept {
  904|  63.5k|  return position() == start_position();
  905|  63.5k|}
_ZNK8simdjson8fallback8ondemand14value_iterator8positionEv:
 1007|  63.5k|simdjson_inline token_position value_iterator::position() const noexcept {
 1008|  63.5k|  return _json_iter->position();
 1009|  63.5k|}
_ZNK8simdjson8fallback8ondemand14value_iterator20incorrect_type_errorEPKc:
  898|  4.09k|simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept {
  899|  4.09k|  logger::log_error(*_json_iter, start_position(), depth(), message);
  900|  4.09k|  return INCORRECT_TYPE;
  901|  4.09k|}
_ZNK8simdjson8fallback8ondemand14value_iterator15assert_at_startEv:
  920|  63.5k|inline void value_iterator::assert_at_start() const noexcept {
  921|  63.5k|  SIMDJSON_ASSUME( _json_iter->token._position == _start_position );
  ------------------
  |  |  181|  63.5k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 63.5k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  922|  63.5k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth );
  ------------------
  |  |  181|  63.5k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 63.5k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  923|  63.5k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  181|  63.5k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 63.5k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  924|  63.5k|}
_ZN8simdjson8fallback8ondemand14value_iterator18started_root_arrayEv:
  463|  3.74k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::started_root_array() noexcept {
  464|  3.74k|  auto error = check_root_array();
  465|  3.74k|  if (error) { return error; }
  ------------------
  |  Branch (465:7): [True: 60, False: 3.68k]
  ------------------
  466|  3.68k|  return started_array();
  467|  3.74k|}
_ZN8simdjson8fallback8ondemand14value_iterator16check_root_arrayEv:
  433|  3.74k|simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept {
  434|       |  // When in streaming mode, we cannot expect peek_last() to be the last structural element of the
  435|       |  // current document. It only works in the normal mode where we have indexed a single document.
  436|       |  // Note that adding a check for 'streaming' is not expensive since we only have at most
  437|       |  // one root element.
  438|  3.74k|  if ( ! _json_iter->streaming() ) {
  ------------------
  |  Branch (438:8): [True: 3.74k, False: 0]
  ------------------
  439|       |    // The following lines do not fully protect against garbage content within the
  440|       |    // array: e.g., `[1, 2] foo]`. Users concerned with garbage content should
  441|       |    // also call `at_end()` on the document instance at the end of the processing to
  442|       |    // ensure that the processing has finished at the end.
  443|       |    //
  444|  3.74k|    if (*_json_iter->peek_last() != ']') {
  ------------------
  |  Branch (444:9): [True: 60, False: 3.68k]
  ------------------
  445|     60|      _json_iter->abandon();
  446|     60|      return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end");
  447|     60|    }
  448|       |    // If the last character is ] *and* the first gibberish character is also ']'
  449|       |    // then on-demand could accidentally go over. So we need additional checks.
  450|       |    // https://github.com/simdjson/simdjson/issues/1834
  451|       |    // Checking that the document is balanced requires a full scan which is potentially
  452|       |    // expensive, but it only happens in edge cases where the first padding character is
  453|       |    // a closing bracket.
  454|  3.68k|    if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) {
  ------------------
  |  Branch (454:9): [True: 0, False: 3.68k]
  |  Branch (454:67): [True: 0, False: 0]
  ------------------
  455|      0|      _json_iter->abandon();
  456|       |      // The exact error would require more work. It will typically be an unclosed array.
  457|      0|      return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced");
  458|      0|    }
  459|  3.68k|  }
  460|  3.68k|  return SUCCESS;
  461|  3.74k|}
_ZN8simdjson8fallback8ondemand14value_iterator12report_errorENS_10error_codeEPKc:
 1019|    718|simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept {
 1020|    718|  return _json_iter->report_error(error, message);
 1021|    718|}
_ZN8simdjson8fallback8ondemand14value_iterator13started_arrayEv:
  418|  6.18k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::started_array() noexcept {
  419|  6.18k|  assert_at_container_start();
  420|  6.18k|  if (*_json_iter->peek() == ']') {
  ------------------
  |  Branch (420:7): [True: 976, False: 5.20k]
  ------------------
  421|    976|    logger::log_value(*_json_iter, "empty array");
  422|    976|    _json_iter->return_current_and_advance();
  423|    976|    SIMDJSON_TRY( end_container() );
  ------------------
  |  |  279|    976|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 976]
  |  |  ------------------
  ------------------
  424|    976|    return false;
  425|    976|  }
  426|  5.20k|  _json_iter->descend_to(depth()+1);
  427|       |#if SIMDJSON_DEVELOPMENT_CHECKS
  428|       |  _json_iter->set_start_position(_depth, start_position());
  429|       |#endif
  430|  5.20k|  return true;
  431|  6.18k|}
_ZNK8simdjson8fallback8ondemand14value_iterator25assert_at_container_startEv:
  926|  6.67k|inline void value_iterator::assert_at_container_start() const noexcept {
  927|  6.67k|  SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 );
  ------------------
  |  |  181|  6.67k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 6.67k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  928|  6.67k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth );
  ------------------
  |  |  181|  6.67k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 6.67k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  929|  6.67k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  181|  6.67k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 6.67k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  930|  6.67k|}
_ZN8simdjson8fallback8ondemand14value_iterator13end_containerEv:
   73|  4.48k|simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept {
   74|       |#if SIMDJSON_CHECK_EOF
   75|       |    if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); }
   76|       |    // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); }
   77|       |#endif // SIMDJSON_CHECK_EOF
   78|  4.48k|    _json_iter->ascend_to(depth()-1);
   79|  4.48k|    return SUCCESS;
   80|  4.48k|}
_ZNK8simdjson8fallback8ondemand14value_iterator15assert_is_validEv:
  974|  5.39k|inline void value_iterator::assert_is_valid() const noexcept {
  975|  5.39k|  SIMDJSON_ASSUME( _json_iter != nullptr );
  ------------------
  |  |  181|  5.39k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 5.39k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  976|  5.39k|}
_ZNK8simdjson8fallback8ondemand14value_iterator8is_validEv:
  978|  50.6k|simdjson_inline bool value_iterator::is_valid() const noexcept {
  979|  50.6k|  return _json_iter != nullptr;
  980|  50.6k|}
_ZNK8simdjson8fallback8ondemand14value_iterator7is_openEv:
  773|  47.4k|simdjson_inline bool value_iterator::is_open() const noexcept {
  774|  47.4k|  return _json_iter->depth() >= depth();
  775|  47.4k|}
_ZNK8simdjson8fallback8ondemand14value_iterator5errorEv:
  798|  86.1k|simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept {
  799|  86.1k|  return _json_iter->error;
  800|  86.1k|}
_ZN8simdjson8fallback8ondemand14value_iterator7abandonEv:
  791|    793|simdjson_inline void value_iterator::abandon() noexcept {
  792|    793|  _json_iter->abandon();
  793|    793|}
_ZNK8simdjson8fallback8ondemand14value_iterator5childEv:
  763|  41.8k|simdjson_inline value_iterator value_iterator::child() const noexcept {
  764|  41.8k|  assert_at_child();
  765|  41.8k|  return { _json_iter, depth()+1, _json_iter->token.position() };
  766|  41.8k|}
_ZNK8simdjson8fallback8ondemand14value_iterator15assert_at_childEv:
  958|  41.8k|inline void value_iterator::assert_at_child() const noexcept {
  959|  41.8k|  SIMDJSON_ASSUME( _json_iter->token._position > _start_position );
  ------------------
  |  |  181|  41.8k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.8k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  960|  41.8k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 );
  ------------------
  |  |  181|  41.8k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.8k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  961|  41.8k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  181|  41.8k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.8k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  962|  41.8k|}
_ZN8simdjson8fallback8ondemand14value_iterator10get_stringEb:
  500|  1.89k|simdjson_warn_unused simdjson_inline simdjson_result<std::string_view> value_iterator::get_string(bool allow_replacement) noexcept {
  501|  1.89k|  return get_raw_json_string().unescape(json_iter(), allow_replacement);
  502|  1.89k|}
_ZN8simdjson8fallback8ondemand14value_iterator19get_raw_json_stringEv:
  506|  2.50k|simdjson_warn_unused simdjson_inline simdjson_result<raw_json_string> value_iterator::get_raw_json_string() noexcept {
  507|  2.50k|  auto json = peek_scalar("string");
  508|  2.50k|  if (*json != '"') { return incorrect_type_error("Not a string"); }
  ------------------
  |  Branch (508:7): [True: 739, False: 1.76k]
  ------------------
  509|  1.76k|  advance_scalar("string");
  510|  1.76k|  return raw_json_string(json+1);
  511|  2.50k|}
_ZN8simdjson8fallback8ondemand14value_iterator11peek_scalarEPKc:
  818|  2.50k|simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept {
  819|  2.50k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  820|       |  // If we're not at the position anymore, we don't want to advance the cursor.
  821|  2.50k|  if (!is_at_start()) { return peek_start(); }
  ------------------
  |  Branch (821:7): [True: 0, False: 2.50k]
  ------------------
  822|       |
  823|       |  // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value.
  824|  2.50k|  assert_at_start();
  825|  2.50k|  return _json_iter->peek();
  826|  2.50k|}
_ZN8simdjson8fallback8ondemand14value_iterator14advance_scalarEPKc:
  828|  1.76k|simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept {
  829|  1.76k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  830|       |  // If we're not at the position anymore, we don't want to advance the cursor.
  831|  1.76k|  if (!is_at_start()) { return; }
  ------------------
  |  Branch (831:7): [True: 0, False: 1.76k]
  ------------------
  832|       |
  833|       |  // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value.
  834|  1.76k|  assert_at_start();
  835|  1.76k|  _json_iter->return_current_and_advance();
  836|  1.76k|  _json_iter->ascend_to(depth()-1);
  837|  1.76k|}
_ZN8simdjson8fallback8ondemand14value_iterator9json_iterEv:
  807|  1.89k|simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept {
  808|  1.89k|  return *_json_iter;
  809|  1.89k|}
_ZN8simdjson8fallback8ondemand14value_iterator8get_boolEv:
  542|    962|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::get_bool() noexcept {
  543|    962|  auto result = parse_bool(peek_non_root_scalar("bool"));
  544|    962|  if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); }
  ------------------
  |  Branch (544:6): [True: 388, False: 574]
  ------------------
  545|    962|  return result;
  546|    962|}
_ZNK8simdjson8fallback8ondemand14value_iterator10parse_boolEPKh:
  486|    962|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::parse_bool(const uint8_t *json) const noexcept {
  487|    962|  auto not_true = atomparsing::str4ncmp(json, "true");
  488|    962|  auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e');
  489|    962|  bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]);
  ------------------
  |  Branch (489:17): [True: 768, False: 194]
  |  Branch (489:29): [True: 574, False: 194]
  |  Branch (489:43): [True: 0, False: 388]
  |  Branch (489:95): [True: 194, False: 194]
  ------------------
  490|    962|  if (error) { return incorrect_type_error("Not a boolean"); }
  ------------------
  |  Branch (490:7): [True: 574, False: 388]
  ------------------
  491|    388|  return simdjson_result<bool>(!not_true);
  492|    962|}
_ZN8simdjson8fallback8ondemand14value_iterator20peek_non_root_scalarEPKc:
  873|  33.6k|simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept {
  874|  33.6k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  875|  33.6k|  if (!is_at_start()) { return peek_start(); }
  ------------------
  |  Branch (875:7): [True: 0, False: 33.6k]
  ------------------
  876|       |
  877|  33.6k|  assert_at_non_root_start();
  878|  33.6k|  return _json_iter->peek();
  879|  33.6k|}
_ZNK8simdjson8fallback8ondemand14value_iterator24assert_at_non_root_startEv:
  969|  50.2k|inline void value_iterator::assert_at_non_root_start() const noexcept {
  970|  50.2k|  assert_at_start();
  971|  50.2k|  SIMDJSON_ASSUME( _depth > 1 );
  ------------------
  |  |  181|  50.2k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 50.2k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  972|  50.2k|}
_ZN8simdjson8fallback8ondemand14value_iterator23advance_non_root_scalarEPKc:
  889|  16.6k|simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept {
  890|  16.6k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  891|  16.6k|  if (!is_at_start()) { return; }
  ------------------
  |  Branch (891:7): [True: 0, False: 16.6k]
  ------------------
  892|       |
  893|  16.6k|  assert_at_non_root_start();
  894|  16.6k|  _json_iter->return_current_and_advance();
  895|  16.6k|  _json_iter->ascend_to(depth()-1);
  896|  16.6k|}
_ZN8simdjson8fallback8ondemand14value_iterator11start_arrayEv:
  401|  4.38k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::start_array() noexcept {
  402|  4.38k|  SIMDJSON_TRY( start_container('[', "Not an array", "array") );
  ------------------
  |  |  279|  4.38k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 1.89k, False: 2.49k]
  |  |  ------------------
  ------------------
  403|  2.49k|  return started_array();
  404|  4.38k|}
_ZN8simdjson8fallback8ondemand14value_iterator9get_int64Ev:
  522|  1.92k|simdjson_warn_unused simdjson_inline simdjson_result<int64_t> value_iterator::get_int64() noexcept {
  523|  1.92k|  auto result = numberparsing::parse_integer(peek_non_root_scalar("int64"));
  524|  1.92k|  if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); }
  ------------------
  |  Branch (524:6): [True: 507, False: 1.41k]
  ------------------
  525|  1.92k|  return result;
  526|  1.92k|}
_ZN8simdjson8fallback8ondemand14value_iterator10get_doubleEv:
  532|  22.2k|simdjson_warn_unused simdjson_inline simdjson_result<double> value_iterator::get_double() noexcept {
  533|  22.2k|  auto result = numberparsing::parse_double(peek_non_root_scalar("double"));
  534|  22.2k|  if(result.error() == SUCCESS) { advance_non_root_scalar("double"); }
  ------------------
  |  Branch (534:6): [True: 13.4k, False: 8.80k]
  ------------------
  535|  22.2k|  return result;
  536|  22.2k|}
_ZN8simdjson8fallback8ondemand14value_iterator12start_objectEv:
   13|    790|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::start_object() noexcept {
   14|    790|  SIMDJSON_TRY( start_container('{', "Not an object", "object") );
  ------------------
  |  |  279|    790|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 301, False: 489]
  |  |  ------------------
  ------------------
   15|    489|  return started_object();
   16|    790|}
_ZN8simdjson8fallback8ondemand14value_iterator14started_objectEv:
   23|    489|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::started_object() noexcept {
   24|    489|  assert_at_container_start();
   25|       |#if SIMDJSON_DEVELOPMENT_CHECKS
   26|       |  _json_iter->set_start_position(_depth, start_position());
   27|       |#endif
   28|    489|  if (*_json_iter->peek() == '}') {
  ------------------
  |  Branch (28:7): [True: 220, False: 269]
  ------------------
   29|    220|    logger::log_value(*_json_iter, "empty object");
   30|    220|    _json_iter->return_current_and_advance();
   31|    220|    end_container();
   32|    220|    return false;
   33|    220|  }
   34|    269|  return true;
   35|    489|}
_ZN8simdjson8fallback8ondemand14value_iterator10get_uint64Ev:
  512|  4.29k|simdjson_warn_unused simdjson_inline simdjson_result<uint64_t> value_iterator::get_uint64() noexcept {
  513|  4.29k|  auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64"));
  514|  4.29k|  if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); }
  ------------------
  |  Branch (514:6): [True: 1.87k, False: 2.42k]
  ------------------
  515|  4.29k|  return result;
  516|  4.29k|}
_ZN8simdjson8fallback8ondemand14value_iterator7is_nullEv:
  547|  4.20k|simdjson_inline simdjson_result<bool> value_iterator::is_null() noexcept {
  548|  4.20k|  bool is_null_value;
  549|  4.20k|  SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value));
  ------------------
  |  |  279|  4.20k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 478, False: 3.72k]
  |  |  ------------------
  ------------------
  550|  3.72k|  if(is_null_value) { advance_non_root_scalar("null"); }
  ------------------
  |  Branch (550:6): [True: 403, False: 3.32k]
  ------------------
  551|  3.72k|  return is_null_value;
  552|  4.20k|}
_ZNK8simdjson8fallback8ondemand14value_iterator10parse_nullEPKh:
  493|  4.20k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::parse_null(const uint8_t *json) const noexcept {
  494|  4.20k|  bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]);
  ------------------
  |  Branch (494:25): [True: 413, False: 3.78k]
  |  Branch (494:65): [True: 403, False: 10]
  ------------------
  495|       |  // if we start with 'n', we must be a null
  496|  4.20k|  if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); }
  ------------------
  |  Branch (496:6): [True: 3.79k, False: 403]
  |  Branch (496:25): [True: 478, False: 3.32k]
  ------------------
  497|  3.72k|  return is_null_string;
  498|  4.20k|}
_ZN8simdjson8fallback8ondemand14value_iterator10skip_childEv:
  756|  41.7k|simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept {
  757|  41.7k|  SIMDJSON_ASSUME( _json_iter->token._position > _start_position );
  ------------------
  |  |  181|  41.7k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.7k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  758|  41.7k|  SIMDJSON_ASSUME( _json_iter->_depth >= _depth );
  ------------------
  |  |  181|  41.7k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.7k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  759|       |
  760|  41.7k|  return _json_iter->skip_child(depth());
  761|  41.7k|}
_ZN8simdjson8fallback8ondemand14value_iterator16has_next_elementEv:
  469|  41.5k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::has_next_element() noexcept {
  470|  41.5k|  assert_at_next();
  471|       |
  472|  41.5k|  logger::log_event(*this, "has_next_element");
  473|  41.5k|  switch (*_json_iter->return_current_and_advance()) {
  474|  3.28k|    case ']':
  ------------------
  |  Branch (474:5): [True: 3.28k, False: 38.2k]
  ------------------
  475|  3.28k|      logger::log_end_value(*_json_iter, "array");
  476|  3.28k|      SIMDJSON_TRY( end_container() );
  ------------------
  |  |  279|  3.28k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 3.28k]
  |  |  ------------------
  ------------------
  477|  3.28k|      return false;
  478|  37.6k|    case ',':
  ------------------
  |  Branch (478:5): [True: 37.6k, False: 3.94k]
  ------------------
  479|  37.6k|      _json_iter->descend_to(depth()+1);
  480|  37.6k|      return true;
  481|    658|    default:
  ------------------
  |  Branch (481:5): [True: 658, False: 40.9k]
  ------------------
  482|    658|      return report_error(TAPE_ERROR, "Missing comma between array elements");
  483|  41.5k|  }
  484|  41.5k|}
_ZNK8simdjson8fallback8ondemand14value_iterator14assert_at_nextEv:
  932|  41.5k|inline void value_iterator::assert_at_next() const noexcept {
  933|  41.5k|  SIMDJSON_ASSUME( _json_iter->token._position > _start_position );
  ------------------
  |  |  181|  41.5k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.5k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  934|  41.5k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth );
  ------------------
  |  |  181|  41.5k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.5k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  935|  41.5k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  181|  41.5k|#define SIMDJSON_ASSUME(COND) do { if (!(COND)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (181:40): [True: 0, False: 41.5k]
  |  |  |  Branch (181:83): [Folded - Ignored]
  |  |  ------------------
  ------------------
  936|  41.5k|}
_ZNK8simdjson8fallback8ondemand14value_iterator9json_iterEv:
  804|  41.5k|simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept {
  805|  41.5k|  return *_json_iter;
  806|  41.5k|}

_ZN8simdjson8fallback8ondemand14value_iteratorC2Ev:
   32|  13.4k|  simdjson_inline value_iterator() noexcept = default;

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115trailing_zeroesEm:
   16|  11.8M|simdjson_inline int trailing_zeroes(uint64_t input_num) {
   17|       |#if SIMDJSON_REGULAR_VISUAL_STUDIO
   18|       |  return (int)_tzcnt_u64(input_num);
   19|       |#else // SIMDJSON_REGULAR_VISUAL_STUDIO
   20|       |  ////////
   21|       |  // You might expect the next line to be equivalent to
   22|       |  // return (int)_tzcnt_u64(input_num);
   23|       |  // but the generated code differs and might be less efficient?
   24|       |  ////////
   25|  11.8M|  return __builtin_ctzll(input_num);
   26|  11.8M|#endif // SIMDJSON_REGULAR_VISUAL_STUDIO
   27|  11.8M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_112add_overflowEmmPm:
   51|  5.94k|                                uint64_t *result) {
   52|       |#if SIMDJSON_REGULAR_VISUAL_STUDIO
   53|       |  return _addcarry_u64(0, value1, value2,
   54|       |                       reinterpret_cast<unsigned __int64 *>(result));
   55|       |#else
   56|  5.94k|  return __builtin_uaddll_overflow(value1, value2,
   57|  5.94k|                                   reinterpret_cast<unsigned long long *>(result));
   58|  5.94k|#endif
   59|  5.94k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_110count_onesEm:
   45|   270k|simdjson_inline long long int count_ones(uint64_t input_num) {
   46|   270k|  return _popcnt64(input_num);
   47|   270k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116clear_lowest_bitEm:
   30|  11.8M|simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) {
   31|  11.8M|  return _blsr_u64(input_num);
   32|  11.8M|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_110prefix_xorEm:
   13|   706k|simdjson_inline uint64_t prefix_xor(const uint64_t bitmask) {
   14|       |  // There should be no such thing with a processor supporting avx2
   15|       |  // but not clmul.
   16|   706k|  __m128i all_ones = _mm_set1_epi8('\xFF');
   17|   706k|  __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0);
   18|   706k|  return _mm_cvtsi128_si64(result);
   19|   706k|}

_ZN8simdjson7haswell14implementationC2Ev:
   21|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ev:
  226|  14.9k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   93|  14.9k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   45|  14.9k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   17|  14.9k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  304|   706k|    simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8<T>::load(ptr), simd8<T>::load(ptr+32)} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE4loadEPKh:
   77|  1.51M|    static simdjson_inline simd8<T> load(const T values[32]) {
   78|  1.51M|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   79|  1.51M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  227|  19.0M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   94|  19.0M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   46|  19.0M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   20|  19.0M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  325|   706k|    simdjson_inline simd8<T> reduce_or() const {
  326|   706k|      return this->chunks[0] | this->chunks[1];
  327|   706k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   27|  3.11M|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   23|  35.8M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  278|   706k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   31|   806k|    simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast<Child*>(this); *this_cast = *this_cast | other; return *this_cast; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi1EEENS4_IhEES8_:
   53|   190k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   190k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   190k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  284|   380k|    simdjson_inline simd8<uint8_t> shr() const { return simd8<uint8_t>(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_:
  172|   571k|        L replace12, L replace13, L replace14, L replace15) const {
  173|   571k|      return lookup_16(simd8<L>::repeat_16(
  174|   571k|        replace0,  replace1,  replace2,  replace3,
  175|   571k|        replace4,  replace5,  replace6,  replace7,
  176|   571k|        replace8,  replace9,  replace10, replace11,
  177|   571k|        replace12, replace13, replace14, replace15
  178|   571k|      ));
  179|   571k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  110|   571k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  111|   571k|      return _mm256_shuffle_epi8(lookup_table, *this);
  112|   571k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   24|   761k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  248|  1.98M|    ) {
  249|  1.98M|      return simd8<uint8_t>(
  250|  1.98M|        v0, v1, v2, v3, v4, v5, v6, v7,
  251|  1.98M|        v8, v9, v10,v11,v12,v13,v14,v15,
  252|  1.98M|        v0, v1, v2, v3, v4, v5, v6, v7,
  253|  1.98M|        v8, v9, v10,v11,v12,v13,v14,v15
  254|  1.98M|      );
  255|  1.98M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|  1.98M|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   28|  1.14M|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  229|  2.56M|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   75|  4.68M|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   53|   190k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   190k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   190k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   53|   190k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   190k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   190k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  259|   476k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm256_subs_epu8(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEC2EDv4_x:
  186|   380k|    simdjson_inline simd8(const __m256i _value) : base8_numeric<int8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaEC2EDv4_x:
   94|   380k|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IaNS2_5simd8IbEEEC2EDv4_x:
   46|   380k|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEC2EDv4_x:
   20|   380k|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEgtES4_:
  219|   190k|    simdjson_inline simd8<bool> operator>(const simd8<int8_t> other) const { return _mm256_cmpgt_epi8(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEcvRKDv4_xEv:
   23|   380k|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IbEC2EDv4_x:
   64|  7.26M|    simdjson_inline simd8<bool>(const __m256i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv4_x:
   46|  7.26M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv4_x:
   20|  7.26M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEC2Ea:
  188|   190k|    simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaE5splatEa:
   75|   190k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRDv4_xEv:
   24|   190k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   29|   190k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  231|  98.4k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  265|  95.2k|    simdjson_inline simd8<uint8_t> gt_bits(const simd8<uint8_t> other) const { return this->saturating_sub(other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21any_bits_set_anywhereEv:
  280|  4.63k|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  279|  4.63k|    simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5storeEPh:
   97|  3.25k|    simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simdeqENS2_5simd8IhEES4_:
   48|  7.07M|    friend simdjson_really_inline Mask operator==(const simd8<T> lhs, const simd8<T> rhs) { return _mm256_cmpeq_epi8(lhs, rhs); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IbE10to_bitmaskEv:
   68|  7.07M|    simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRKDv4_xEv:
   23|  7.07M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqEh:
  337|  1.41M|    simdjson_inline uint64_t eq(const T m) const {
  338|  1.41M|      const simd8<T> mask = simd8<T>::splat(m);
  339|  1.41M|      return  simd8x64<bool>(
  340|  1.41M|        this->chunks[0] == mask,
  341|  1.41M|        this->chunks[1] == mask
  342|  1.41M|      ).to_bitmask();
  343|  1.41M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbEC2ENS2_5simd8IbEES6_:
  303|  3.53M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbE10to_bitmaskEv:
  319|  3.53M|    simdjson_inline uint64_t to_bitmask() const {
  320|  3.53M|      uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask());
  321|  3.53M|      uint64_t r_hi =                       this->chunks[1].to_bitmask();
  322|  3.53M|      return r_lo | (r_hi << 32);
  323|  3.53M|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqERKS4_:
  345|  1.41M|    simdjson_inline uint64_t eq(const simd8x64<uint8_t> &other) const {
  346|  1.41M|      return  simd8x64<bool>(
  347|  1.41M|        this->chunks[0] == other.chunks[0],
  348|  1.41M|        this->chunks[1] == other.chunks[1]
  349|  1.41M|      ).to_bitmask();
  350|  1.41M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2ENS2_5simd8IhEES6_:
  303|  2.11M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE4lteqEh:
  352|   706k|    simdjson_inline uint64_t lteq(const T m) const {
  353|   706k|      const simd8<T> mask = simd8<T>::splat(m);
  354|   706k|      return  simd8x64<bool>(
  355|   706k|        this->chunks[0] <= mask,
  356|   706k|        this->chunks[1] <= mask
  357|   706k|      ).to_bitmask();
  358|   706k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEleES4_:
  268|  1.41M|    simdjson_inline simd8<bool> operator<=(const simd8<uint8_t> other) const { return other.max_val(*this) == other; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7max_valES4_:
  262|  1.41M|    simdjson_inline simd8<uint8_t> max_val(const simd8<uint8_t> other) const { return _mm256_max_epu8(*this, other); }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote13copy_and_findEPKhPh:
   29|  3.25k|simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) {
   30|       |  // this can read up to 15 bytes beyond the buffer size, but we require
   31|       |  // SIMDJSON_PADDING of padding
   32|  3.25k|  static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes");
   33|  3.25k|  simd8<uint8_t> v(src);
   34|       |  // store to dest unconditionally - we can overwrite the bits we don't like later
   35|  3.25k|  v.store(dst);
   36|  3.25k|  return {
   37|  3.25k|      static_cast<uint32_t>((v == '\\').to_bitmask()),     // bs_bits
   38|  3.25k|      static_cast<uint32_t>((v == '"').to_bitmask()), // quote_bits
   39|  3.25k|  };
   40|  3.25k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote15has_quote_firstEv:
   20|  3.25k|  simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote11quote_indexEv:
   22|    446|  simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote13has_backslashEv:
   21|  2.80k|  simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote15backslash_indexEv:
   23|  2.60k|  simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); }

_ZN8simdjson7icelake14implementationC2Ev:
   21|      1|  ) {}

_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEptEv:
  230|  5.10k|  T* operator->() { return ptr.load(); }
_ZNK8simdjson14implementation25required_instruction_setsEv:
   90|      2|  virtual uint32_t required_instruction_sets() const { return _required_instruction_sets; }
_ZN8simdjson14implementationC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_j:
  146|      5|  {
  147|      5|  }
_ZN8simdjson8internal29available_implementation_listC2Ev:
  176|      1|  simdjson_inline available_implementation_list() {}
_ZN8simdjson14implementationD2Ev:
  148|      5|  virtual ~implementation()=default;
_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEaSEPS3_:
  231|      1|  atomic_ptr& operator=(T *_ptr) { ptr = _ptr; return *this; }
_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEcvPS3_Ev:
  228|      1|  operator T*() { return ptr.load(); }
_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEC2EPS3_:
  222|      1|  atomic_ptr(T *_ptr) : ptr{_ptr} {}

_ZN8simdjson12is_streamingENS_11stage1_modeE:
   27|  9.98k|inline bool is_streaming(stage1_mode mode) {
   28|       |  // performance note: it is probably faster to check that mode is different
   29|       |  // from regular than checking that it is either streaming_partial or streaming_final.
   30|  9.98k|  return (mode != stage1_mode::regular);
   31|       |  // return (mode == stage1_mode::streaming_partial || mode == stage1_mode::streaming_final);
   32|  9.98k|}
_ZNK8simdjson8internal25dom_parser_implementation8capacityEv:
  228|  5.10k|simdjson_inline size_t dom_parser_implementation::capacity() const noexcept {
  229|  5.10k|  return _capacity;
  230|  5.10k|}
_ZN8simdjson8internal25dom_parser_implementationC2Ev:
  224|  5.10k|simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept = default;
_ZN8simdjson8internal25dom_parser_implementationD2Ev:
  166|  5.10k|  virtual ~dom_parser_implementation() = default;

simdjson.cpp:_ZN8simdjson8internalL30detect_supported_architecturesEv:
  151|      1|static inline uint32_t detect_supported_architectures() {
  152|      1|  uint32_t eax, ebx, ecx, edx;
  153|      1|  uint32_t host_isa = 0x0;
  154|       |
  155|       |  // EBX for EAX=0x1
  156|      1|  eax = 0x1;
  157|      1|  ecx = 0x0;
  158|      1|  cpuid(&eax, &ebx, &ecx, &edx);
  159|       |
  160|      1|  if (ecx & cpuid_sse42_bit) {
  ------------------
  |  Branch (160:7): [True: 1, False: 0]
  ------------------
  161|      1|    host_isa |= instruction_set::SSE42;
  162|      1|  } else {
  163|      0|    return host_isa; // everything after is redundant
  164|      0|  }
  165|       |
  166|      1|  if (ecx & cpuid_pclmulqdq_bit) {
  ------------------
  |  Branch (166:7): [True: 1, False: 0]
  ------------------
  167|      1|    host_isa |= instruction_set::PCLMULQDQ;
  168|      1|  }
  169|       |
  170|       |
  171|      1|  if ((ecx & cpuid_osxsave) != cpuid_osxsave) {
  ------------------
  |  Branch (171:7): [True: 0, False: 1]
  ------------------
  172|      0|    return host_isa;
  173|      0|  }
  174|       |
  175|       |  // xgetbv for checking if the OS saves registers
  176|      1|  uint64_t xcr0 = xgetbv();
  177|       |
  178|      1|  if ((xcr0 & cpuid_avx256_saved) == 0) {
  ------------------
  |  Branch (178:7): [True: 0, False: 1]
  ------------------
  179|      0|    return host_isa;
  180|      0|  }
  181|       |
  182|       |  // ECX for EAX=0x7
  183|      1|  eax = 0x7;
  184|      1|  ecx = 0x0;
  185|      1|  cpuid(&eax, &ebx, &ecx, &edx);
  186|      1|  if (ebx & cpuid_avx2_bit) {
  ------------------
  |  Branch (186:7): [True: 1, False: 0]
  ------------------
  187|      1|    host_isa |= instruction_set::AVX2;
  188|      1|  }
  189|      1|  if (ebx & cpuid_bmi1_bit) {
  ------------------
  |  Branch (189:7): [True: 1, False: 0]
  ------------------
  190|      1|    host_isa |= instruction_set::BMI1;
  191|      1|  }
  192|       |
  193|      1|  if (ebx & cpuid_bmi2_bit) {
  ------------------
  |  Branch (193:7): [True: 1, False: 0]
  ------------------
  194|      1|    host_isa |= instruction_set::BMI2;
  195|      1|  }
  196|       |
  197|      1|  if (!((xcr0 & cpuid_avx512_saved) == cpuid_avx512_saved)) {
  ------------------
  |  Branch (197:7): [True: 1, False: 0]
  ------------------
  198|      1|     return host_isa;
  199|      1|  }
  200|       |
  201|      0|  if (ebx & cpuid_avx512f_bit) {
  ------------------
  |  Branch (201:7): [True: 0, False: 0]
  ------------------
  202|      0|    host_isa |= instruction_set::AVX512F;
  203|      0|  }
  204|       |
  205|      0|  if (ebx & cpuid_avx512dq_bit) {
  ------------------
  |  Branch (205:7): [True: 0, False: 0]
  ------------------
  206|      0|    host_isa |= instruction_set::AVX512DQ;
  207|      0|  }
  208|       |
  209|      0|  if (ebx & cpuid_avx512ifma_bit) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    host_isa |= instruction_set::AVX512IFMA;
  211|      0|  }
  212|       |
  213|      0|  if (ebx & cpuid_avx512pf_bit) {
  ------------------
  |  Branch (213:7): [True: 0, False: 0]
  ------------------
  214|      0|    host_isa |= instruction_set::AVX512PF;
  215|      0|  }
  216|       |
  217|      0|  if (ebx & cpuid_avx512er_bit) {
  ------------------
  |  Branch (217:7): [True: 0, False: 0]
  ------------------
  218|      0|    host_isa |= instruction_set::AVX512ER;
  219|      0|  }
  220|       |
  221|      0|  if (ebx & cpuid_avx512cd_bit) {
  ------------------
  |  Branch (221:7): [True: 0, False: 0]
  ------------------
  222|      0|    host_isa |= instruction_set::AVX512CD;
  223|      0|  }
  224|       |
  225|      0|  if (ebx & cpuid_avx512bw_bit) {
  ------------------
  |  Branch (225:7): [True: 0, False: 0]
  ------------------
  226|      0|    host_isa |= instruction_set::AVX512BW;
  227|      0|  }
  228|       |
  229|      0|  if (ebx & cpuid_avx512vl_bit) {
  ------------------
  |  Branch (229:7): [True: 0, False: 0]
  ------------------
  230|      0|    host_isa |= instruction_set::AVX512VL;
  231|      0|  }
  232|       |
  233|      0|  if (ecx & cpuid_avx512vbmi2_bit) {
  ------------------
  |  Branch (233:7): [True: 0, False: 0]
  ------------------
  234|      0|    host_isa |= instruction_set::AVX512VBMI2;
  235|      0|  }
  236|       |
  237|      0|  return host_isa;
  238|      1|}
simdjson.cpp:_ZN8simdjson8internalL5cpuidEPjS1_S1_S1_:
  119|      2|                         uint32_t *edx) {
  120|       |#if defined(_MSC_VER)
  121|       |  int cpu_info[4];
  122|       |  __cpuidex(cpu_info, *eax, *ecx);
  123|       |  *eax = cpu_info[0];
  124|       |  *ebx = cpu_info[1];
  125|       |  *ecx = cpu_info[2];
  126|       |  *edx = cpu_info[3];
  127|       |#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)
  128|       |  uint32_t level = *eax;
  129|       |  __get_cpuid(level, eax, ebx, ecx, edx);
  130|       |#else
  131|      2|  uint32_t a = *eax, b, c = *ecx, d;
  132|      2|  asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d));
  133|      2|  *eax = a;
  134|      2|  *ebx = b;
  135|      2|  *ecx = c;
  136|      2|  *edx = d;
  137|      2|#endif
  138|      2|}
simdjson.cpp:_ZN8simdjson8internalL6xgetbvEv:
  141|      1|static inline uint64_t xgetbv() {
  142|       |#if defined(_MSC_VER)
  143|       |  return _xgetbv(0);
  144|       |#else
  145|      1|  uint32_t xcr0_lo, xcr0_hi;
  146|      1|  asm volatile("xgetbv\n\t" : "=a" (xcr0_lo), "=d" (xcr0_hi) : "c" (0));
  147|      1|  return xcr0_lo | (uint64_t(xcr0_hi) << 32);
  148|      1|#endif
  149|      1|}

_ZN8simdjson13padded_stringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   66|  5.10k|    : viable_size(sv_.size()), data_ptr(internal::allocate_padded_buffer(sv_.size())) {
   67|  5.10k|  if(simdjson_unlikely(!data_ptr)) {
  ------------------
  |  |  120|  5.10k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 7, False: 5.09k]
  |  |  ------------------
  ------------------
   68|       |    //allocation failed or zero size
   69|      7|    viable_size = 0;
   70|      7|    return;
   71|      7|  }
   72|  5.09k|  if (sv_.size()) {
  ------------------
  |  Branch (72:7): [True: 4.99k, False: 104]
  ------------------
   73|  4.99k|    std::memcpy(data_ptr, sv_.data(), sv_.size());
   74|  4.99k|  }
   75|  5.09k|}
_ZN8simdjson8internal22allocate_padded_bufferEm:
   21|  5.10k|inline char *allocate_padded_buffer(size_t length) noexcept {
   22|  5.10k|  const size_t totalpaddedlength = length + SIMDJSON_PADDING;
   23|  5.10k|  if(totalpaddedlength<length) {
  ------------------
  |  Branch (23:6): [True: 0, False: 5.10k]
  ------------------
   24|       |    // overflow
   25|      0|    return nullptr;
   26|      0|  }
   27|  5.10k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   28|       |  // avoid getting out of memory
   29|  5.10k|  if (totalpaddedlength>(1UL<<20)) {
  ------------------
  |  Branch (29:7): [True: 7, False: 5.09k]
  ------------------
   30|      7|    return nullptr;
   31|      7|  }
   32|  5.09k|#endif
   33|       |
   34|  5.09k|  char *padded_buffer = new (std::nothrow) char[totalpaddedlength];
   35|  5.09k|  if (padded_buffer == nullptr) {
  ------------------
  |  Branch (35:7): [True: 0, False: 5.09k]
  ------------------
   36|      0|    return nullptr;
   37|      0|  }
   38|       |  // We write nulls in the padded region to avoid having uninitialized
   39|       |  // content which may trigger warning for some sanitizers
   40|  5.09k|  std::memset(padded_buffer + length, 0, totalpaddedlength - length);
   41|  5.09k|  return padded_buffer;
   42|  5.09k|} // allocate_padded_buffer()
_ZNK8simdjson13padded_stringcvNS_18padded_string_viewEEv:
  113|  5.10k|inline padded_string::operator padded_string_view() const noexcept {
  114|  5.10k|  return padded_string_view(data(), length(), length() + SIMDJSON_PADDING);
  115|  5.10k|}
_ZNK8simdjson13padded_string4dataEv:
  107|  5.10k|inline const char *padded_string::data() const noexcept { return data_ptr; }
_ZNK8simdjson13padded_string6lengthEv:
  105|  10.2k|inline size_t padded_string::length() const noexcept { return viable_size; }
_ZN8simdjson13padded_stringD2Ev:
   99|  5.10k|inline padded_string::~padded_string() noexcept {
  100|  5.10k|  delete[] data_ptr;
  101|  5.10k|}

_ZNK8simdjson18padded_string_view7paddingEv:
   36|  5.10k|inline size_t padded_string_view::padding() const noexcept { return capacity() - length(); }
_ZNK8simdjson18padded_string_view8capacityEv:
   34|  5.10k|inline size_t padded_string_view::capacity() const noexcept { return _capacity; }
_ZN8simdjson18padded_string_viewC2EPKcmm:
   16|  5.10k|{
   17|  5.10k|}

_ZN8simdjson8westmere14implementationC2Ev:
   20|      1|  simdjson_inline implementation() : simdjson::implementation("westmere", "Intel/AMD SSE4.2", internal::instruction_set::SSE42 | internal::instruction_set::PCLMULQDQ) {}

_ZN8simdjson8internal10is_integerEc:
   59|  12.6M|bool is_integer(char c)  noexcept  { return (c >= '0' && c <= '9'); }
  ------------------
  |  Branch (59:46): [True: 12.6M, False: 10.4k]
  |  Branch (59:58): [True: 12.6M, False: 4.84k]
  ------------------
_ZN8simdjson8internal13parse_decimalERPKc:
   62|  8.41k|decimal parse_decimal(const char *&p) noexcept {
   63|  8.41k|  decimal answer;
   64|  8.41k|  answer.num_digits = 0;
   65|  8.41k|  answer.decimal_point = 0;
   66|  8.41k|  answer.truncated = false;
   67|  8.41k|  answer.negative = (*p == '-');
   68|  8.41k|  if ((*p == '-') || (*p == '+')) {
  ------------------
  |  Branch (68:7): [True: 0, False: 8.41k]
  |  Branch (68:22): [True: 0, False: 8.41k]
  ------------------
   69|      0|    ++p;
   70|      0|  }
   71|       |
   72|  10.4k|  while (*p == '0') {
  ------------------
  |  Branch (72:10): [True: 2.07k, False: 8.41k]
  ------------------
   73|  2.07k|    ++p;
   74|  2.07k|  }
   75|  11.9M|  while (is_integer(*p)) {
  ------------------
  |  Branch (75:10): [True: 11.9M, False: 8.41k]
  ------------------
   76|  11.9M|    if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (76:9): [True: 181k, False: 11.7M]
  ------------------
   77|   181k|      answer.digits[answer.num_digits] = uint8_t(*p - '0');
   78|   181k|    }
   79|  11.9M|    answer.num_digits++;
   80|  11.9M|    ++p;
   81|  11.9M|  }
   82|  8.41k|  if (*p == '.') {
  ------------------
  |  Branch (82:7): [True: 2.96k, False: 5.44k]
  ------------------
   83|  2.96k|    ++p;
   84|  2.96k|    const char *first_after_period = p;
   85|       |    // if we have not yet encountered a zero, we have to skip it as well
   86|  2.96k|    if (answer.num_digits == 0) {
  ------------------
  |  Branch (86:9): [True: 1.73k, False: 1.23k]
  ------------------
   87|       |      // skip zeros
   88|   540k|      while (*p == '0') {
  ------------------
  |  Branch (88:14): [True: 538k, False: 1.73k]
  ------------------
   89|   538k|        ++p;
   90|   538k|      }
   91|  1.73k|    }
   92|   690k|    while (is_integer(*p)) {
  ------------------
  |  Branch (92:12): [True: 687k, False: 2.96k]
  ------------------
   93|   687k|      if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (93:11): [True: 171k, False: 515k]
  ------------------
   94|   171k|        answer.digits[answer.num_digits] = uint8_t(*p - '0');
   95|   171k|      }
   96|   687k|      answer.num_digits++;
   97|   687k|      ++p;
   98|   687k|    }
   99|  2.96k|    answer.decimal_point = int32_t(first_after_period - p);
  100|  2.96k|  }
  101|  8.41k|  if(answer.num_digits > 0) {
  ------------------
  |  Branch (101:6): [True: 7.31k, False: 1.10k]
  ------------------
  102|  7.31k|    const char *preverse = p - 1;
  103|  7.31k|    int32_t trailing_zeros = 0;
  104|  17.6k|    while ((*preverse == '0') || (*preverse == '.')) {
  ------------------
  |  Branch (104:12): [True: 10.0k, False: 7.62k]
  |  Branch (104:34): [True: 317, False: 7.31k]
  ------------------
  105|  10.3k|      if(*preverse == '0') { trailing_zeros++; };
  ------------------
  |  Branch (105:10): [True: 10.0k, False: 317]
  ------------------
  106|  10.3k|      --preverse;
  107|  10.3k|    }
  108|  7.31k|    answer.decimal_point += int32_t(answer.num_digits);
  109|  7.31k|    answer.num_digits -= uint32_t(trailing_zeros);
  110|  7.31k|  }
  111|  8.41k|  if(answer.num_digits > max_digits ) {
  ------------------
  |  Branch (111:6): [True: 281, False: 8.13k]
  ------------------
  112|    281|    answer.num_digits = max_digits;
  113|    281|    answer.truncated = true;
  114|    281|  }
  115|  8.41k|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (115:7): [True: 1.20k, False: 7.21k]
  |  Branch (115:22): [True: 2.69k, False: 4.51k]
  ------------------
  116|  3.90k|    ++p;
  117|  3.90k|    bool neg_exp = false;
  118|  3.90k|    if ('-' == *p) {
  ------------------
  |  Branch (118:9): [True: 999, False: 2.90k]
  ------------------
  119|    999|      neg_exp = true;
  120|    999|      ++p;
  121|  2.90k|    } else if ('+' == *p) {
  ------------------
  |  Branch (121:16): [True: 200, False: 2.70k]
  ------------------
  122|    200|      ++p;
  123|    200|    }
  124|  3.90k|    int32_t exp_number = 0; // exponential part
  125|  18.2k|    while (is_integer(*p)) {
  ------------------
  |  Branch (125:12): [True: 14.3k, False: 3.90k]
  ------------------
  126|  14.3k|      uint8_t digit = uint8_t(*p - '0');
  127|  14.3k|      if (exp_number < 0x10000) {
  ------------------
  |  Branch (127:11): [True: 13.3k, False: 1.01k]
  ------------------
  128|  13.3k|        exp_number = 10 * exp_number + digit;
  129|  13.3k|      }
  130|  14.3k|      ++p;
  131|  14.3k|    }
  132|  3.90k|    answer.decimal_point += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (132:30): [True: 999, False: 2.90k]
  ------------------
  133|  3.90k|  }
  134|  8.41k|  return answer;
  135|  8.41k|}
_ZN8simdjson8internal5roundERNS0_7decimalE:
  323|  6.32k|uint64_t round(decimal &h) {
  324|  6.32k|  if ((h.num_digits == 0) || (h.decimal_point < 0)) {
  ------------------
  |  Branch (324:7): [True: 0, False: 6.32k]
  |  Branch (324:30): [True: 211, False: 6.10k]
  ------------------
  325|    211|    return 0;
  326|  6.10k|  } else if (h.decimal_point > 18) {
  ------------------
  |  Branch (326:14): [True: 0, False: 6.10k]
  ------------------
  327|      0|    return UINT64_MAX;
  328|      0|  }
  329|       |  // at this point, we know that h.decimal_point >= 0
  330|  6.10k|  uint32_t dp = uint32_t(h.decimal_point);
  331|  6.10k|  uint64_t n = 0;
  332|  99.8k|  for (uint32_t i = 0; i < dp; i++) {
  ------------------
  |  Branch (332:24): [True: 93.7k, False: 6.10k]
  ------------------
  333|  93.7k|    n = (10 * n) + ((i < h.num_digits) ? h.digits[i] : 0);
  ------------------
  |  Branch (333:21): [True: 91.3k, False: 2.41k]
  ------------------
  334|  93.7k|  }
  335|  6.10k|  bool round_up = false;
  336|  6.10k|  if (dp < h.num_digits) {
  ------------------
  |  Branch (336:7): [True: 5.72k, False: 383]
  ------------------
  337|  5.72k|    round_up = h.digits[dp] >= 5; // normally, we round up
  338|       |    // but we may need to round to even!
  339|  5.72k|    if ((h.digits[dp] == 5) && (dp + 1 == h.num_digits)) {
  ------------------
  |  Branch (339:9): [True: 1.87k, False: 3.85k]
  |  Branch (339:32): [True: 403, False: 1.47k]
  ------------------
  340|    403|      round_up = h.truncated || ((dp > 0) && (1 & h.digits[dp - 1]));
  ------------------
  |  Branch (340:18): [True: 194, False: 209]
  |  Branch (340:34): [True: 209, False: 0]
  |  Branch (340:46): [True: 180, False: 29]
  ------------------
  341|    403|    }
  342|  5.72k|  }
  343|  6.10k|  if (round_up) {
  ------------------
  |  Branch (343:7): [True: 3.80k, False: 2.30k]
  ------------------
  344|  3.80k|    n++;
  345|  3.80k|  }
  346|  6.10k|  return n;
  347|  6.32k|}
_ZN8simdjson8internal18decimal_left_shiftERNS0_7decimalEj:
  350|  22.8k|void decimal_left_shift(decimal &h, uint32_t shift) {
  351|  22.8k|  if (h.num_digits == 0) {
  ------------------
  |  Branch (351:7): [True: 0, False: 22.8k]
  ------------------
  352|      0|    return;
  353|      0|  }
  354|  22.8k|  uint32_t num_new_digits = number_of_digits_decimal_left_shift(h, shift);
  355|  22.8k|  int32_t read_index = int32_t(h.num_digits - 1);
  356|  22.8k|  uint32_t write_index = h.num_digits - 1 + num_new_digits;
  357|  22.8k|  uint64_t n = 0;
  358|       |
  359|  3.37M|  while (read_index >= 0) {
  ------------------
  |  Branch (359:10): [True: 3.35M, False: 22.8k]
  ------------------
  360|  3.35M|    n += uint64_t(h.digits[read_index]) << shift;
  361|  3.35M|    uint64_t quotient = n / 10;
  362|  3.35M|    uint64_t remainder = n - (10 * quotient);
  363|  3.35M|    if (write_index < max_digits) {
  ------------------
  |  Branch (363:9): [True: 3.34M, False: 3.67k]
  ------------------
  364|  3.34M|      h.digits[write_index] = uint8_t(remainder);
  365|  3.34M|    } else if (remainder > 0) {
  ------------------
  |  Branch (365:16): [True: 3.08k, False: 592]
  ------------------
  366|  3.08k|      h.truncated = true;
  367|  3.08k|    }
  368|  3.35M|    n = quotient;
  369|  3.35M|    write_index--;
  370|  3.35M|    read_index--;
  371|  3.35M|  }
  372|   286k|  while (n > 0) {
  ------------------
  |  Branch (372:10): [True: 263k, False: 22.8k]
  ------------------
  373|   263k|    uint64_t quotient = n / 10;
  374|   263k|    uint64_t remainder = n - (10 * quotient);
  375|   263k|    if (write_index < max_digits) {
  ------------------
  |  Branch (375:9): [True: 263k, False: 0]
  ------------------
  376|   263k|      h.digits[write_index] = uint8_t(remainder);
  377|   263k|    } else if (remainder > 0) {
  ------------------
  |  Branch (377:16): [True: 0, False: 0]
  ------------------
  378|      0|      h.truncated = true;
  379|      0|    }
  380|   263k|    n = quotient;
  381|   263k|    write_index--;
  382|   263k|  }
  383|  22.8k|  h.num_digits += num_new_digits;
  384|  22.8k|  if (h.num_digits > max_digits) {
  ------------------
  |  Branch (384:7): [True: 262, False: 22.5k]
  ------------------
  385|    262|    h.num_digits = max_digits;
  386|    262|  }
  387|  22.8k|  h.decimal_point += int32_t(num_new_digits);
  388|  22.8k|  trim(h);
  389|  22.8k|}
_ZN8simdjson8internal19decimal_right_shiftERNS0_7decimalEj:
  392|  21.7k|void decimal_right_shift(decimal &h, uint32_t shift) {
  393|  21.7k|  uint32_t read_index = 0;
  394|  21.7k|  uint32_t write_index = 0;
  395|       |
  396|  21.7k|  uint64_t n = 0;
  397|       |
  398|   311k|  while ((n >> shift) == 0) {
  ------------------
  |  Branch (398:10): [True: 290k, False: 20.6k]
  ------------------
  399|   290k|    if (read_index < h.num_digits) {
  ------------------
  |  Branch (399:9): [True: 289k, False: 1.13k]
  ------------------
  400|   289k|      n = (10 * n) + h.digits[read_index++];
  401|   289k|    } else if (n == 0) {
  ------------------
  |  Branch (401:16): [True: 0, False: 1.13k]
  ------------------
  402|      0|      return;
  403|  1.13k|    } else {
  404|  18.1k|      while ((n >> shift) == 0) {
  ------------------
  |  Branch (404:14): [True: 16.9k, False: 1.13k]
  ------------------
  405|  16.9k|        n = 10 * n;
  406|  16.9k|        read_index++;
  407|  16.9k|      }
  408|  1.13k|      break;
  409|  1.13k|    }
  410|   290k|  }
  411|  21.7k|  h.decimal_point -= int32_t(read_index - 1);
  412|  21.7k|  if (h.decimal_point < -decimal_point_range) { // it is zero
  ------------------
  |  Branch (412:7): [True: 0, False: 21.7k]
  ------------------
  413|      0|    h.num_digits = 0;
  414|      0|    h.decimal_point = 0;
  415|      0|    h.negative = false;
  416|      0|    h.truncated = false;
  417|      0|    return;
  418|      0|  }
  419|  21.7k|  uint64_t mask = (uint64_t(1) << shift) - 1;
  420|  5.03M|  while (read_index < h.num_digits) {
  ------------------
  |  Branch (420:10): [True: 5.00M, False: 21.7k]
  ------------------
  421|  5.00M|    uint8_t new_digit = uint8_t(n >> shift);
  422|  5.00M|    n = (10 * (n & mask)) + h.digits[read_index++];
  423|  5.00M|    h.digits[write_index++] = new_digit;
  424|  5.00M|  }
  425|   934k|  while (n > 0) {
  ------------------
  |  Branch (425:10): [True: 912k, False: 21.7k]
  ------------------
  426|   912k|    uint8_t new_digit = uint8_t(n >> shift);
  427|   912k|    n = 10 * (n & mask);
  428|   912k|    if (write_index < max_digits) {
  ------------------
  |  Branch (428:9): [True: 907k, False: 5.34k]
  ------------------
  429|   907k|      h.digits[write_index++] = new_digit;
  430|   907k|    } else if (new_digit > 0) {
  ------------------
  |  Branch (430:16): [True: 4.76k, False: 583]
  ------------------
  431|  4.76k|      h.truncated = true;
  432|  4.76k|    }
  433|   912k|  }
  434|  21.7k|  h.num_digits = write_index;
  435|  21.7k|  trim(h);
  436|  21.7k|}
_ZN8simdjson8internal10from_charsEPKc:
  562|  8.41k|double from_chars(const char *first) noexcept {
  563|  8.41k|  bool negative = first[0] == '-';
  564|  8.41k|  if (negative) {
  ------------------
  |  Branch (564:7): [True: 198, False: 8.21k]
  ------------------
  565|    198|    first++;
  566|    198|  }
  567|  8.41k|  adjusted_mantissa am = parse_long_mantissa<binary_format<double>>(first);
  568|  8.41k|  uint64_t word = am.mantissa;
  569|  8.41k|  word |= uint64_t(am.power2)
  570|  8.41k|          << binary_format<double>::mantissa_explicit_bits();
  571|  8.41k|  word = negative ? word | (uint64_t(1) << binary_format<double>::sign_index())
  ------------------
  |  Branch (571:10): [True: 198, False: 8.21k]
  ------------------
  572|  8.41k|                  : word;
  573|  8.41k|  double value;
  574|  8.41k|  std::memcpy(&value, &word, sizeof(double));
  575|  8.41k|  return value;
  576|  8.41k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_135number_of_digits_decimal_left_shiftERNS0_7decimalEj:
  226|  22.8k|uint32_t number_of_digits_decimal_left_shift(decimal &h, uint32_t shift) {
  227|  22.8k|  shift &= 63;
  228|  22.8k|  const static uint16_t number_of_digits_decimal_left_shift_table[65] = {
  229|  22.8k|      0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817,
  230|  22.8k|      0x181D, 0x2024, 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067,
  231|  22.8k|      0x3073, 0x3080, 0x388E, 0x389C, 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF,
  232|  22.8k|      0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169, 0x5180, 0x5998, 0x59B0,
  233|  22.8k|      0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B, 0x72AA,
  234|  22.8k|      0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC,
  235|  22.8k|      0x8C02, 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C,
  236|  22.8k|      0x051C, 0x051C,
  237|  22.8k|  };
  238|  22.8k|  uint32_t x_a = number_of_digits_decimal_left_shift_table[shift];
  239|  22.8k|  uint32_t x_b = number_of_digits_decimal_left_shift_table[shift + 1];
  240|  22.8k|  uint32_t num_new_digits = x_a >> 11;
  241|  22.8k|  uint32_t pow5_a = 0x7FF & x_a;
  242|  22.8k|  uint32_t pow5_b = 0x7FF & x_b;
  243|  22.8k|  const static uint8_t
  244|  22.8k|      number_of_digits_decimal_left_shift_table_powers_of_5[0x051C] = {
  245|  22.8k|          5, 2, 5, 1, 2, 5, 6, 2, 5, 3, 1, 2, 5, 1, 5, 6, 2, 5, 7, 8, 1, 2, 5,
  246|  22.8k|          3, 9, 0, 6, 2, 5, 1, 9, 5, 3, 1, 2, 5, 9, 7, 6, 5, 6, 2, 5, 4, 8, 8,
  247|  22.8k|          2, 8, 1, 2, 5, 2, 4, 4, 1, 4, 0, 6, 2, 5, 1, 2, 2, 0, 7, 0, 3, 1, 2,
  248|  22.8k|          5, 6, 1, 0, 3, 5, 1, 5, 6, 2, 5, 3, 0, 5, 1, 7, 5, 7, 8, 1, 2, 5, 1,
  249|  22.8k|          5, 2, 5, 8, 7, 8, 9, 0, 6, 2, 5, 7, 6, 2, 9, 3, 9, 4, 5, 3, 1, 2, 5,
  250|  22.8k|          3, 8, 1, 4, 6, 9, 7, 2, 6, 5, 6, 2, 5, 1, 9, 0, 7, 3, 4, 8, 6, 3, 2,
  251|  22.8k|          8, 1, 2, 5, 9, 5, 3, 6, 7, 4, 3, 1, 6, 4, 0, 6, 2, 5, 4, 7, 6, 8, 3,
  252|  22.8k|          7, 1, 5, 8, 2, 0, 3, 1, 2, 5, 2, 3, 8, 4, 1, 8, 5, 7, 9, 1, 0, 1, 5,
  253|  22.8k|          6, 2, 5, 1, 1, 9, 2, 0, 9, 2, 8, 9, 5, 5, 0, 7, 8, 1, 2, 5, 5, 9, 6,
  254|  22.8k|          0, 4, 6, 4, 4, 7, 7, 5, 3, 9, 0, 6, 2, 5, 2, 9, 8, 0, 2, 3, 2, 2, 3,
  255|  22.8k|          8, 7, 6, 9, 5, 3, 1, 2, 5, 1, 4, 9, 0, 1, 1, 6, 1, 1, 9, 3, 8, 4, 7,
  256|  22.8k|          6, 5, 6, 2, 5, 7, 4, 5, 0, 5, 8, 0, 5, 9, 6, 9, 2, 3, 8, 2, 8, 1, 2,
  257|  22.8k|          5, 3, 7, 2, 5, 2, 9, 0, 2, 9, 8, 4, 6, 1, 9, 1, 4, 0, 6, 2, 5, 1, 8,
  258|  22.8k|          6, 2, 6, 4, 5, 1, 4, 9, 2, 3, 0, 9, 5, 7, 0, 3, 1, 2, 5, 9, 3, 1, 3,
  259|  22.8k|          2, 2, 5, 7, 4, 6, 1, 5, 4, 7, 8, 5, 1, 5, 6, 2, 5, 4, 6, 5, 6, 6, 1,
  260|  22.8k|          2, 8, 7, 3, 0, 7, 7, 3, 9, 2, 5, 7, 8, 1, 2, 5, 2, 3, 2, 8, 3, 0, 6,
  261|  22.8k|          4, 3, 6, 5, 3, 8, 6, 9, 6, 2, 8, 9, 0, 6, 2, 5, 1, 1, 6, 4, 1, 5, 3,
  262|  22.8k|          2, 1, 8, 2, 6, 9, 3, 4, 8, 1, 4, 4, 5, 3, 1, 2, 5, 5, 8, 2, 0, 7, 6,
  263|  22.8k|          6, 0, 9, 1, 3, 4, 6, 7, 4, 0, 7, 2, 2, 6, 5, 6, 2, 5, 2, 9, 1, 0, 3,
  264|  22.8k|          8, 3, 0, 4, 5, 6, 7, 3, 3, 7, 0, 3, 6, 1, 3, 2, 8, 1, 2, 5, 1, 4, 5,
  265|  22.8k|          5, 1, 9, 1, 5, 2, 2, 8, 3, 6, 6, 8, 5, 1, 8, 0, 6, 6, 4, 0, 6, 2, 5,
  266|  22.8k|          7, 2, 7, 5, 9, 5, 7, 6, 1, 4, 1, 8, 3, 4, 2, 5, 9, 0, 3, 3, 2, 0, 3,
  267|  22.8k|          1, 2, 5, 3, 6, 3, 7, 9, 7, 8, 8, 0, 7, 0, 9, 1, 7, 1, 2, 9, 5, 1, 6,
  268|  22.8k|          6, 0, 1, 5, 6, 2, 5, 1, 8, 1, 8, 9, 8, 9, 4, 0, 3, 5, 4, 5, 8, 5, 6,
  269|  22.8k|          4, 7, 5, 8, 3, 0, 0, 7, 8, 1, 2, 5, 9, 0, 9, 4, 9, 4, 7, 0, 1, 7, 7,
  270|  22.8k|          2, 9, 2, 8, 2, 3, 7, 9, 1, 5, 0, 3, 9, 0, 6, 2, 5, 4, 5, 4, 7, 4, 7,
  271|  22.8k|          3, 5, 0, 8, 8, 6, 4, 6, 4, 1, 1, 8, 9, 5, 7, 5, 1, 9, 5, 3, 1, 2, 5,
  272|  22.8k|          2, 2, 7, 3, 7, 3, 6, 7, 5, 4, 4, 3, 2, 3, 2, 0, 5, 9, 4, 7, 8, 7, 5,
  273|  22.8k|          9, 7, 6, 5, 6, 2, 5, 1, 1, 3, 6, 8, 6, 8, 3, 7, 7, 2, 1, 6, 1, 6, 0,
  274|  22.8k|          2, 9, 7, 3, 9, 3, 7, 9, 8, 8, 2, 8, 1, 2, 5, 5, 6, 8, 4, 3, 4, 1, 8,
  275|  22.8k|          8, 6, 0, 8, 0, 8, 0, 1, 4, 8, 6, 9, 6, 8, 9, 9, 4, 1, 4, 0, 6, 2, 5,
  276|  22.8k|          2, 8, 4, 2, 1, 7, 0, 9, 4, 3, 0, 4, 0, 4, 0, 0, 7, 4, 3, 4, 8, 4, 4,
  277|  22.8k|          9, 7, 0, 7, 0, 3, 1, 2, 5, 1, 4, 2, 1, 0, 8, 5, 4, 7, 1, 5, 2, 0, 2,
  278|  22.8k|          0, 0, 3, 7, 1, 7, 4, 2, 2, 4, 8, 5, 3, 5, 1, 5, 6, 2, 5, 7, 1, 0, 5,
  279|  22.8k|          4, 2, 7, 3, 5, 7, 6, 0, 1, 0, 0, 1, 8, 5, 8, 7, 1, 1, 2, 4, 2, 6, 7,
  280|  22.8k|          5, 7, 8, 1, 2, 5, 3, 5, 5, 2, 7, 1, 3, 6, 7, 8, 8, 0, 0, 5, 0, 0, 9,
  281|  22.8k|          2, 9, 3, 5, 5, 6, 2, 1, 3, 3, 7, 8, 9, 0, 6, 2, 5, 1, 7, 7, 6, 3, 5,
  282|  22.8k|          6, 8, 3, 9, 4, 0, 0, 2, 5, 0, 4, 6, 4, 6, 7, 7, 8, 1, 0, 6, 6, 8, 9,
  283|  22.8k|          4, 5, 3, 1, 2, 5, 8, 8, 8, 1, 7, 8, 4, 1, 9, 7, 0, 0, 1, 2, 5, 2, 3,
  284|  22.8k|          2, 3, 3, 8, 9, 0, 5, 3, 3, 4, 4, 7, 2, 6, 5, 6, 2, 5, 4, 4, 4, 0, 8,
  285|  22.8k|          9, 2, 0, 9, 8, 5, 0, 0, 6, 2, 6, 1, 6, 1, 6, 9, 4, 5, 2, 6, 6, 7, 2,
  286|  22.8k|          3, 6, 3, 2, 8, 1, 2, 5, 2, 2, 2, 0, 4, 4, 6, 0, 4, 9, 2, 5, 0, 3, 1,
  287|  22.8k|          3, 0, 8, 0, 8, 4, 7, 2, 6, 3, 3, 3, 6, 1, 8, 1, 6, 4, 0, 6, 2, 5, 1,
  288|  22.8k|          1, 1, 0, 2, 2, 3, 0, 2, 4, 6, 2, 5, 1, 5, 6, 5, 4, 0, 4, 2, 3, 6, 3,
  289|  22.8k|          1, 6, 6, 8, 0, 9, 0, 8, 2, 0, 3, 1, 2, 5, 5, 5, 5, 1, 1, 1, 5, 1, 2,
  290|  22.8k|          3, 1, 2, 5, 7, 8, 2, 7, 0, 2, 1, 1, 8, 1, 5, 8, 3, 4, 0, 4, 5, 4, 1,
  291|  22.8k|          0, 1, 5, 6, 2, 5, 2, 7, 7, 5, 5, 5, 7, 5, 6, 1, 5, 6, 2, 8, 9, 1, 3,
  292|  22.8k|          5, 1, 0, 5, 9, 0, 7, 9, 1, 7, 0, 2, 2, 7, 0, 5, 0, 7, 8, 1, 2, 5, 1,
  293|  22.8k|          3, 8, 7, 7, 7, 8, 7, 8, 0, 7, 8, 1, 4, 4, 5, 6, 7, 5, 5, 2, 9, 5, 3,
  294|  22.8k|          9, 5, 8, 5, 1, 1, 3, 5, 2, 5, 3, 9, 0, 6, 2, 5, 6, 9, 3, 8, 8, 9, 3,
  295|  22.8k|          9, 0, 3, 9, 0, 7, 2, 2, 8, 3, 7, 7, 6, 4, 7, 6, 9, 7, 9, 2, 5, 5, 6,
  296|  22.8k|          7, 6, 2, 6, 9, 5, 3, 1, 2, 5, 3, 4, 6, 9, 4, 4, 6, 9, 5, 1, 9, 5, 3,
  297|  22.8k|          6, 1, 4, 1, 8, 8, 8, 2, 3, 8, 4, 8, 9, 6, 2, 7, 8, 3, 8, 1, 3, 4, 7,
  298|  22.8k|          6, 5, 6, 2, 5, 1, 7, 3, 4, 7, 2, 3, 4, 7, 5, 9, 7, 6, 8, 0, 7, 0, 9,
  299|  22.8k|          4, 4, 1, 1, 9, 2, 4, 4, 8, 1, 3, 9, 1, 9, 0, 6, 7, 3, 8, 2, 8, 1, 2,
  300|  22.8k|          5, 8, 6, 7, 3, 6, 1, 7, 3, 7, 9, 8, 8, 4, 0, 3, 5, 4, 7, 2, 0, 5, 9,
  301|  22.8k|          6, 2, 2, 4, 0, 6, 9, 5, 9, 5, 3, 3, 6, 9, 1, 4, 0, 6, 2, 5,
  302|  22.8k|      };
  303|  22.8k|  const uint8_t *pow5 =
  304|  22.8k|      &number_of_digits_decimal_left_shift_table_powers_of_5[pow5_a];
  305|  22.8k|  uint32_t i = 0;
  306|  22.8k|  uint32_t n = pow5_b - pow5_a;
  307|  25.1k|  for (; i < n; i++) {
  ------------------
  |  Branch (307:10): [True: 24.9k, False: 194]
  ------------------
  308|  24.9k|    if (i >= h.num_digits) {
  ------------------
  |  Branch (308:9): [True: 476, False: 24.4k]
  ------------------
  309|    476|      return num_new_digits - 1;
  310|  24.4k|    } else if (h.digits[i] == pow5[i]) {
  ------------------
  |  Branch (310:16): [True: 2.29k, False: 22.1k]
  ------------------
  311|  2.29k|      continue;
  312|  22.1k|    } else if (h.digits[i] < pow5[i]) {
  ------------------
  |  Branch (312:16): [True: 15.3k, False: 6.80k]
  ------------------
  313|  15.3k|      return num_new_digits - 1;
  314|  15.3k|    } else {
  315|  6.80k|      return num_new_digits;
  316|  6.80k|    }
  317|  24.9k|  }
  318|    194|  return num_new_digits;
  319|  22.8k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_14trimERNS0_7decimalE:
  220|  44.6k|inline void trim(decimal &h) {
  221|   384k|  while ((h.num_digits > 0) && (h.digits[h.num_digits - 1] == 0)) {
  ------------------
  |  Branch (221:10): [True: 384k, False: 0]
  |  Branch (221:32): [True: 340k, False: 44.6k]
  ------------------
  222|   340k|    h.num_digits--;
  223|   340k|  }
  224|  44.6k|}
_ZN8simdjson8internal13binary_formatIdE22mantissa_explicit_bitsEv:
   46|  18.4k|template <> constexpr int binary_format<double>::mantissa_explicit_bits() {
   47|  18.4k|  return 52;
   48|  18.4k|}
_ZN8simdjson8internal13binary_formatIdE10sign_indexEv:
   57|    198|template <> constexpr int binary_format<double>::sign_index() { return 63; }
_ZN8simdjson8internal19parse_long_mantissaINS0_13binary_formatIdEEEENS0_17adjusted_mantissaEPKc:
  551|  8.41k|adjusted_mantissa parse_long_mantissa(const char *first) {
  552|  8.41k|  decimal d = parse_decimal(first);
  553|  8.41k|  return compute_float<binary>(d);
  554|  8.41k|}
_ZN8simdjson8internal13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaERNS0_7decimalE:
  438|  8.41k|template <typename binary> adjusted_mantissa compute_float(decimal &d) {
  439|  8.41k|  adjusted_mantissa answer;
  440|  8.41k|  if (d.num_digits == 0) {
  ------------------
  |  Branch (440:7): [True: 1.10k, False: 7.31k]
  ------------------
  441|       |    // should be zero
  442|  1.10k|    answer.power2 = 0;
  443|  1.10k|    answer.mantissa = 0;
  444|  1.10k|    return answer;
  445|  1.10k|  }
  446|       |  // At this point, going further, we can assume that d.num_digits > 0.
  447|       |  // We want to guard against excessive decimal point values because
  448|       |  // they can result in long running times. Indeed, we do
  449|       |  // shifts by at most 60 bits. We have that log(10**400)/log(2**60) ~= 22
  450|       |  // which is fine, but log(10**299995)/log(2**60) ~= 16609 which is not
  451|       |  // fine (runs for a long time).
  452|       |  //
  453|  7.31k|  if(d.decimal_point < -324) {
  ------------------
  |  Branch (453:6): [True: 443, False: 6.86k]
  ------------------
  454|       |    // We have something smaller than 1e-324 which is always zero
  455|       |    // in binary64 and binary32.
  456|       |    // It should be zero.
  457|    443|    answer.power2 = 0;
  458|    443|    answer.mantissa = 0;
  459|    443|    return answer;
  460|  6.86k|  } else if(d.decimal_point >= 310) {
  ------------------
  |  Branch (460:13): [True: 1.30k, False: 5.56k]
  ------------------
  461|       |    // We have something at least as large as 0.1e310 which is
  462|       |    // always infinite.
  463|  1.30k|    answer.power2 = binary::infinite_power();
  464|  1.30k|    answer.mantissa = 0;
  465|  1.30k|    return answer;
  466|  1.30k|  }
  467|       |
  468|  5.56k|  static const uint32_t max_shift = 60;
  469|  5.56k|  static const uint32_t num_powers = 19;
  470|  5.56k|  static const uint8_t powers[19] = {
  471|  5.56k|      0,  3,  6,  9,  13, 16, 19, 23, 26, 29, //
  472|  5.56k|      33, 36, 39, 43, 46, 49, 53, 56, 59,     //
  473|  5.56k|  };
  474|  5.56k|  int32_t exp2 = 0;
  475|  25.5k|  while (d.decimal_point > 0) {
  ------------------
  |  Branch (475:10): [True: 20.0k, False: 5.56k]
  ------------------
  476|  20.0k|    uint32_t n = uint32_t(d.decimal_point);
  477|  20.0k|    uint32_t shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (477:22): [True: 5.58k, False: 14.4k]
  ------------------
  478|  20.0k|    decimal_right_shift(d, shift);
  479|  20.0k|    if (d.decimal_point < -decimal_point_range) {
  ------------------
  |  Branch (479:9): [True: 0, False: 20.0k]
  ------------------
  480|       |      // should be zero
  481|      0|      answer.power2 = 0;
  482|      0|      answer.mantissa = 0;
  483|      0|      return answer;
  484|      0|    }
  485|  20.0k|    exp2 += int32_t(shift);
  486|  20.0k|  }
  487|       |  // We shift left toward [1/2 ... 1].
  488|  23.3k|  while (d.decimal_point <= 0) {
  ------------------
  |  Branch (488:10): [True: 23.3k, False: 0]
  ------------------
  489|  23.3k|    uint32_t shift;
  490|  23.3k|    if (d.decimal_point == 0) {
  ------------------
  |  Branch (490:9): [True: 12.4k, False: 10.9k]
  ------------------
  491|  12.4k|      if (d.digits[0] >= 5) {
  ------------------
  |  Branch (491:11): [True: 5.56k, False: 6.90k]
  ------------------
  492|  5.56k|        break;
  493|  5.56k|      }
  494|  6.90k|      shift = (d.digits[0] < 2) ? 2 : 1;
  ------------------
  |  Branch (494:15): [True: 2.40k, False: 4.49k]
  ------------------
  495|  10.9k|    } else {
  496|  10.9k|      uint32_t n = uint32_t(-d.decimal_point);
  497|  10.9k|      shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (497:15): [True: 1.76k, False: 9.14k]
  ------------------
  498|  10.9k|    }
  499|  17.8k|    decimal_left_shift(d, shift);
  500|  17.8k|    if (d.decimal_point > decimal_point_range) {
  ------------------
  |  Branch (500:9): [True: 0, False: 17.8k]
  ------------------
  501|       |      // we want to get infinity:
  502|      0|      answer.power2 = 0xFF;
  503|      0|      answer.mantissa = 0;
  504|      0|      return answer;
  505|      0|    }
  506|  17.8k|    exp2 -= int32_t(shift);
  507|  17.8k|  }
  508|       |  // We are now in the range [1/2 ... 1] but the binary format uses [1 ... 2].
  509|  5.56k|  exp2--;
  510|  5.56k|  constexpr int32_t minimum_exponent = binary::minimum_exponent();
  511|  6.07k|  while ((minimum_exponent + 1) > exp2) {
  ------------------
  |  Branch (511:10): [True: 515, False: 5.56k]
  ------------------
  512|    515|    uint32_t n = uint32_t((minimum_exponent + 1) - exp2);
  513|    515|    if (n > max_shift) {
  ------------------
  |  Branch (513:9): [True: 0, False: 515]
  ------------------
  514|      0|      n = max_shift;
  515|      0|    }
  516|    515|    decimal_right_shift(d, n);
  517|    515|    exp2 += int32_t(n);
  518|    515|  }
  519|  5.56k|  if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (519:7): [True: 519, False: 5.04k]
  ------------------
  520|    519|    answer.power2 = binary::infinite_power();
  521|    519|    answer.mantissa = 0;
  522|    519|    return answer;
  523|    519|  }
  524|       |
  525|  5.04k|  const int mantissa_size_in_bits = binary::mantissa_explicit_bits() + 1;
  526|  5.04k|  decimal_left_shift(d, mantissa_size_in_bits);
  527|       |
  528|  5.04k|  uint64_t mantissa = round(d);
  529|       |  // It is possible that we have an overflow, in which case we need
  530|       |  // to shift back.
  531|  5.04k|  if (mantissa >= (uint64_t(1) << mantissa_size_in_bits)) {
  ------------------
  |  Branch (531:7): [True: 1.27k, False: 3.76k]
  ------------------
  532|  1.27k|    decimal_right_shift(d, 1);
  533|  1.27k|    exp2 += 1;
  534|  1.27k|    mantissa = round(d);
  535|  1.27k|    if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (535:9): [True: 0, False: 1.27k]
  ------------------
  536|      0|      answer.power2 = binary::infinite_power();
  537|      0|      answer.mantissa = 0;
  538|      0|      return answer;
  539|      0|    }
  540|  1.27k|  }
  541|  5.04k|  answer.power2 = exp2 - binary::minimum_exponent();
  542|  5.04k|  if (mantissa < (uint64_t(1) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (542:7): [True: 515, False: 4.52k]
  ------------------
  543|    515|    answer.power2--;
  544|    515|  }
  545|  5.04k|  answer.mantissa =
  546|  5.04k|      mantissa & ((uint64_t(1) << binary::mantissa_explicit_bits()) - 1);
  547|  5.04k|  return answer;
  548|  5.04k|}
_ZN8simdjson8internal17adjusted_mantissaC2Ev:
   28|  8.41k|  adjusted_mantissa() : mantissa(0), power2(0) {}
_ZN8simdjson8internal13binary_formatIdE14infinite_powerEv:
   53|  8.66k|template <> constexpr int binary_format<double>::infinite_power() {
   54|  8.66k|  return 0x7FF;
   55|  8.66k|}
_ZN8simdjson8internal13binary_formatIdE16minimum_exponentEv:
   50|  5.04k|template <> constexpr int binary_format<double>::minimum_exponent() {
   51|  5.04k|  return -1023;
   52|  5.04k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EEC2EPKhm:
   62|  4.99k|simdjson_inline buf_block_reader<STEP_SIZE>::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE14has_full_blockEv:
   68|   353k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   69|   353k|  return idx < lenminusstep;
   70|   353k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE7advanceEv:
   86|   353k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
   87|   353k|  idx += STEP_SIZE;
   88|   353k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE10full_blockEv:
   73|   348k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   74|   348k|  return &buf[idx];
   75|   348k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE13get_remainderEPh:
   78|  4.99k|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
   79|  4.99k|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (79:6): [True: 0, False: 4.99k]
  ------------------
   80|  4.99k|  std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once.
   81|  4.99k|  std::memcpy(dst, buf + idx, len - idx);
   82|  4.99k|  return len - idx;
   83|  4.99k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE11block_indexEv:
   65|   711k|simdjson_inline size_t buf_block_reader<STEP_SIZE>::block_index() { return idx; }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scannerC2Ev:
   99|  4.99k|  json_scanner() = default;
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner4nextERKNS1_4simd8simd8x64IhEE:
  125|   706k|simdjson_inline json_block json_scanner::next(const simd::simd8x64<uint8_t>& in) {
  126|   706k|  json_string_block strings = string_scanner.next(in);
  127|       |  // identifies the white-space and the structural characters
  128|   706k|  json_character_block characters = json_character_block::classify(in);
  129|       |  // The term "scalar" refers to anything except structural characters and white space
  130|       |  // (so letters, numbers, quotes).
  131|       |  // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers).
  132|       |  //
  133|       |  // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon)
  134|       |  // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential
  135|       |  // pseudo-structural character just like we would if we had  ' "a string" true '; otherwise we
  136|       |  // may need to add an extra check when parsing strings.
  137|       |  //
  138|       |  // Performance: there are many ways to skin this cat.
  139|   706k|  const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote();
  140|   706k|  uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar);
  141|       |  // We are returning a function-local object so either we get a move constructor
  142|       |  // or we get copy elision.
  143|   706k|  return json_block(
  144|   706k|    strings,// strings is a function-local object so either it moves or the copy is elided.
  145|   706k|    characters,
  146|   706k|    follows_nonquote_scalar
  147|   706k|  );
  148|   706k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage17followsEmRm:
  119|   706k|simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
  120|   706k|  const uint64_t result = match << 1 | overflow;
  121|   706k|  overflow = match >> 63;
  122|   706k|  return result;
  123|   706k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage110json_blockC2ENS2_17json_string_blockENS1_20json_character_blockEm:
   29|   706k|  _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner6finishEv:
  150|  4.99k|simdjson_inline error_code json_scanner::finish() {
  151|  4.99k|  return string_scanner.finish();
  152|  4.99k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block16structural_startEv:
   35|   706k|  simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block26potential_structural_startEv:
   59|   706k|  simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block22potential_scalar_startEv:
   64|   706k|  simdjson_inline uint64_t potential_scalar_start() const noexcept {
   65|       |    // The term "scalar" refers to anything except structural characters and white space
   66|       |    // (so letters, numbers, quotes).
   67|       |    // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space
   68|       |    // then we know that it is irrelevant structurally.
   69|   706k|    return _characters.scalar() & ~follows_potential_scalar();
   70|   706k|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block24follows_potential_scalarEv:
   75|   706k|  simdjson_inline uint64_t follows_potential_scalar() const noexcept {
   76|       |    // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character
   77|       |    // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a
   78|       |    // white space.
   79|       |    // It is understood that within quoted region, anything at all could be marked (irrelevant).
   80|   706k|    return _follows_potential_nonquote_scalar;
   81|   706k|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block23non_quote_inside_stringEm:
   42|   706k|  simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const noexcept { return _string.non_quote_inside_string(mask); }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner4nextERKNS1_4simd8simd8x64IhEE:
  110|   706k|simdjson_inline json_string_block json_string_scanner::next(const simd::simd8x64<uint8_t>& in) {
  111|   706k|  const uint64_t backslash = in.eq('\\');
  112|   706k|  const uint64_t escaped = find_escaped(backslash);
  113|   706k|  const uint64_t quote = in.eq('"') & ~escaped;
  114|       |
  115|       |  //
  116|       |  // prefix_xor flips on bits inside the string (and flips off the end quote).
  117|       |  //
  118|       |  // Then we xor with prev_in_string: if we were in a string already, its effect is flipped
  119|       |  // (characters inside strings are outside, and characters outside strings are inside).
  120|       |  //
  121|   706k|  const uint64_t in_string = prefix_xor(quote) ^ prev_in_string;
  122|       |
  123|       |  //
  124|       |  // Check if we're still in a string at the end of the box so the next block will know
  125|       |  //
  126|       |  // right shift of a signed value expected to be well-defined and standard
  127|       |  // compliant as of C++20, John Regher from Utah U. says this is fine code
  128|       |  //
  129|   706k|  prev_in_string = uint64_t(static_cast<int64_t>(in_string) >> 63);
  130|       |
  131|       |  // Use ^ to turn the beginning quote off, and the end quote on.
  132|       |
  133|       |  // We are returning a function-local object so either we get a move constructor
  134|       |  // or we get copy elision.
  135|   706k|  return json_string_block(
  136|   706k|    backslash,
  137|   706k|    escaped,
  138|   706k|    quote,
  139|   706k|    in_string
  140|   706k|  );
  141|   706k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner23find_escaped_branchlessEm:
   85|  5.94k|simdjson_inline uint64_t json_string_scanner::find_escaped_branchless(uint64_t backslash) {
   86|       |  // If there was overflow, pretend the first character isn't a backslash
   87|  5.94k|  backslash &= ~prev_escaped;
   88|  5.94k|  uint64_t follows_escape = backslash << 1 | prev_escaped;
   89|       |
   90|       |  // Get sequences starting on even bits by clearing out the odd series using +
   91|  5.94k|  const uint64_t even_bits = 0x5555555555555555ULL;
   92|  5.94k|  uint64_t odd_sequence_starts = backslash & ~even_bits & ~follows_escape;
   93|  5.94k|  uint64_t sequences_starting_on_even_bits;
   94|  5.94k|  prev_escaped = add_overflow(odd_sequence_starts, backslash, &sequences_starting_on_even_bits);
   95|  5.94k|  uint64_t invert_mask = sequences_starting_on_even_bits << 1; // The mask we want to return is the *escaped* bits, not escapes.
   96|       |
   97|       |  // Mask every other backslashed character as an escaped character
   98|       |  // Flip the mask for sequences that start on even bits, to correct them
   99|  5.94k|  return (even_bits ^ invert_mask) & follows_escape;
  100|  5.94k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage117json_string_blockC2Emmmm:
    9|   706k|  _backslash(backslash), _escaped(escaped), _quote(quote), _in_string(in_string) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block5quoteEv:
   16|   706k|  simdjson_inline uint64_t quote() const { return _quote; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner6finishEv:
  143|  4.99k|simdjson_inline error_code json_string_scanner::finish() {
  144|  4.99k|  if (prev_in_string) {
  ------------------
  |  Branch (144:7): [True: 164, False: 4.82k]
  ------------------
  145|    164|    return UNCLOSED_STRING;
  146|    164|  }
  147|  4.82k|  return SUCCESS;
  148|  4.99k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block11string_tailEv:
   28|   706k|  simdjson_inline uint64_t string_tail() const { return _in_string ^ _quote; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block23non_quote_inside_stringEm:
   24|   706k|  simdjson_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer5indexILm128EEENS_10error_codeEPKhmRNS0_25dom_parser_implementationENS_11stage1_modeE:
  197|  5.10k|error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept {
  198|  5.10k|  if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; }
  ------------------
  |  |  120|  5.10k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 5.10k]
  |  |  ------------------
  ------------------
  199|       |  // We guard the rest of the code so that we can assume that len > 0 throughout.
  200|  5.10k|  if (len == 0) { return EMPTY; }
  ------------------
  |  Branch (200:7): [True: 111, False: 4.99k]
  ------------------
  201|  4.99k|  if (is_streaming(partial)) {
  ------------------
  |  Branch (201:7): [True: 0, False: 4.99k]
  ------------------
  202|      0|    len = trim_partial_utf8(buf, len);
  203|       |    // If you end up with an empty window after trimming
  204|       |    // the partial UTF-8 bytes, then chances are good that you
  205|       |    // have an UTF-8 formatting error.
  206|      0|    if(len == 0) { return UTF8_ERROR; }
  ------------------
  |  Branch (206:8): [True: 0, False: 0]
  ------------------
  207|      0|  }
  208|  4.99k|  buf_block_reader<STEP_SIZE> reader(buf, len);
  209|  4.99k|  json_structural_indexer indexer(parser.structural_indexes.get());
  210|       |
  211|       |  // Read all but the last block
  212|   353k|  while (reader.has_full_block()) {
  ------------------
  |  Branch (212:10): [True: 348k, False: 4.99k]
  ------------------
  213|   348k|    indexer.step<STEP_SIZE>(reader.full_block(), reader);
  214|   348k|  }
  215|       |  // Take care of the last block (will always be there unless file is empty which is
  216|       |  // not supposed to happen.)
  217|  4.99k|  uint8_t block[STEP_SIZE];
  218|  4.99k|  if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; }
  ------------------
  |  |  120|  4.99k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 4.99k]
  |  |  ------------------
  ------------------
  219|  4.99k|  indexer.step<STEP_SIZE>(block, reader);
  220|  4.99k|  return indexer.finish(parser, reader.block_index(), len, partial);
  221|  4.99k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexerC2EPj:
  156|  4.99k|simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexerC2EPj:
   21|  4.99k|  simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4stepILm128EEEvPKhRNS1_16buf_block_readerIXT_EEE:
  224|   353k|simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept {
  225|   353k|  simd::simd8x64<uint8_t> in_1(block);
  226|   353k|  simd::simd8x64<uint8_t> in_2(block+64);
  227|   353k|  json_block block_1 = scanner.next(in_1);
  228|   353k|  json_block block_2 = scanner.next(in_2);
  229|   353k|  this->next(in_1, block_1, reader.block_index());
  230|   353k|  this->next(in_2, block_2, reader.block_index()+64);
  231|   353k|  reader.advance();
  232|   353k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4nextERKNS1_4simd8simd8x64IhEERKNS2_10json_blockEm:
  242|   706k|simdjson_inline void json_structural_indexer::next(const simd::simd8x64<uint8_t>& in, const json_block& block, size_t idx) {
  243|   706k|  uint64_t unescaped = in.lteq(0x1F);
  244|   706k|#if SIMDJSON_UTF8VALIDATION
  245|   706k|  checker.check_next_input(in);
  246|   706k|#endif
  247|   706k|  indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser
  248|   706k|  prev_structurals = block.structural_start();
  249|   706k|  unescaped_chars_error |= block.non_quote_inside_string(unescaped);
  250|   706k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer5writeEjm:
   34|   711k|  simdjson_inline void write(uint32_t idx, uint64_t bits) {
   35|       |    // In some instances, the next branch is expensive because it is mispredicted.
   36|       |    // Unfortunately, in other cases,
   37|       |    // it helps tremendously.
   38|   711k|    if (bits == 0)
  ------------------
  |  Branch (38:9): [True: 441k, False: 270k]
  ------------------
   39|   441k|        return;
   40|       |#if SIMDJSON_PREFER_REVERSE_BITS
   41|       |    /**
   42|       |     * ARM lacks a fast trailing zero instruction, but it has a fast
   43|       |     * bit reversal instruction and a fast leading zero instruction.
   44|       |     * Thus it may be profitable to reverse the bits (once) and then
   45|       |     * to rely on a sequence of instructions that call the leading
   46|       |     * zero instruction.
   47|       |     *
   48|       |     * Performance notes:
   49|       |     * The chosen routine is not optimal in terms of data dependency
   50|       |     * since zero_leading_bit might require two instructions. However,
   51|       |     * it tends to minimize the total number of instructions which is
   52|       |     * beneficial.
   53|       |     */
   54|       |
   55|       |    uint64_t rev_bits = reverse_bits(bits);
   56|       |    int cnt = static_cast<int>(count_ones(bits));
   57|       |    int i = 0;
   58|       |    // Do the first 8 all together
   59|       |    for (; i<8; i++) {
   60|       |      int lz = leading_zeroes(rev_bits);
   61|       |      this->tail[i] = static_cast<uint32_t>(idx) + lz;
   62|       |      rev_bits = zero_leading_bit(rev_bits, lz);
   63|       |    }
   64|       |    // Do the next 8 all together (we hope in most cases it won't happen at all
   65|       |    // and the branch is easily predicted).
   66|       |    if (simdjson_unlikely(cnt > 8)) {
   67|       |      i = 8;
   68|       |      for (; i<16; i++) {
   69|       |        int lz = leading_zeroes(rev_bits);
   70|       |        this->tail[i] = static_cast<uint32_t>(idx) + lz;
   71|       |        rev_bits = zero_leading_bit(rev_bits, lz);
   72|       |      }
   73|       |
   74|       |
   75|       |      // Most files don't have 16+ structurals per block, so we take several basically guaranteed
   76|       |      // branch mispredictions here. 16+ structurals per block means either punctuation ({} [] , :)
   77|       |      // or the start of a value ("abc" true 123) every four characters.
   78|       |      if (simdjson_unlikely(cnt > 16)) {
   79|       |        i = 16;
   80|       |        while (rev_bits != 0) {
   81|       |          int lz = leading_zeroes(rev_bits);
   82|       |          this->tail[i++] = static_cast<uint32_t>(idx) + lz;
   83|       |          rev_bits = zero_leading_bit(rev_bits, lz);
   84|       |        }
   85|       |      }
   86|       |    }
   87|       |    this->tail += cnt;
   88|       |#else // SIMDJSON_PREFER_REVERSE_BITS
   89|       |    /**
   90|       |     * Under recent x64 systems, we often have both a fast trailing zero
   91|       |     * instruction and a fast 'clear-lower-bit' instruction so the following
   92|       |     * algorithm can be competitive.
   93|       |     */
   94|       |
   95|   270k|    int cnt = static_cast<int>(count_ones(bits));
   96|       |    // Do the first 8 all together
   97|  2.43M|    for (int i=0; i<8; i++) {
  ------------------
  |  Branch (97:19): [True: 2.16M, False: 270k]
  ------------------
   98|  2.16M|      this->tail[i] = idx + trailing_zeroes(bits);
   99|  2.16M|      bits = clear_lowest_bit(bits);
  100|  2.16M|    }
  101|       |
  102|       |    // Do the next 8 all together (we hope in most cases it won't happen at all
  103|       |    // and the branch is easily predicted).
  104|   270k|    if (simdjson_unlikely(cnt > 8)) {
  ------------------
  |  |  120|   270k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 179k, False: 90.9k]
  |  |  ------------------
  ------------------
  105|  1.61M|      for (int i=8; i<16; i++) {
  ------------------
  |  Branch (105:21): [True: 1.43M, False: 179k]
  ------------------
  106|  1.43M|        this->tail[i] = idx + trailing_zeroes(bits);
  107|  1.43M|        bits = clear_lowest_bit(bits);
  108|  1.43M|      }
  109|       |
  110|       |      // Most files don't have 16+ structurals per block, so we take several basically guaranteed
  111|       |      // branch mispredictions here. 16+ structurals per block means either punctuation ({} [] , :)
  112|       |      // or the start of a value ("abc" true 123) every four characters.
  113|   179k|      if (simdjson_unlikely(cnt > 16)) {
  ------------------
  |  |  120|   179k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 176k, False: 3.40k]
  |  |  ------------------
  ------------------
  114|   176k|        int i = 16;
  115|  8.27M|        do {
  116|  8.27M|          this->tail[i] = idx + trailing_zeroes(bits);
  117|  8.27M|          bits = clear_lowest_bit(bits);
  118|  8.27M|          i++;
  119|  8.27M|        } while (i < cnt);
  ------------------
  |  Branch (119:18): [True: 8.09M, False: 176k]
  ------------------
  120|   176k|      }
  121|   179k|    }
  122|       |
  123|   270k|    this->tail += cnt;
  124|   270k|#endif
  125|   270k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer6finishERNS0_25dom_parser_implementationEmmNS_11stage1_modeE:
  252|  4.99k|simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) {
  253|       |  // Write out the final iteration's structurals
  254|  4.99k|  indexer.write(uint32_t(idx-64), prev_structurals);
  255|  4.99k|  error_code error = scanner.finish();
  256|       |  // We deliberately break down the next expression so that it is
  257|       |  // human readable.
  258|  4.99k|  const bool should_we_exit = is_streaming(partial) ?
  ------------------
  |  Branch (258:31): [True: 0, False: 4.99k]
  ------------------
  259|      0|    ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING
  ------------------
  |  Branch (259:6): [True: 0, False: 0]
  |  Branch (259:28): [True: 0, False: 0]
  ------------------
  260|  4.99k|    : (error != SUCCESS); // if partial is false, we must have SUCCESS
  261|  4.99k|  const bool have_unclosed_string = (error == UNCLOSED_STRING);
  262|  4.99k|  if (simdjson_unlikely(should_we_exit)) { return error; }
  ------------------
  |  |  120|  4.99k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 164, False: 4.82k]
  |  |  ------------------
  ------------------
  263|       |
  264|  4.82k|  if (unescaped_chars_error) {
  ------------------
  |  Branch (264:7): [True: 191, False: 4.63k]
  ------------------
  265|    191|    return UNESCAPED_CHARS;
  266|    191|  }
  267|  4.63k|  parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get());
  268|       |  /***
  269|       |   * The On Demand API requires special padding.
  270|       |   *
  271|       |   * This is related to https://github.com/simdjson/simdjson/issues/906
  272|       |   * Basically, we want to make sure that if the parsing continues beyond the last (valid)
  273|       |   * structural character, it quickly stops.
  274|       |   * Only three structural characters can be repeated without triggering an error in JSON:  [,] and }.
  275|       |   * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing
  276|       |   * continues, then it must be [,] or }.
  277|       |   * Suppose it is ] or }. We backtrack to the first character, what could it be that would
  278|       |   * not trigger an error? It could be ] or } but no, because you can't start a document that way.
  279|       |   * It can't be a comma, a colon or any simple value. So the only way we could continue is
  280|       |   * if the repeated character is [. But if so, the document must start with [. But if the document
  281|       |   * starts with [, it should end with ]. If we enforce that rule, then we would get
  282|       |   * ][[ which is invalid.
  283|       |   *
  284|       |   * This is illustrated with the test array_iterate_unclosed_error() on the following input:
  285|       |   * R"({ "a": [,,)"
  286|       |   **/
  287|  4.63k|  parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final
  288|  4.63k|  parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len);
  289|  4.63k|  parser.structural_indexes[parser.n_structural_indexes + 2] = 0;
  290|  4.63k|  parser.next_structural_index = 0;
  291|       |  // a valid JSON file cannot have zero structural indexes - we should have found something
  292|  4.63k|  if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  120|  4.63k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 5, False: 4.63k]
  |  |  ------------------
  ------------------
  293|      5|    return EMPTY;
  294|      5|  }
  295|  4.63k|  if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) {
  ------------------
  |  |  120|  4.63k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 4.63k]
  |  |  ------------------
  ------------------
  296|      0|    return UNEXPECTED_ERROR;
  297|      0|  }
  298|  4.63k|  if (partial == stage1_mode::streaming_partial) {
  ------------------
  |  Branch (298:7): [True: 0, False: 4.63k]
  ------------------
  299|       |    // If we have an unclosed string, then the last structural
  300|       |    // will be the quote and we want to make sure to omit it.
  301|      0|    if(have_unclosed_string) {
  ------------------
  |  Branch (301:8): [True: 0, False: 0]
  ------------------
  302|      0|      parser.n_structural_indexes--;
  303|       |      // a valid JSON file cannot have zero structural indexes - we should have found something
  304|      0|      if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; }
  ------------------
  |  |  120|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  305|      0|    }
  306|       |    // We truncate the input to the end of the last complete document (or zero).
  307|      0|    auto new_structural_indexes = find_next_document_index(parser);
  308|      0|    if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) {
  ------------------
  |  Branch (308:9): [True: 0, False: 0]
  |  Branch (308:40): [True: 0, False: 0]
  ------------------
  309|      0|      if(parser.structural_indexes[0] == 0) {
  ------------------
  |  Branch (309:10): [True: 0, False: 0]
  ------------------
  310|       |        // If the buffer is partial and we started at index 0 but the document is
  311|       |        // incomplete, it's too big to parse.
  312|      0|        return CAPACITY;
  313|      0|      } else {
  314|       |        // It is possible that the document could be parsed, we just had a lot
  315|       |        // of white space.
  316|      0|        parser.n_structural_indexes = 0;
  317|      0|        return EMPTY;
  318|      0|      }
  319|      0|    }
  320|       |
  321|      0|    parser.n_structural_indexes = new_structural_indexes;
  322|  4.63k|  } else if (partial == stage1_mode::streaming_final) {
  ------------------
  |  Branch (322:14): [True: 0, False: 4.63k]
  ------------------
  323|      0|    if(have_unclosed_string) { parser.n_structural_indexes--; }
  ------------------
  |  Branch (323:8): [True: 0, False: 0]
  ------------------
  324|       |    // We truncate the input to the end of the last complete document (or zero).
  325|       |    // Because partial == stage1_mode::streaming_final, it means that we may
  326|       |    // silently ignore trailing garbage. Though it sounds bad, we do it
  327|       |    // deliberately because many people who have streams of JSON documents
  328|       |    // will truncate them for processing. E.g., imagine that you are uncompressing
  329|       |    // the data from a size file or receiving it in chunks from the network. You
  330|       |    // may not know where exactly the last document will be. Meanwhile the
  331|       |    // document_stream instances allow people to know the JSON documents they are
  332|       |    // parsing (see the iterator.source() method).
  333|      0|    parser.n_structural_indexes = find_next_document_index(parser);
  334|       |    // We store the initial n_structural_indexes so that the client can see
  335|       |    // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes,
  336|       |    // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len,
  337|       |    // otherwise, it will copy some prior index.
  338|      0|    parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes];
  339|       |    // This next line is critical, do not change it unless you understand what you are
  340|       |    // doing.
  341|      0|    parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len);
  342|      0|    if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  120|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  343|       |        // We tolerate an unclosed string at the very end of the stream. Indeed, users
  344|       |        // often load their data in bulk without being careful and they want us to ignore
  345|       |        // the trailing garbage.
  346|      0|        return EMPTY;
  347|      0|    }
  348|      0|  }
  349|  4.63k|  checker.check_eof();
  350|  4.63k|  return checker.errors();
  351|  4.63k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_next_inputERKNS1_4simd8simd8x64IhEE:
  173|   706k|    simdjson_inline void check_next_input(const simd8x64<uint8_t>& input) {
  174|   706k|      if(simdjson_likely(is_ascii(input))) {
  ------------------
  |  |  117|   706k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 611k, False: 95.2k]
  |  |  ------------------
  ------------------
  175|   611k|        this->error |= this->prev_incomplete;
  176|   611k|      } else {
  177|       |        // you might think that a for-loop would work, but under Visual Studio, it is not good enough.
  178|  95.2k|        static_assert((simd8x64<uint8_t>::NUM_CHUNKS == 1)
  179|  95.2k|                ||(simd8x64<uint8_t>::NUM_CHUNKS == 2)
  180|  95.2k|                || (simd8x64<uint8_t>::NUM_CHUNKS == 4),
  181|  95.2k|                "We support one, two or four chunks per 64-byte block.");
  182|  95.2k|        SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 1) {
  ------------------
  |  |  167|  95.2k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  |  Branch (182:32): [Folded - Ignored]
  ------------------
  183|      0|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  184|  95.2k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 2) {
  ------------------
  |  |  167|  95.2k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  |  Branch (184:39): [Folded - Ignored]
  ------------------
  185|  95.2k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  186|  95.2k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  187|  95.2k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 4) {
  ------------------
  |  |  167|      0|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  |  Branch (187:39): [Folded - Ignored]
  ------------------
  188|      0|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  189|      0|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  190|      0|          this->check_utf8_bytes(input.chunks[2], input.chunks[1]);
  191|      0|          this->check_utf8_bytes(input.chunks[3], input.chunks[2]);
  192|      0|        }
  193|  95.2k|        this->prev_incomplete = is_incomplete(input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1]);
  194|  95.2k|        this->prev_input_block = input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1];
  195|  95.2k|      }
  196|   706k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_utf8_bytesENS1_4simd5simd8IhEES6_:
  148|   190k|    simdjson_inline void check_utf8_bytes(const simd8<uint8_t> input, const simd8<uint8_t> prev_input) {
  149|       |      // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes
  150|       |      // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers)
  151|   190k|      simd8<uint8_t> prev1 = input.prev<1>(prev_input);
  152|   190k|      simd8<uint8_t> sc = check_special_cases(input, prev1);
  153|   190k|      this->error |= check_multibyte_lengths(input, prev_input, sc);
  154|   190k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation19check_special_casesENS1_4simd5simd8IhEES5_:
    8|   190k|  simdjson_inline simd8<uint8_t> check_special_cases(const simd8<uint8_t> input, const simd8<uint8_t> prev1) {
    9|       |// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII)
   10|       |// Bit 1 = Too Long (ASCII followed by continuation)
   11|       |// Bit 2 = Overlong 3-byte
   12|       |// Bit 4 = Surrogate
   13|       |// Bit 5 = Overlong 2-byte
   14|       |// Bit 7 = Two Continuations
   15|   190k|    constexpr const uint8_t TOO_SHORT   = 1<<0; // 11______ 0_______
   16|       |                                                // 11______ 11______
   17|   190k|    constexpr const uint8_t TOO_LONG    = 1<<1; // 0_______ 10______
   18|   190k|    constexpr const uint8_t OVERLONG_3  = 1<<2; // 11100000 100_____
   19|   190k|    constexpr const uint8_t SURROGATE   = 1<<4; // 11101101 101_____
   20|   190k|    constexpr const uint8_t OVERLONG_2  = 1<<5; // 1100000_ 10______
   21|   190k|    constexpr const uint8_t TWO_CONTS   = 1<<7; // 10______ 10______
   22|   190k|    constexpr const uint8_t TOO_LARGE   = 1<<3; // 11110100 1001____
   23|       |                                                // 11110100 101_____
   24|       |                                                // 11110101 1001____
   25|       |                                                // 11110101 101_____
   26|       |                                                // 1111011_ 1001____
   27|       |                                                // 1111011_ 101_____
   28|       |                                                // 11111___ 1001____
   29|       |                                                // 11111___ 101_____
   30|   190k|    constexpr const uint8_t TOO_LARGE_1000 = 1<<6;
   31|       |                                                // 11110101 1000____
   32|       |                                                // 1111011_ 1000____
   33|       |                                                // 11111___ 1000____
   34|   190k|    constexpr const uint8_t OVERLONG_4  = 1<<6; // 11110000 1000____
   35|       |
   36|   190k|    const simd8<uint8_t> byte_1_high = prev1.shr<4>().lookup_16<uint8_t>(
   37|       |      // 0_______ ________ <ASCII in byte 1>
   38|   190k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   39|   190k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   40|       |      // 10______ ________ <continuation in byte 1>
   41|   190k|      TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS,
   42|       |      // 1100____ ________ <two byte lead in byte 1>
   43|   190k|      TOO_SHORT | OVERLONG_2,
   44|       |      // 1101____ ________ <two byte lead in byte 1>
   45|   190k|      TOO_SHORT,
   46|       |      // 1110____ ________ <three byte lead in byte 1>
   47|   190k|      TOO_SHORT | OVERLONG_3 | SURROGATE,
   48|       |      // 1111____ ________ <four+ byte lead in byte 1>
   49|   190k|      TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4
   50|   190k|    );
   51|   190k|    constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 .
   52|   190k|    const simd8<uint8_t> byte_1_low = (prev1 & 0x0F).lookup_16<uint8_t>(
   53|       |      // ____0000 ________
   54|   190k|      CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4,
   55|       |      // ____0001 ________
   56|   190k|      CARRY | OVERLONG_2,
   57|       |      // ____001_ ________
   58|   190k|      CARRY,
   59|   190k|      CARRY,
   60|       |
   61|       |      // ____0100 ________
   62|   190k|      CARRY | TOO_LARGE,
   63|       |      // ____0101 ________
   64|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   65|       |      // ____011_ ________
   66|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   67|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   68|       |
   69|       |      // ____1___ ________
   70|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   71|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   72|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   73|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   74|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   75|       |      // ____1101 ________
   76|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE,
   77|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   78|   190k|      CARRY | TOO_LARGE | TOO_LARGE_1000
   79|   190k|    );
   80|   190k|    const simd8<uint8_t> byte_2_high = input.shr<4>().lookup_16<uint8_t>(
   81|       |      // ________ 0_______ <ASCII in byte 2>
   82|   190k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   83|   190k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   84|       |
   85|       |      // ________ 1000____
   86|   190k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4,
   87|       |      // ________ 1001____
   88|   190k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE,
   89|       |      // ________ 101_____
   90|   190k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   91|   190k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   92|       |
   93|       |      // ________ 11______
   94|   190k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT
   95|   190k|    );
   96|   190k|    return (byte_1_high & byte_1_low & byte_2_high);
   97|   190k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation23check_multibyte_lengthsENS1_4simd5simd8IhEES5_S5_:
   99|   190k|      const simd8<uint8_t> prev_input, const simd8<uint8_t> sc) {
  100|   190k|    simd8<uint8_t> prev2 = input.prev<2>(prev_input);
  101|   190k|    simd8<uint8_t> prev3 = input.prev<3>(prev_input);
  102|   190k|    simd8<uint8_t> must23 = simd8<uint8_t>(must_be_2_3_continuation(prev2, prev3));
  103|   190k|    simd8<uint8_t> must23_80 = must23 & uint8_t(0x80);
  104|   190k|    return must23_80 ^ sc;
  105|   190k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation13is_incompleteENS1_4simd5simd8IhEE:
  111|  95.2k|  simdjson_inline simd8<uint8_t> is_incomplete(const simd8<uint8_t> input) {
  112|       |    // If the previous input's last 3 bytes match this, they're too short (they ended at EOF):
  113|       |    // ... 1111____ 111_____ 11______
  114|  95.2k|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  115|  95.2k|    static const uint8_t max_array[64] = {
  116|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  117|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  118|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  119|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  120|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  121|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  122|  95.2k|      255, 255, 255, 255, 255, 255, 255, 255,
  123|  95.2k|      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  124|  95.2k|    };
  125|       |#else
  126|       |    static const uint8_t max_array[32] = {
  127|       |      255, 255, 255, 255, 255, 255, 255, 255,
  128|       |      255, 255, 255, 255, 255, 255, 255, 255,
  129|       |      255, 255, 255, 255, 255, 255, 255, 255,
  130|       |      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  131|       |    };
  132|       |#endif
  133|  95.2k|    const simd8<uint8_t> max_value(&max_array[sizeof(max_array)-sizeof(simd8<uint8_t>)]);
  134|  95.2k|    return input.gt_bits(max_value);
  135|  95.2k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker9check_eofEv:
  159|  4.63k|    simdjson_inline void check_eof() {
  160|       |      // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't
  161|       |      // possibly finish them.
  162|  4.63k|      this->error |= this->prev_incomplete;
  163|  4.63k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker6errorsEv:
  198|  4.63k|    simdjson_inline error_code errors() {
  199|  4.63k|      return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS;
  ------------------
  |  Branch (199:14): [True: 769, False: 3.86k]
  ------------------
  200|  4.63k|    }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113stringparsing12parse_stringEPKhPhb:
  142|  1.56k|simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) {
  143|  3.25k|  while (1) {
  ------------------
  |  Branch (143:10): [Folded - Ignored]
  ------------------
  144|       |    // Copy the next n bytes, and find the backslash and quote in them.
  145|  3.25k|    auto bs_quote = backslash_and_quote::copy_and_find(src, dst);
  146|       |    // If the next thing is the end quote, copy and return
  147|  3.25k|    if (bs_quote.has_quote_first()) {
  ------------------
  |  Branch (147:9): [True: 446, False: 2.80k]
  ------------------
  148|       |      // we encountered quotes first. Move dst to point to quotes and exit
  149|    446|      return dst + bs_quote.quote_index();
  150|    446|    }
  151|  2.80k|    if (bs_quote.has_backslash()) {
  ------------------
  |  Branch (151:9): [True: 2.60k, False: 195]
  ------------------
  152|       |      /* find out where the backspace is */
  153|  2.60k|      auto bs_dist = bs_quote.backslash_index();
  154|  2.60k|      uint8_t escape_char = src[bs_dist + 1];
  155|       |      /* we encountered backslash first. Handle backslash */
  156|  2.60k|      if (escape_char == 'u') {
  ------------------
  |  Branch (156:11): [True: 1.76k, False: 843]
  ------------------
  157|       |        /* move src/dst up to the start; they will be further adjusted
  158|       |           within the unicode codepoint handling code. */
  159|  1.76k|        src += bs_dist;
  160|  1.76k|        dst += bs_dist;
  161|  1.76k|        if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) {
  ------------------
  |  Branch (161:13): [True: 898, False: 868]
  ------------------
  162|    898|          return nullptr;
  163|    898|        }
  164|  1.76k|      } else {
  165|       |        /* simple 1:1 conversion. Will eat bs_dist+2 characters in input and
  166|       |         * write bs_dist+1 characters to output
  167|       |         * note this may reach beyond the part of the buffer we've actually
  168|       |         * seen. I think this is ok */
  169|    843|        uint8_t escape_result = escape_map[escape_char];
  170|    843|        if (escape_result == 0u) {
  ------------------
  |  Branch (170:13): [True: 225, False: 618]
  ------------------
  171|    225|          return nullptr; /* bogus escape value is an error */
  172|    225|        }
  173|    618|        dst[bs_dist] = escape_result;
  174|    618|        src += bs_dist + 2;
  175|    618|        dst += bs_dist + 1;
  176|    618|      }
  177|  2.60k|    } else {
  178|       |      /* they are the same. Since they can't co-occur, it means we
  179|       |       * encountered neither. */
  180|    195|      src += backslash_and_quote::BYTES_PROCESSED;
  181|    195|      dst += backslash_and_quote::BYTES_PROCESSED;
  182|    195|    }
  183|  2.80k|  }
  184|       |  /* can't be reached */
  185|      0|  return nullptr;
  186|  1.56k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113stringparsing24handle_unicode_codepointEPPKhPPhb:
   44|  1.76k|                                            uint8_t **dst_ptr, bool allow_replacement) {
   45|       |  // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD)
   46|  1.76k|  constexpr uint32_t substitution_code_point = 0xfffd;
   47|       |  // jsoncharutils::hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the
   48|       |  // conversion isn't valid; we defer the check for this to inside the
   49|       |  // multilingual plane check
   50|  1.76k|  uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2);
   51|  1.76k|  *src_ptr += 6;
   52|       |
   53|       |  // If we found a high surrogate, we must
   54|       |  // check for low surrogate for characters
   55|       |  // outside the Basic
   56|       |  // Multilingual Plane.
   57|  1.76k|  if (code_point >= 0xd800 && code_point < 0xdc00) {
  ------------------
  |  Branch (57:7): [True: 1.23k, False: 536]
  |  Branch (57:31): [True: 708, False: 522]
  ------------------
   58|    708|    const uint8_t *src_data = *src_ptr;
   59|       |    /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */
   60|    708|    if (((src_data[0] << 8) | src_data[1]) != ((static_cast<uint8_t> ('\\') << 8) | static_cast<uint8_t> ('u'))) {
  ------------------
  |  Branch (60:9): [True: 266, False: 442]
  ------------------
   61|    266|      if(!allow_replacement) { return false; }
  ------------------
  |  Branch (61:10): [True: 266, False: 0]
  ------------------
   62|      0|      code_point = substitution_code_point;
   63|    442|    } else {
   64|    442|      uint32_t code_point_2 = jsoncharutils::hex_to_u32_nocheck(src_data + 2);
   65|       |
   66|       |      // We have already checked that the high surrogate is valid and
   67|       |      // (code_point - 0xd800) < 1024.
   68|       |      //
   69|       |      // Check that code_point_2 is in the range 0xdc00..0xdfff
   70|       |      // and that code_point_2 was parsed from valid hex.
   71|    442|      uint32_t low_bit = code_point_2 - 0xdc00;
   72|    442|      if (low_bit >> 10) {
  ------------------
  |  Branch (72:11): [True: 218, False: 224]
  ------------------
   73|    218|        if(!allow_replacement) { return false; }
  ------------------
  |  Branch (73:12): [True: 218, False: 0]
  ------------------
   74|      0|        code_point = substitution_code_point;
   75|    224|      } else {
   76|    224|        code_point =  (((code_point - 0xd800) << 10) | low_bit) + 0x10000;
   77|    224|        *src_ptr += 6;
   78|    224|      }
   79|       |
   80|    442|    }
   81|  1.05k|  } else if (code_point >= 0xdc00 && code_point <= 0xdfff) {
  ------------------
  |  Branch (81:14): [True: 522, False: 536]
  |  Branch (81:38): [True: 215, False: 307]
  ------------------
   82|       |      // If we encounter a low surrogate (not preceded by a high surrogate)
   83|       |      // then we have an error.
   84|    215|      if(!allow_replacement) { return false; }
  ------------------
  |  Branch (84:10): [True: 215, False: 0]
  ------------------
   85|      0|      code_point = substitution_code_point;
   86|      0|  }
   87|  1.06k|  size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr);
   88|  1.06k|  *dst_ptr += offset;
   89|  1.06k|  return offset > 0;
   90|  1.76k|}

_ZN8simdjson7haswell25dom_parser_implementation6stage1EPKhmNS_11stage1_modeE:
  138|  5.10k|simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept {
  139|  5.10k|  this->buf = _buf;
  140|  5.10k|  this->len = _len;
  141|  5.10k|  return haswell::stage1::json_structural_indexer::index<128>(_buf, _len, *this, streaming);
  142|  5.10k|}
_ZNK8simdjson7haswell25dom_parser_implementation12parse_stringEPKhPhb:
  156|  1.56k|simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept {
  157|  1.56k|  return haswell::stringparsing::parse_string(src, dst, replacement_char);
  158|  1.56k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   85|   706k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   86|   706k|  return input.reduce_or().is_ascii();
   87|   706k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   97|   190k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   98|   190k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   99|   190k|  simd8<uint8_t> is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0
  100|       |  // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine.
  101|   190k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  102|   190k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner12find_escapedEm:
  126|   706k|simdjson_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
  127|   706k|  if (!backslash) { uint64_t escaped = prev_escaped; prev_escaped = 0; return escaped; }
  ------------------
  |  Branch (127:7): [True: 700k, False: 5.94k]
  ------------------
  128|  5.94k|  return find_escaped_branchless(backslash);
  129|   706k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_120json_character_block8classifyERKNS1_4simd8simd8x64IhEE:
   32|   706k|simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64<uint8_t>& in) {
   33|       |  // These lookups rely on the fact that anything < 127 will match the lower 4 bits, which is why
   34|       |  // we can't use the generic lookup_16.
   35|   706k|  const auto whitespace_table = simd8<uint8_t>::repeat_16(' ', 100, 100, 100, 17, 100, 113, 2, 100, '\t', '\n', 112, 100, '\r', 100, 100);
   36|       |
   37|       |  // The 6 operators (:,[]{}) have these values:
   38|       |  //
   39|       |  // , 2C
   40|       |  // : 3A
   41|       |  // [ 5B
   42|       |  // { 7B
   43|       |  // ] 5D
   44|       |  // } 7D
   45|       |  //
   46|       |  // If you use | 0x20 to turn [ and ] into { and }, the lower 4 bits of each character is unique.
   47|       |  // We exploit this, using a simd 4-bit lookup to tell us which character match against, and then
   48|       |  // match it (against | 0x20).
   49|       |  //
   50|       |  // To prevent recognizing other characters, everything else gets compared with 0, which cannot
   51|       |  // match due to the | 0x20.
   52|       |  //
   53|       |  // NOTE: Due to the | 0x20, this ALSO treats <FF> and <SUB> (control characters 0C and 1A) like ,
   54|       |  // and :. This gets caught in stage 2, which checks the actual character to ensure the right
   55|       |  // operators are in the right places.
   56|   706k|  const auto op_table = simd8<uint8_t>::repeat_16(
   57|   706k|    0, 0, 0, 0,
   58|   706k|    0, 0, 0, 0,
   59|   706k|    0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B
   60|   706k|    ',', '}', 0, 0  // , = 2C, ] = 5D, } = 7D
   61|   706k|  );
   62|       |
   63|       |  // We compute whitespace and op separately. If later code only uses one or the
   64|       |  // other, given the fact that all functions are aggressively inlined, we can
   65|       |  // hope that useless computations will be omitted. This is namely case when
   66|       |  // minifying (we only need whitespace).
   67|       |
   68|   706k|  const uint64_t whitespace = in.eq({
   69|   706k|    _mm256_shuffle_epi8(whitespace_table, in.chunks[0]),
   70|   706k|    _mm256_shuffle_epi8(whitespace_table, in.chunks[1])
   71|   706k|  });
   72|       |  // Turn [ and ] into { and }
   73|   706k|  const simd8x64<uint8_t> curlified{
   74|   706k|    in.chunks[0] | 0x20,
   75|   706k|    in.chunks[1] | 0x20
   76|   706k|  };
   77|   706k|  const uint64_t op = curlified.eq({
   78|   706k|    _mm256_shuffle_epi8(op_table, in.chunks[0]),
   79|   706k|    _mm256_shuffle_epi8(op_table, in.chunks[1])
   80|   706k|  });
   81|       |
   82|   706k|  return { whitespace, op };
   83|   706k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block6scalarEv:
   28|  1.41M|simdjson_inline uint64_t json_character_block::scalar() const noexcept { return ~(op() | whitespace()); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block2opEv:
   27|  2.11M|simdjson_inline uint64_t json_character_block::op() const noexcept { return _op; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block10whitespaceEv:
   26|  1.41M|simdjson_inline uint64_t json_character_block::whitespace() const noexcept { return _whitespace; }

_ZNK8simdjson7haswell14implementation32create_dom_parser_implementationEmmRNSt3__110unique_ptrINS_8internal25dom_parser_implementationENS2_14default_deleteIS5_EEEE:
   10|  5.10k|) const noexcept {
   11|  5.10k|  dst.reset( new (std::nothrow) dom_parser_implementation() );
   12|  5.10k|  if (!dst) { return MEMALLOC; }
  ------------------
  |  Branch (12:7): [True: 0, False: 5.10k]
  ------------------
   13|  5.10k|  if (auto err = dst->set_capacity(capacity))
  ------------------
  |  Branch (13:12): [True: 0, False: 5.10k]
  ------------------
   14|      0|    return err;
   15|  5.10k|  if (auto err = dst->set_max_depth(max_depth))
  ------------------
  |  Branch (15:12): [True: 0, False: 5.10k]
  ------------------
   16|      0|    return err;
   17|  5.10k|  return SUCCESS;
   18|  5.10k|}

_ZNK8simdjson8internal29available_implementation_list21detect_best_supportedEv:
  144|      1|const implementation *available_implementation_list::detect_best_supported() const noexcept {
  145|       |  // They are prelisted in priority order, so we just go down the list
  146|      1|  uint32_t supported_instruction_sets = internal::detect_supported_architectures();
  147|      2|  for (const implementation *impl : internal::get_available_implementation_pointers()) {
  ------------------
  |  Branch (147:35): [True: 2, False: 0]
  ------------------
  148|      2|    uint32_t required_instruction_sets = impl->required_instruction_sets();
  149|      2|    if ((supported_instruction_sets & required_instruction_sets) == required_instruction_sets) { return impl; }
  ------------------
  |  Branch (149:9): [True: 1, False: 1]
  ------------------
  150|      2|  }
  151|      0|  return get_unsupported_singleton(); // this should never happen?
  152|      1|}
_ZNK8simdjson8internal49detect_best_supported_implementation_on_first_use8set_bestEv:
  154|      1|const implementation *detect_best_supported_implementation_on_first_use::set_best() const noexcept {
  155|      1|  SIMDJSON_PUSH_DISABLE_WARNINGS
  156|       |  SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe
  157|      1|  char *force_implementation_name = getenv("SIMDJSON_FORCE_IMPLEMENTATION");
  158|      1|  SIMDJSON_POP_DISABLE_WARNINGS
  159|       |
  160|      1|  if (force_implementation_name) {
  ------------------
  |  Branch (160:7): [True: 0, False: 1]
  ------------------
  161|      0|    auto force_implementation = get_available_implementations()[force_implementation_name];
  162|      0|    if (force_implementation) {
  ------------------
  |  Branch (162:9): [True: 0, False: 0]
  ------------------
  163|      0|      return get_active_implementation() = force_implementation;
  164|      0|    } else {
  165|       |      // Note: abort() and stderr usage within the library is forbidden.
  166|      0|      return get_active_implementation() = get_unsupported_singleton();
  167|      0|    }
  168|      0|  }
  169|      1|  return get_active_implementation() = get_available_implementations().detect_best_supported();
  170|      1|}
_ZN8simdjson29get_available_implementationsEv:
  174|      1|SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations() {
  175|      1|  static const internal::available_implementation_list available_implementations{};
  176|      1|  return available_implementations;
  177|      1|}
_ZN8simdjson25get_active_implementationEv:
  179|  5.10k|SIMDJSON_DLLIMPORTEXPORT internal::atomic_ptr<const implementation>& get_active_implementation() {
  180|  5.10k|    static const internal::detect_best_supported_implementation_on_first_use detect_best_supported_implementation_on_first_use_singleton;
  181|  5.10k|    static internal::atomic_ptr<const implementation> active_implementation{&detect_best_supported_implementation_on_first_use_singleton};
  182|  5.10k|    return active_implementation;
  183|  5.10k|}
simdjson.cpp:_ZN8simdjson8internalL37get_available_implementation_pointersEv:
   80|      1|static const std::initializer_list<const implementation *>& get_available_implementation_pointers() {
   81|      1|  static const std::initializer_list<const implementation *> available_implementation_pointers {
   82|      1|#if SIMDJSON_IMPLEMENTATION_ICELAKE
   83|      1|    get_icelake_singleton(),
   84|      1|#endif
   85|      1|#if SIMDJSON_IMPLEMENTATION_HASWELL
   86|      1|    get_haswell_singleton(),
   87|      1|#endif
   88|      1|#if SIMDJSON_IMPLEMENTATION_WESTMERE
   89|      1|    get_westmere_singleton(),
   90|      1|#endif
   91|       |#if SIMDJSON_IMPLEMENTATION_ARM64
   92|       |    get_arm64_singleton(),
   93|       |#endif
   94|       |#if SIMDJSON_IMPLEMENTATION_PPC64
   95|       |    get_ppc64_singleton(),
   96|       |#endif
   97|      1|#if SIMDJSON_IMPLEMENTATION_FALLBACK
   98|      1|    get_fallback_singleton(),
   99|      1|#endif
  100|      1|  }; // available_implementation_pointers
  101|      1|  return available_implementation_pointers;
  102|      1|}
simdjson.cpp:_ZN8simdjson8internalL21get_icelake_singletonEv:
   18|      1|static const icelake::implementation* get_icelake_singleton() {
   19|      1|  static const icelake::implementation icelake_singleton{};
   20|      1|  return &icelake_singleton;
   21|      1|}
simdjson.cpp:_ZN8simdjson8internalL21get_haswell_singletonEv:
   24|      1|static const haswell::implementation* get_haswell_singleton() {
   25|      1|  static const haswell::implementation haswell_singleton{};
   26|      1|  return &haswell_singleton;
   27|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_westmere_singletonEv:
   30|      1|static const westmere::implementation* get_westmere_singleton() {
   31|      1|  static const westmere::implementation westmere_singleton{};
   32|      1|  return &westmere_singleton;
   33|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_fallback_singletonEv:
   48|      1|static const fallback::implementation* get_fallback_singleton() {
   49|      1|  static const fallback::implementation fallback_singleton{};
   50|      1|  return &fallback_singleton;
   51|      1|}
_ZN8simdjson8internal49detect_best_supported_implementation_on_first_useC2Ev:
   75|      1|  simdjson_inline detect_best_supported_implementation_on_first_use() noexcept : implementation("best_supported_detector", "Detects the best supported implementation and sets it", 0) {}
_ZNK8simdjson8internal49detect_best_supported_implementation_on_first_use32create_dom_parser_implementationEmmRNSt3__110unique_ptrINS0_25dom_parser_implementationENS2_14default_deleteIS4_EEEE:
   66|      1|  ) const noexcept final {
   67|      1|    return set_best()->create_dom_parser_implementation(capacity, max_length, dst);
   68|      1|  }

