_ZN8FuzzDataC2EPKhm:
   50|  5.00k|           size_t size) : Data(data),Size(size){}
_ZN8FuzzData16splitIntoStringsEv:
  117|  5.00k|  std::vector<std::string_view> splitIntoStrings() {
  118|  5.00k|    std::vector<std::string_view> ret;
  119|  5.00k|    if(Size>0) {
  ------------------
  |  Branch (119:8): [True: 5.00k, False: 2]
  ------------------
  120|  5.00k|      ret=split(chardata(),Size);
  121|       |      // all data consumed.
  122|  5.00k|      Data+=Size;
  123|  5.00k|      Size=0;
  124|  5.00k|    }
  125|  5.00k|    return ret;
  126|  5.00k|  }
_Z5splitPKcm:
   26|  5.00k|inline std::vector<std::string_view> split(const char* Data, size_t Size) {
   27|       |
   28|  5.00k|  std::vector<std::string_view> ret;
   29|       |
   30|  5.00k|    using namespace std::literals;
   31|  5.00k|    constexpr auto sep="\n~~\n"sv;
   32|       |
   33|  5.00k|    std::string_view all(Data,Size);
   34|  5.00k|    auto pos=all.find(sep);
   35|  1.09M|    while(pos!=std::string_view::npos) {
  ------------------
  |  Branch (35:11): [True: 1.08M, False: 5.00k]
  ------------------
   36|  1.08M|      ret.push_back(all.substr(0,pos));
   37|  1.08M|      all=all.substr(pos+sep.size());
   38|  1.08M|      pos=all.find(sep);
   39|  1.08M|    }
   40|  5.00k|    ret.push_back(all);
   41|  5.00k|    return ret;
   42|  5.00k|}
_ZNK8FuzzData8chardataEv:
  158|  5.00k|  const char* chardata() const {return static_cast<const char*>(static_cast<const void*>(Data));}
_ZN8FuzzData6getIntILi0ELi12EEEiv:
   54|  5.00k|  int getInt() {
   55|  5.00k|    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.00k|    constexpr int range=(Max-Min)+1;
   60|  5.00k|    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.00k|    if(range<256)
  ------------------
  |  Branch (64:8): [Folded - Ignored]
  ------------------
   65|  5.00k|      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.00k|  T get() {
   74|  5.00k|    const auto Nbytes=sizeof(T);
   75|  5.00k|    T ret{};
   76|  5.00k|    if(Size<Nbytes) {
  ------------------
  |  Branch (76:8): [True: 0, False: 5.00k]
  ------------------
   77|       |      //don't throw, signal with null instead.
   78|      0|      Data=nullptr;
   79|      0|      Size=0;
   80|      0|      return ret;
   81|      0|    }
   82|  5.00k|    std::memcpy(&ret,Data,Nbytes);
   83|  5.00k|    Data+=Nbytes;
   84|  5.00k|    Size-=Nbytes;
   85|  5.00k|    return ret;
   86|  5.00k|  }

LLVMFuzzerTestOneInput:
    7|  5.00k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
    8|  5.00k|  FuzzData fd(Data, Size);
    9|  5.00k|  const int action = fd.getInt<0, 12>();
   10|       |
   11|       |  // split the remainder of the document into strings
   12|  5.00k|  auto strings = fd.splitIntoStrings();
   13|  5.00k|  while (strings.size() < 1) {
  ------------------
  |  Branch (13:10): [True: 2, False: 5.00k]
  ------------------
   14|      2|    strings.emplace_back();
   15|      2|  }
   16|  5.00k|#if SIMDJSON_EXCEPTIONS
   17|  5.00k|  try {
   18|  5.00k|#endif
   19|  5.00k|    simdjson::ondemand::parser parser;
   20|  5.00k|    simdjson::padded_string padded(strings[0]);
   21|  5.00k|    auto doc = parser.iterate(padded);
   22|  5.00k|    if (doc.error()) {
  ------------------
  |  Branch (22:9): [True: 1.18k, False: 3.82k]
  ------------------
   23|  1.18k|      return 0;
   24|  1.18k|    }
   25|  38.7k|    for (auto item : doc) {
  ------------------
  |  Branch (25:20): [True: 38.7k, False: 3.82k]
  ------------------
   26|  38.7k|      switch (action) {
   27|  3.99k|      case 0: {
  ------------------
  |  Branch (27:7): [True: 3.99k, False: 34.7k]
  ------------------
   28|  3.99k|        simdjson_unused auto x = item.get_string();
  ------------------
  |  |  113|  3.99k|  #define simdjson_unused __attribute__((unused))
  ------------------
   29|  3.99k|      } break;
   30|    991|      case 1: {
  ------------------
  |  Branch (30:7): [True: 991, False: 37.7k]
  ------------------
   31|    991|        simdjson_unused auto x = item.get_bool();
  ------------------
  |  |  113|    991|  #define simdjson_unused __attribute__((unused))
  ------------------
   32|    991|      } break;
   33|  1.70k|      case 2: {
  ------------------
  |  Branch (33:7): [True: 1.70k, False: 37.0k]
  ------------------
   34|  1.70k|        simdjson_unused auto x = item.get_array();
  ------------------
  |  |  113|  1.70k|  #define simdjson_unused __attribute__((unused))
  ------------------
   35|  1.70k|      } break;
   36|  2.19k|      case 3: {
  ------------------
  |  Branch (36:7): [True: 2.19k, False: 36.5k]
  ------------------
   37|  2.19k|        simdjson_unused auto x = item.get_int64();
  ------------------
  |  |  113|  2.19k|  #define simdjson_unused __attribute__((unused))
  ------------------
   38|  2.19k|      } break;
   39|  21.0k|      case 4: {
  ------------------
  |  Branch (39:7): [True: 21.0k, False: 17.6k]
  ------------------
   40|  21.0k|        simdjson_unused auto x = item.get_double();
  ------------------
  |  |  113|  21.0k|  #define simdjson_unused __attribute__((unused))
  ------------------
   41|  21.0k|      } break;
   42|    847|      case 5: {
  ------------------
  |  Branch (42:7): [True: 847, False: 37.9k]
  ------------------
   43|    847|        simdjson_unused auto x = item.get_object();
  ------------------
  |  |  113|    847|  #define simdjson_unused __attribute__((unused))
  ------------------
   44|    847|      } break;
   45|  2.26k|      case 6: {
  ------------------
  |  Branch (45:7): [True: 2.26k, False: 36.4k]
  ------------------
   46|  2.26k|        simdjson_unused auto x = item.get_uint64();
  ------------------
  |  |  113|  2.26k|  #define simdjson_unused __attribute__((unused))
  ------------------
   47|  2.26k|      } break;
   48|    575|      case 7: {
  ------------------
  |  Branch (48:7): [True: 575, False: 38.1k]
  ------------------
   49|    575|        simdjson_unused auto x = item.get_raw_json_string();
  ------------------
  |  |  113|    575|  #define simdjson_unused __attribute__((unused))
  ------------------
   50|    575|      } break;
   51|  1.12k|      case 8: {
  ------------------
  |  Branch (51:7): [True: 1.12k, False: 37.6k]
  ------------------
   52|  1.12k|        simdjson_unused auto x = item.is_null();
  ------------------
  |  |  113|  1.12k|  #define simdjson_unused __attribute__((unused))
  ------------------
   53|  1.12k|      } break;
   54|  1.26k|      case 9: {
  ------------------
  |  Branch (54:7): [True: 1.26k, False: 37.4k]
  ------------------
   55|  1.26k|        simdjson_unused auto x = item.begin();
  ------------------
  |  |  113|  1.26k|  #define simdjson_unused __attribute__((unused))
  ------------------
   56|  1.26k|      } break;
   57|    283|      case 10: {
  ------------------
  |  Branch (57:7): [True: 283, False: 38.4k]
  ------------------
   58|    283|        simdjson_unused auto x = item.end();
  ------------------
  |  |  113|    283|  #define simdjson_unused __attribute__((unused))
  ------------------
   59|    283|      } break;
   60|  2.20k|      case 11: {
  ------------------
  |  Branch (60:7): [True: 2.20k, False: 36.5k]
  ------------------
   61|  5.26k|        for (auto e : item) {
  ------------------
  |  Branch (61:21): [True: 5.26k, False: 2.20k]
  ------------------
   62|  5.26k|          simdjson_unused auto x = e.is_null();
  ------------------
  |  |  113|  5.26k|  #define simdjson_unused __attribute__((unused))
  ------------------
   63|  5.26k|        }
   64|  2.20k|      } break;
   65|    204|      default:;
  ------------------
  |  Branch (65:7): [True: 204, False: 38.5k]
  ------------------
   66|  38.7k|      }
   67|  38.7k|    }
   68|  3.82k|#if SIMDJSON_EXCEPTIONS
   69|  3.82k|  } catch (...) {
   70|      0|  }
   71|      0|#endif
   72|       |
   73|      0|  return 0;
   74|  5.00k|}

_ZN8simdjson15simdjson_resultIbEC2ENS_10error_codeE:
  175|  7.08k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2ENS_10error_codeE:
  107|  7.08k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EObNS_10error_codeE:
  104|  62.6k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIbEC2EOb:
  178|  55.5k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EOb:
  110|  55.5k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNO8simdjson15simdjson_resultIbE3getERb:
  127|  13.3k|simdjson_warn_unused simdjson_inline error_code simdjson_result<T>::get(T &value) && noexcept {
  128|  13.3k|  return std::forward<internal::simdjson_result_base<T>>(*this).get(value);
  129|  13.3k|}
_ZNO8simdjson8internal20simdjson_result_baseIbE3getERb:
   55|  13.3k|simdjson_warn_unused simdjson_inline error_code simdjson_result_base<T>::get(T &value) && noexcept {
   56|  13.3k|  error_code error;
   57|  13.3k|  std::forward<simdjson_result_base<T>>(*this).tie(value, error);
   58|  13.3k|  return error;
   59|  13.3k|}
_ZNO8simdjson8internal20simdjson_result_baseIbE3tieERbRNS_10error_codeE:
   47|  13.3k|simdjson_inline void simdjson_result_base<T>::tie(T &value, error_code &error) && noexcept {
   48|  13.3k|  error = this->second;
   49|  13.3k|  if (!error) {
  ------------------
  |  Branch (49:7): [True: 10.2k, False: 3.06k]
  ------------------
   50|  10.2k|    value = std::forward<simdjson_result_base<T>>(*this).first;
   51|  10.2k|  }
   52|  13.3k|}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2ENS_10error_codeE:
  175|  3.52k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2ENS_10error_codeE:
  107|  3.52k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_NS_10error_codeE:
  104|  3.99k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2EOS5_:
  178|    476|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_:
  110|    476|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultIbE5errorEv:
  132|  42.8k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  42.8k|  return internal::simdjson_result_base<T>::error();
  134|  42.8k|}
_ZNK8simdjson8internal20simdjson_result_baseIbE5errorEv:
   62|  42.8k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  42.8k|  return this->second;
   64|  42.8k|}
_ZN8simdjson15simdjson_resultIlEC2ENS_10error_codeE:
  175|  1.43k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2ENS_10error_codeE:
  107|  1.43k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2EOlNS_10error_codeE:
  104|  2.19k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIlEC2EOl:
  178|    758|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2EOl:
  110|    758|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultIlE5errorEv:
  132|  2.16k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  2.16k|  return internal::simdjson_result_base<T>::error();
  134|  2.16k|}
_ZNK8simdjson8internal20simdjson_result_baseIlE5errorEv:
   62|  2.16k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  2.16k|  return this->second;
   64|  2.16k|}
_ZN8simdjson15simdjson_resultIdEC2ENS_10error_codeE:
  175|  7.04k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2ENS_10error_codeE:
  107|  7.04k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2EOdNS_10error_codeE:
  104|  21.0k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIdEC2EOd:
  178|  14.0k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2EOd:
  110|  14.0k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultIdE5errorEv:
  132|  20.9k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  20.9k|  return internal::simdjson_result_base<T>::error();
  134|  20.9k|}
_ZNK8simdjson8internal20simdjson_result_baseIdE5errorEv:
   62|  20.9k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  20.9k|  return this->second;
   64|  20.9k|}
_ZN8simdjson15simdjson_resultImEC2ENS_10error_codeE:
  175|  1.51k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2ENS_10error_codeE:
  107|  1.51k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2EOmNS_10error_codeE:
  104|  2.26k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultImEC2EOm:
  178|    754|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2EOm:
  110|    754|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson15simdjson_resultImE5errorEv:
  132|  2.23k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  133|  2.23k|  return internal::simdjson_result_base<T>::error();
  134|  2.23k|}
_ZNK8simdjson8internal20simdjson_result_baseImE5errorEv:
   62|  2.23k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  2.23k|  return this->second;
   64|  2.23k|}

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_114leading_zeroesEm:
   29|  4.10k|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.10k|  return __builtin_clzll(input_num);
   40|  4.10k|#endif// _MSC_VER
   41|  4.10k|}

_ZN8simdjson8fallback14implementationC2Ev:
   23|      1|  ) {}

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_111atomparsing8str4ncmpEPKhPKc:
   19|  6.46k|simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) {
   20|  6.46k|  uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++)
   21|  6.46k|  static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes");
   22|  6.46k|  std::memcpy(&srcval, src, sizeof(uint32_t));
   23|  6.46k|  return srcval ^ string_to_uint32(atom);
   24|  6.46k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_111atomparsing16string_to_uint32EPKc:
   13|  6.46k|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.00k|inline simdjson_warn_unused error_code dom_parser_implementation::set_capacity(size_t capacity) noexcept {
   59|  5.00k|  if(capacity > SIMDJSON_MAXSIZE_BYTES) { return CAPACITY; }
  ------------------
  |  Branch (59:6): [True: 0, False: 5.00k]
  ------------------
   60|       |  // Stage 1 index output
   61|  5.00k|  size_t max_structures = SIMDJSON_ROUNDUP_N(capacity, 64) + 2 + 7;
  ------------------
  |  |   68|  5.00k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   62|  5.00k|  structural_indexes.reset( new (std::nothrow) uint32_t[max_structures] );
   63|  5.00k|  if (!structural_indexes) { _capacity = 0; return MEMALLOC; }
  ------------------
  |  Branch (63:7): [True: 0, False: 5.00k]
  ------------------
   64|  5.00k|  structural_indexes[0] = 0;
   65|  5.00k|  n_structural_indexes = 0;
   66|       |
   67|  5.00k|  _capacity = capacity;
   68|  5.00k|  return SUCCESS;
   69|  5.00k|}
_ZN8simdjson7haswell25dom_parser_implementation13set_max_depthEm:
   71|  5.00k|inline simdjson_warn_unused error_code dom_parser_implementation::set_max_depth(size_t max_depth) noexcept {
   72|       |  // Stage 2 stacks
   73|  5.00k|  open_containers.reset(new (std::nothrow) open_container[max_depth]);
   74|  5.00k|  is_array.reset(new (std::nothrow) bool[max_depth]);
   75|  5.00k|  if (!is_array || !open_containers) { _max_depth = 0; return MEMALLOC; }
  ------------------
  |  Branch (75:7): [True: 0, False: 5.00k]
  |  Branch (75:20): [True: 0, False: 5.00k]
  ------------------
   76|       |
   77|  5.00k|  _max_depth = max_depth;
   78|  5.00k|  return SUCCESS;
   79|  5.00k|}
_ZN8simdjson7haswell25dom_parser_implementationC2Ev:
   53|  5.00k|inline dom_parser_implementation::dom_parser_implementation() noexcept = default;

_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEEC2ENS_10error_codeE:
   74|  1.18k|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEEC2EOS3_NS_10error_codeE:
   71|  5.00k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEEC2EOS3_:
   77|  3.82k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEEC2EOS3_NS_10error_codeE:
   71|  7.45k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEEC2ENS_10error_codeE:
   74|  2.56k|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEEC2EOS3_NS_10error_codeE:
   71|  8.79k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEEC2EOS3_:
   77|  6.23k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5arrayEE5errorEv:
   24|  9.13k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  9.13k|  return this->second;
   26|  9.13k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEEC2EOS3_:
   77|  5.03k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand14array_iteratorEE5errorEv:
   24|  93.2k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  93.2k|  return this->second;
   26|  93.2k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEEC2ENS_10error_codeE:
   74|  2.55k|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEEC2EOS3_NS_10error_codeE:
   71|  44.0k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEEC2EOS3_:
   77|  41.4k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand5valueEE5errorEv:
   24|  48.6k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  48.6k|  return this->second;
   26|  48.6k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEEC2ENS_10error_codeE:
   74|    643|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEEC2EOS3_NS_10error_codeE:
   71|  4.44k|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEEC2EOS3_:
   77|  3.79k|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand15raw_json_stringEE5errorEv:
   24|  4.12k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  4.12k|  return this->second;
   26|  4.12k|}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand6objectEEC2ENS_10error_codeE:
   74|    413|    : implementation_simdjson_result_base(T{}, error) {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand6objectEEC2EOS3_NS_10error_codeE:
   71|    847|    : first{std::forward<T>(value)}, second{error} {}
_ZN8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand6objectEEC2EOS3_:
   77|    434|    : implementation_simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8fallback35implementation_simdjson_result_baseINS0_8ondemand8documentEE5errorEv:
   24|  8.82k|simdjson_inline error_code implementation_simdjson_result_base<T>::error() const noexcept {
   25|  8.82k|  return this->second;
   26|  8.82k|}

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

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113jsoncharutils31is_not_structural_or_whitespaceEh:
   11|  17.1k|simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) {
   12|  17.1k|  return internal::structural_or_whitespace_negated[c];
   13|  17.1k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113jsoncharutils19full_multiplicationEmm:
   95|  4.80k|simdjson_inline value128 full_multiplication(uint64_t value1, uint64_t value2) {
   96|  4.80k|  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|  4.80k|  __uint128_t r = (static_cast<__uint128_t>(value1)) * value2;
  107|  4.80k|  answer.low = uint64_t(r);
  108|  4.80k|  answer.high = uint64_t(r >> 64);
  109|  4.80k|#endif
  110|  4.80k|  return answer;
  111|  4.80k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113jsoncharutils27is_structural_or_whitespaceEh:
   15|    512|simdjson_inline uint32_t is_structural_or_whitespace(uint8_t c) {
   16|    512|  return internal::structural_or_whitespace[c];
   17|    512|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils18hex_to_u32_nocheckEPKh:
   26|  4.13k|    const uint8_t *src) { // strictly speaking, static inline is a C-ism
   27|  4.13k|  uint32_t v1 = internal::digit_to_val32[630 + src[0]];
   28|  4.13k|  uint32_t v2 = internal::digit_to_val32[420 + src[1]];
   29|  4.13k|  uint32_t v3 = internal::digit_to_val32[210 + src[2]];
   30|  4.13k|  uint32_t v4 = internal::digit_to_val32[0 + src[3]];
   31|  4.13k|  return v1 | v2 | v3 | v4;
   32|  4.13k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils17codepoint_to_utf8EjPh:
   46|  2.62k|simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) {
   47|  2.62k|  if (cp <= 0x7F) {
  ------------------
  |  Branch (47:7): [True: 231, False: 2.39k]
  ------------------
   48|    231|    c[0] = uint8_t(cp);
   49|    231|    return 1; // ascii
   50|    231|  }
   51|  2.39k|  if (cp <= 0x7FF) {
  ------------------
  |  Branch (51:7): [True: 382, False: 2.00k]
  ------------------
   52|    382|    c[0] = uint8_t((cp >> 6) + 192);
   53|    382|    c[1] = uint8_t((cp & 63) + 128);
   54|    382|    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|  2.00k|  } else if (cp <= 0xFFFF) {
  ------------------
  |  Branch (58:14): [True: 369, False: 1.63k]
  ------------------
   59|    369|    c[0] = uint8_t((cp >> 12) + 224);
   60|    369|    c[1] = uint8_t(((cp >> 6) & 63) + 128);
   61|    369|    c[2] = uint8_t((cp & 63) + 128);
   62|    369|    return 3;
   63|  1.63k|  } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this
  ------------------
  |  Branch (63:14): [True: 243, False: 1.39k]
  ------------------
   64|       |                               // is not needed
   65|    243|    c[0] = uint8_t((cp >> 18) + 240);
   66|    243|    c[1] = uint8_t(((cp >> 12) & 63) + 128);
   67|    243|    c[2] = uint8_t(((cp >> 6) & 63) + 128);
   68|    243|    c[3] = uint8_t((cp & 63) + 128);
   69|    243|    return 4;
   70|    243|  }
   71|       |  // will return 0 when the code point was too large.
   72|  1.39k|  return 0; // bad r
   73|  2.39k|}

fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_113parse_integerEPKh:
  845|  2.16k|simdjson_unused simdjson_inline simdjson_result<int64_t> parse_integer(const uint8_t *src) noexcept {
  846|       |  //
  847|       |  // Check for minus sign
  848|       |  //
  849|  2.16k|  bool negative = (*src == '-');
  850|  2.16k|  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|  2.16k|  const uint8_t *const start_digits = p;
  857|  2.16k|  uint64_t i = 0;
  858|  3.06M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (858:10): [True: 3.06M, False: 2.16k]
  ------------------
  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|  2.16k|  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|  2.16k|  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|  2.16k|  if ((digit_count == 0) || (digit_count > longest_digit_count)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (870:7): [True: 454, False: 1.71k]
  |  Branch (870:29): [True: 239, False: 1.47k]
  ------------------
  871|       |  // Here digit_count > 0.
  872|  1.47k|  if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (872:7): [True: 581, False: 891]
  |  Branch (872:33): [True: 200, False: 381]
  ------------------
  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|  1.27k|  if(integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); }
  ------------------
  |  Branch (878:6): [True: 241, False: 1.03k]
  ------------------
  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|  1.03k|  if(i > uint64_t(INT64_MAX) + uint64_t(negative)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (882:6): [True: 273, False: 758]
  ------------------
  883|    758|  return negative ? (~i+1) : i;
  ------------------
  |  Branch (883:10): [True: 211, False: 547]
  ------------------
  884|  1.03k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing11parse_digitImEEbhRT_:
  365|  20.4M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  366|  20.4M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  367|  20.4M|  if (digit > 9) {
  ------------------
  |  Branch (367:7): [True: 40.9k, False: 20.4M]
  ------------------
  368|  40.9k|    return false;
  369|  40.9k|  }
  370|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  371|  20.4M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  372|  20.4M|  return true;
  373|  20.4M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_112parse_doubleEPKh:
  972|  20.9k|simdjson_unused simdjson_inline simdjson_result<double> parse_double(const uint8_t * src) noexcept {
  973|       |  //
  974|       |  // Check for minus sign
  975|       |  //
  976|  20.9k|  bool negative = (*src == '-');
  977|  20.9k|  src += uint8_t(negative);
  978|       |
  979|       |  //
  980|       |  // Parse the integer part.
  981|       |  //
  982|  20.9k|  uint64_t i = 0;
  983|  20.9k|  const uint8_t *p = src;
  984|  20.9k|  p += parse_digit(*p, i);
  985|  20.9k|  bool leading_zero = (i == 0);
  986|  11.9M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (986:10): [True: 11.9M, False: 20.9k]
  ------------------
  987|       |  // no integer digits, or 0123 (zero must be solo)
  988|  20.9k|  if ( p == src ) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (988:8): [True: 690, False: 20.2k]
  ------------------
  989|  20.2k|  if ( (leading_zero && p != src+1)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (989:9): [True: 8.42k, False: 11.8k]
  |  Branch (989:25): [True: 965, False: 7.45k]
  ------------------
  990|       |
  991|       |  //
  992|       |  // Parse the decimal part.
  993|       |  //
  994|  19.3k|  int64_t exponent = 0;
  995|  19.3k|  bool overflow;
  996|  19.3k|  if (simdjson_likely(*p == '.')) {
  ------------------
  |  |  117|  19.3k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 8.19k, False: 11.1k]
  |  |  ------------------
  ------------------
  997|  8.19k|    p++;
  998|  8.19k|    const uint8_t *start_decimal_digits = p;
  999|  8.19k|    if (!parse_digit(*p, i)) { return NUMBER_ERROR; } // no decimal digits
  ------------------
  |  Branch (999:9): [True: 1.76k, False: 6.43k]
  ------------------
 1000|  6.43k|    p++;
 1001|  3.09M|    while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (1001:12): [True: 3.08M, False: 6.43k]
  ------------------
 1002|  6.43k|    exponent = -(p - start_decimal_digits);
 1003|       |
 1004|       |    // Overflow check. More than 19 digits (minus the decimal) may be overflow.
 1005|  6.43k|    overflow = p-src-1 > 19;
 1006|  6.43k|    if (simdjson_unlikely(overflow && leading_zero)) {
  ------------------
  |  |  120|  9.18k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 1.87k, False: 4.55k]
  |  |  |  Branch (120:52): [True: 2.75k, False: 3.67k]
  |  |  |  Branch (120:52): [True: 1.87k, False: 876]
  |  |  ------------------
  ------------------
 1007|       |      // Skip leading 0.00000 and see if it still overflows
 1008|  1.87k|      const uint8_t *start_digits = src + 2;
 1009|  2.05M|      while (*start_digits == '0') { start_digits++; }
  ------------------
  |  Branch (1009:14): [True: 2.05M, False: 1.87k]
  ------------------
 1010|  1.87k|      overflow = start_digits-src > 19;
 1011|  1.87k|    }
 1012|  11.1k|  } else {
 1013|  11.1k|    overflow = p-src > 19;
 1014|  11.1k|  }
 1015|       |
 1016|       |  //
 1017|       |  // Parse the exponent
 1018|       |  //
 1019|  17.5k|  if (*p == 'e' || *p == 'E') {
  ------------------
  |  Branch (1019:7): [True: 1.46k, False: 16.0k]
  |  Branch (1019:20): [True: 5.22k, False: 10.8k]
  ------------------
 1020|  6.69k|    p++;
 1021|  6.69k|    bool exp_neg = *p == '-';
 1022|  6.69k|    p += exp_neg || *p == '+';
  ------------------
  |  Branch (1022:10): [True: 1.91k, False: 4.77k]
  |  Branch (1022:21): [True: 195, False: 4.58k]
  ------------------
 1023|       |
 1024|  6.69k|    uint64_t exp = 0;
 1025|  6.69k|    const uint8_t *start_exp_digits = p;
 1026|  1.05M|    while (parse_digit(*p, exp)) { p++; }
  ------------------
  |  Branch (1026:12): [True: 1.04M, False: 6.69k]
  ------------------
 1027|       |    // no exp digits, or 20+ exp digits
 1028|  6.69k|    if (p-start_exp_digits == 0 || p-start_exp_digits > 19) { return NUMBER_ERROR; }
  ------------------
  |  Branch (1028:9): [True: 502, False: 6.19k]
  |  Branch (1028:36): [True: 246, False: 5.94k]
  ------------------
 1029|       |
 1030|  5.94k|    exponent += exp_neg ? 0-exp : exp;
  ------------------
  |  Branch (1030:17): [True: 1.83k, False: 4.10k]
  ------------------
 1031|  5.94k|  }
 1032|       |
 1033|  16.7k|  if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (1033:7): [True: 1.09k, False: 15.6k]
  ------------------
 1034|       |
 1035|  15.6k|  overflow = overflow || exponent < simdjson::internal::smallest_power || exponent > simdjson::internal::largest_power;
  ------------------
  |  Branch (1035:14): [True: 4.87k, False: 10.8k]
  |  Branch (1035:26): [True: 1.01k, False: 9.81k]
  |  Branch (1035:75): [True: 1.54k, False: 8.26k]
  ------------------
 1036|       |
 1037|       |  //
 1038|       |  // Assemble (or slow-parse) the float
 1039|       |  //
 1040|  15.6k|  double d;
 1041|  15.6k|  if (simdjson_likely(!overflow)) {
  ------------------
  |  |  117|  15.6k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 8.26k, False: 7.43k]
  |  |  ------------------
  ------------------
 1042|  8.26k|    if (compute_float_64(exponent, i, negative, d)) { return d; }
  ------------------
  |  Branch (1042:9): [True: 7.71k, False: 550]
  ------------------
 1043|  8.26k|  }
 1044|  7.98k|  if (!parse_float_fallback(src - uint8_t(negative), &d)) {
  ------------------
  |  Branch (1044:7): [True: 1.64k, False: 6.33k]
  ------------------
 1045|  1.64k|    return NUMBER_ERROR;
 1046|  1.64k|  }
 1047|  6.33k|  return d;
 1048|  7.98k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing16compute_float_64ElmbRd:
   55|  8.26k|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|  8.26k|  if (-22 <= power && power <= 22 && i <= 9007199254740991) {
  ------------------
  |  Branch (67:7): [True: 7.82k, False: 442]
  |  Branch (67:23): [True: 5.67k, False: 2.15k]
  |  Branch (67:38): [True: 3.96k, False: 1.70k]
  ------------------
   68|  3.96k|#endif
   69|       |    // convert the integer into a double. This is lossless since
   70|       |    // 0 <= i <= 2^53 - 1.
   71|  3.96k|    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|  3.96k|    if (power < 0) {
  ------------------
  |  Branch (82:9): [True: 2.37k, False: 1.58k]
  ------------------
   83|  2.37k|      d = d / simdjson::internal::power_of_ten[-power];
   84|  2.37k|    } else {
   85|  1.58k|      d = d * simdjson::internal::power_of_ten[power];
   86|  1.58k|    }
   87|  3.96k|    if (negative) {
  ------------------
  |  Branch (87:9): [True: 5, False: 3.95k]
  ------------------
   88|      5|      d = -d;
   89|      5|    }
   90|  3.96k|    return true;
   91|  3.96k|  }
   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.30k|  if(i == 0) {
  ------------------
  |  Branch (114:6): [True: 198, False: 4.10k]
  ------------------
  115|    198|    d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (115:9): [True: 0, False: 198]
  ------------------
  116|    198|    return true;
  117|    198|  }
  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.10k|  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.10k|  int lz = leading_zeroes(i);
  151|  4.10k|  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.10k|  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.10k|  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.10k|  if((firstproduct.high & 0x1FF) == 0x1FF) {
  ------------------
  |  Branch (184:6): [True: 704, False: 3.40k]
  ------------------
  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|    704|    simdjson::internal::value128 secondproduct = jsoncharutils::full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]);
  207|    704|    firstproduct.low += secondproduct.high;
  208|    704|    if(secondproduct.high > firstproduct.low) { firstproduct.high++; }
  ------------------
  |  Branch (208:8): [True: 399, False: 305]
  ------------------
  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|    704|    if(simdjson_unlikely(firstproduct.low  == 0xFFFFFFFFFFFFFFFF)) {
  ------------------
  |  |  120|    704|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 704]
  |  |  ------------------
  ------------------
  212|       |      // This is very unlikely, but if so, we need to do much more work!
  213|      0|      return false;
  214|      0|    }
  215|    704|  }
  216|  4.10k|  uint64_t lower = firstproduct.low;
  217|  4.10k|  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.10k|  uint64_t upperbit = upper >> 63;
  222|  4.10k|  uint64_t mantissa = upper >> (upperbit + 9);
  223|  4.10k|  lz += int(1 ^ upperbit);
  224|       |
  225|       |  // Here we have mantissa < (1<<54).
  226|  4.10k|  int64_t real_exponent = exponent - lz;
  227|  4.10k|  if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal?
  ------------------
  |  |  120|  4.10k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 208, False: 3.89k]
  |  |  ------------------
  ------------------
  228|       |    // Here have that real_exponent <= 0 so -real_exponent >= 0
  229|    208|    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: 141, False: 67]
  ------------------
  230|    141|      d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (230:11): [True: 0, False: 141]
  ------------------
  231|    141|      return true;
  232|    141|    }
  233|       |    // next line is safe because -real_exponent + 1 < 0
  234|     67|    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|     67|    mantissa += (mantissa & 1); // round up
  238|     67|    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|     67|    real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1;
  ------------------
  |  Branch (246:21): [True: 67, False: 0]
  ------------------
  247|     67|    d = to_double(mantissa, real_exponent, negative);
  248|     67|    return true;
  249|    208|  }
  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|  3.89k|  if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) {
  ------------------
  |  |  120|  17.1k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 915, False: 2.98k]
  |  |  |  Branch (120:52): [True: 2.04k, False: 1.85k]
  |  |  |  Branch (120:52): [True: 1.83k, False: 208]
  |  |  |  Branch (120:52): [True: 1.61k, False: 222]
  |  |  |  Branch (120:52): [True: 915, False: 699]
  |  |  ------------------
  ------------------
  273|    915|    if((mantissa  << (upperbit + 64 - 53 - 2)) ==  upper) {
  ------------------
  |  Branch (273:8): [True: 274, False: 641]
  ------------------
  274|    274|      mantissa &= ~1;             // flip it so that we do not round up
  275|    274|    }
  276|    915|  }
  277|       |
  278|  3.89k|  mantissa += mantissa & 1;
  279|  3.89k|  mantissa >>= 1;
  280|       |
  281|       |  // Here we have mantissa < (1<<53), unless there was an overflow
  282|  3.89k|  if (mantissa >= (1ULL << 53)) {
  ------------------
  |  Branch (282:7): [True: 278, False: 3.61k]
  ------------------
  283|       |    //////////
  284|       |    // This will happen when parsing values such as 7.2057594037927933e+16
  285|       |    ////////
  286|    278|    mantissa = (1ULL << 52);
  287|    278|    real_exponent++;
  288|    278|  }
  289|  3.89k|  mantissa &= ~(1ULL << 52);
  290|       |  // we have to check that real_exponent is in range, otherwise we bail out
  291|  3.89k|  if (simdjson_unlikely(real_exponent > 2046)) {
  ------------------
  |  |  120|  3.89k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 550, False: 3.34k]
  |  |  ------------------
  ------------------
  292|       |    // We have an infinite value!!! We could actually throw an error here if we could.
  293|    550|    return false;
  294|    550|  }
  295|  3.34k|  d = to_double(mantissa, real_exponent, negative);
  296|  3.34k|  return true;
  297|  3.89k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_19to_doubleEmmb:
   40|  3.41k|simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) {
   41|  3.41k|    double d;
   42|  3.41k|    mantissa &= ~(1ULL << 52);
   43|  3.41k|    mantissa |= real_exponent << 52;
   44|  3.41k|    mantissa |= ((static_cast<uint64_t>(negative)) << 63);
   45|  3.41k|    std::memcpy(&d, &mantissa, sizeof(d));
   46|  3.41k|    return d;
   47|  3.41k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing20parse_float_fallbackEPKhPd:
  306|  7.98k|static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) {
  307|  7.98k|  *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|  7.98k|  return !(*outDouble > (std::numeric_limits<double>::max)() || *outDouble < std::numeric_limits<double>::lowest());
  ------------------
  |  Branch (318:12): [True: 1.57k, False: 6.41k]
  |  Branch (318:65): [True: 78, False: 6.33k]
  ------------------
  319|  7.98k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback12_GLOBAL__N_113numberparsing12_GLOBAL__N_114parse_unsignedEPKh:
  697|  2.23k|simdjson_unused simdjson_inline simdjson_result<uint64_t> parse_unsigned(const uint8_t * const src) noexcept {
  698|  2.23k|  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|  2.23k|  const uint8_t *const start_digits = p;
  704|  2.23k|  uint64_t i = 0;
  705|  1.29M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (705:10): [True: 1.29M, False: 2.23k]
  ------------------
  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|  2.23k|  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|  2.23k|  if ((digit_count == 0) || (digit_count > 20)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (715:7): [True: 323, False: 1.91k]
  |  Branch (715:29): [True: 252, False: 1.66k]
  ------------------
  716|       |  // Here digit_count > 0.
  717|  1.66k|  if (('0' == *start_digits) && (digit_count > 1)) { return NUMBER_ERROR; }
  ------------------
  |  Branch (717:7): [True: 580, False: 1.08k]
  |  Branch (717:33): [True: 213, False: 367]
  ------------------
  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|  1.45k|  if (integer_string_finisher[*p] != SUCCESS) { return error_code(integer_string_finisher[*p]); }
  ------------------
  |  Branch (723:7): [True: 260, False: 1.19k]
  ------------------
  724|       |
  725|  1.19k|  if (digit_count == 20) {
  ------------------
  |  Branch (725:7): [True: 709, False: 482]
  ------------------
  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|    709|    if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (738:9): [True: 197, False: 512]
  |  Branch (738:35): [True: 240, False: 272]
  ------------------
  739|    709|  }
  740|       |
  741|    754|  return i;
  742|  1.19k|}

_ZN8simdjson8fallback8ondemand5array10start_rootERNS1_14value_iteratorE:
   55|  3.82k|simdjson_inline simdjson_result<array> array::start_root(value_iterator &iter) noexcept {
   56|  3.82k|  simdjson_unused bool has_value;
  ------------------
  |  |  113|  3.82k|  #define simdjson_unused __attribute__((unused))
  ------------------
   57|  3.82k|  SIMDJSON_TRY( iter.start_root_array().get(has_value) );
  ------------------
  |  |  279|  3.82k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 197, False: 3.62k]
  |  |  ------------------
  ------------------
   58|  3.62k|  return array(iter);
   59|  3.82k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5arrayEEC2ENS_10error_codeE:
  181|  2.56k|{
  182|  2.56k|}
_ZN8simdjson8fallback8ondemand5arrayC2ERKNS1_14value_iteratorE:
   45|  6.23k|{
   46|  6.23k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5arrayEEC2EOS3_:
  175|  6.23k|{
  176|  6.23k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5arrayEE5beginEv:
  184|  7.08k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array>::begin() noexcept {
  185|  7.08k|  if (error()) { return error(); }
  ------------------
  |  Branch (185:7): [True: 2.05k, False: 5.03k]
  ------------------
  186|  5.03k|  return first.begin();
  187|  7.08k|}
_ZN8simdjson8fallback8ondemand5array5beginEv:
   66|  5.03k|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.03k|  return array_iterator(iter);
   71|  5.03k|}
_ZN8simdjson8fallback8ondemand5array5startERNS1_14value_iteratorE:
   48|  4.89k|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.89k|  simdjson_unused bool has_value;
  ------------------
  |  |  113|  4.89k|  #define simdjson_unused __attribute__((unused))
  ------------------
   52|  4.89k|  SIMDJSON_TRY( iter.start_array().get(has_value) );
  ------------------
  |  |  279|  4.89k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 2.28k, False: 2.60k]
  |  |  ------------------
  ------------------
   53|  2.60k|  return array(iter);
   54|  4.89k|}

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

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEC2ENS_10error_codeE:
   44|  2.42k|{
   45|  2.42k|}
_ZN8simdjson8fallback8ondemand14array_iteratorC2ERKNS1_14value_iteratorE:
    7|  5.03k|{}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEC2EOS3_:
   39|  5.03k|{
   40|  5.03k|  first.iter.assert_is_valid();
   41|  5.03k|}
_ZNK8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEneERKS4_:
   55|  50.0k|simdjson_inline bool simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator!=(const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &other) const noexcept {
   56|  50.0k|  if (!first.iter.is_valid()) { return error(); }
  ------------------
  |  Branch (56:7): [True: 3.46k, False: 46.5k]
  ------------------
   57|  46.5k|  return first != other.first;
   58|  50.0k|}
_ZNK8simdjson8fallback8ondemand14array_iteratorneERKS2_:
   16|  46.5k|simdjson_inline bool array_iterator::operator!=(const array_iterator &) const noexcept {
   17|  46.5k|  return iter.is_open();
   18|  46.5k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEdeEv:
   47|  44.0k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator*() noexcept {
   48|  44.0k|  if (error()) { return error(); }
  ------------------
  |  Branch (48:7): [True: 1.73k, False: 42.2k]
  ------------------
   49|  42.2k|  return *first;
   50|  44.0k|}
_ZN8simdjson8fallback8ondemand14array_iteratordeEv:
    9|  42.2k|simdjson_inline simdjson_result<value> array_iterator::operator*() noexcept {
   10|  42.2k|  if (iter.error()) { iter.abandon(); return iter.error(); }
  ------------------
  |  Branch (10:7): [True: 823, False: 41.4k]
  ------------------
   11|  41.4k|  return value(iter.child());
   12|  42.2k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand14array_iteratorEEppEv:
   59|  44.0k|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.0k|  if (error()) { second = SUCCESS; return *this; }
  ------------------
  |  Branch (61:7): [True: 1.73k, False: 42.2k]
  ------------------
   62|  42.2k|  ++(first);
   63|  42.2k|  return *this;
   64|  44.0k|}
_ZN8simdjson8fallback8ondemand14array_iteratorppEv:
   19|  42.2k|simdjson_inline array_iterator &array_iterator::operator++() noexcept {
   20|  42.2k|  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.2k|  if (( error = iter.error() )) { return *this; }
  ------------------
  |  Branch (23:7): [True: 1.00k, False: 41.2k]
  ------------------
   24|  41.2k|  if (( error = iter.skip_child() )) { return *this; }
  ------------------
  |  Branch (24:7): [True: 139, False: 41.1k]
  ------------------
   25|  41.1k|  if (( error = iter.has_next_element().error() )) { return *this; }
  ------------------
  |  Branch (25:7): [True: 684, False: 40.4k]
  ------------------
   26|  40.4k|  return *this;
   27|  41.1k|}

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

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand8documentEEC2ENS_10error_codeE:
  291|  1.18k|{
  292|  1.18k|}
_ZN8simdjson8fallback8ondemand8document5startEONS1_13json_iteratorE:
   11|  3.82k|simdjson_inline document document::start(json_iterator &&iter) noexcept {
   12|  3.82k|  return document(std::forward<json_iterator>(iter));
   13|  3.82k|}
_ZN8simdjson8fallback8ondemand8documentC2EONS1_13json_iteratorE:
    7|  3.82k|{
    8|  3.82k|  logger::log_start_value(iter, "document");
    9|  3.82k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand8documentEEC2EOS3_:
  283|  3.82k|{
  284|  3.82k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand8documentEE5beginEv:
  310|  3.82k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::document>::begin() & noexcept {
  311|  3.82k|  if (error()) { return error(); }
  ------------------
  |  Branch (311:7): [True: 0, False: 3.82k]
  ------------------
  312|  3.82k|  return first.begin();
  313|  3.82k|}
_ZNR8simdjson8fallback8ondemand8document5beginEv:
  176|  3.82k|simdjson_inline simdjson_result<array_iterator> document::begin() & noexcept {
  177|  3.82k|  return get_array().begin();
  178|  3.82k|}
_ZNR8simdjson8fallback8ondemand8document9get_arrayEv:
   70|  3.82k|simdjson_inline simdjson_result<array> document::get_array() & noexcept {
   71|  3.82k|  auto value = get_root_value_iterator();
   72|  3.82k|  return array::start_root(value);
   73|  3.82k|}
_ZN8simdjson8fallback8ondemand8document23get_root_value_iteratorEv:
   37|  3.82k|simdjson_inline value_iterator document::get_root_value_iterator() noexcept {
   38|  3.82k|  return resume_value_iterator();
   39|  3.82k|}
_ZN8simdjson8fallback8ondemand8document21resume_value_iteratorEv:
   34|  3.82k|simdjson_inline value_iterator document::resume_value_iterator() noexcept {
   35|  3.82k|  return value_iterator(&iter, 1, iter.root_position());
   36|  3.82k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand8documentEE3endEv:
  314|  3.82k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::document>::end() & noexcept {
  315|  3.82k|  return {};
  316|  3.82k|}

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

_ZN8simdjson8fallback8ondemand13json_iteratorC2EOS2_:
   13|  8.82k|{
   14|  8.82k|  other.parser = nullptr;
   15|  8.82k|}
_ZNK8simdjson8fallback8ondemand13json_iterator8positionEv:
  315|  12.7M|simdjson_inline token_position json_iterator::position() const noexcept {
  316|  12.7M|  return token.position();
  317|  12.7M|}
_ZNK8simdjson8fallback8ondemand13json_iterator5depthEv:
  300|  6.50M|simdjson_inline depth_t json_iterator::depth() const noexcept {
  301|  6.50M|  return _depth;
  302|  6.50M|}
_ZN8simdjson8fallback8ondemand13json_iteratorC2EPKhPNS1_6parserE:
   36|  3.82k|{
   37|  3.82k|  logger::log_headers();
   38|       |#if SIMDJSON_CHECK_EOF
   39|       |  assert_more_tokens();
   40|       |#endif
   41|  3.82k|}
_ZNK8simdjson8fallback8ondemand13json_iterator13root_positionEv:
  165|  3.82k|simdjson_inline token_position json_iterator::root_position() const noexcept {
  166|  3.82k|  return _root;
  167|  3.82k|}
_ZNK8simdjson8fallback8ondemand13json_iterator4peekEPKj:
  260|  3.62k|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.62k|  return token.peek(position);
  267|  3.62k|}
_ZNK8simdjson8fallback8ondemand13json_iterator4peekEi:
  246|  52.3k|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.3k|  return token.peek(delta);
  251|  52.3k|}
_ZN8simdjson8fallback8ondemand13json_iterator26return_current_and_advanceEv:
  234|  6.41M|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|  6.41M|  return token.return_current_and_advance();
  239|  6.41M|}
_ZNK8simdjson8fallback8ondemand13json_iterator9streamingEv:
  161|  3.67k|simdjson_inline bool json_iterator::streaming() const noexcept {
  162|  3.67k|  return _streaming;
  163|  3.67k|}
_ZNK8simdjson8fallback8ondemand13json_iterator9peek_lastEv:
  284|  3.67k|simdjson_inline const uint8_t *json_iterator::peek_last() const noexcept {
  285|  3.67k|  return token.peek(last_position());
  286|  3.67k|}
_ZNK8simdjson8fallback8ondemand13json_iterator13last_positionEv:
  276|  3.67k|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.67k|  uint32_t n_structural_indexes{parser->implementation->n_structural_indexes};
  281|  3.67k|  SIMDJSON_ASSUME(n_structural_indexes > 0);
  ------------------
  |  |  191|  3.67k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  282|      0|  return &parser->implementation->structural_indexes[n_structural_indexes - 1];
  283|  3.67k|}
_ZN8simdjson8fallback8ondemand13json_iterator7abandonEv:
  229|    873|simdjson_inline void json_iterator::abandon() noexcept {
  230|    873|  parser = nullptr;
  231|    873|  _depth = 0;
  232|    873|}
_ZN8simdjson8fallback8ondemand13json_iterator12report_errorENS_10error_codeEPKc:
  308|    873|simdjson_inline error_code json_iterator::report_error(error_code _error, const char *message) noexcept {
  309|    873|  SIMDJSON_ASSUME(_error != SUCCESS && _error != UNINITIALIZED && _error != INCORRECT_TYPE && _error != NO_SUCH_FIELD);
  ------------------
  |  |  191|    873|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  310|      0|  logger::log_error(*this, message);
  311|    873|  error = _error;
  312|    873|  return error;
  313|    873|}
_ZNK8simdjson8fallback8ondemand13json_iterator12end_positionEv:
  196|  6.33M|simdjson_inline token_position json_iterator::end_position() const noexcept {
  197|  6.33M|  uint32_t n_structural_indexes{parser->implementation->n_structural_indexes};
  198|  6.33M|  return &parser->implementation->structural_indexes[n_structural_indexes];
  199|  6.33M|}
_ZN8simdjson8fallback8ondemand13json_iterator9ascend_toEi:
  288|  24.2k|simdjson_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept {
  289|  24.2k|  SIMDJSON_ASSUME(parent_depth >= 0 && parent_depth < INT32_MAX - 1);
  ------------------
  |  |  191|  24.2k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  290|  24.2k|  SIMDJSON_ASSUME(_depth == parent_depth + 1);
  ------------------
  |  |  191|  24.2k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  291|      0|  _depth = parent_depth;
  292|  24.2k|}
_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);
  ------------------
  |  |  191|  42.8k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  296|  42.8k|  SIMDJSON_ASSUME(_depth == child_depth - 1);
  ------------------
  |  |  191|  42.8k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  297|      0|  _depth = child_depth;
  298|  42.8k|}
_ZN8simdjson8fallback8ondemand13json_iterator8unescapeENS1_15raw_json_stringEb:
  319|  3.60k|simdjson_inline simdjson_result<std::string_view> json_iterator::unescape(raw_json_string in, bool allow_replacement) noexcept {
  320|  3.60k|  return parser->unescape(in, _string_buf_loc, allow_replacement);
  321|  3.60k|}
_ZN8simdjson8fallback8ondemand13json_iterator10skip_childEi:
   76|  41.2k|simdjson_warn_unused simdjson_inline error_code json_iterator::skip_child(depth_t parent_depth) noexcept {
   77|  41.2k|  if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (77:7): [True: 21.4k, False: 19.8k]
  ------------------
   78|  19.8k|  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.86k|    case '[': case '{': case ':':
  ------------------
  |  Branch (87:5): [True: 627, False: 19.1k]
  |  Branch (87:15): [True: 663, False: 19.1k]
  |  Branch (87:25): [True: 576, False: 19.2k]
  ------------------
   88|  1.86k|      logger::log_start_value(*this, "skip");
   89|  1.86k|      break;
   90|       |    // If there is a comma, we have just finished a value in an array/object, and need to get back in
   91|    631|    case ',':
  ------------------
  |  Branch (91:5): [True: 631, False: 19.1k]
  ------------------
   92|    631|      logger::log_value(*this, "skip");
   93|    631|      break;
   94|       |    // ] or } means we just finished a value and need to jump out of the array/object
   95|  4.82k|    case ']': case '}':
  ------------------
  |  Branch (95:5): [True: 2.08k, False: 17.7k]
  |  Branch (95:15): [True: 2.73k, False: 17.0k]
  ------------------
   96|  4.82k|      logger::log_end_value(*this, "skip");
   97|  4.82k|      _depth--;
   98|  4.82k|      if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (98:11): [True: 3.94k, False: 882]
  ------------------
   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|    882|      break;
  104|    882|    case '"':
  ------------------
  |  Branch (104:5): [True: 834, False: 18.9k]
  ------------------
  105|    834|      if(*peek() == ':') {
  ------------------
  |  Branch (105:10): [True: 388, False: 446]
  ------------------
  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|    388|        logger::log_value(*this, "key");
  112|    388|        return_current_and_advance(); // eat up the ':'
  113|    388|        break; // important!!!
  114|    388|      }
  115|    834|      simdjson_fallthrough;
  ------------------
  |  |  311|    446|# define simdjson_fallthrough [[fallthrough]]
  ------------------
  116|       |    // Anything else must be a scalar value
  117|  12.1k|    default:
  ------------------
  |  Branch (117:5): [True: 11.6k, False: 8.15k]
  ------------------
  118|       |      // For the first scalar, we will have incremented depth already, so we decrement it here.
  119|  12.1k|      logger::log_value(*this, "skip");
  120|  12.1k|      _depth--;
  121|  12.1k|      if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (121:11): [True: 11.7k, False: 374]
  ------------------
  122|    374|      break;
  123|  19.8k|  }
  124|       |
  125|       |  // Now that we've considered the first value, we only increment/decrement for arrays/objects
  126|  6.32M|  while (position() < end_position()) {
  ------------------
  |  Branch (126:10): [True: 6.32M, False: 139]
  ------------------
  127|  6.32M|    switch (*return_current_and_advance()) {
  128|  6.31M|      case '[': case '{':
  ------------------
  |  Branch (128:7): [True: 153k, False: 6.17M]
  |  Branch (128:17): [True: 6.15M, False: 168k]
  ------------------
  129|  6.31M|        logger::log_start_value(*this, "skip");
  130|  6.31M|        _depth++;
  131|  6.31M|        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|  8.37k|      case ']': case '}':
  ------------------
  |  Branch (137:7): [True: 5.35k, False: 6.32M]
  |  Branch (137:17): [True: 3.01k, False: 6.32M]
  ------------------
  138|  8.37k|        logger::log_end_value(*this, "skip");
  139|  8.37k|        _depth--;
  140|  8.37k|        if (depth() <= parent_depth) { return SUCCESS; }
  ------------------
  |  Branch (140:13): [True: 4.00k, False: 4.37k]
  ------------------
  141|  4.37k|        break;
  142|  7.33k|      default:
  ------------------
  |  Branch (142:7): [True: 7.33k, False: 6.31M]
  ------------------
  143|  7.33k|        logger::log_value(*this, "skip", "");
  144|  7.33k|        break;
  145|  6.32M|    }
  146|  6.32M|  }
  147|       |
  148|    139|  return report_error(TAPE_ERROR, "not enough close braces");
  149|  4.14k|}

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

fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL15log_start_valueERKNS1_13json_iteratorEPKcii:
   36|  6.31M|inline void log_start_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept {
   37|  6.31M|  log_line(iter, "+", type, "", delta, depth_delta);
   38|  6.31M|  if (LOG_ENABLED) { log_depth++; }
  ------------------
  |  Branch (38:7): [Folded - Ignored]
  ------------------
   39|  6.31M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL8log_lineERKNS1_13json_iteratorEPKcS7_NSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
  124|  6.39M|inline void log_line(const json_iterator &iter, const char *title_prefix, const char *title, std::string_view detail, int delta, int depth_delta) noexcept {
  125|  6.39M|  log_line(iter, iter.position()+delta, depth_t(iter.depth()+depth_delta), title_prefix, title, detail);
  126|  6.39M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL8log_lineERKNS1_13json_iteratorEPKjiPKcS9_NSt3__117basic_string_viewIcNSA_11char_traitsIcEEEE:
  127|  6.46M|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) noexcept {
  128|  6.46M|  if (LOG_ENABLED) {
  ------------------
  |  Branch (128:7): [Folded - Ignored]
  ------------------
  129|      0|    const int indent = depth*2;
  130|      0|    const auto buf = iter.token.buf;
  131|      0|    printf("| %*s%s%-*s ",
  132|      0|      indent, "",
  133|      0|      title_prefix,
  134|      0|      LOG_EVENT_LEN - indent - int(strlen(title_prefix)), title
  135|      0|      );
  136|      0|    {
  137|       |      // Print the current structural.
  138|      0|      printf("| ");
  139|       |      // Before we begin, the index might point right before the document.
  140|       |      // This could be unsafe, see https://github.com/simdjson/simdjson/discussions/1938
  141|      0|      if(index < iter._root) {
  ------------------
  |  Branch (141:10): [True: 0, False: 0]
  ------------------
  142|      0|        printf("%*s", LOG_BUFFER_LEN, "");
  143|      0|      } else {
  144|      0|        auto current_structural = &buf[*index];
  145|      0|        for (int i=0;i<LOG_BUFFER_LEN;i++) {
  ------------------
  |  Branch (145:22): [True: 0, False: 0]
  ------------------
  146|      0|            printf("%c", printable_char(current_structural[i]));
  147|      0|        }
  148|      0|      }
  149|      0|      printf(" ");
  150|      0|    }
  151|      0|    {
  152|       |      // Print the next structural.
  153|      0|      printf("| ");
  154|      0|      auto next_structural = &buf[*(index+1)];
  155|      0|      for (int i=0;i<LOG_SMALL_BUFFER_LEN;i++) {
  ------------------
  |  Branch (155:20): [True: 0, False: 0]
  ------------------
  156|      0|        printf("%c", printable_char(next_structural[i]));
  157|      0|      }
  158|      0|      printf(" ");
  159|      0|    }
  160|       |    // printf("| %5u ", *(index+1));
  161|      0|    printf("| %5i ", depth);
  162|      0|    printf("| %6.*s ", int(detail.size()) , detail.data());
  163|      0|    printf("|\n");
  164|      0|    fflush(stdout);
  165|      0|  }
  166|  6.46M|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL11log_headersEv:
   73|  3.82k|inline void log_headers() noexcept {
   74|  3.82k|  if (LOG_ENABLED) {
  ------------------
  |  Branch (74:7): [Folded - Ignored]
  ------------------
   75|       |    // Technically a static variable is not thread-safe, but if you are using threads
   76|       |    // and logging... well...
   77|      0|    static bool displayed_hint{false};
   78|      0|    log_depth = 0;
   79|      0|    printf("\n");
   80|      0|    if(!displayed_hint) {
  ------------------
  |  Branch (80:8): [True: 0, False: 0]
  ------------------
   81|       |      // We only print this helpful header once.
   82|      0|      printf("# Logging provides the depth and position of the iterator user-visible steps:\n");
   83|      0|      printf("# +array says 'this is where we were when we discovered the start array'\n");
   84|      0|      printf("# -array says 'this is where we were when we ended the array'\n");
   85|      0|      printf("# skip says 'this is a structural or value I am skipping'\n");
   86|      0|      printf("# +/-skip says 'this is a start/end array or object I am skipping'\n");
   87|      0|      printf("#\n");
   88|      0|      printf("# The indentation of the terms (array, string,...) indicates the depth,\n");
   89|      0|      printf("# in addition to the depth being displayed.\n");
   90|      0|      printf("#\n");
   91|      0|      printf("# Every token in the document has a single depth determined by the tokens before it,\n");
   92|      0|      printf("# and is not affected by what the token actually is.\n");
   93|      0|      printf("#\n");
   94|      0|      printf("# Not all structural elements are presented as tokens in the logs.\n");
   95|      0|      printf("#\n");
   96|      0|      printf("# We never give control to the user within an empty array or an empty object.\n");
   97|      0|      printf("#\n");
   98|      0|      printf("# Inside an array, having a depth greater than the array's depth means that\n");
   99|      0|      printf("# we are pointing inside a value.\n");
  100|      0|      printf("# Having a depth equal to the array means that we are pointing right before a value.\n");
  101|      0|      printf("# Having a depth smaller than the array means that we have moved beyond the array.\n");
  102|      0|      displayed_hint = true;
  103|      0|    }
  104|      0|    printf("\n");
  105|      0|    printf("| %-*s ", LOG_EVENT_LEN,        "Event");
  106|      0|    printf("| %-*s ", LOG_BUFFER_LEN,       "Buffer");
  107|      0|    printf("| %-*s ", LOG_SMALL_BUFFER_LEN, "Next");
  108|       |    // printf("| %-*s ", 5,                    "Next#");
  109|      0|    printf("| %-*s ", 5,                    "Depth");
  110|      0|    printf("| Detail ");
  111|      0|    printf("|\n");
  112|       |
  113|      0|    printf("|%.*s", LOG_EVENT_LEN+2, DASHES);
  114|      0|    printf("|%.*s", LOG_BUFFER_LEN+2, DASHES);
  115|      0|    printf("|%.*s", LOG_SMALL_BUFFER_LEN+2, DASHES);
  116|       |    // printf("|%.*s", 5+2, DASHES);
  117|      0|    printf("|%.*s", 5+2, DASHES);
  118|      0|    printf("|--------");
  119|      0|    printf("|\n");
  120|      0|    fflush(stdout);
  121|      0|  }
  122|  3.82k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL15log_start_valueERKNS1_13json_iteratorEPKjiPKcNSt3__117basic_string_viewIcNSA_11char_traitsIcEEEE:
   32|  9.51k|inline void log_start_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept {
   33|  9.51k|  log_line(iter, index, depth, "+", type, detail);
   34|  9.51k|  if (LOG_ENABLED) { log_depth++; }
  ------------------
  |  Branch (34:7): [Folded - Ignored]
  ------------------
   35|  9.51k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_errorERKNS1_13json_iteratorEPKjiPKcS9_:
   49|  4.54k|inline void log_error(const json_iterator &iter, token_position index, depth_t depth, const char *error, const char *detail) noexcept {
   50|  4.54k|  log_line(iter, index, depth, "ERROR: ", error, detail);
   51|  4.54k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_errorERKNS1_13json_iteratorEPKcS7_ii:
   46|    873|inline void log_error(const json_iterator &iter, const char *error, const char *detail, int delta, int depth_delta) noexcept {
   47|    873|  log_line(iter, "ERROR: ", error, detail, delta, depth_delta);
   48|    873|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_valueERKNS1_13json_iteratorEPKcNSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
   28|  21.4k|inline void log_value(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept {
   29|  21.4k|  log_line(iter, "", type, detail, delta, depth_delta);
   30|  21.4k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_valueERKNS1_13json_iteratorEPKjiPKcNSt3__117basic_string_viewIcNSA_11char_traitsIcEEEE:
   25|  55.5k|inline void log_value(const json_iterator &iter, token_position index, depth_t depth, const char *type, std::string_view detail) noexcept {
   26|  55.5k|  log_line(iter, index, depth, "", type, detail);
   27|  55.5k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL13log_end_valueERKNS1_13json_iteratorEPKcii:
   41|  16.2k|inline void log_end_value(const json_iterator &iter, const char *type, int delta, int depth_delta) noexcept {
   42|  16.2k|  if (LOG_ENABLED) { log_depth--; }
  ------------------
  |  Branch (42:7): [Folded - Ignored]
  ------------------
   43|  16.2k|  log_line(iter, "-", type, "", delta, depth_delta);
   44|  16.2k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_eventERKNS1_14value_iteratorEPKcNSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
   53|  41.1k|inline void log_event(const value_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept {
   54|  41.1k|  log_event(iter.json_iter(), type, detail, delta, depth_delta);
   55|  41.1k|}
fuzz_ondemand.cpp:_ZN8simdjson8fallback8ondemand6loggerL9log_eventERKNS1_13json_iteratorEPKcNSt3__117basic_string_viewIcNS8_11char_traitsIcEEEEii:
   21|  41.1k|inline void log_event(const json_iterator &iter, const char *type, std::string_view detail, int delta, int depth_delta) noexcept {
   22|  41.1k|  log_line(iter, "", type, detail, delta, depth_delta);
   23|  41.1k|}

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand6objectEEC2ENS_10error_codeE:
  174|    413|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::object>(error) {}
_ZN8simdjson8fallback8ondemand6object5startERNS1_14value_iteratorE:
   36|    800|simdjson_inline simdjson_result<object> object::start(value_iterator &iter) noexcept {
   37|    800|  SIMDJSON_TRY( iter.start_object().error() );
  ------------------
  |  |  279|    800|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 366, False: 434]
  |  |  ------------------
  ------------------
   38|    434|  return object(iter);
   39|    800|}
_ZN8simdjson8fallback8ondemand6objectC2ERKNS1_14value_iteratorE:
   89|    434|{
   90|    434|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand6objectEEC2EOS3_:
  172|    434|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::object>(std::forward<SIMDJSON_IMPLEMENTATION::ondemand::object>(value)) {}

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

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

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

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand15raw_json_stringEEC2ENS_10error_codeE:
  177|    643|    : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string>(error) {}
_ZN8simdjson8fallback8ondemand15raw_json_stringC2EPKh:
    6|  3.79k|simdjson_inline raw_json_string::raw_json_string(const uint8_t * _buf) noexcept : buf{_buf} {}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand15raw_json_stringEEC2EOS3_:
  175|  3.79k|    : 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|  3.86k|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|  3.86k|  if (error()) { return error(); }
  ------------------
  |  Branch (184:7): [True: 262, False: 3.60k]
  ------------------
  185|  3.60k|  return first.unescape(iter, allow_replacement);
  186|  3.86k|}
_ZNK8simdjson8fallback8ondemand15raw_json_string8unescapeERNS1_13json_iteratorEb:
  146|  3.60k|simdjson_inline simdjson_warn_unused simdjson_result<std::string_view> raw_json_string::unescape(json_iterator &iter, bool allow_replacement) const noexcept {
  147|  3.60k|  return iter.unescape(*this, allow_replacement);
  148|  3.60k|}

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

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

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

_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEEC2ENS_10error_codeE:
  222|  2.55k|{
  223|  2.55k|}
_ZN8simdjson8fallback8ondemand5valueC2ERKNS1_14value_iteratorE:
    7|  41.4k|{
    8|  41.4k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEEC2EOS3_:
  216|  41.4k|{
  217|  41.4k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_stringEb:
  304|  3.99k|simdjson_inline simdjson_result<std::string_view> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_string(bool allow_replacement) noexcept {
  305|  3.99k|  if (error()) { return error(); }
  ------------------
  |  Branch (305:7): [True: 130, False: 3.86k]
  ------------------
  306|  3.86k|  return first.get_string(allow_replacement);
  307|  3.99k|}
_ZN8simdjson8fallback8ondemand5value10get_stringEb:
   33|  3.86k|simdjson_inline simdjson_result<std::string_view> value::get_string(bool allow_replacement) noexcept {
   34|  3.86k|  return iter.get_string(allow_replacement);
   35|  3.86k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE8get_boolEv:
  316|    991|simdjson_inline simdjson_result<bool> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_bool() noexcept {
  317|    991|  if (error()) { return error(); }
  ------------------
  |  Branch (317:7): [True: 63, False: 928]
  ------------------
  318|    928|  return first.get_bool();
  319|    991|}
_ZN8simdjson8fallback8ondemand5value8get_boolEv:
   57|    928|simdjson_inline simdjson_result<bool> value::get_bool() noexcept {
   58|    928|  return iter.get_bool();
   59|    928|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE9get_arrayEv:
  272|  1.70k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_array() noexcept {
  273|  1.70k|  if (error()) { return error(); }
  ------------------
  |  Branch (273:7): [True: 80, False: 1.62k]
  ------------------
  274|  1.62k|  return first.get_array();
  275|  1.70k|}
_ZN8simdjson8fallback8ondemand5value9get_arrayEv:
   16|  4.89k|simdjson_inline simdjson_result<array> value::get_array() noexcept {
   17|  4.89k|  return array::start(iter);
   18|  4.89k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE9get_int64Ev:
  288|  2.19k|simdjson_inline simdjson_result<int64_t> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_int64() noexcept {
  289|  2.19k|  if (error()) { return error(); }
  ------------------
  |  Branch (289:7): [True: 32, False: 2.16k]
  ------------------
  290|  2.16k|  return first.get_int64();
  291|  2.19k|}
_ZN8simdjson8fallback8ondemand5value9get_int64Ev:
   51|  2.16k|simdjson_inline simdjson_result<int64_t> value::get_int64() noexcept {
   52|  2.16k|  return iter.get_int64();
   53|  2.16k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_doubleEv:
  296|  21.0k|simdjson_inline simdjson_result<double> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_double() noexcept {
  297|  21.0k|  if (error()) { return error(); }
  ------------------
  |  Branch (297:7): [True: 134, False: 20.9k]
  ------------------
  298|  20.9k|  return first.get_double();
  299|  21.0k|}
_ZN8simdjson8fallback8ondemand5value10get_doubleEv:
   39|  20.9k|simdjson_inline simdjson_result<double> value::get_double() noexcept {
   40|  20.9k|  return iter.get_double();
   41|  20.9k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_objectEv:
  276|    847|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_object() noexcept {
  277|    847|  if (error()) { return error(); }
  ------------------
  |  Branch (277:7): [True: 47, False: 800]
  ------------------
  278|    800|  return first.get_object();
  279|    847|}
_ZN8simdjson8fallback8ondemand5value10get_objectEv:
   19|    800|simdjson_inline simdjson_result<object> value::get_object() noexcept {
   20|    800|  return object::start(iter);
   21|    800|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE10get_uint64Ev:
  280|  2.26k|simdjson_inline simdjson_result<uint64_t> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_uint64() noexcept {
  281|  2.26k|  if (error()) { return error(); }
  ------------------
  |  Branch (281:7): [True: 28, False: 2.23k]
  ------------------
  282|  2.23k|  return first.get_uint64();
  283|  2.26k|}
_ZN8simdjson8fallback8ondemand5value10get_uint64Ev:
   45|  2.23k|simdjson_inline simdjson_result<uint64_t> value::get_uint64() noexcept {
   46|  2.23k|  return iter.get_uint64();
   47|  2.23k|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE19get_raw_json_stringEv:
  312|    575|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::get_raw_json_string() noexcept {
  313|    575|  if (error()) { return error(); }
  ------------------
  |  Branch (313:7): [True: 18, False: 557]
  ------------------
  314|    557|  return first.get_raw_json_string();
  315|    575|}
_ZN8simdjson8fallback8ondemand5value19get_raw_json_stringEv:
   30|    557|simdjson_inline simdjson_result<raw_json_string> value::get_raw_json_string() noexcept {
   31|    557|  return iter.get_raw_json_string();
   32|    557|}
_ZN8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE7is_nullEv:
  320|  6.38k|simdjson_inline simdjson_result<bool> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::is_null() noexcept {
  321|  6.38k|  if (error()) { return error(); }
  ------------------
  |  Branch (321:7): [True: 1.77k, False: 4.60k]
  ------------------
  322|  4.60k|  return first.is_null();
  323|  6.38k|}
_ZN8simdjson8fallback8ondemand5value7is_nullEv:
   60|  4.60k|simdjson_inline simdjson_result<bool> value::is_null() noexcept {
   61|  4.60k|  return iter.is_null();
   62|  4.60k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE5beginEv:
  236|  3.46k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::begin() & noexcept {
  237|  3.46k|  if (error()) { return error(); }
  ------------------
  |  Branch (237:7): [True: 203, False: 3.26k]
  ------------------
  238|  3.26k|  return first.begin();
  239|  3.46k|}
_ZNR8simdjson8fallback8ondemand5value5beginEv:
  104|  3.26k|simdjson_inline simdjson_result<array_iterator> value::begin() & noexcept {
  105|  3.26k|  return get_array().begin();
  106|  3.26k|}
_ZNR8simdjson15simdjson_resultINS_8fallback8ondemand5valueEE3endEv:
  240|  2.48k|simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>::end() & noexcept {
  241|  2.48k|  if (error()) { return error(); }
  ------------------
  |  Branch (241:7): [True: 170, False: 2.31k]
  ------------------
  242|  2.31k|  return {};
  243|  2.48k|}

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

_ZN8simdjson8fallback8ondemand14value_iteratorC2EPNS1_13json_iteratorEiPKj:
   10|  45.2k|{
   11|  45.2k|}
_ZN8simdjson8fallback8ondemand14value_iterator16start_root_arrayEv:
  401|  3.82k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::start_root_array() noexcept {
  402|  3.82k|  SIMDJSON_TRY( start_container('[', "Not an array", "array") );
  ------------------
  |  |  279|  3.82k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 147, False: 3.67k]
  |  |  ------------------
  ------------------
  403|  3.67k|  return started_root_array();
  404|  3.82k|}
_ZN8simdjson8fallback8ondemand14value_iterator15start_containerEhPKcS4_:
  829|  9.51k|simdjson_inline error_code value_iterator::start_container(uint8_t start_char, const char *incorrect_type_message, const char *type) noexcept {
  830|  9.51k|  logger::log_start_value(*_json_iter, start_position(), depth(), type);
  831|       |  // If we're not at the position anymore, we don't want to advance the cursor.
  832|  9.51k|  const uint8_t *json;
  833|  9.51k|  if (!is_at_start()) {
  ------------------
  |  Branch (833:7): [True: 0, False: 9.51k]
  ------------------
  834|       |#if SIMDJSON_DEVELOPMENT_CHECKS
  835|       |    if (!is_at_iterator_start()) { return OUT_OF_ORDER_ITERATION; }
  836|       |#endif
  837|      0|    json = peek_start();
  838|      0|    if (*json != start_char) { return incorrect_type_error(incorrect_type_message); }
  ------------------
  |  Branch (838:9): [True: 0, False: 0]
  ------------------
  839|  9.51k|  } else {
  840|  9.51k|    assert_at_start();
  841|       |    /**
  842|       |     * We should be prudent. Let us peek. If it is not the right type, we
  843|       |     * return an error. Only once we have determined that we have the right
  844|       |     * type are we allowed to advance!
  845|       |     */
  846|  9.51k|    json = _json_iter->peek();
  847|  9.51k|    if (*json != start_char) { return incorrect_type_error(incorrect_type_message); }
  ------------------
  |  Branch (847:9): [True: 2.79k, False: 6.71k]
  ------------------
  848|  6.71k|    _json_iter->return_current_and_advance();
  849|  6.71k|  }
  850|       |
  851|       |
  852|  6.71k|  return SUCCESS;
  853|  9.51k|}
_ZNK8simdjson8fallback8ondemand14value_iterator14start_positionEv:
  993|   134k|simdjson_inline token_position value_iterator::start_position() const noexcept {
  994|   134k|  return _start_position;
  995|   134k|}
_ZNK8simdjson8fallback8ondemand14value_iterator5depthEv:
  785|   265k|simdjson_warn_unused simdjson_inline depth_t value_iterator::depth() const noexcept {
  786|   265k|  return _depth;
  787|   265k|}
_ZNK8simdjson8fallback8ondemand14value_iterator11is_at_startEv:
  893|  65.0k|simdjson_inline bool value_iterator::is_at_start() const noexcept {
  894|  65.0k|  return position() == start_position();
  895|  65.0k|}
_ZNK8simdjson8fallback8ondemand14value_iterator8positionEv:
  997|  65.0k|simdjson_inline token_position value_iterator::position() const noexcept {
  998|  65.0k|  return _json_iter->position();
  999|  65.0k|}
_ZNK8simdjson8fallback8ondemand14value_iterator20incorrect_type_errorEPKc:
  888|  4.54k|simdjson_inline error_code value_iterator::incorrect_type_error(const char *message) const noexcept {
  889|  4.54k|  logger::log_error(*_json_iter, start_position(), depth(), message);
  890|  4.54k|  return INCORRECT_TYPE;
  891|  4.54k|}
_ZNK8simdjson8fallback8ondemand14value_iterator15assert_at_startEv:
  910|  65.0k|inline void value_iterator::assert_at_start() const noexcept {
  911|  65.0k|  SIMDJSON_ASSUME( _json_iter->token._position == _start_position );
  ------------------
  |  |  191|  65.0k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  912|  65.0k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth );
  ------------------
  |  |  191|  65.0k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  913|  65.0k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  191|  65.0k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  914|  65.0k|}
_ZN8simdjson8fallback8ondemand14value_iterator18started_root_arrayEv:
  453|  3.67k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::started_root_array() noexcept {
  454|  3.67k|  auto error = check_root_array();
  455|  3.67k|  if (error) { return error; }
  ------------------
  |  Branch (455:7): [True: 50, False: 3.62k]
  ------------------
  456|  3.62k|  return started_array();
  457|  3.67k|}
_ZN8simdjson8fallback8ondemand14value_iterator16check_root_arrayEv:
  428|  3.67k|simdjson_warn_unused simdjson_inline error_code value_iterator::check_root_array() noexcept {
  429|       |  // When in streaming mode, we cannot expect peek_last() to be the last structural element of the
  430|       |  // current document. It only works in the normal mode where we have indexed a single document.
  431|       |  // Note that adding a check for 'streaming' is not expensive since we only have at most
  432|       |  // one root element.
  433|  3.67k|  if ( ! _json_iter->streaming() ) {
  ------------------
  |  Branch (433:8): [True: 3.67k, False: 0]
  ------------------
  434|  3.67k|    if (*_json_iter->peek_last() != ']') {
  ------------------
  |  Branch (434:9): [True: 50, False: 3.62k]
  ------------------
  435|     50|      _json_iter->abandon();
  436|     50|      return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing ] at end");
  437|     50|    }
  438|       |    // If the last character is ] *and* the first gibberish character is also ']'
  439|       |    // then on-demand could accidentally go over. So we need additional checks.
  440|       |    // https://github.com/simdjson/simdjson/issues/1834
  441|       |    // Checking that the document is balanced requires a full scan which is potentially
  442|       |    // expensive, but it only happens in edge cases where the first padding character is
  443|       |    // a closing bracket.
  444|  3.62k|    if ((*_json_iter->peek(_json_iter->end_position()) == ']') && (!_json_iter->balanced())) {
  ------------------
  |  Branch (444:9): [True: 0, False: 3.62k]
  |  Branch (444:67): [True: 0, False: 0]
  ------------------
  445|      0|      _json_iter->abandon();
  446|       |      // The exact error would require more work. It will typically be an unclosed array.
  447|      0|      return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "the document is unbalanced");
  448|      0|    }
  449|  3.62k|  }
  450|  3.62k|  return SUCCESS;
  451|  3.67k|}
_ZN8simdjson8fallback8ondemand14value_iterator12report_errorENS_10error_codeEPKc:
 1009|    734|simdjson_inline error_code value_iterator::report_error(error_code error, const char *message) noexcept {
 1010|    734|  return _json_iter->report_error(error, message);
 1011|    734|}
_ZN8simdjson8fallback8ondemand14value_iterator13started_arrayEv:
  413|  6.23k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::started_array() noexcept {
  414|  6.23k|  assert_at_container_start();
  415|  6.23k|  if (*_json_iter->peek() == ']') {
  ------------------
  |  Branch (415:7): [True: 779, False: 5.45k]
  ------------------
  416|    779|    logger::log_value(*_json_iter, "empty array");
  417|    779|    _json_iter->return_current_and_advance();
  418|    779|    SIMDJSON_TRY( end_container() );
  ------------------
  |  |  279|    779|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 779]
  |  |  ------------------
  ------------------
  419|    779|    return false;
  420|    779|  }
  421|  5.45k|  _json_iter->descend_to(depth()+1);
  422|       |#if SIMDJSON_DEVELOPMENT_CHECKS
  423|       |  _json_iter->set_start_position(_depth, start_position());
  424|       |#endif
  425|  5.45k|  return true;
  426|  6.23k|}
_ZNK8simdjson8fallback8ondemand14value_iterator25assert_at_container_startEv:
  916|  6.66k|inline void value_iterator::assert_at_container_start() const noexcept {
  917|  6.66k|  SIMDJSON_ASSUME( _json_iter->token._position == _start_position + 1 );
  ------------------
  |  |  191|  6.66k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  918|  6.66k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth );
  ------------------
  |  |  191|  6.66k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  919|  6.66k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  191|  6.66k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  920|  6.66k|}
_ZN8simdjson8fallback8ondemand14value_iterator13end_containerEv:
   68|  4.07k|simdjson_warn_unused simdjson_inline error_code value_iterator::end_container() noexcept {
   69|       |#if SIMDJSON_CHECK_EOF
   70|       |    if (depth() > 1 && at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing parent ] or }"); }
   71|       |    // if (depth() <= 1 && !at_end()) { return report_error(INCOMPLETE_ARRAY_OR_OBJECT, "missing [ or { at start"); }
   72|       |#endif // SIMDJSON_CHECK_EOF
   73|  4.07k|    _json_iter->ascend_to(depth()-1);
   74|  4.07k|    return SUCCESS;
   75|  4.07k|}
_ZNK8simdjson8fallback8ondemand14value_iterator15assert_is_validEv:
  964|  5.03k|inline void value_iterator::assert_is_valid() const noexcept {
  965|  5.03k|  SIMDJSON_ASSUME( _json_iter != nullptr );
  ------------------
  |  |  191|  5.03k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  966|  5.03k|}
_ZNK8simdjson8fallback8ondemand14value_iterator8is_validEv:
  968|  50.0k|simdjson_inline bool value_iterator::is_valid() const noexcept {
  969|  50.0k|  return _json_iter != nullptr;
  970|  50.0k|}
_ZNK8simdjson8fallback8ondemand14value_iterator7is_openEv:
  763|  46.5k|simdjson_inline bool value_iterator::is_open() const noexcept {
  764|  46.5k|  return _json_iter->depth() >= depth();
  765|  46.5k|}
_ZNK8simdjson8fallback8ondemand14value_iterator5errorEv:
  788|  85.3k|simdjson_warn_unused simdjson_inline error_code value_iterator::error() const noexcept {
  789|  85.3k|  return _json_iter->error;
  790|  85.3k|}
_ZN8simdjson8fallback8ondemand14value_iterator7abandonEv:
  781|    823|simdjson_inline void value_iterator::abandon() noexcept {
  782|    823|  _json_iter->abandon();
  783|    823|}
_ZNK8simdjson8fallback8ondemand14value_iterator5childEv:
  753|  41.4k|simdjson_inline value_iterator value_iterator::child() const noexcept {
  754|  41.4k|  assert_at_child();
  755|  41.4k|  return { _json_iter, depth()+1, _json_iter->token.position() };
  756|  41.4k|}
_ZNK8simdjson8fallback8ondemand14value_iterator15assert_at_childEv:
  948|  41.4k|inline void value_iterator::assert_at_child() const noexcept {
  949|  41.4k|  SIMDJSON_ASSUME( _json_iter->token._position > _start_position );
  ------------------
  |  |  191|  41.4k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  950|  41.4k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth + 1 );
  ------------------
  |  |  191|  41.4k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  951|  41.4k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  191|  41.4k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  952|  41.4k|}
_ZN8simdjson8fallback8ondemand14value_iterator10get_stringEb:
  490|  3.86k|simdjson_warn_unused simdjson_inline simdjson_result<std::string_view> value_iterator::get_string(bool allow_replacement) noexcept {
  491|  3.86k|  return get_raw_json_string().unescape(json_iter(), allow_replacement);
  492|  3.86k|}
_ZN8simdjson8fallback8ondemand14value_iterator19get_raw_json_stringEv:
  496|  4.42k|simdjson_warn_unused simdjson_inline simdjson_result<raw_json_string> value_iterator::get_raw_json_string() noexcept {
  497|  4.42k|  auto json = peek_scalar("string");
  498|  4.42k|  if (*json != '"') { return incorrect_type_error("Not a string"); }
  ------------------
  |  Branch (498:7): [True: 625, False: 3.79k]
  ------------------
  499|  3.79k|  advance_scalar("string");
  500|  3.79k|  return raw_json_string(json+1);
  501|  4.42k|}
_ZN8simdjson8fallback8ondemand14value_iterator11peek_scalarEPKc:
  808|  4.42k|simdjson_inline const uint8_t *value_iterator::peek_scalar(const char *type) noexcept {
  809|  4.42k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  810|       |  // If we're not at the position anymore, we don't want to advance the cursor.
  811|  4.42k|  if (!is_at_start()) { return peek_start(); }
  ------------------
  |  Branch (811:7): [True: 0, False: 4.42k]
  ------------------
  812|       |
  813|       |  // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value.
  814|  4.42k|  assert_at_start();
  815|  4.42k|  return _json_iter->peek();
  816|  4.42k|}
_ZN8simdjson8fallback8ondemand14value_iterator14advance_scalarEPKc:
  818|  3.79k|simdjson_inline void value_iterator::advance_scalar(const char *type) noexcept {
  819|  3.79k|  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|  3.79k|  if (!is_at_start()) { return; }
  ------------------
  |  Branch (821:7): [True: 0, False: 3.79k]
  ------------------
  822|       |
  823|       |  // Get the JSON and advance the cursor, decreasing depth to signify that we have retrieved the value.
  824|  3.79k|  assert_at_start();
  825|  3.79k|  _json_iter->return_current_and_advance();
  826|  3.79k|  _json_iter->ascend_to(depth()-1);
  827|  3.79k|}
_ZN8simdjson8fallback8ondemand14value_iterator9json_iterEv:
  797|  3.86k|simdjson_warn_unused simdjson_inline json_iterator &value_iterator::json_iter() noexcept {
  798|  3.86k|  return *_json_iter;
  799|  3.86k|}
_ZN8simdjson8fallback8ondemand14value_iterator8get_boolEv:
  532|    928|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::get_bool() noexcept {
  533|    928|  auto result = parse_bool(peek_non_root_scalar("bool"));
  534|    928|  if(result.error() == SUCCESS) { advance_non_root_scalar("bool"); }
  ------------------
  |  Branch (534:6): [True: 381, False: 547]
  ------------------
  535|    928|  return result;
  536|    928|}
_ZNK8simdjson8fallback8ondemand14value_iterator10parse_boolEPKh:
  476|    928|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::parse_bool(const uint8_t *json) const noexcept {
  477|    928|  auto not_true = atomparsing::str4ncmp(json, "true");
  478|    928|  auto not_false = atomparsing::str4ncmp(json, "fals") | (json[4] ^ 'e');
  479|    928|  bool error = (not_true && not_false) || jsoncharutils::is_not_structural_or_whitespace(json[not_true ? 5 : 4]);
  ------------------
  |  Branch (479:17): [True: 733, False: 195]
  |  Branch (479:29): [True: 539, False: 194]
  |  Branch (479:43): [True: 8, False: 381]
  |  Branch (479:95): [True: 194, False: 195]
  ------------------
  480|    928|  if (error) { return incorrect_type_error("Not a boolean"); }
  ------------------
  |  Branch (480:7): [True: 547, False: 381]
  ------------------
  481|    381|  return simdjson_result<bool>(!not_true);
  482|    928|}
_ZN8simdjson8fallback8ondemand14value_iterator20peek_non_root_scalarEPKc:
  863|  30.9k|simdjson_inline const uint8_t *value_iterator::peek_non_root_scalar(const char *type) noexcept {
  864|  30.9k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  865|  30.9k|  if (!is_at_start()) { return peek_start(); }
  ------------------
  |  Branch (865:7): [True: 0, False: 30.9k]
  ------------------
  866|       |
  867|  30.9k|  assert_at_non_root_start();
  868|  30.9k|  return _json_iter->peek();
  869|  30.9k|}
_ZNK8simdjson8fallback8ondemand14value_iterator24assert_at_non_root_startEv:
  959|  47.2k|inline void value_iterator::assert_at_non_root_start() const noexcept {
  960|  47.2k|  assert_at_start();
  961|  47.2k|  SIMDJSON_ASSUME( _depth > 1 );
  ------------------
  |  |  191|  47.2k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  962|  47.2k|}
_ZN8simdjson8fallback8ondemand14value_iterator23advance_non_root_scalarEPKc:
  879|  16.3k|simdjson_inline void value_iterator::advance_non_root_scalar(const char *type) noexcept {
  880|  16.3k|  logger::log_value(*_json_iter, start_position(), depth(), type);
  881|  16.3k|  if (!is_at_start()) { return; }
  ------------------
  |  Branch (881:7): [True: 0, False: 16.3k]
  ------------------
  882|       |
  883|  16.3k|  assert_at_non_root_start();
  884|  16.3k|  _json_iter->return_current_and_advance();
  885|  16.3k|  _json_iter->ascend_to(depth()-1);
  886|  16.3k|}
_ZN8simdjson8fallback8ondemand14value_iterator11start_arrayEv:
  396|  4.89k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::start_array() noexcept {
  397|  4.89k|  SIMDJSON_TRY( start_container('[', "Not an array", "array") );
  ------------------
  |  |  279|  4.89k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 2.28k, False: 2.60k]
  |  |  ------------------
  ------------------
  398|  2.60k|  return started_array();
  399|  4.89k|}
_ZN8simdjson8fallback8ondemand14value_iterator9get_int64Ev:
  512|  2.16k|simdjson_warn_unused simdjson_inline simdjson_result<int64_t> value_iterator::get_int64() noexcept {
  513|  2.16k|  auto result = numberparsing::parse_integer(peek_non_root_scalar("int64"));
  514|  2.16k|  if(result.error() == SUCCESS) { advance_non_root_scalar("int64"); }
  ------------------
  |  Branch (514:6): [True: 758, False: 1.40k]
  ------------------
  515|  2.16k|  return result;
  516|  2.16k|}
_ZN8simdjson8fallback8ondemand14value_iterator10get_doubleEv:
  522|  20.9k|simdjson_warn_unused simdjson_inline simdjson_result<double> value_iterator::get_double() noexcept {
  523|  20.9k|  auto result = numberparsing::parse_double(peek_non_root_scalar("double"));
  524|  20.9k|  if(result.error() == SUCCESS) { advance_non_root_scalar("double"); }
  ------------------
  |  Branch (524:6): [True: 14.0k, False: 6.91k]
  ------------------
  525|  20.9k|  return result;
  526|  20.9k|}
_ZN8simdjson8fallback8ondemand14value_iterator12start_objectEv:
   13|    800|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::start_object() noexcept {
   14|    800|  SIMDJSON_TRY( start_container('{', "Not an object", "object") );
  ------------------
  |  |  279|    800|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 366, False: 434]
  |  |  ------------------
  ------------------
   15|    434|  return started_object();
   16|    800|}
_ZN8simdjson8fallback8ondemand14value_iterator14started_objectEv:
   23|    434|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::started_object() noexcept {
   24|    434|  assert_at_container_start();
   25|       |#if SIMDJSON_DEVELOPMENT_CHECKS
   26|       |  _json_iter->set_start_position(_depth, start_position());
   27|       |#endif
   28|    434|  if (*_json_iter->peek() == '}') {
  ------------------
  |  Branch (28:7): [True: 212, False: 222]
  ------------------
   29|    212|    logger::log_value(*_json_iter, "empty object");
   30|    212|    _json_iter->return_current_and_advance();
   31|    212|    end_container();
   32|    212|    return false;
   33|    212|  }
   34|    222|  return true;
   35|    434|}
_ZN8simdjson8fallback8ondemand14value_iterator10get_uint64Ev:
  502|  2.23k|simdjson_warn_unused simdjson_inline simdjson_result<uint64_t> value_iterator::get_uint64() noexcept {
  503|  2.23k|  auto result = numberparsing::parse_unsigned(peek_non_root_scalar("uint64"));
  504|  2.23k|  if(result.error() == SUCCESS) { advance_non_root_scalar("uint64"); }
  ------------------
  |  Branch (504:6): [True: 754, False: 1.48k]
  ------------------
  505|  2.23k|  return result;
  506|  2.23k|}
_ZN8simdjson8fallback8ondemand14value_iterator7is_nullEv:
  537|  4.60k|simdjson_inline simdjson_result<bool> value_iterator::is_null() noexcept {
  538|  4.60k|  bool is_null_value;
  539|  4.60k|  SIMDJSON_TRY(parse_null(peek_non_root_scalar("null")).get(is_null_value));
  ------------------
  |  |  279|  4.60k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 580, False: 4.02k]
  |  |  ------------------
  ------------------
  540|  4.02k|  if(is_null_value) { advance_non_root_scalar("null"); }
  ------------------
  |  Branch (540:6): [True: 437, False: 3.58k]
  ------------------
  541|  4.02k|  return is_null_value;
  542|  4.60k|}
_ZNK8simdjson8fallback8ondemand14value_iterator10parse_nullEPKh:
  483|  4.60k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::parse_null(const uint8_t *json) const noexcept {
  484|  4.60k|  bool is_null_string = !atomparsing::str4ncmp(json, "null") && jsoncharutils::is_structural_or_whitespace(json[4]);
  ------------------
  |  Branch (484:25): [True: 512, False: 4.09k]
  |  Branch (484:65): [True: 437, False: 75]
  ------------------
  485|       |  // if we start with 'n', we must be a null
  486|  4.60k|  if(!is_null_string && json[0]=='n') { return incorrect_type_error("Not a null but starts with n"); }
  ------------------
  |  Branch (486:6): [True: 4.16k, False: 437]
  |  Branch (486:25): [True: 580, False: 3.58k]
  ------------------
  487|  4.02k|  return is_null_string;
  488|  4.60k|}
_ZN8simdjson8fallback8ondemand14value_iterator10skip_childEv:
  746|  41.2k|simdjson_warn_unused simdjson_inline error_code value_iterator::skip_child() noexcept {
  747|  41.2k|  SIMDJSON_ASSUME( _json_iter->token._position > _start_position );
  ------------------
  |  |  191|  41.2k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  748|  41.2k|  SIMDJSON_ASSUME( _json_iter->_depth >= _depth );
  ------------------
  |  |  191|  41.2k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  749|       |
  750|      0|  return _json_iter->skip_child(depth());
  751|  41.2k|}
_ZN8simdjson8fallback8ondemand14value_iterator16has_next_elementEv:
  459|  41.1k|simdjson_warn_unused simdjson_inline simdjson_result<bool> value_iterator::has_next_element() noexcept {
  460|  41.1k|  assert_at_next();
  461|       |
  462|  41.1k|  logger::log_event(*this, "has_next_element");
  463|  41.1k|  switch (*_json_iter->return_current_and_advance()) {
  464|  3.08k|    case ']':
  ------------------
  |  Branch (464:5): [True: 3.08k, False: 38.0k]
  ------------------
  465|  3.08k|      logger::log_end_value(*_json_iter, "array");
  466|  3.08k|      SIMDJSON_TRY( end_container() );
  ------------------
  |  |  279|  3.08k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 3.08k]
  |  |  ------------------
  ------------------
  467|  3.08k|      return false;
  468|  37.3k|    case ',':
  ------------------
  |  Branch (468:5): [True: 37.3k, False: 3.76k]
  ------------------
  469|  37.3k|      _json_iter->descend_to(depth()+1);
  470|  37.3k|      return true;
  471|    684|    default:
  ------------------
  |  Branch (471:5): [True: 684, False: 40.4k]
  ------------------
  472|    684|      return report_error(TAPE_ERROR, "Missing comma between array elements");
  473|  41.1k|  }
  474|  41.1k|}
_ZNK8simdjson8fallback8ondemand14value_iterator14assert_at_nextEv:
  922|  41.1k|inline void value_iterator::assert_at_next() const noexcept {
  923|  41.1k|  SIMDJSON_ASSUME( _json_iter->token._position > _start_position );
  ------------------
  |  |  191|  41.1k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  924|  41.1k|  SIMDJSON_ASSUME( _json_iter->_depth == _depth );
  ------------------
  |  |  191|  41.1k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  925|  41.1k|  SIMDJSON_ASSUME( _depth > 0 );
  ------------------
  |  |  191|  41.1k|#define SIMDJSON_ASSUME(COND) assert(COND)
  ------------------
  926|  41.1k|}
_ZNK8simdjson8fallback8ondemand14value_iterator9json_iterEv:
  794|  41.1k|simdjson_warn_unused simdjson_inline const json_iterator &value_iterator::json_iter() const noexcept {
  795|  41.1k|  return *_json_iter;
  796|  41.1k|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115trailing_zeroesEm:
   16|  10.6M|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|  10.6M|  return __builtin_ctzll(input_num);
   26|  10.6M|#endif // SIMDJSON_REGULAR_VISUAL_STUDIO
   27|  10.6M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_112add_overflowEmmPm:
   51|  6.16k|                                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|  6.16k|  return __builtin_uaddll_overflow(value1, value2,
   57|  6.16k|                                   reinterpret_cast<unsigned long long *>(result));
   58|  6.16k|#endif
   59|  6.16k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_110count_onesEm:
   45|   230k|simdjson_inline long long int count_ones(uint64_t input_num) {
   46|   230k|  return _popcnt64(input_num);
   47|   230k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116clear_lowest_bitEm:
   30|  10.6M|simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) {
   31|  10.6M|  return _blsr_u64(input_num);
   32|  10.6M|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_110prefix_xorEm:
   13|   694k|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|   694k|  __m128i all_ones = _mm_set1_epi8('\xFF');
   17|   694k|  __m128i result = _mm_clmulepi64_si128(_mm_set_epi64x(0ULL, bitmask), all_ones, 0);
   18|   694k|  return _mm_cvtsi128_si64(result);
   19|   694k|}

_ZN8simdjson7haswell14implementationC2Ev:
   21|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ev:
  226|  14.6k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   93|  14.6k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   45|  14.6k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   17|  14.6k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  304|   694k|    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.46M|    static simdjson_inline simd8<T> load(const T values[32]) {
   78|  1.46M|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   79|  1.46M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  227|  17.4M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   94|  17.4M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   46|  17.4M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   20|  17.4M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  325|   694k|    simdjson_inline simd8<T> reduce_or() const {
  326|   694k|      return this->chunks[0] | this->chunks[1];
  327|   694k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   27|  2.99M|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   23|  33.7M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  278|   694k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   31|   771k|    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|   145k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   145k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   145k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  284|   290k|    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|   435k|        L replace12, L replace13, L replace14, L replace15) const {
  173|   435k|      return lookup_16(simd8<L>::repeat_16(
  174|   435k|        replace0,  replace1,  replace2,  replace3,
  175|   435k|        replace4,  replace5,  replace6,  replace7,
  176|   435k|        replace8,  replace9,  replace10, replace11,
  177|   435k|        replace12, replace13, replace14, replace15
  178|   435k|      ));
  179|   435k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  110|   435k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  111|   435k|      return _mm256_shuffle_epi8(lookup_table, *this);
  112|   435k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   24|   580k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  248|  1.82M|    ) {
  249|  1.82M|      return simd8<uint8_t>(
  250|  1.82M|        v0, v1, v2, v3, v4, v5, v6, v7,
  251|  1.82M|        v8, v9, v10,v11,v12,v13,v14,v15,
  252|  1.82M|        v0, v1, v2, v3, v4, v5, v6, v7,
  253|  1.82M|        v8, v9, v10,v11,v12,v13,v14,v15
  254|  1.82M|      );
  255|  1.82M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|  1.82M|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   28|   870k|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  229|  2.27M|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   75|  4.35M|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   53|   145k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   145k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   145k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   53|   145k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   145k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   145k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  259|   362k|    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|   290k|    simdjson_inline simd8(const __m256i _value) : base8_numeric<int8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaEC2EDv4_x:
   94|   290k|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IaNS2_5simd8IbEEEC2EDv4_x:
   46|   290k|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEC2EDv4_x:
   20|   290k|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEgtES4_:
  219|   145k|    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|   290k|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IbEC2EDv4_x:
   64|  7.09M|    simdjson_inline simd8<bool>(const __m256i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv4_x:
   46|  7.09M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv4_x:
   20|  7.09M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEC2Ea:
  188|   145k|    simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaE5splatEa:
   75|   145k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRDv4_xEv:
   24|   145k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   29|   145k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  231|  78.2k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  265|  72.5k|    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.58k|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  279|  4.58k|    simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5storeEPh:
   97|  5.72k|    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|  6.95M|    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|  6.95M|    simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRKDv4_xEv:
   23|  6.95M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqEh:
  337|  1.38M|    simdjson_inline uint64_t eq(const T m) const {
  338|  1.38M|      const simd8<T> mask = simd8<T>::splat(m);
  339|  1.38M|      return  simd8x64<bool>(
  340|  1.38M|        this->chunks[0] == mask,
  341|  1.38M|        this->chunks[1] == mask
  342|  1.38M|      ).to_bitmask();
  343|  1.38M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbEC2ENS2_5simd8IbEES6_:
  303|  3.47M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbE10to_bitmaskEv:
  319|  3.47M|    simdjson_inline uint64_t to_bitmask() const {
  320|  3.47M|      uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask());
  321|  3.47M|      uint64_t r_hi =                       this->chunks[1].to_bitmask();
  322|  3.47M|      return r_lo | (r_hi << 32);
  323|  3.47M|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqERKS4_:
  345|  1.38M|    simdjson_inline uint64_t eq(const simd8x64<uint8_t> &other) const {
  346|  1.38M|      return  simd8x64<bool>(
  347|  1.38M|        this->chunks[0] == other.chunks[0],
  348|  1.38M|        this->chunks[1] == other.chunks[1]
  349|  1.38M|      ).to_bitmask();
  350|  1.38M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2ENS2_5simd8IhEES6_:
  303|  2.08M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE4lteqEh:
  352|   694k|    simdjson_inline uint64_t lteq(const T m) const {
  353|   694k|      const simd8<T> mask = simd8<T>::splat(m);
  354|   694k|      return  simd8x64<bool>(
  355|   694k|        this->chunks[0] <= mask,
  356|   694k|        this->chunks[1] <= mask
  357|   694k|      ).to_bitmask();
  358|   694k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEleES4_:
  268|  1.38M|    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.38M|    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|  5.72k|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|  5.72k|  static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes");
   33|  5.72k|  simd8<uint8_t> v(src);
   34|       |  // store to dest unconditionally - we can overwrite the bits we don't like later
   35|  5.72k|  v.store(dst);
   36|  5.72k|  return {
   37|  5.72k|      static_cast<uint32_t>((v == '\\').to_bitmask()),     // bs_bits
   38|  5.72k|      static_cast<uint32_t>((v == '"').to_bitmask()), // quote_bits
   39|  5.72k|  };
   40|  5.72k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote15has_quote_firstEv:
   20|  5.72k|  simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote11quote_indexEv:
   22|    476|  simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote13has_backslashEv:
   21|  5.24k|  simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote15backslash_indexEv:
   23|  5.05k|  simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); }

_ZN8simdjson7icelake14implementationC2Ev:
   21|      1|  ) {}

_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEptEv:
  230|  5.00k|  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.79k|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.79k|  return (mode != stage1_mode::regular);
   31|       |  // return (mode == stage1_mode::streaming_partial || mode == stage1_mode::streaming_final);
   32|  9.79k|}
_ZNK8simdjson8internal25dom_parser_implementation8capacityEv:
  228|  5.00k|simdjson_inline size_t dom_parser_implementation::capacity() const noexcept {
  229|  5.00k|  return _capacity;
  230|  5.00k|}
_ZN8simdjson8internal25dom_parser_implementationC2Ev:
  224|  5.00k|simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept = default;
_ZN8simdjson8internal25dom_parser_implementationD2Ev:
  166|  5.00k|  virtual ~dom_parser_implementation() = default;

simdjson.cpp:_ZN8simdjson8internalL30detect_supported_architecturesEv:
  138|      1|static inline uint32_t detect_supported_architectures() {
  139|      1|  uint32_t eax, ebx, ecx, edx;
  140|      1|  uint32_t host_isa = 0x0;
  141|       |
  142|       |  // ECX for EAX=0x7
  143|      1|  eax = 0x7;
  144|      1|  ecx = 0x0;
  145|      1|  cpuid(&eax, &ebx, &ecx, &edx);
  146|      1|  if (ebx & cpuid_avx2_bit) {
  ------------------
  |  Branch (146:7): [True: 1, False: 0]
  ------------------
  147|      1|    host_isa |= instruction_set::AVX2;
  148|      1|  }
  149|      1|  if (ebx & cpuid_bmi1_bit) {
  ------------------
  |  Branch (149:7): [True: 1, False: 0]
  ------------------
  150|      1|    host_isa |= instruction_set::BMI1;
  151|      1|  }
  152|       |
  153|      1|  if (ebx & cpuid_bmi2_bit) {
  ------------------
  |  Branch (153:7): [True: 1, False: 0]
  ------------------
  154|      1|    host_isa |= instruction_set::BMI2;
  155|      1|  }
  156|       |
  157|      1|  if (ebx & cpuid_avx512f_bit) {
  ------------------
  |  Branch (157:7): [True: 0, False: 1]
  ------------------
  158|      0|    host_isa |= instruction_set::AVX512F;
  159|      0|  }
  160|       |
  161|      1|  if (ebx & cpuid_avx512dq_bit) {
  ------------------
  |  Branch (161:7): [True: 0, False: 1]
  ------------------
  162|      0|    host_isa |= instruction_set::AVX512DQ;
  163|      0|  }
  164|       |
  165|      1|  if (ebx & cpuid_avx512ifma_bit) {
  ------------------
  |  Branch (165:7): [True: 0, False: 1]
  ------------------
  166|      0|    host_isa |= instruction_set::AVX512IFMA;
  167|      0|  }
  168|       |
  169|      1|  if (ebx & cpuid_avx512pf_bit) {
  ------------------
  |  Branch (169:7): [True: 0, False: 1]
  ------------------
  170|      0|    host_isa |= instruction_set::AVX512PF;
  171|      0|  }
  172|       |
  173|      1|  if (ebx & cpuid_avx512er_bit) {
  ------------------
  |  Branch (173:7): [True: 0, False: 1]
  ------------------
  174|      0|    host_isa |= instruction_set::AVX512ER;
  175|      0|  }
  176|       |
  177|      1|  if (ebx & cpuid_avx512cd_bit) {
  ------------------
  |  Branch (177:7): [True: 0, False: 1]
  ------------------
  178|      0|    host_isa |= instruction_set::AVX512CD;
  179|      0|  }
  180|       |
  181|      1|  if (ebx & cpuid_avx512bw_bit) {
  ------------------
  |  Branch (181:7): [True: 0, False: 1]
  ------------------
  182|      0|    host_isa |= instruction_set::AVX512BW;
  183|      0|  }
  184|       |
  185|      1|  if (ebx & cpuid_avx512vl_bit) {
  ------------------
  |  Branch (185:7): [True: 0, False: 1]
  ------------------
  186|      0|    host_isa |= instruction_set::AVX512VL;
  187|      0|  }
  188|       |
  189|      1|  if (ecx & cpuid_avx512vbmi2_bit) {
  ------------------
  |  Branch (189:7): [True: 0, False: 1]
  ------------------
  190|      0|    host_isa |= instruction_set::AVX512VBMI2;
  191|      0|  }
  192|       |
  193|       |  // EBX for EAX=0x1
  194|      1|  eax = 0x1;
  195|      1|  cpuid(&eax, &ebx, &ecx, &edx);
  196|       |
  197|      1|  if (ecx & cpuid_sse42_bit) {
  ------------------
  |  Branch (197:7): [True: 1, False: 0]
  ------------------
  198|      1|    host_isa |= instruction_set::SSE42;
  199|      1|  }
  200|       |
  201|      1|  if (ecx & cpuid_pclmulqdq_bit) {
  ------------------
  |  Branch (201:7): [True: 1, False: 0]
  ------------------
  202|      1|    host_isa |= instruction_set::PCLMULQDQ;
  203|      1|  }
  204|       |
  205|      1|  return host_isa;
  206|      1|}
simdjson.cpp:_ZN8simdjson8internalL5cpuidEPjS1_S1_S1_:
  117|      2|                         uint32_t *edx) {
  118|       |#if defined(_MSC_VER)
  119|       |  int cpu_info[4];
  120|       |  __cpuid(cpu_info, *eax);
  121|       |  *eax = cpu_info[0];
  122|       |  *ebx = cpu_info[1];
  123|       |  *ecx = cpu_info[2];
  124|       |  *edx = cpu_info[3];
  125|       |#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)
  126|       |  uint32_t level = *eax;
  127|       |  __get_cpuid(level, eax, ebx, ecx, edx);
  128|       |#else
  129|      2|  uint32_t a = *eax, b, c = *ecx, d;
  130|      2|  asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d));
  131|      2|  *eax = a;
  132|      2|  *ebx = b;
  133|      2|  *ecx = c;
  134|      2|  *edx = d;
  135|      2|#endif
  136|      2|}

_ZN8simdjson13padded_stringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   66|  5.00k|    : viable_size(sv_.size()), data_ptr(internal::allocate_padded_buffer(sv_.size())) {
   67|  5.00k|  if(simdjson_unlikely(!data_ptr)) {
  ------------------
  |  |  120|  5.00k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 9, False: 4.99k]
  |  |  ------------------
  ------------------
   68|       |    //allocation failed or zero size
   69|      9|    viable_size = 0;
   70|      9|    return;
   71|      9|  }
   72|  4.99k|  if (sv_.size()) {
  ------------------
  |  Branch (72:7): [True: 4.89k, False: 97]
  ------------------
   73|  4.89k|    std::memcpy(data_ptr, sv_.data(), sv_.size());
   74|  4.89k|  }
   75|  4.99k|}
_ZN8simdjson8internal22allocate_padded_bufferEm:
   21|  5.00k|inline char *allocate_padded_buffer(size_t length) noexcept {
   22|  5.00k|  const size_t totalpaddedlength = length + SIMDJSON_PADDING;
   23|  5.00k|  if(totalpaddedlength<length) {
  ------------------
  |  Branch (23:6): [True: 0, False: 5.00k]
  ------------------
   24|       |    // overflow
   25|      0|    return nullptr;
   26|      0|  }
   27|  5.00k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   28|       |  // avoid getting out of memory
   29|  5.00k|  if (totalpaddedlength>(1UL<<20)) {
  ------------------
  |  Branch (29:7): [True: 9, False: 4.99k]
  ------------------
   30|      9|    return nullptr;
   31|      9|  }
   32|  4.99k|#endif
   33|       |
   34|  4.99k|  char *padded_buffer = new (std::nothrow) char[totalpaddedlength];
   35|  4.99k|  if (padded_buffer == nullptr) {
  ------------------
  |  Branch (35:7): [True: 0, False: 4.99k]
  ------------------
   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|  4.99k|  std::memset(padded_buffer + length, 0, totalpaddedlength - length);
   41|  4.99k|  return padded_buffer;
   42|  4.99k|} // allocate_padded_buffer()
_ZNK8simdjson13padded_stringcvNS_18padded_string_viewEEv:
  113|  5.00k|inline padded_string::operator padded_string_view() const noexcept {
  114|  5.00k|  return padded_string_view(data(), length(), length() + SIMDJSON_PADDING);
  115|  5.00k|}
_ZNK8simdjson13padded_string4dataEv:
  107|  5.00k|inline const char *padded_string::data() const noexcept { return data_ptr; }
_ZNK8simdjson13padded_string6lengthEv:
  105|  10.0k|inline size_t padded_string::length() const noexcept { return viable_size; }
_ZN8simdjson13padded_stringD2Ev:
   99|  5.00k|inline padded_string::~padded_string() noexcept {
  100|  5.00k|  delete[] data_ptr;
  101|  5.00k|}

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

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

_ZN8simdjson8internal10is_integerEc:
   59|  10.4M|bool is_integer(char c)  noexcept  { return (c >= '0' && c <= '9'); }
  ------------------
  |  Branch (59:46): [True: 10.4M, False: 10.1k]
  |  Branch (59:58): [True: 10.3M, False: 4.17k]
  ------------------
_ZN8simdjson8internal13parse_decimalERPKc:
   62|  7.98k|decimal parse_decimal(const char *&p) noexcept {
   63|  7.98k|  decimal answer;
   64|  7.98k|  answer.num_digits = 0;
   65|  7.98k|  answer.decimal_point = 0;
   66|  7.98k|  answer.truncated = false;
   67|  7.98k|  answer.negative = (*p == '-');
   68|  7.98k|  if ((*p == '-') || (*p == '+')) {
  ------------------
  |  Branch (68:7): [True: 0, False: 7.98k]
  |  Branch (68:22): [True: 0, False: 7.98k]
  ------------------
   69|      0|    ++p;
   70|      0|  }
   71|       |
   72|  10.2k|  while (*p == '0') {
  ------------------
  |  Branch (72:10): [True: 2.26k, False: 7.98k]
  ------------------
   73|  2.26k|    ++p;
   74|  2.26k|  }
   75|  9.38M|  while (is_integer(*p)) {
  ------------------
  |  Branch (75:10): [True: 9.37M, False: 7.98k]
  ------------------
   76|  9.37M|    if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (76:9): [True: 140k, False: 9.23M]
  ------------------
   77|   140k|      answer.digits[answer.num_digits] = uint8_t(*p - '0');
   78|   140k|    }
   79|  9.37M|    answer.num_digits++;
   80|  9.37M|    ++p;
   81|  9.37M|  }
   82|  7.98k|  if (*p == '.') {
  ------------------
  |  Branch (82:7): [True: 3.02k, False: 4.95k]
  ------------------
   83|  3.02k|    ++p;
   84|  3.02k|    const char *first_after_period = p;
   85|       |    // if we have not yet encountered a zero, we have to skip it as well
   86|  3.02k|    if (answer.num_digits == 0) {
  ------------------
  |  Branch (86:9): [True: 1.89k, False: 1.13k]
  ------------------
   87|       |      // skip zeros
   88|  1.88M|      while (*p == '0') {
  ------------------
  |  Branch (88:14): [True: 1.88M, False: 1.89k]
  ------------------
   89|  1.88M|        ++p;
   90|  1.88M|      }
   91|  1.89k|    }
   92|  1.00M|    while (is_integer(*p)) {
  ------------------
  |  Branch (92:12): [True: 1.00M, False: 3.02k]
  ------------------
   93|  1.00M|      if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (93:11): [True: 288k, False: 717k]
  ------------------
   94|   288k|        answer.digits[answer.num_digits] = uint8_t(*p - '0');
   95|   288k|      }
   96|  1.00M|      answer.num_digits++;
   97|  1.00M|      ++p;
   98|  1.00M|    }
   99|  3.02k|    answer.decimal_point = int32_t(first_after_period - p);
  100|  3.02k|  }
  101|  7.98k|  if(answer.num_digits > 0) {
  ------------------
  |  Branch (101:6): [True: 7.40k, False: 580]
  ------------------
  102|  7.40k|    const char *preverse = p - 1;
  103|  7.40k|    int32_t trailing_zeros = 0;
  104|   137k|    while ((*preverse == '0') || (*preverse == '.')) {
  ------------------
  |  Branch (104:12): [True: 129k, False: 7.69k]
  |  Branch (104:34): [True: 289, False: 7.40k]
  ------------------
  105|   130k|      if(*preverse == '0') { trailing_zeros++; };
  ------------------
  |  Branch (105:10): [True: 129k, False: 289]
  ------------------
  106|   130k|      --preverse;
  107|   130k|    }
  108|  7.40k|    answer.decimal_point += int32_t(answer.num_digits);
  109|  7.40k|    answer.num_digits -= uint32_t(trailing_zeros);
  110|  7.40k|  }
  111|  7.98k|  if(answer.num_digits > max_digits ) {
  ------------------
  |  Branch (111:6): [True: 353, False: 7.63k]
  ------------------
  112|    353|    answer.num_digits = max_digits;
  113|    353|    answer.truncated = true;
  114|    353|  }
  115|  7.98k|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (115:7): [True: 627, False: 7.35k]
  |  Branch (115:22): [True: 2.65k, False: 4.69k]
  ------------------
  116|  3.28k|    ++p;
  117|  3.28k|    bool neg_exp = false;
  118|  3.28k|    if ('-' == *p) {
  ------------------
  |  Branch (118:9): [True: 1.05k, False: 2.22k]
  ------------------
  119|  1.05k|      neg_exp = true;
  120|  1.05k|      ++p;
  121|  2.22k|    } else if ('+' == *p) {
  ------------------
  |  Branch (121:16): [True: 194, False: 2.03k]
  ------------------
  122|    194|      ++p;
  123|    194|    }
  124|  3.28k|    int32_t exp_number = 0; // exponential part
  125|  15.0k|    while (is_integer(*p)) {
  ------------------
  |  Branch (125:12): [True: 11.7k, False: 3.28k]
  ------------------
  126|  11.7k|      uint8_t digit = uint8_t(*p - '0');
  127|  11.7k|      if (exp_number < 0x10000) {
  ------------------
  |  Branch (127:11): [True: 10.5k, False: 1.17k]
  ------------------
  128|  10.5k|        exp_number = 10 * exp_number + digit;
  129|  10.5k|      }
  130|  11.7k|      ++p;
  131|  11.7k|    }
  132|  3.28k|    answer.decimal_point += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (132:30): [True: 1.05k, False: 2.22k]
  ------------------
  133|  3.28k|  }
  134|  7.98k|  return answer;
  135|  7.98k|}
_ZN8simdjson8internal5roundERNS0_7decimalE:
  323|  6.78k|uint64_t round(decimal &h) {
  324|  6.78k|  if ((h.num_digits == 0) || (h.decimal_point < 0)) {
  ------------------
  |  Branch (324:7): [True: 0, False: 6.78k]
  |  Branch (324:30): [True: 219, False: 6.56k]
  ------------------
  325|    219|    return 0;
  326|  6.56k|  } else if (h.decimal_point > 18) {
  ------------------
  |  Branch (326:14): [True: 0, False: 6.56k]
  ------------------
  327|      0|    return UINT64_MAX;
  328|      0|  }
  329|       |  // at this point, we know that h.decimal_point >= 0
  330|  6.56k|  uint32_t dp = uint32_t(h.decimal_point);
  331|  6.56k|  uint64_t n = 0;
  332|   105k|  for (uint32_t i = 0; i < dp; i++) {
  ------------------
  |  Branch (332:24): [True: 99.2k, False: 6.56k]
  ------------------
  333|  99.2k|    n = (10 * n) + ((i < h.num_digits) ? h.digits[i] : 0);
  ------------------
  |  Branch (333:21): [True: 97.4k, False: 1.75k]
  ------------------
  334|  99.2k|  }
  335|  6.56k|  bool round_up = false;
  336|  6.56k|  if (dp < h.num_digits) {
  ------------------
  |  Branch (336:7): [True: 6.32k, False: 244]
  ------------------
  337|  6.32k|    round_up = h.digits[dp] >= 5; // normally, we round up
  338|       |    // but we may need to round to even!
  339|  6.32k|    if ((h.digits[dp] == 5) && (dp + 1 == h.num_digits)) {
  ------------------
  |  Branch (339:9): [True: 2.35k, False: 3.96k]
  |  Branch (339:32): [True: 437, False: 1.91k]
  ------------------
  340|    437|      round_up = h.truncated || ((dp > 0) && (1 & h.digits[dp - 1]));
  ------------------
  |  Branch (340:18): [True: 224, False: 213]
  |  Branch (340:34): [True: 213, False: 0]
  |  Branch (340:46): [True: 171, False: 42]
  ------------------
  341|    437|    }
  342|  6.32k|  }
  343|  6.56k|  if (round_up) {
  ------------------
  |  Branch (343:7): [True: 4.94k, False: 1.62k]
  ------------------
  344|  4.94k|    n++;
  345|  4.94k|  }
  346|  6.56k|  return n;
  347|  6.78k|}
_ZN8simdjson8internal18decimal_left_shiftERNS0_7decimalEj:
  350|  28.1k|void decimal_left_shift(decimal &h, uint32_t shift) {
  351|  28.1k|  if (h.num_digits == 0) {
  ------------------
  |  Branch (351:7): [True: 0, False: 28.1k]
  ------------------
  352|      0|    return;
  353|      0|  }
  354|  28.1k|  uint32_t num_new_digits = number_of_digits_decimal_left_shift(h, shift);
  355|  28.1k|  int32_t read_index = int32_t(h.num_digits - 1);
  356|  28.1k|  uint32_t write_index = h.num_digits - 1 + num_new_digits;
  357|  28.1k|  uint64_t n = 0;
  358|       |
  359|  4.18M|  while (read_index >= 0) {
  ------------------
  |  Branch (359:10): [True: 4.15M, False: 28.1k]
  ------------------
  360|  4.15M|    n += uint64_t(h.digits[read_index]) << shift;
  361|  4.15M|    uint64_t quotient = n / 10;
  362|  4.15M|    uint64_t remainder = n - (10 * quotient);
  363|  4.15M|    if (write_index < max_digits) {
  ------------------
  |  Branch (363:9): [True: 4.15M, False: 7.23k]
  ------------------
  364|  4.15M|      h.digits[write_index] = uint8_t(remainder);
  365|  4.15M|    } else if (remainder > 0) {
  ------------------
  |  Branch (365:16): [True: 5.48k, False: 1.74k]
  ------------------
  366|  5.48k|      h.truncated = true;
  367|  5.48k|    }
  368|  4.15M|    n = quotient;
  369|  4.15M|    write_index--;
  370|  4.15M|    read_index--;
  371|  4.15M|  }
  372|   352k|  while (n > 0) {
  ------------------
  |  Branch (372:10): [True: 324k, False: 28.1k]
  ------------------
  373|   324k|    uint64_t quotient = n / 10;
  374|   324k|    uint64_t remainder = n - (10 * quotient);
  375|   324k|    if (write_index < max_digits) {
  ------------------
  |  Branch (375:9): [True: 324k, False: 0]
  ------------------
  376|   324k|      h.digits[write_index] = uint8_t(remainder);
  377|   324k|    } else if (remainder > 0) {
  ------------------
  |  Branch (377:16): [True: 0, False: 0]
  ------------------
  378|      0|      h.truncated = true;
  379|      0|    }
  380|   324k|    n = quotient;
  381|   324k|    write_index--;
  382|   324k|  }
  383|  28.1k|  h.num_digits += num_new_digits;
  384|  28.1k|  if (h.num_digits > max_digits) {
  ------------------
  |  Branch (384:7): [True: 491, False: 27.6k]
  ------------------
  385|    491|    h.num_digits = max_digits;
  386|    491|  }
  387|  28.1k|  h.decimal_point += int32_t(num_new_digits);
  388|  28.1k|  trim(h);
  389|  28.1k|}
_ZN8simdjson8internal19decimal_right_shiftERNS0_7decimalEj:
  392|  20.8k|void decimal_right_shift(decimal &h, uint32_t shift) {
  393|  20.8k|  uint32_t read_index = 0;
  394|  20.8k|  uint32_t write_index = 0;
  395|       |
  396|  20.8k|  uint64_t n = 0;
  397|       |
  398|   296k|  while ((n >> shift) == 0) {
  ------------------
  |  Branch (398:10): [True: 276k, False: 19.8k]
  ------------------
  399|   276k|    if (read_index < h.num_digits) {
  ------------------
  |  Branch (399:9): [True: 275k, False: 1.02k]
  ------------------
  400|   275k|      n = (10 * n) + h.digits[read_index++];
  401|   275k|    } else if (n == 0) {
  ------------------
  |  Branch (401:16): [True: 0, False: 1.02k]
  ------------------
  402|      0|      return;
  403|  1.02k|    } else {
  404|  16.2k|      while ((n >> shift) == 0) {
  ------------------
  |  Branch (404:14): [True: 15.1k, False: 1.02k]
  ------------------
  405|  15.1k|        n = 10 * n;
  406|  15.1k|        read_index++;
  407|  15.1k|      }
  408|  1.02k|      break;
  409|  1.02k|    }
  410|   276k|  }
  411|  20.8k|  h.decimal_point -= int32_t(read_index - 1);
  412|  20.8k|  if (h.decimal_point < -decimal_point_range) { // it is zero
  ------------------
  |  Branch (412:7): [True: 0, False: 20.8k]
  ------------------
  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|  20.8k|  uint64_t mask = (uint64_t(1) << shift) - 1;
  420|  5.18M|  while (read_index < h.num_digits) {
  ------------------
  |  Branch (420:10): [True: 5.16M, False: 20.8k]
  ------------------
  421|  5.16M|    uint8_t new_digit = uint8_t(n >> shift);
  422|  5.16M|    n = (10 * (n & mask)) + h.digits[read_index++];
  423|  5.16M|    h.digits[write_index++] = new_digit;
  424|  5.16M|  }
  425|   879k|  while (n > 0) {
  ------------------
  |  Branch (425:10): [True: 859k, False: 20.8k]
  ------------------
  426|   859k|    uint8_t new_digit = uint8_t(n >> shift);
  427|   859k|    n = 10 * (n & mask);
  428|   859k|    if (write_index < max_digits) {
  ------------------
  |  Branch (428:9): [True: 853k, False: 5.16k]
  ------------------
  429|   853k|      h.digits[write_index++] = new_digit;
  430|   853k|    } else if (new_digit > 0) {
  ------------------
  |  Branch (430:16): [True: 4.59k, False: 573]
  ------------------
  431|  4.59k|      h.truncated = true;
  432|  4.59k|    }
  433|   859k|  }
  434|  20.8k|  h.num_digits = write_index;
  435|  20.8k|  trim(h);
  436|  20.8k|}
_ZN8simdjson8internal10from_charsEPKc:
  562|  7.98k|double from_chars(const char *first) noexcept {
  563|  7.98k|  bool negative = first[0] == '-';
  564|  7.98k|  if (negative) {
  ------------------
  |  Branch (564:7): [True: 199, False: 7.78k]
  ------------------
  565|    199|    first++;
  566|    199|  }
  567|  7.98k|  adjusted_mantissa am = parse_long_mantissa<binary_format<double>>(first);
  568|  7.98k|  uint64_t word = am.mantissa;
  569|  7.98k|  word |= uint64_t(am.power2)
  570|  7.98k|          << binary_format<double>::mantissa_explicit_bits();
  571|  7.98k|  word = negative ? word | (uint64_t(1) << binary_format<double>::sign_index())
  ------------------
  |  Branch (571:10): [True: 199, False: 7.78k]
  ------------------
  572|  7.98k|                  : word;
  573|  7.98k|  double value;
  574|  7.98k|  std::memcpy(&value, &word, sizeof(double));
  575|  7.98k|  return value;
  576|  7.98k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_135number_of_digits_decimal_left_shiftERNS0_7decimalEj:
  226|  28.1k|uint32_t number_of_digits_decimal_left_shift(decimal &h, uint32_t shift) {
  227|  28.1k|  shift &= 63;
  228|  28.1k|  const static uint16_t number_of_digits_decimal_left_shift_table[65] = {
  229|  28.1k|      0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817,
  230|  28.1k|      0x181D, 0x2024, 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067,
  231|  28.1k|      0x3073, 0x3080, 0x388E, 0x389C, 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF,
  232|  28.1k|      0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169, 0x5180, 0x5998, 0x59B0,
  233|  28.1k|      0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B, 0x72AA,
  234|  28.1k|      0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC,
  235|  28.1k|      0x8C02, 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C,
  236|  28.1k|      0x051C, 0x051C,
  237|  28.1k|  };
  238|  28.1k|  uint32_t x_a = number_of_digits_decimal_left_shift_table[shift];
  239|  28.1k|  uint32_t x_b = number_of_digits_decimal_left_shift_table[shift + 1];
  240|  28.1k|  uint32_t num_new_digits = x_a >> 11;
  241|  28.1k|  uint32_t pow5_a = 0x7FF & x_a;
  242|  28.1k|  uint32_t pow5_b = 0x7FF & x_b;
  243|  28.1k|  const static uint8_t
  244|  28.1k|      number_of_digits_decimal_left_shift_table_powers_of_5[0x051C] = {
  245|  28.1k|          5, 2, 5, 1, 2, 5, 6, 2, 5, 3, 1, 2, 5, 1, 5, 6, 2, 5, 7, 8, 1, 2, 5,
  246|  28.1k|          3, 9, 0, 6, 2, 5, 1, 9, 5, 3, 1, 2, 5, 9, 7, 6, 5, 6, 2, 5, 4, 8, 8,
  247|  28.1k|          2, 8, 1, 2, 5, 2, 4, 4, 1, 4, 0, 6, 2, 5, 1, 2, 2, 0, 7, 0, 3, 1, 2,
  248|  28.1k|          5, 6, 1, 0, 3, 5, 1, 5, 6, 2, 5, 3, 0, 5, 1, 7, 5, 7, 8, 1, 2, 5, 1,
  249|  28.1k|          5, 2, 5, 8, 7, 8, 9, 0, 6, 2, 5, 7, 6, 2, 9, 3, 9, 4, 5, 3, 1, 2, 5,
  250|  28.1k|          3, 8, 1, 4, 6, 9, 7, 2, 6, 5, 6, 2, 5, 1, 9, 0, 7, 3, 4, 8, 6, 3, 2,
  251|  28.1k|          8, 1, 2, 5, 9, 5, 3, 6, 7, 4, 3, 1, 6, 4, 0, 6, 2, 5, 4, 7, 6, 8, 3,
  252|  28.1k|          7, 1, 5, 8, 2, 0, 3, 1, 2, 5, 2, 3, 8, 4, 1, 8, 5, 7, 9, 1, 0, 1, 5,
  253|  28.1k|          6, 2, 5, 1, 1, 9, 2, 0, 9, 2, 8, 9, 5, 5, 0, 7, 8, 1, 2, 5, 5, 9, 6,
  254|  28.1k|          0, 4, 6, 4, 4, 7, 7, 5, 3, 9, 0, 6, 2, 5, 2, 9, 8, 0, 2, 3, 2, 2, 3,
  255|  28.1k|          8, 7, 6, 9, 5, 3, 1, 2, 5, 1, 4, 9, 0, 1, 1, 6, 1, 1, 9, 3, 8, 4, 7,
  256|  28.1k|          6, 5, 6, 2, 5, 7, 4, 5, 0, 5, 8, 0, 5, 9, 6, 9, 2, 3, 8, 2, 8, 1, 2,
  257|  28.1k|          5, 3, 7, 2, 5, 2, 9, 0, 2, 9, 8, 4, 6, 1, 9, 1, 4, 0, 6, 2, 5, 1, 8,
  258|  28.1k|          6, 2, 6, 4, 5, 1, 4, 9, 2, 3, 0, 9, 5, 7, 0, 3, 1, 2, 5, 9, 3, 1, 3,
  259|  28.1k|          2, 2, 5, 7, 4, 6, 1, 5, 4, 7, 8, 5, 1, 5, 6, 2, 5, 4, 6, 5, 6, 6, 1,
  260|  28.1k|          2, 8, 7, 3, 0, 7, 7, 3, 9, 2, 5, 7, 8, 1, 2, 5, 2, 3, 2, 8, 3, 0, 6,
  261|  28.1k|          4, 3, 6, 5, 3, 8, 6, 9, 6, 2, 8, 9, 0, 6, 2, 5, 1, 1, 6, 4, 1, 5, 3,
  262|  28.1k|          2, 1, 8, 2, 6, 9, 3, 4, 8, 1, 4, 4, 5, 3, 1, 2, 5, 5, 8, 2, 0, 7, 6,
  263|  28.1k|          6, 0, 9, 1, 3, 4, 6, 7, 4, 0, 7, 2, 2, 6, 5, 6, 2, 5, 2, 9, 1, 0, 3,
  264|  28.1k|          8, 3, 0, 4, 5, 6, 7, 3, 3, 7, 0, 3, 6, 1, 3, 2, 8, 1, 2, 5, 1, 4, 5,
  265|  28.1k|          5, 1, 9, 1, 5, 2, 2, 8, 3, 6, 6, 8, 5, 1, 8, 0, 6, 6, 4, 0, 6, 2, 5,
  266|  28.1k|          7, 2, 7, 5, 9, 5, 7, 6, 1, 4, 1, 8, 3, 4, 2, 5, 9, 0, 3, 3, 2, 0, 3,
  267|  28.1k|          1, 2, 5, 3, 6, 3, 7, 9, 7, 8, 8, 0, 7, 0, 9, 1, 7, 1, 2, 9, 5, 1, 6,
  268|  28.1k|          6, 0, 1, 5, 6, 2, 5, 1, 8, 1, 8, 9, 8, 9, 4, 0, 3, 5, 4, 5, 8, 5, 6,
  269|  28.1k|          4, 7, 5, 8, 3, 0, 0, 7, 8, 1, 2, 5, 9, 0, 9, 4, 9, 4, 7, 0, 1, 7, 7,
  270|  28.1k|          2, 9, 2, 8, 2, 3, 7, 9, 1, 5, 0, 3, 9, 0, 6, 2, 5, 4, 5, 4, 7, 4, 7,
  271|  28.1k|          3, 5, 0, 8, 8, 6, 4, 6, 4, 1, 1, 8, 9, 5, 7, 5, 1, 9, 5, 3, 1, 2, 5,
  272|  28.1k|          2, 2, 7, 3, 7, 3, 6, 7, 5, 4, 4, 3, 2, 3, 2, 0, 5, 9, 4, 7, 8, 7, 5,
  273|  28.1k|          9, 7, 6, 5, 6, 2, 5, 1, 1, 3, 6, 8, 6, 8, 3, 7, 7, 2, 1, 6, 1, 6, 0,
  274|  28.1k|          2, 9, 7, 3, 9, 3, 7, 9, 8, 8, 2, 8, 1, 2, 5, 5, 6, 8, 4, 3, 4, 1, 8,
  275|  28.1k|          8, 6, 0, 8, 0, 8, 0, 1, 4, 8, 6, 9, 6, 8, 9, 9, 4, 1, 4, 0, 6, 2, 5,
  276|  28.1k|          2, 8, 4, 2, 1, 7, 0, 9, 4, 3, 0, 4, 0, 4, 0, 0, 7, 4, 3, 4, 8, 4, 4,
  277|  28.1k|          9, 7, 0, 7, 0, 3, 1, 2, 5, 1, 4, 2, 1, 0, 8, 5, 4, 7, 1, 5, 2, 0, 2,
  278|  28.1k|          0, 0, 3, 7, 1, 7, 4, 2, 2, 4, 8, 5, 3, 5, 1, 5, 6, 2, 5, 7, 1, 0, 5,
  279|  28.1k|          4, 2, 7, 3, 5, 7, 6, 0, 1, 0, 0, 1, 8, 5, 8, 7, 1, 1, 2, 4, 2, 6, 7,
  280|  28.1k|          5, 7, 8, 1, 2, 5, 3, 5, 5, 2, 7, 1, 3, 6, 7, 8, 8, 0, 0, 5, 0, 0, 9,
  281|  28.1k|          2, 9, 3, 5, 5, 6, 2, 1, 3, 3, 7, 8, 9, 0, 6, 2, 5, 1, 7, 7, 6, 3, 5,
  282|  28.1k|          6, 8, 3, 9, 4, 0, 0, 2, 5, 0, 4, 6, 4, 6, 7, 7, 8, 1, 0, 6, 6, 8, 9,
  283|  28.1k|          4, 5, 3, 1, 2, 5, 8, 8, 8, 1, 7, 8, 4, 1, 9, 7, 0, 0, 1, 2, 5, 2, 3,
  284|  28.1k|          2, 3, 3, 8, 9, 0, 5, 3, 3, 4, 4, 7, 2, 6, 5, 6, 2, 5, 4, 4, 4, 0, 8,
  285|  28.1k|          9, 2, 0, 9, 8, 5, 0, 0, 6, 2, 6, 1, 6, 1, 6, 9, 4, 5, 2, 6, 6, 7, 2,
  286|  28.1k|          3, 6, 3, 2, 8, 1, 2, 5, 2, 2, 2, 0, 4, 4, 6, 0, 4, 9, 2, 5, 0, 3, 1,
  287|  28.1k|          3, 0, 8, 0, 8, 4, 7, 2, 6, 3, 3, 3, 6, 1, 8, 1, 6, 4, 0, 6, 2, 5, 1,
  288|  28.1k|          1, 1, 0, 2, 2, 3, 0, 2, 4, 6, 2, 5, 1, 5, 6, 5, 4, 0, 4, 2, 3, 6, 3,
  289|  28.1k|          1, 6, 6, 8, 0, 9, 0, 8, 2, 0, 3, 1, 2, 5, 5, 5, 5, 1, 1, 1, 5, 1, 2,
  290|  28.1k|          3, 1, 2, 5, 7, 8, 2, 7, 0, 2, 1, 1, 8, 1, 5, 8, 3, 4, 0, 4, 5, 4, 1,
  291|  28.1k|          0, 1, 5, 6, 2, 5, 2, 7, 7, 5, 5, 5, 7, 5, 6, 1, 5, 6, 2, 8, 9, 1, 3,
  292|  28.1k|          5, 1, 0, 5, 9, 0, 7, 9, 1, 7, 0, 2, 2, 7, 0, 5, 0, 7, 8, 1, 2, 5, 1,
  293|  28.1k|          3, 8, 7, 7, 7, 8, 7, 8, 0, 7, 8, 1, 4, 4, 5, 6, 7, 5, 5, 2, 9, 5, 3,
  294|  28.1k|          9, 5, 8, 5, 1, 1, 3, 5, 2, 5, 3, 9, 0, 6, 2, 5, 6, 9, 3, 8, 8, 9, 3,
  295|  28.1k|          9, 0, 3, 9, 0, 7, 2, 2, 8, 3, 7, 7, 6, 4, 7, 6, 9, 7, 9, 2, 5, 5, 6,
  296|  28.1k|          7, 6, 2, 6, 9, 5, 3, 1, 2, 5, 3, 4, 6, 9, 4, 4, 6, 9, 5, 1, 9, 5, 3,
  297|  28.1k|          6, 1, 4, 1, 8, 8, 8, 2, 3, 8, 4, 8, 9, 6, 2, 7, 8, 3, 8, 1, 3, 4, 7,
  298|  28.1k|          6, 5, 6, 2, 5, 1, 7, 3, 4, 7, 2, 3, 4, 7, 5, 9, 7, 6, 8, 0, 7, 0, 9,
  299|  28.1k|          4, 4, 1, 1, 9, 2, 4, 4, 8, 1, 3, 9, 1, 9, 0, 6, 7, 3, 8, 2, 8, 1, 2,
  300|  28.1k|          5, 8, 6, 7, 3, 6, 1, 7, 3, 7, 9, 8, 8, 4, 0, 3, 5, 4, 7, 2, 0, 5, 9,
  301|  28.1k|          6, 2, 2, 4, 0, 6, 9, 5, 9, 5, 3, 3, 6, 9, 1, 4, 0, 6, 2, 5,
  302|  28.1k|      };
  303|  28.1k|  const uint8_t *pow5 =
  304|  28.1k|      &number_of_digits_decimal_left_shift_table_powers_of_5[pow5_a];
  305|  28.1k|  uint32_t i = 0;
  306|  28.1k|  uint32_t n = pow5_b - pow5_a;
  307|  32.8k|  for (; i < n; i++) {
  ------------------
  |  Branch (307:10): [True: 31.9k, False: 848]
  ------------------
  308|  31.9k|    if (i >= h.num_digits) {
  ------------------
  |  Branch (308:9): [True: 404, False: 31.5k]
  ------------------
  309|    404|      return num_new_digits - 1;
  310|  31.5k|    } else if (h.digits[i] == pow5[i]) {
  ------------------
  |  Branch (310:16): [True: 4.66k, False: 26.8k]
  ------------------
  311|  4.66k|      continue;
  312|  26.8k|    } else if (h.digits[i] < pow5[i]) {
  ------------------
  |  Branch (312:16): [True: 19.4k, False: 7.40k]
  ------------------
  313|  19.4k|      return num_new_digits - 1;
  314|  19.4k|    } else {
  315|  7.40k|      return num_new_digits;
  316|  7.40k|    }
  317|  31.9k|  }
  318|    848|  return num_new_digits;
  319|  28.1k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_14trimERNS0_7decimalE:
  220|  49.0k|inline void trim(decimal &h) {
  221|   398k|  while ((h.num_digits > 0) && (h.digits[h.num_digits - 1] == 0)) {
  ------------------
  |  Branch (221:10): [True: 398k, False: 0]
  |  Branch (221:32): [True: 349k, False: 49.0k]
  ------------------
  222|   349k|    h.num_digits--;
  223|   349k|  }
  224|  49.0k|}
_ZN8simdjson8internal13binary_formatIdE22mantissa_explicit_bitsEv:
   46|  18.6k|template <> constexpr int binary_format<double>::mantissa_explicit_bits() {
   47|  18.6k|  return 52;
   48|  18.6k|}
_ZN8simdjson8internal13binary_formatIdE10sign_indexEv:
   57|    199|template <> constexpr int binary_format<double>::sign_index() { return 63; }
_ZN8simdjson8internal19parse_long_mantissaINS0_13binary_formatIdEEEENS0_17adjusted_mantissaEPKc:
  551|  7.98k|adjusted_mantissa parse_long_mantissa(const char *first) {
  552|  7.98k|  decimal d = parse_decimal(first);
  553|  7.98k|  return compute_float<binary>(d);
  554|  7.98k|}
_ZN8simdjson8internal13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaERNS0_7decimalE:
  438|  7.98k|template <typename binary> adjusted_mantissa compute_float(decimal &d) {
  439|  7.98k|  adjusted_mantissa answer;
  440|  7.98k|  if (d.num_digits == 0) {
  ------------------
  |  Branch (440:7): [True: 580, False: 7.40k]
  ------------------
  441|       |    // should be zero
  442|    580|    answer.power2 = 0;
  443|    580|    answer.mantissa = 0;
  444|    580|    return answer;
  445|    580|  }
  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.40k|  if(d.decimal_point < -324) {
  ------------------
  |  Branch (453:6): [True: 426, False: 6.97k]
  ------------------
  454|       |    // We have something smaller than 1e-324 which is always zero
  455|       |    // in binary64 and binary32.
  456|       |    // It should be zero.
  457|    426|    answer.power2 = 0;
  458|    426|    answer.mantissa = 0;
  459|    426|    return answer;
  460|  6.97k|  } else if(d.decimal_point >= 310) {
  ------------------
  |  Branch (460:13): [True: 1.10k, False: 5.87k]
  ------------------
  461|       |    // We have something at least as large as 0.1e310 which is
  462|       |    // always infinite.
  463|  1.10k|    answer.power2 = binary::infinite_power();
  464|  1.10k|    answer.mantissa = 0;
  465|  1.10k|    return answer;
  466|  1.10k|  }
  467|       |
  468|  5.87k|  static const uint32_t max_shift = 60;
  469|  5.87k|  static const uint32_t num_powers = 19;
  470|  5.87k|  static const uint8_t powers[19] = {
  471|  5.87k|      0,  3,  6,  9,  13, 16, 19, 23, 26, 29, //
  472|  5.87k|      33, 36, 39, 43, 46, 49, 53, 56, 59,     //
  473|  5.87k|  };
  474|  5.87k|  int32_t exp2 = 0;
  475|  24.6k|  while (d.decimal_point > 0) {
  ------------------
  |  Branch (475:10): [True: 18.7k, False: 5.87k]
  ------------------
  476|  18.7k|    uint32_t n = uint32_t(d.decimal_point);
  477|  18.7k|    uint32_t shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (477:22): [True: 5.23k, False: 13.5k]
  ------------------
  478|  18.7k|    decimal_right_shift(d, shift);
  479|  18.7k|    if (d.decimal_point < -decimal_point_range) {
  ------------------
  |  Branch (479:9): [True: 0, False: 18.7k]
  ------------------
  480|       |      // should be zero
  481|      0|      answer.power2 = 0;
  482|      0|      answer.mantissa = 0;
  483|      0|      return answer;
  484|      0|    }
  485|  18.7k|    exp2 += int32_t(shift);
  486|  18.7k|  }
  487|       |  // We shift left toward [1/2 ... 1].
  488|  28.6k|  while (d.decimal_point <= 0) {
  ------------------
  |  Branch (488:10): [True: 28.6k, False: 0]
  ------------------
  489|  28.6k|    uint32_t shift;
  490|  28.6k|    if (d.decimal_point == 0) {
  ------------------
  |  Branch (490:9): [True: 13.9k, False: 14.6k]
  ------------------
  491|  13.9k|      if (d.digits[0] >= 5) {
  ------------------
  |  Branch (491:11): [True: 5.87k, False: 8.11k]
  ------------------
  492|  5.87k|        break;
  493|  5.87k|      }
  494|  8.11k|      shift = (d.digits[0] < 2) ? 2 : 1;
  ------------------
  |  Branch (494:15): [True: 3.00k, False: 5.11k]
  ------------------
  495|  14.6k|    } else {
  496|  14.6k|      uint32_t n = uint32_t(-d.decimal_point);
  497|  14.6k|      shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (497:15): [True: 2.52k, False: 12.1k]
  ------------------
  498|  14.6k|    }
  499|  22.8k|    decimal_left_shift(d, shift);
  500|  22.8k|    if (d.decimal_point > decimal_point_range) {
  ------------------
  |  Branch (500:9): [True: 0, False: 22.8k]
  ------------------
  501|       |      // we want to get infinity:
  502|      0|      answer.power2 = 0xFF;
  503|      0|      answer.mantissa = 0;
  504|      0|      return answer;
  505|      0|    }
  506|  22.8k|    exp2 -= int32_t(shift);
  507|  22.8k|  }
  508|       |  // We are now in the range [1/2 ... 1] but the binary format uses [1 ... 2].
  509|  5.87k|  exp2--;
  510|  5.87k|  constexpr int32_t minimum_exponent = binary::minimum_exponent();
  511|  6.52k|  while ((minimum_exponent + 1) > exp2) {
  ------------------
  |  Branch (511:10): [True: 648, False: 5.87k]
  ------------------
  512|    648|    uint32_t n = uint32_t((minimum_exponent + 1) - exp2);
  513|    648|    if (n > max_shift) {
  ------------------
  |  Branch (513:9): [True: 0, False: 648]
  ------------------
  514|      0|      n = max_shift;
  515|      0|    }
  516|    648|    decimal_right_shift(d, n);
  517|    648|    exp2 += int32_t(n);
  518|    648|  }
  519|  5.87k|  if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (519:7): [True: 545, False: 5.32k]
  ------------------
  520|    545|    answer.power2 = binary::infinite_power();
  521|    545|    answer.mantissa = 0;
  522|    545|    return answer;
  523|    545|  }
  524|       |
  525|  5.32k|  const int mantissa_size_in_bits = binary::mantissa_explicit_bits() + 1;
  526|  5.32k|  decimal_left_shift(d, mantissa_size_in_bits);
  527|       |
  528|  5.32k|  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.32k|  if (mantissa >= (uint64_t(1) << mantissa_size_in_bits)) {
  ------------------
  |  Branch (531:7): [True: 1.45k, False: 3.87k]
  ------------------
  532|  1.45k|    decimal_right_shift(d, 1);
  533|  1.45k|    exp2 += 1;
  534|  1.45k|    mantissa = round(d);
  535|  1.45k|    if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (535:9): [True: 0, False: 1.45k]
  ------------------
  536|      0|      answer.power2 = binary::infinite_power();
  537|      0|      answer.mantissa = 0;
  538|      0|      return answer;
  539|      0|    }
  540|  1.45k|  }
  541|  5.32k|  answer.power2 = exp2 - binary::minimum_exponent();
  542|  5.32k|  if (mantissa < (uint64_t(1) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (542:7): [True: 648, False: 4.68k]
  ------------------
  543|    648|    answer.power2--;
  544|    648|  }
  545|  5.32k|  answer.mantissa =
  546|  5.32k|      mantissa & ((uint64_t(1) << binary::mantissa_explicit_bits()) - 1);
  547|  5.32k|  return answer;
  548|  5.32k|}
_ZN8simdjson8internal17adjusted_mantissaC2Ev:
   28|  7.98k|  adjusted_mantissa() : mantissa(0), power2(0) {}
_ZN8simdjson8internal13binary_formatIdE14infinite_powerEv:
   53|  8.97k|template <> constexpr int binary_format<double>::infinite_power() {
   54|  8.97k|  return 0x7FF;
   55|  8.97k|}
_ZN8simdjson8internal13binary_formatIdE16minimum_exponentEv:
   50|  5.32k|template <> constexpr int binary_format<double>::minimum_exponent() {
   51|  5.32k|  return -1023;
   52|  5.32k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EEC2EPKhm:
   62|  4.89k|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|   347k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   69|   347k|  return idx < lenminusstep;
   70|   347k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE7advanceEv:
   86|   347k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
   87|   347k|  idx += STEP_SIZE;
   88|   347k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE10full_blockEv:
   73|   342k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   74|   342k|  return &buf[idx];
   75|   342k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE13get_remainderEPh:
   78|  4.89k|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
   79|  4.89k|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (79:6): [True: 0, False: 4.89k]
  ------------------
   80|  4.89k|  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.89k|  std::memcpy(dst, buf + idx, len - idx);
   82|  4.89k|  return len - idx;
   83|  4.89k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm128EE11block_indexEv:
   65|   699k|simdjson_inline size_t buf_block_reader<STEP_SIZE>::block_index() { return idx; }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scannerC2Ev:
   99|  4.89k|  json_scanner() = default;
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner4nextERKNS1_4simd8simd8x64IhEE:
  125|   694k|simdjson_inline json_block json_scanner::next(const simd::simd8x64<uint8_t>& in) {
  126|   694k|  json_string_block strings = string_scanner.next(in);
  127|       |  // identifies the white-space and the structural characters
  128|   694k|  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|   694k|  const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote();
  140|   694k|  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|   694k|  return json_block(
  144|   694k|    strings,// strings is a function-local object so either it moves or the copy is elided.
  145|   694k|    characters,
  146|   694k|    follows_nonquote_scalar
  147|   694k|  );
  148|   694k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage17followsEmRm:
  119|   694k|simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
  120|   694k|  const uint64_t result = match << 1 | overflow;
  121|   694k|  overflow = match >> 63;
  122|   694k|  return result;
  123|   694k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage110json_blockC2ENS2_17json_string_blockENS1_20json_character_blockEm:
   29|   694k|  _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner6finishEv:
  150|  4.89k|simdjson_inline error_code json_scanner::finish() {
  151|  4.89k|  return string_scanner.finish();
  152|  4.89k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block16structural_startEv:
   35|   694k|  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|   694k|  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|   694k|  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|   694k|    return _characters.scalar() & ~follows_potential_scalar();
   70|   694k|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block24follows_potential_scalarEv:
   75|   694k|  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|   694k|    return _follows_potential_nonquote_scalar;
   81|   694k|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block23non_quote_inside_stringEm:
   42|   694k|  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|   694k|simdjson_inline json_string_block json_string_scanner::next(const simd::simd8x64<uint8_t>& in) {
  111|   694k|  const uint64_t backslash = in.eq('\\');
  112|   694k|  const uint64_t escaped = find_escaped(backslash);
  113|   694k|  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|   694k|  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|   694k|  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|   694k|  return json_string_block(
  136|   694k|    backslash,
  137|   694k|    escaped,
  138|   694k|    quote,
  139|   694k|    in_string
  140|   694k|  );
  141|   694k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner23find_escaped_branchlessEm:
   85|  6.16k|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|  6.16k|  backslash &= ~prev_escaped;
   88|  6.16k|  uint64_t follows_escape = backslash << 1 | prev_escaped;
   89|       |
   90|       |  // Get sequences starting on even bits by clearing out the odd series using +
   91|  6.16k|  const uint64_t even_bits = 0x5555555555555555ULL;
   92|  6.16k|  uint64_t odd_sequence_starts = backslash & ~even_bits & ~follows_escape;
   93|  6.16k|  uint64_t sequences_starting_on_even_bits;
   94|  6.16k|  prev_escaped = add_overflow(odd_sequence_starts, backslash, &sequences_starting_on_even_bits);
   95|  6.16k|  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|  6.16k|  return (even_bits ^ invert_mask) & follows_escape;
  100|  6.16k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage117json_string_blockC2Emmmm:
    9|   694k|  _backslash(backslash), _escaped(escaped), _quote(quote), _in_string(in_string) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block5quoteEv:
   16|   694k|  simdjson_inline uint64_t quote() const { return _quote; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner6finishEv:
  143|  4.89k|simdjson_inline error_code json_string_scanner::finish() {
  144|  4.89k|  if (prev_in_string) {
  ------------------
  |  Branch (144:7): [True: 132, False: 4.76k]
  ------------------
  145|    132|    return UNCLOSED_STRING;
  146|    132|  }
  147|  4.76k|  return SUCCESS;
  148|  4.89k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block11string_tailEv:
   28|   694k|  simdjson_inline uint64_t string_tail() const { return _in_string ^ _quote; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block23non_quote_inside_stringEm:
   24|   694k|  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.00k|error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept {
  198|  5.00k|  if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; }
  ------------------
  |  |  120|  5.00k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 5.00k]
  |  |  ------------------
  ------------------
  199|       |  // We guard the rest of the code so that we can assume that len > 0 throughout.
  200|  5.00k|  if (len == 0) { return EMPTY; }
  ------------------
  |  Branch (200:7): [True: 106, False: 4.89k]
  ------------------
  201|  4.89k|  if (is_streaming(partial)) {
  ------------------
  |  Branch (201:7): [True: 0, False: 4.89k]
  ------------------
  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.89k|  buf_block_reader<STEP_SIZE> reader(buf, len);
  209|  4.89k|  json_structural_indexer indexer(parser.structural_indexes.get());
  210|       |
  211|       |  // Read all but the last block
  212|   347k|  while (reader.has_full_block()) {
  ------------------
  |  Branch (212:10): [True: 342k, False: 4.89k]
  ------------------
  213|   342k|    indexer.step<STEP_SIZE>(reader.full_block(), reader);
  214|   342k|  }
  215|       |  // Take care of the last block (will always be there unless file is empty which is
  216|       |  // not supposed to happen.)
  217|  4.89k|  uint8_t block[STEP_SIZE];
  218|  4.89k|  if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; }
  ------------------
  |  |  120|  4.89k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 4.89k]
  |  |  ------------------
  ------------------
  219|  4.89k|  indexer.step<STEP_SIZE>(block, reader);
  220|  4.89k|  return indexer.finish(parser, reader.block_index(), len, partial);
  221|  4.89k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexerC2EPj:
  156|  4.89k|simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexerC2EPj:
   21|  4.89k|  simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4stepILm128EEEvPKhRNS1_16buf_block_readerIXT_EEE:
  224|   347k|simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept {
  225|   347k|  simd::simd8x64<uint8_t> in_1(block);
  226|   347k|  simd::simd8x64<uint8_t> in_2(block+64);
  227|   347k|  json_block block_1 = scanner.next(in_1);
  228|   347k|  json_block block_2 = scanner.next(in_2);
  229|   347k|  this->next(in_1, block_1, reader.block_index());
  230|   347k|  this->next(in_2, block_2, reader.block_index()+64);
  231|   347k|  reader.advance();
  232|   347k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4nextERKNS1_4simd8simd8x64IhEERKNS2_10json_blockEm:
  242|   694k|simdjson_inline void json_structural_indexer::next(const simd::simd8x64<uint8_t>& in, const json_block& block, size_t idx) {
  243|   694k|  uint64_t unescaped = in.lteq(0x1F);
  244|   694k|#if SIMDJSON_UTF8VALIDATION
  245|   694k|  checker.check_next_input(in);
  246|   694k|#endif
  247|   694k|  indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser
  248|   694k|  prev_structurals = block.structural_start();
  249|   694k|  unescaped_chars_error |= block.non_quote_inside_string(unescaped);
  250|   694k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer5writeEjm:
   34|   699k|  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|   699k|    if (bits == 0)
  ------------------
  |  Branch (38:9): [True: 469k, False: 230k]
  ------------------
   39|   469k|        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|   230k|    int cnt = static_cast<int>(count_ones(bits));
   96|       |    // Do the first 8 all together
   97|  2.07M|    for (int i=0; i<8; i++) {
  ------------------
  |  Branch (97:19): [True: 1.84M, False: 230k]
  ------------------
   98|  1.84M|      this->tail[i] = idx + trailing_zeroes(bits);
   99|  1.84M|      bits = clear_lowest_bit(bits);
  100|  1.84M|    }
  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|   230k|    if (simdjson_unlikely(cnt > 8)) {
  ------------------
  |  |  120|   230k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 166k, False: 63.9k]
  |  |  ------------------
  ------------------
  105|  1.49M|      for (int i=8; i<16; i++) {
  ------------------
  |  Branch (105:21): [True: 1.32M, False: 166k]
  ------------------
  106|  1.32M|        this->tail[i] = idx + trailing_zeroes(bits);
  107|  1.32M|        bits = clear_lowest_bit(bits);
  108|  1.32M|      }
  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|   166k|      if (simdjson_unlikely(cnt > 16)) {
  ------------------
  |  |  120|   166k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 160k, False: 5.25k]
  |  |  ------------------
  ------------------
  114|   160k|        int i = 16;
  115|  7.44M|        do {
  116|  7.44M|          this->tail[i] = idx + trailing_zeroes(bits);
  117|  7.44M|          bits = clear_lowest_bit(bits);
  118|  7.44M|          i++;
  119|  7.44M|        } while (i < cnt);
  ------------------
  |  Branch (119:18): [True: 7.28M, False: 160k]
  ------------------
  120|   160k|      }
  121|   166k|    }
  122|       |
  123|   230k|    this->tail += cnt;
  124|   230k|#endif
  125|   230k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer6finishERNS0_25dom_parser_implementationEmmNS_11stage1_modeE:
  252|  4.89k|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.89k|  indexer.write(uint32_t(idx-64), prev_structurals);
  255|  4.89k|  error_code error = scanner.finish();
  256|       |  // We deliberately break down the next expression so that it is
  257|       |  // human readable.
  258|  4.89k|  const bool should_we_exit = is_streaming(partial) ?
  ------------------
  |  Branch (258:31): [True: 0, False: 4.89k]
  ------------------
  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.89k|    : (error != SUCCESS); // if partial is false, we must have SUCCESS
  261|  4.89k|  const bool have_unclosed_string = (error == UNCLOSED_STRING);
  262|  4.89k|  if (simdjson_unlikely(should_we_exit)) { return error; }
  ------------------
  |  |  120|  4.89k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 132, False: 4.76k]
  |  |  ------------------
  ------------------
  263|       |
  264|  4.76k|  if (unescaped_chars_error) {
  ------------------
  |  Branch (264:7): [True: 178, False: 4.58k]
  ------------------
  265|    178|    return UNESCAPED_CHARS;
  266|    178|  }
  267|  4.58k|  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.58k|  parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final
  288|  4.58k|  parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len);
  289|  4.58k|  parser.structural_indexes[parser.n_structural_indexes + 2] = 0;
  290|  4.58k|  parser.next_structural_index = 0;
  291|       |  // a valid JSON file cannot have zero structural indexes - we should have found something
  292|  4.58k|  if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  120|  4.58k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 1, False: 4.58k]
  |  |  ------------------
  ------------------
  293|      1|    return EMPTY;
  294|      1|  }
  295|  4.58k|  if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) {
  ------------------
  |  |  120|  4.58k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 4.58k]
  |  |  ------------------
  ------------------
  296|      0|    return UNEXPECTED_ERROR;
  297|      0|  }
  298|  4.58k|  if (partial == stage1_mode::streaming_partial) {
  ------------------
  |  Branch (298:7): [True: 0, False: 4.58k]
  ------------------
  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.58k|  } else if (partial == stage1_mode::streaming_final) {
  ------------------
  |  Branch (322:14): [True: 0, False: 4.58k]
  ------------------
  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.58k|  checker.check_eof();
  350|  4.58k|  return checker.errors();
  351|  4.58k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_next_inputERKNS1_4simd8simd8x64IhEE:
  173|   694k|    simdjson_inline void check_next_input(const simd8x64<uint8_t>& input) {
  174|   694k|      if(simdjson_likely(is_ascii(input))) {
  ------------------
  |  |  117|   694k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 621k, False: 72.5k]
  |  |  ------------------
  ------------------
  175|   621k|        this->error |= this->prev_incomplete;
  176|   621k|      } else {
  177|       |        // you might think that a for-loop would work, but under Visual Studio, it is not good enough.
  178|  72.5k|        static_assert((simd8x64<uint8_t>::NUM_CHUNKS == 1)
  179|  72.5k|                ||(simd8x64<uint8_t>::NUM_CHUNKS == 2)
  180|  72.5k|                || (simd8x64<uint8_t>::NUM_CHUNKS == 4),
  181|  72.5k|                "We support one, two or four chunks per 64-byte block.");
  182|  72.5k|        SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 1) {
  ------------------
  |  |  167|  72.5k|#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|  72.5k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 2) {
  ------------------
  |  |  167|  72.5k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  |  Branch (184:39): [Folded - Ignored]
  ------------------
  185|  72.5k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  186|  72.5k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  187|  72.5k|        } 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|  72.5k|        this->prev_incomplete = is_incomplete(input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1]);
  194|  72.5k|        this->prev_input_block = input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1];
  195|  72.5k|      }
  196|   694k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_utf8_bytesENS1_4simd5simd8IhEES6_:
  148|   145k|    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|   145k|      simd8<uint8_t> prev1 = input.prev<1>(prev_input);
  152|   145k|      simd8<uint8_t> sc = check_special_cases(input, prev1);
  153|   145k|      this->error |= check_multibyte_lengths(input, prev_input, sc);
  154|   145k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation19check_special_casesENS1_4simd5simd8IhEES5_:
    8|   145k|  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|   145k|    constexpr const uint8_t TOO_SHORT   = 1<<0; // 11______ 0_______
   16|       |                                                // 11______ 11______
   17|   145k|    constexpr const uint8_t TOO_LONG    = 1<<1; // 0_______ 10______
   18|   145k|    constexpr const uint8_t OVERLONG_3  = 1<<2; // 11100000 100_____
   19|   145k|    constexpr const uint8_t SURROGATE   = 1<<4; // 11101101 101_____
   20|   145k|    constexpr const uint8_t OVERLONG_2  = 1<<5; // 1100000_ 10______
   21|   145k|    constexpr const uint8_t TWO_CONTS   = 1<<7; // 10______ 10______
   22|   145k|    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|   145k|    constexpr const uint8_t TOO_LARGE_1000 = 1<<6;
   31|       |                                                // 11110101 1000____
   32|       |                                                // 1111011_ 1000____
   33|       |                                                // 11111___ 1000____
   34|   145k|    constexpr const uint8_t OVERLONG_4  = 1<<6; // 11110000 1000____
   35|       |
   36|   145k|    const simd8<uint8_t> byte_1_high = prev1.shr<4>().lookup_16<uint8_t>(
   37|       |      // 0_______ ________ <ASCII in byte 1>
   38|   145k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   39|   145k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   40|       |      // 10______ ________ <continuation in byte 1>
   41|   145k|      TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS,
   42|       |      // 1100____ ________ <two byte lead in byte 1>
   43|   145k|      TOO_SHORT | OVERLONG_2,
   44|       |      // 1101____ ________ <two byte lead in byte 1>
   45|   145k|      TOO_SHORT,
   46|       |      // 1110____ ________ <three byte lead in byte 1>
   47|   145k|      TOO_SHORT | OVERLONG_3 | SURROGATE,
   48|       |      // 1111____ ________ <four+ byte lead in byte 1>
   49|   145k|      TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4
   50|   145k|    );
   51|   145k|    constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 .
   52|   145k|    const simd8<uint8_t> byte_1_low = (prev1 & 0x0F).lookup_16<uint8_t>(
   53|       |      // ____0000 ________
   54|   145k|      CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4,
   55|       |      // ____0001 ________
   56|   145k|      CARRY | OVERLONG_2,
   57|       |      // ____001_ ________
   58|   145k|      CARRY,
   59|   145k|      CARRY,
   60|       |
   61|       |      // ____0100 ________
   62|   145k|      CARRY | TOO_LARGE,
   63|       |      // ____0101 ________
   64|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   65|       |      // ____011_ ________
   66|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   67|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   68|       |
   69|       |      // ____1___ ________
   70|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   71|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   72|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   73|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   74|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   75|       |      // ____1101 ________
   76|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE,
   77|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   78|   145k|      CARRY | TOO_LARGE | TOO_LARGE_1000
   79|   145k|    );
   80|   145k|    const simd8<uint8_t> byte_2_high = input.shr<4>().lookup_16<uint8_t>(
   81|       |      // ________ 0_______ <ASCII in byte 2>
   82|   145k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   83|   145k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   84|       |
   85|       |      // ________ 1000____
   86|   145k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4,
   87|       |      // ________ 1001____
   88|   145k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE,
   89|       |      // ________ 101_____
   90|   145k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   91|   145k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   92|       |
   93|       |      // ________ 11______
   94|   145k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT
   95|   145k|    );
   96|   145k|    return (byte_1_high & byte_1_low & byte_2_high);
   97|   145k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation23check_multibyte_lengthsENS1_4simd5simd8IhEES5_S5_:
   99|   145k|      const simd8<uint8_t> prev_input, const simd8<uint8_t> sc) {
  100|   145k|    simd8<uint8_t> prev2 = input.prev<2>(prev_input);
  101|   145k|    simd8<uint8_t> prev3 = input.prev<3>(prev_input);
  102|   145k|    simd8<uint8_t> must23 = simd8<uint8_t>(must_be_2_3_continuation(prev2, prev3));
  103|   145k|    simd8<uint8_t> must23_80 = must23 & uint8_t(0x80);
  104|   145k|    return must23_80 ^ sc;
  105|   145k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation13is_incompleteENS1_4simd5simd8IhEE:
  111|  72.5k|  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|  72.5k|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  115|  72.5k|    static const uint8_t max_array[64] = {
  116|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  117|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  118|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  119|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  120|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  121|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  122|  72.5k|      255, 255, 255, 255, 255, 255, 255, 255,
  123|  72.5k|      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  124|  72.5k|    };
  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|  72.5k|    const simd8<uint8_t> max_value(&max_array[sizeof(max_array)-sizeof(simd8<uint8_t>)]);
  134|  72.5k|    return input.gt_bits(max_value);
  135|  72.5k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker9check_eofEv:
  159|  4.58k|    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.58k|      this->error |= this->prev_incomplete;
  163|  4.58k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker6errorsEv:
  198|  4.58k|    simdjson_inline error_code errors() {
  199|  4.58k|      return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS;
  ------------------
  |  Branch (199:14): [True: 767, False: 3.82k]
  ------------------
  200|  4.58k|    }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113stringparsing12parse_stringEPKhPhb:
  142|  3.60k|simdjson_warn_unused simdjson_inline uint8_t *parse_string(const uint8_t *src, uint8_t *dst, bool allow_replacement) {
  143|  5.72k|  while (1) {
  ------------------
  |  Branch (143:10): [Folded - Ignored]
  ------------------
  144|       |    // Copy the next n bytes, and find the backslash and quote in them.
  145|  5.72k|    auto bs_quote = backslash_and_quote::copy_and_find(src, dst);
  146|       |    // If the next thing is the end quote, copy and return
  147|  5.72k|    if (bs_quote.has_quote_first()) {
  ------------------
  |  Branch (147:9): [True: 476, False: 5.24k]
  ------------------
  148|       |      // we encountered quotes first. Move dst to point to quotes and exit
  149|    476|      return dst + bs_quote.quote_index();
  150|    476|    }
  151|  5.24k|    if (bs_quote.has_backslash()) {
  ------------------
  |  Branch (151:9): [True: 5.05k, False: 194]
  ------------------
  152|       |      /* find out where the backspace is */
  153|  5.05k|      auto bs_dist = bs_quote.backslash_index();
  154|  5.05k|      uint8_t escape_char = src[bs_dist + 1];
  155|       |      /* we encountered backslash first. Handle backslash */
  156|  5.05k|      if (escape_char == 'u') {
  ------------------
  |  Branch (156:11): [True: 3.64k, False: 1.41k]
  ------------------
  157|       |        /* move src/dst up to the start; they will be further adjusted
  158|       |           within the unicode codepoint handling code. */
  159|  3.64k|        src += bs_dist;
  160|  3.64k|        dst += bs_dist;
  161|  3.64k|        if (!handle_unicode_codepoint(&src, &dst, allow_replacement)) {
  ------------------
  |  Branch (161:13): [True: 2.41k, False: 1.22k]
  ------------------
  162|  2.41k|          return nullptr;
  163|  2.41k|        }
  164|  3.64k|      } 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|  1.41k|        uint8_t escape_result = escape_map[escape_char];
  170|  1.41k|        if (escape_result == 0u) {
  ------------------
  |  Branch (170:13): [True: 712, False: 698]
  ------------------
  171|    712|          return nullptr; /* bogus escape value is an error */
  172|    712|        }
  173|    698|        dst[bs_dist] = escape_result;
  174|    698|        src += bs_dist + 2;
  175|    698|        dst += bs_dist + 1;
  176|    698|      }
  177|  5.05k|    } else {
  178|       |      /* they are the same. Since they can't co-occur, it means we
  179|       |       * encountered neither. */
  180|    194|      src += backslash_and_quote::BYTES_PROCESSED;
  181|    194|      dst += backslash_and_quote::BYTES_PROCESSED;
  182|    194|    }
  183|  5.24k|  }
  184|       |  /* can't be reached */
  185|      0|  return nullptr;
  186|  3.60k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113stringparsing24handle_unicode_codepointEPPKhPPhb:
   44|  3.64k|                                            uint8_t **dst_ptr, bool allow_replacement) {
   45|       |  // Use the default Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD)
   46|  3.64k|  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|  3.64k|  uint32_t code_point = jsoncharutils::hex_to_u32_nocheck(*src_ptr + 2);
   51|  3.64k|  *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|  3.64k|  if (code_point >= 0xd800 && code_point < 0xdc00) {
  ------------------
  |  Branch (57:7): [True: 2.92k, False: 713]
  |  Branch (57:31): [True: 1.01k, False: 1.91k]
  ------------------
   58|  1.01k|    const uint8_t *src_data = *src_ptr;
   59|       |    /* Compiler optimizations convert this to a single 16-bit load and compare on most platforms */
   60|  1.01k|    if (((src_data[0] << 8) | src_data[1]) != ((static_cast<uint8_t> ('\\') << 8) | static_cast<uint8_t> ('u'))) {
  ------------------
  |  Branch (60:9): [True: 518, False: 497]
  ------------------
   61|    518|      if(!allow_replacement) { return false; }
  ------------------
  |  Branch (61:10): [True: 518, False: 0]
  ------------------
   62|      0|      code_point = substitution_code_point;
   63|    497|    } else {
   64|    497|      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|    497|      uint32_t low_bit = code_point_2 - 0xdc00;
   72|    497|      if (low_bit >> 10) {
  ------------------
  |  Branch (72:11): [True: 254, False: 243]
  ------------------
   73|    254|        if(!allow_replacement) { return false; }
  ------------------
  |  Branch (73:12): [True: 254, False: 0]
  ------------------
   74|      0|        code_point = substitution_code_point;
   75|    243|      } else {
   76|    243|        code_point =  (((code_point - 0xd800) << 10) | low_bit) + 0x10000;
   77|    243|        *src_ptr += 6;
   78|    243|      }
   79|       |
   80|    497|    }
   81|  2.62k|  } else if (code_point >= 0xdc00 && code_point <= 0xdfff) {
  ------------------
  |  Branch (81:14): [True: 1.91k, False: 713]
  |  Branch (81:38): [True: 248, False: 1.66k]
  ------------------
   82|       |      // If we encounter a low surrogate (not preceded by a high surrogate)
   83|       |      // then we have an error.
   84|    248|      if(!allow_replacement) { return false; }
  ------------------
  |  Branch (84:10): [True: 248, False: 0]
  ------------------
   85|      0|      code_point = substitution_code_point;
   86|      0|  }
   87|  2.62k|  size_t offset = jsoncharutils::codepoint_to_utf8(code_point, *dst_ptr);
   88|  2.62k|  *dst_ptr += offset;
   89|  2.62k|  return offset > 0;
   90|  3.64k|}

_ZN8simdjson7haswell25dom_parser_implementation6stage1EPKhmNS_11stage1_modeE:
  138|  5.00k|simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept {
  139|  5.00k|  this->buf = _buf;
  140|  5.00k|  this->len = _len;
  141|  5.00k|  return haswell::stage1::json_structural_indexer::index<128>(_buf, _len, *this, streaming);
  142|  5.00k|}
_ZNK8simdjson7haswell25dom_parser_implementation12parse_stringEPKhPhb:
  156|  3.60k|simdjson_warn_unused uint8_t *dom_parser_implementation::parse_string(const uint8_t *src, uint8_t *dst, bool replacement_char) const noexcept {
  157|  3.60k|  return haswell::stringparsing::parse_string(src, dst, replacement_char);
  158|  3.60k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   85|   694k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   86|   694k|  return input.reduce_or().is_ascii();
   87|   694k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   97|   145k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   98|   145k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   99|   145k|  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|   145k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  102|   145k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner12find_escapedEm:
  126|   694k|simdjson_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
  127|   694k|  if (!backslash) { uint64_t escaped = prev_escaped; prev_escaped = 0; return escaped; }
  ------------------
  |  Branch (127:7): [True: 688k, False: 6.16k]
  ------------------
  128|  6.16k|  return find_escaped_branchless(backslash);
  129|   694k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_120json_character_block8classifyERKNS1_4simd8simd8x64IhEE:
   32|   694k|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|   694k|  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|   694k|  const auto op_table = simd8<uint8_t>::repeat_16(
   57|   694k|    0, 0, 0, 0,
   58|   694k|    0, 0, 0, 0,
   59|   694k|    0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B
   60|   694k|    ',', '}', 0, 0  // , = 2C, ] = 5D, } = 7D
   61|   694k|  );
   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|   694k|  const uint64_t whitespace = in.eq({
   69|   694k|    _mm256_shuffle_epi8(whitespace_table, in.chunks[0]),
   70|   694k|    _mm256_shuffle_epi8(whitespace_table, in.chunks[1])
   71|   694k|  });
   72|       |  // Turn [ and ] into { and }
   73|   694k|  const simd8x64<uint8_t> curlified{
   74|   694k|    in.chunks[0] | 0x20,
   75|   694k|    in.chunks[1] | 0x20
   76|   694k|  };
   77|   694k|  const uint64_t op = curlified.eq({
   78|   694k|    _mm256_shuffle_epi8(op_table, in.chunks[0]),
   79|   694k|    _mm256_shuffle_epi8(op_table, in.chunks[1])
   80|   694k|  });
   81|       |
   82|   694k|  return { whitespace, op };
   83|   694k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block6scalarEv:
   28|  1.38M|simdjson_inline uint64_t json_character_block::scalar() const noexcept { return ~(op() | whitespace()); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block2opEv:
   27|  2.08M|simdjson_inline uint64_t json_character_block::op() const noexcept { return _op; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block10whitespaceEv:
   26|  1.38M|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.00k|) const noexcept {
   11|  5.00k|  dst.reset( new (std::nothrow) dom_parser_implementation() );
   12|  5.00k|  if (!dst) { return MEMALLOC; }
  ------------------
  |  Branch (12:7): [True: 0, False: 5.00k]
  ------------------
   13|  5.00k|  if (auto err = dst->set_capacity(capacity))
  ------------------
  |  Branch (13:12): [True: 0, False: 5.00k]
  ------------------
   14|      0|    return err;
   15|  5.00k|  if (auto err = dst->set_max_depth(max_depth))
  ------------------
  |  Branch (15:12): [True: 0, False: 5.00k]
  ------------------
   16|      0|    return err;
   17|  5.00k|  return SUCCESS;
   18|  5.00k|}

_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.00k|SIMDJSON_DLLIMPORTEXPORT internal::atomic_ptr<const implementation>& get_active_implementation() {
  180|  5.00k|    static const internal::detect_best_supported_implementation_on_first_use detect_best_supported_implementation_on_first_use_singleton;
  181|  5.00k|    static internal::atomic_ptr<const implementation> active_implementation{&detect_best_supported_implementation_on_first_use_singleton};
  182|  5.00k|    return active_implementation;
  183|  5.00k|}
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|  }

