_ZN10NulOStreamC1Ev:
   19|  4.39k|  NulOStream() : std::ostream(this) {}
_ZN12NulStreambuf8overflowEi:
   11|  97.4k|  virtual int overflow(int c) override final{
   12|  97.4k|    setp(dummyBuffer, dummyBuffer + sizeof(dummyBuffer));
   13|  97.4k|    return (c == traits_type::eof()) ? '\0' : c;
  ------------------
  |  Branch (13:12): [True: 0, False: 97.4k]
  ------------------
   14|  97.4k|  }

LLVMFuzzerTestOneInput:
   59|  8.75k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   60|  8.75k|  simdjson::dom::parser parser;
   61|  8.75k|  simdjson::dom::element elem;
   62|  8.75k|  auto error = parser.parse(Data, Size).get(elem);
   63|       |
   64|  8.75k|  if (error) { return 0; }
  ------------------
  |  Branch (64:7): [True: 4.36k, False: 4.39k]
  ------------------
   65|  4.39k|  NulOStream os;
   66|       |  //std::ostream& os(std::cout);
   67|  4.39k|  print_json(os,elem);
   68|  4.39k|  return 0;
   69|  8.75k|}
fuzz_dump.cpp:_ZL10print_jsonRNSt3__113basic_ostreamIcNS_11char_traitsIcEEEEN8simdjson3dom7elementE:
   14|  1.36M|static void print_json(std::ostream& os, simdjson::dom::element element) noexcept {
   15|  1.36M|  const char endl='\n';
   16|  1.36M|  switch (element.type()) {
  ------------------
  |  Branch (16:11): [True: 0, False: 1.36M]
  ------------------
   17|  18.2k|  case simdjson::dom::element_type::ARRAY:
  ------------------
  |  Branch (17:3): [True: 18.2k, False: 1.34M]
  ------------------
   18|  18.2k|    os << "[";
   19|  18.2k|    {
   20|  18.2k|      simdjson::dom::array array = element.get_array().value_unsafe();
   21|  1.08M|      for (simdjson::dom::element child : array) {
  ------------------
  |  Branch (21:41): [True: 1.08M, False: 18.2k]
  ------------------
   22|  1.08M|        print_json(os, child);
   23|  1.08M|        os << ",";
   24|  1.08M|      }
   25|  18.2k|    }
   26|  18.2k|    os << "]";
   27|  18.2k|    break;
   28|  4.01k|  case simdjson::dom::element_type::OBJECT:
  ------------------
  |  Branch (28:3): [True: 4.01k, False: 1.35M]
  ------------------
   29|  4.01k|    os << "{";
   30|  4.01k|    {
   31|  4.01k|      simdjson::dom::object object = element.get_object().value_unsafe();
   32|   271k|      for (simdjson::dom::key_value_pair field : object) {
  ------------------
  |  Branch (32:48): [True: 271k, False: 4.01k]
  ------------------
   33|   271k|        os << "\"" << field.key << "\": ";
   34|   271k|        print_json(os, field.value);
   35|   271k|      }
   36|  4.01k|    }
   37|  4.01k|    os << "}";
   38|  4.01k|    break;
   39|  1.30M|  case simdjson::dom::element_type::INT64:
  ------------------
  |  Branch (39:3): [True: 1.30M, False: 53.4k]
  ------------------
   40|  1.30M|    os << element.get_int64().value_unsafe() << endl;
   41|  1.30M|    break;
   42|  1.55k|  case simdjson::dom::element_type::UINT64:
  ------------------
  |  Branch (42:3): [True: 1.55k, False: 1.35M]
  ------------------
   43|  1.55k|    os << element.get_uint64().value_unsafe() << endl;
   44|  1.55k|    break;
   45|  17.0k|  case simdjson::dom::element_type::DOUBLE:
  ------------------
  |  Branch (45:3): [True: 17.0k, False: 1.34M]
  ------------------
   46|  17.0k|    os << element.get_double().value_unsafe() << endl;
   47|  17.0k|    break;
   48|  11.4k|  case simdjson::dom::element_type::STRING:
  ------------------
  |  Branch (48:3): [True: 11.4k, False: 1.34M]
  ------------------
   49|  11.4k|    os << element.get_string().value_unsafe() << endl;
   50|  11.4k|    break;
   51|    783|  case simdjson::dom::element_type::BOOL:
  ------------------
  |  Branch (51:3): [True: 783, False: 1.36M]
  ------------------
   52|    783|    os << element.get_bool().value_unsafe() << endl;
   53|    783|    break;
   54|    389|  case simdjson::dom::element_type::NULL_VALUE:
  ------------------
  |  Branch (54:3): [True: 389, False: 1.36M]
  ------------------
   55|    389|    os << "null" << endl;
   56|    389|    break;
   57|  1.36M|  }
   58|  1.36M|}

_ZN8simdjson3dom5arrayC2ERKNS_8internal8tape_refE:
   66|  18.2k|simdjson_inline array::array(const internal::tape_ref &_tape) noexcept : tape{_tape} {}
_ZN8simdjson15simdjson_resultINS_3dom5arrayEEC2ES2_:
   23|  18.2k|    : internal::simdjson_result_base<dom::array>(std::forward<dom::array>(value)) {}
_ZNK8simdjson3dom5array5beginEv:
   67|  18.2k|inline array::iterator array::begin() const noexcept {
   68|  18.2k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  18.2k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   69|  18.2k|  return internal::tape_ref(tape.doc, tape.json_index + 1);
   70|  18.2k|}
_ZN8simdjson3dom5array8iteratorC2ERKNS_8internal8tape_refE:
  147|  36.5k|simdjson_inline array::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom5array3endEv:
   71|  18.2k|inline array::iterator array::end() const noexcept {
   72|  18.2k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  18.2k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   73|  18.2k|  return internal::tape_ref(tape.doc, tape.after_element() - 1);
   74|  18.2k|}
_ZNK8simdjson3dom5array8iteratorneERKS2_:
  160|  1.10M|inline bool array::iterator::operator!=(const array::iterator& other) const noexcept {
  161|  1.10M|  return tape.json_index != other.tape.json_index;
  162|  1.10M|}
_ZNK8simdjson3dom5array8iteratordeEv:
  148|  1.08M|inline element array::iterator::operator*() const noexcept {
  149|  1.08M|  return element(tape);
  150|  1.08M|}
_ZN8simdjson3dom5array8iteratorppEv:
  151|  1.08M|inline array::iterator& array::iterator::operator++() noexcept {
  152|  1.08M|  tape.json_index = tape.after_element();
  153|  1.08M|  return *this;
  154|  1.08M|}

_ZNK8simdjson3dom8document8capacityEv:
   24|  8.75k|inline size_t document::capacity() const noexcept {
   25|  8.75k|  return allocated_capacity;
   26|  8.75k|}
_ZN8simdjson3dom8document8allocateEm:
   29|  8.75k|inline error_code document::allocate(size_t capacity) noexcept {
   30|  8.75k|  if (capacity == 0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 8.75k]
  ------------------
   31|      0|    string_buf.reset();
   32|      0|    tape.reset();
   33|      0|    allocated_capacity = 0;
   34|      0|    return SUCCESS;
   35|      0|  }
   36|       |
   37|       |  // a pathological input like "[[[[..." would generate capacity tape elements, so
   38|       |  // need a capacity of at least capacity + 1, but it is also possible to do
   39|       |  // worse with "[7,7,7,7,6,7,7,7,6,7,7,6,[7,7,7,7,6,7,7,7,6,7,7,6,7,7,7,7,7,7,6"
   40|       |  //where capacity + 1 tape elements are
   41|       |  // generated, see issue https://github.com/simdjson/simdjson/issues/345
   42|  8.75k|  size_t tape_capacity = SIMDJSON_ROUNDUP_N(capacity + 3, 64);
  ------------------
  |  |   47|  8.75k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   43|       |  // a document with only zero-length strings... could have capacity/3 string
   44|       |  // and we would need capacity/3 * 5 bytes on the string buffer
   45|  8.75k|  size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * capacity / 3 + SIMDJSON_PADDING, 64);
  ------------------
  |  |   47|  8.75k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   46|  8.75k|  string_buf.reset( new (std::nothrow) uint8_t[string_capacity]);
   47|  8.75k|  tape.reset(new (std::nothrow) uint64_t[tape_capacity]);
   48|  8.75k|  if(!(string_buf && tape)) {
  ------------------
  |  Branch (48:8): [True: 8.75k, False: 0]
  |  Branch (48:22): [True: 8.75k, False: 0]
  ------------------
   49|      0|    allocated_capacity = 0;
   50|      0|    string_buf.reset();
   51|      0|    tape.reset();
   52|      0|    return MEMALLOC;
   53|      0|  }
   54|       |  // Technically the allocated_capacity might be larger than capacity
   55|       |  // so the next line is pessimistic.
   56|  8.75k|  allocated_capacity = capacity;
   57|  8.75k|  return SUCCESS;
   58|  8.75k|}
_ZNK8simdjson3dom8document4rootEv:
   20|  4.39k|inline element document::root() const noexcept {
   21|  4.39k|  return element(internal::tape_ref(this, 1));
   22|  4.39k|}

_ZN8simdjson3dom8documentC2Ev:
   23|  8.75k|  document() noexcept = default;
_ZN8simdjson3dom8documentD2Ev:
   24|  8.75k|  ~document() noexcept = default;

_ZN8simdjson3dom7elementC2Ev:
  197|  13.1k|simdjson_inline element::element() noexcept : tape{} {}
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2ENS_10error_codeE:
   27|  4.36k|    : internal::simdjson_result_base<dom::element>(error) {}
_ZN8simdjson3dom7elementC2ERKNS_8internal8tape_refE:
  198|  1.36M|simdjson_inline element::element(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2EOS2_:
   25|  4.39k|    : internal::simdjson_result_base<dom::element>(std::forward<dom::element>(value)) {}
_ZNK8simdjson3dom7element4typeEv:
  200|  1.36M|inline element_type element::type() const noexcept {
  201|  1.36M|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  1.36M|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  202|  1.36M|  auto tape_type = tape.tape_ref_type();
  203|  1.36M|  return tape_type == internal::tape_type::FALSE_VALUE ? element_type::BOOL : static_cast<element_type>(tape_type);
  ------------------
  |  Branch (203:10): [True: 394, False: 1.36M]
  ------------------
  204|  1.36M|}
_ZNK8simdjson3dom7element9get_arrayEv:
  295|  18.2k|inline simdjson_result<array> element::get_array() const noexcept {
  296|  18.2k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  18.2k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  297|  18.2k|  switch (tape.tape_ref_type()) {
  298|  18.2k|    case internal::tape_type::START_ARRAY:
  ------------------
  |  Branch (298:5): [True: 18.2k, False: 0]
  ------------------
  299|  18.2k|      return array(tape);
  300|      0|    default:
  ------------------
  |  Branch (300:5): [True: 0, False: 18.2k]
  ------------------
  301|      0|      return INCORRECT_TYPE;
  302|  18.2k|  }
  303|  18.2k|}
_ZNK8simdjson3dom7element10get_objectEv:
  304|  4.01k|inline simdjson_result<object> element::get_object() const noexcept {
  305|  4.01k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  4.01k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  306|  4.01k|  switch (tape.tape_ref_type()) {
  307|  4.01k|    case internal::tape_type::START_OBJECT:
  ------------------
  |  Branch (307:5): [True: 4.01k, False: 0]
  ------------------
  308|  4.01k|      return object(tape);
  309|      0|    default:
  ------------------
  |  Branch (309:5): [True: 0, False: 4.01k]
  ------------------
  310|      0|      return INCORRECT_TYPE;
  311|  4.01k|  }
  312|  4.01k|}
_ZNK8simdjson3dom7element9get_int64Ev:
  258|  1.30M|inline simdjson_result<int64_t> element::get_int64() const noexcept {
  259|  1.30M|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  1.30M|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  260|  1.30M|  if(simdjson_unlikely(!tape.is_int64())) { // branch rarely taken
  ------------------
  |  |  106|  1.30M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 1.30M]
  |  |  ------------------
  ------------------
  261|      0|    if(tape.is_uint64()) {
  ------------------
  |  Branch (261:8): [True: 0, False: 0]
  ------------------
  262|      0|      uint64_t result = tape.next_tape_value<uint64_t>();
  263|       |      // Wrapping max in parens to handle Windows issue: https://stackoverflow.com/questions/11544073/how-do-i-deal-with-the-max-macro-in-windows-h-colliding-with-max-in-std
  264|      0|      if (result > uint64_t((std::numeric_limits<int64_t>::max)())) {
  ------------------
  |  Branch (264:11): [True: 0, False: 0]
  ------------------
  265|      0|        return NUMBER_OUT_OF_RANGE;
  266|      0|      }
  267|      0|      return static_cast<int64_t>(result);
  268|      0|    }
  269|      0|    return INCORRECT_TYPE;
  270|      0|  }
  271|  1.30M|  return tape.next_tape_value<int64_t>();
  272|  1.30M|}
_ZNK8simdjson3dom7element10get_uint64Ev:
  244|  1.55k|inline simdjson_result<uint64_t> element::get_uint64() const noexcept {
  245|  1.55k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  1.55k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  246|  1.55k|  if(simdjson_unlikely(!tape.is_uint64())) { // branch rarely taken
  ------------------
  |  |  106|  1.55k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 1.55k]
  |  |  ------------------
  ------------------
  247|      0|    if(tape.is_int64()) {
  ------------------
  |  Branch (247:8): [True: 0, False: 0]
  ------------------
  248|      0|      int64_t result = tape.next_tape_value<int64_t>();
  249|      0|      if (result < 0) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        return NUMBER_OUT_OF_RANGE;
  251|      0|      }
  252|      0|      return uint64_t(result);
  253|      0|    }
  254|      0|    return INCORRECT_TYPE;
  255|      0|  }
  256|  1.55k|  return tape.next_tape_value<int64_t>();
  257|  1.55k|}
_ZNK8simdjson3dom7element10get_doubleEv:
  273|  17.0k|inline simdjson_result<double> element::get_double() const noexcept {
  274|  17.0k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  17.0k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|       |  // Performance considerations:
  276|       |  // 1. Querying tape_ref_type() implies doing a shift, it is fast to just do a straight
  277|       |  //   comparison.
  278|       |  // 2. Using a switch-case relies on the compiler guessing what kind of code generation
  279|       |  //    we want... But the compiler cannot know that we expect the type to be "double"
  280|       |  //    most of the time.
  281|       |  // We can expect get<double> to refer to a double type almost all the time.
  282|       |  // It is important to craft the code accordingly so that the compiler can use this
  283|       |  // information. (This could also be solved with profile-guided optimization.)
  284|  17.0k|  if(simdjson_unlikely(!tape.is_double())) { // branch rarely taken
  ------------------
  |  |  106|  17.0k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 17.0k]
  |  |  ------------------
  ------------------
  285|      0|    if(tape.is_uint64()) {
  ------------------
  |  Branch (285:8): [True: 0, False: 0]
  ------------------
  286|      0|      return double(tape.next_tape_value<uint64_t>());
  287|      0|    } else if(tape.is_int64()) {
  ------------------
  |  Branch (287:15): [True: 0, False: 0]
  ------------------
  288|      0|      return double(tape.next_tape_value<int64_t>());
  289|      0|    }
  290|      0|    return INCORRECT_TYPE;
  291|      0|  }
  292|       |  // this is common:
  293|  17.0k|  return tape.next_tape_value<double>();
  294|  17.0k|}
_ZNK8simdjson3dom7element10get_stringEv:
  235|  11.4k|inline simdjson_result<std::string_view> element::get_string() const noexcept {
  236|  11.4k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  11.4k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  237|  11.4k|  switch (tape.tape_ref_type()) {
  238|  11.4k|    case internal::tape_type::STRING:
  ------------------
  |  Branch (238:5): [True: 11.4k, False: 0]
  ------------------
  239|  11.4k|      return tape.get_string_view();
  240|      0|    default:
  ------------------
  |  Branch (240:5): [True: 0, False: 11.4k]
  ------------------
  241|      0|      return INCORRECT_TYPE;
  242|  11.4k|  }
  243|  11.4k|}
_ZNK8simdjson3dom7element8get_boolEv:
  206|    783|inline simdjson_result<bool> element::get_bool() const noexcept {
  207|    783|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|    783|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  208|    783|  if(tape.is_true()) {
  ------------------
  |  Branch (208:6): [True: 389, False: 394]
  ------------------
  209|    389|    return true;
  210|    394|  } else if(tape.is_false()) {
  ------------------
  |  Branch (210:13): [True: 394, False: 0]
  ------------------
  211|    394|    return false;
  212|    394|  }
  213|      0|  return INCORRECT_TYPE;
  214|    783|}
_ZNK8simdjson15simdjson_resultINS_3dom7elementEE3getIS2_EENS_10error_codeERT_:
   43|  8.75k|simdjson_warn_unused simdjson_inline error_code simdjson_result<dom::element>::get(T &value) const noexcept {
   44|  8.75k|  if (error()) { return error(); }
  ------------------
  |  Branch (44:7): [True: 4.36k, False: 4.39k]
  ------------------
   45|  4.39k|  return first.get<T>(value);
   46|  8.75k|}
_ZNK8simdjson3dom7element3getIS1_EENS_10error_codeERT_:
  320|  4.39k|simdjson_warn_unused simdjson_inline error_code element::get<element>(element &value) const noexcept {
  321|  4.39k|  value = element(tape);
  322|  4.39k|  return SUCCESS;
  323|  4.39k|}

_ZN8simdjson3dom6objectC2ERKNS_8internal8tape_refE:
   75|  4.01k|simdjson_inline object::object(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZN8simdjson15simdjson_resultINS_3dom6objectEEC2ES2_:
   22|  4.01k|    : internal::simdjson_result_base<dom::object>(std::forward<dom::object>(value)) {}
_ZNK8simdjson3dom6object5beginEv:
   76|  4.01k|inline object::iterator object::begin() const noexcept {
   77|  4.01k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  4.01k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   78|  4.01k|  return internal::tape_ref(tape.doc, tape.json_index + 1);
   79|  4.01k|}
_ZN8simdjson3dom6object8iteratorC2ERKNS_8internal8tape_refE:
  175|  8.02k|simdjson_inline object::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom6object3endEv:
   80|  4.01k|inline object::iterator object::end() const noexcept {
   81|  4.01k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  4.01k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   82|  4.01k|  return internal::tape_ref(tape.doc, tape.after_element() - 1);
   83|  4.01k|}
_ZNK8simdjson3dom6object8iteratorneERKS2_:
  179|   275k|inline bool object::iterator::operator!=(const object::iterator& other) const noexcept {
  180|   275k|  return tape.json_index != other.tape.json_index;
  181|   275k|}
_ZNK8simdjson3dom6object8iteratordeEv:
  176|   271k|inline const key_value_pair object::iterator::operator*() const noexcept {
  177|   271k|  return key_value_pair(key(), value());
  178|   271k|}
_ZNK8simdjson3dom6object8iterator3keyEv:
  207|   271k|inline std::string_view object::iterator::key() const noexcept {
  208|   271k|  return tape.get_string_view();
  209|   271k|}
_ZNK8simdjson3dom6object8iterator5valueEv:
  216|   271k|inline element object::iterator::value() const noexcept {
  217|   271k|  return element(internal::tape_ref(tape.doc, tape.json_index + 1));
  218|   271k|}
_ZN8simdjson3dom14key_value_pairC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS0_7elementE:
  260|   271k|  key(_key), value(_value) {}
_ZN8simdjson3dom6object8iteratorppEv:
  197|   271k|inline object::iterator& object::iterator::operator++() noexcept {
  198|   271k|  tape.json_index++;
  199|   271k|  tape.json_index = tape.after_element();
  200|   271k|  return *this;
  201|   271k|}

_ZN8simdjson3dom6parserC2Em:
   24|  8.75k|  : _max_capacity{max_capacity},
   25|  8.75k|    loaded_bytes(nullptr) {
   26|  8.75k|}
_ZNR8simdjson3dom6parser5parseEPKhmb:
  153|  8.75k|inline simdjson_result<element> parser::parse(const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept {
  154|  8.75k|  return parse_into_document(doc, buf, len, realloc_if_needed);
  155|  8.75k|}
_ZNR8simdjson3dom6parser19parse_into_documentERNS0_8documentEPKhmb:
  113|  8.75k|inline simdjson_result<element> parser::parse_into_document(document& provided_doc, const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept {
  114|       |  // Important: we need to ensure that document has enough capacity.
  115|       |  // Important: It is possible that provided_doc is actually the internal 'doc' within the parser!!!
  116|  8.75k|  error_code _error = ensure_capacity(provided_doc, len);
  117|  8.75k|  if (_error) { return _error; }
  ------------------
  |  Branch (117:7): [True: 0, False: 8.75k]
  ------------------
  118|  8.75k|  if (realloc_if_needed) {
  ------------------
  |  Branch (118:7): [True: 8.75k, False: 0]
  ------------------
  119|       |    // Make sure we have enough capacity to copy len bytes
  120|  8.75k|    if (!loaded_bytes || _loaded_bytes_capacity < len) {
  ------------------
  |  Branch (120:9): [True: 8.75k, False: 0]
  |  Branch (120:26): [True: 0, False: 0]
  ------------------
  121|  8.75k|      loaded_bytes.reset( internal::allocate_padded_buffer(len) );
  122|  8.75k|      if (!loaded_bytes) {
  ------------------
  |  Branch (122:11): [True: 9, False: 8.74k]
  ------------------
  123|      9|        return MEMALLOC;
  124|      9|      }
  125|  8.74k|      _loaded_bytes_capacity = len;
  126|  8.74k|    }
  127|  8.74k|    std::memcpy(static_cast<void *>(loaded_bytes.get()), buf, len);
  128|  8.74k|    buf = reinterpret_cast<const uint8_t*>(loaded_bytes.get());
  129|  8.74k|  }
  130|       |
  131|  8.74k|  if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) {
  ------------------
  |  Branch (131:6): [True: 8.67k, False: 72]
  |  Branch (131:20): [True: 16, False: 8.66k]
  ------------------
  132|     16|    buf += 3;
  133|     16|    len -= 3;
  134|     16|  }
  135|  8.74k|  _error = implementation->parse(buf, len, provided_doc);
  136|       |
  137|  8.74k|  if (_error) { return _error; }
  ------------------
  |  Branch (137:7): [True: 4.35k, False: 4.39k]
  ------------------
  138|       |
  139|  4.39k|  return provided_doc.root();
  140|  8.74k|}
_ZN8simdjson3dom6parser15ensure_capacityERNS0_8documentEm:
  225|  8.75k|inline error_code parser::ensure_capacity(document& target_document, size_t desired_capacity) noexcept {
  226|       |  // 1. It is wasteful to allocate a document and a parser for documents spanning less than MINIMAL_DOCUMENT_CAPACITY bytes.
  227|       |  // 2. If we allow desired_capacity = 0 then it is possible to exit this function with implementation == nullptr.
  228|  8.75k|  if(desired_capacity < MINIMAL_DOCUMENT_CAPACITY) { desired_capacity = MINIMAL_DOCUMENT_CAPACITY; }
  ------------------
  |  Branch (228:6): [True: 5.97k, False: 2.78k]
  ------------------
  229|       |  // If we don't have enough capacity, (try to) automatically bump it.
  230|       |  // If the document needs allocation, do it too.
  231|       |  // Both in one if statement to minimize unlikely branching.
  232|       |  //
  233|       |  // Note: we must make sure that this function is called if capacity() == 0. We do so because we
  234|       |  // ensure that desired_capacity > 0.
  235|  8.75k|  if (simdjson_unlikely(capacity() < desired_capacity || target_document.capacity() < desired_capacity)) {
  ------------------
  |  |  106|  8.75k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 8.75k, False: 0]
  |  |  |  Branch (106:52): [True: 8.75k, False: 0]
  |  |  |  Branch (106:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  236|  8.75k|    if (desired_capacity > max_capacity()) {
  ------------------
  |  Branch (236:9): [True: 0, False: 8.75k]
  ------------------
  237|      0|      return error = CAPACITY;
  238|      0|    }
  239|  8.75k|    error_code err1 = target_document.capacity() < desired_capacity ? target_document.allocate(desired_capacity) : SUCCESS;
  ------------------
  |  Branch (239:23): [True: 8.75k, False: 0]
  ------------------
  240|  8.75k|    error_code err2 = capacity() < desired_capacity ? allocate(desired_capacity, max_depth()) : SUCCESS;
  ------------------
  |  Branch (240:23): [True: 8.75k, False: 0]
  ------------------
  241|  8.75k|    if(err1 != SUCCESS) { return error = err1; }
  ------------------
  |  Branch (241:8): [True: 0, False: 8.75k]
  ------------------
  242|  8.75k|    if(err2 != SUCCESS) { return error = err2; }
  ------------------
  |  Branch (242:8): [True: 0, False: 8.75k]
  ------------------
  243|  8.75k|  }
  244|  8.75k|  return SUCCESS;
  245|  8.75k|}
_ZNK8simdjson3dom6parser8capacityEv:
  188|  17.5k|simdjson_inline size_t parser::capacity() const noexcept {
  189|  17.5k|  return implementation ? implementation->capacity() : 0;
  ------------------
  |  Branch (189:10): [True: 0, False: 17.5k]
  ------------------
  190|  17.5k|}
_ZNK8simdjson3dom6parser12max_capacityEv:
  191|  8.75k|simdjson_inline size_t parser::max_capacity() const noexcept {
  192|  8.75k|  return _max_capacity;
  193|  8.75k|}
_ZN8simdjson3dom6parser8allocateEmm:
  199|  8.75k|inline error_code parser::allocate(size_t capacity, size_t max_depth) noexcept {
  200|       |  //
  201|       |  // Reallocate implementation if needed
  202|       |  //
  203|  8.75k|  error_code err;
  204|  8.75k|  if (implementation) {
  ------------------
  |  Branch (204:7): [True: 0, False: 8.75k]
  ------------------
  205|      0|    err = implementation->allocate(capacity, max_depth);
  206|  8.75k|  } else {
  207|  8.75k|    err = simdjson::get_active_implementation()->create_dom_parser_implementation(capacity, max_depth, implementation);
  208|  8.75k|  }
  209|  8.75k|  if (err) { return err; }
  ------------------
  |  Branch (209:7): [True: 0, False: 8.75k]
  ------------------
  210|  8.75k|  return SUCCESS;
  211|  8.75k|}
_ZNK8simdjson3dom6parser9max_depthEv:
  194|  8.75k|simdjson_pure simdjson_inline size_t parser::max_depth() const noexcept {
  195|  8.75k|  return implementation ? implementation->max_depth() : DEFAULT_MAX_DEPTH;
  ------------------
  |  Branch (195:10): [True: 0, False: 8.75k]
  ------------------
  196|  8.75k|}

_ZN8simdjson3dom6parserD2Ev:
   60|  8.75k|  ~parser()=default;

_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2ENS_10error_codeE:
  111|  4.36k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_NS_10error_codeE:
  108|  8.75k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_:
  114|  4.39k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom5arrayEEC2EOS3_:
  114|  18.2k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom5arrayEEC2EOS3_NS_10error_codeE:
  108|  18.2k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZNO8simdjson8internal20simdjson_result_baseINS_3dom5arrayEE12value_unsafeEv:
  102|  18.2k|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|  18.2k|  return std::forward<T>(this->first);
  104|  18.2k|}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom6objectEEC2EOS3_:
  114|  4.01k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom6objectEEC2EOS3_NS_10error_codeE:
  108|  4.01k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZNO8simdjson8internal20simdjson_result_baseINS_3dom6objectEE12value_unsafeEv:
  102|  4.01k|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|  4.01k|  return std::forward<T>(this->first);
  104|  4.01k|}
_ZN8simdjson8internal20simdjson_result_baseIlEC2EOlNS_10error_codeE:
  108|  1.30M|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIlEC2EOl:
  199|  1.30M|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIlEC2EOl:
  114|  1.30M|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNO8simdjson15simdjson_resultIlE12value_unsafeEv:
  187|  1.30M|simdjson_inline T&& simdjson_result<T>::value_unsafe() && noexcept {
  188|  1.30M|  return std::forward<internal::simdjson_result_base<T>>(*this).value_unsafe();
  189|  1.30M|}
_ZNO8simdjson8internal20simdjson_result_baseIlE12value_unsafeEv:
  102|  1.30M|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|  1.30M|  return std::forward<T>(this->first);
  104|  1.30M|}
_ZN8simdjson8internal20simdjson_result_baseImEC2EOmNS_10error_codeE:
  108|  1.55k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultImEC2EOm:
  199|  1.55k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseImEC2EOm:
  114|  1.55k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNO8simdjson15simdjson_resultImE12value_unsafeEv:
  187|  1.55k|simdjson_inline T&& simdjson_result<T>::value_unsafe() && noexcept {
  188|  1.55k|  return std::forward<internal::simdjson_result_base<T>>(*this).value_unsafe();
  189|  1.55k|}
_ZNO8simdjson8internal20simdjson_result_baseImE12value_unsafeEv:
  102|  1.55k|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|  1.55k|  return std::forward<T>(this->first);
  104|  1.55k|}
_ZN8simdjson15simdjson_resultIdEC2EOd:
  199|  17.0k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2EOd:
  114|  17.0k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseIdEC2EOdNS_10error_codeE:
  108|  17.0k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZNO8simdjson15simdjson_resultIdE12value_unsafeEv:
  187|  17.0k|simdjson_inline T&& simdjson_result<T>::value_unsafe() && noexcept {
  188|  17.0k|  return std::forward<internal::simdjson_result_base<T>>(*this).value_unsafe();
  189|  17.0k|}
_ZNO8simdjson8internal20simdjson_result_baseIdE12value_unsafeEv:
  102|  17.0k|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|  17.0k|  return std::forward<T>(this->first);
  104|  17.0k|}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2EOS5_:
  199|  11.4k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_:
  114|  11.4k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_NS_10error_codeE:
  108|  11.4k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZNO8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEE12value_unsafeEv:
  187|  11.4k|simdjson_inline T&& simdjson_result<T>::value_unsafe() && noexcept {
  188|  11.4k|  return std::forward<internal::simdjson_result_base<T>>(*this).value_unsafe();
  189|  11.4k|}
_ZNO8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEE12value_unsafeEv:
  102|  11.4k|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|  11.4k|  return std::forward<T>(this->first);
  104|  11.4k|}
_ZN8simdjson15simdjson_resultIbEC2EOb:
  199|    783|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EOb:
  114|    783|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EObNS_10error_codeE:
  108|    783|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZNO8simdjson15simdjson_resultIbE12value_unsafeEv:
  187|    783|simdjson_inline T&& simdjson_result<T>::value_unsafe() && noexcept {
  188|    783|  return std::forward<internal::simdjson_result_base<T>>(*this).value_unsafe();
  189|    783|}
_ZNO8simdjson8internal20simdjson_result_baseIbE12value_unsafeEv:
  102|    783|simdjson_inline T&& simdjson_result_base<T>::value_unsafe() && noexcept {
  103|    783|  return std::forward<T>(this->first);
  104|    783|}
_ZNK8simdjson8internal20simdjson_result_baseINS_3dom7elementEE5errorEv:
   66|  13.1k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   67|  13.1k|  return this->second;
   68|  13.1k|}

_ZN8simdjson8fallback14implementationC2Ev:
   17|      1|  simdjson_inline implementation() : simdjson::implementation(
   18|      1|      "fallback",
   19|      1|      "Generic fallback implementation",
   20|      1|      0
   21|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_true_atomEPKhm:
   42|     57|simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) {
   43|     57|  if (len > 4) { return is_valid_true_atom(src); }
  ------------------
  |  Branch (43:7): [True: 21, False: 36]
  ------------------
   44|     36|  else if (len == 4) { return !str4ncmp(src, "true"); }
  ------------------
  |  Branch (44:12): [True: 33, False: 3]
  ------------------
   45|      3|  else { return false; }
   46|     57|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_true_atomEPKh:
   37|    490|simdjson_inline bool is_valid_true_atom(const uint8_t *src) {
   38|    490|  return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0;
   39|    490|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing8str4ncmpEPKhPKc:
   29|  1.62k|simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) {
   30|  1.62k|  uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++)
   31|  1.62k|  static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes");
   32|  1.62k|  std::memcpy(&srcval, src, sizeof(uint32_t));
   33|  1.62k|  return srcval ^ string_to_uint32(atom);
   34|  1.62k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing16string_to_uint32EPKc:
   23|  1.62k|simdjson_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing19is_valid_false_atomEPKhm:
   54|     99|simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) {
   55|     99|  if (len > 5) { return is_valid_false_atom(src); }
  ------------------
  |  Branch (55:7): [True: 46, False: 53]
  ------------------
   56|     53|  else if (len == 5) { return !str4ncmp(src+1, "alse"); }
  ------------------
  |  Branch (56:12): [True: 49, False: 4]
  ------------------
   57|      4|  else { return false; }
   58|     99|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing19is_valid_false_atomEPKh:
   49|    544|simdjson_inline bool is_valid_false_atom(const uint8_t *src) {
   50|    544|  return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0;
   51|    544|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_null_atomEPKhm:
   66|     42|simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) {
   67|     42|  if (len > 4) { return is_valid_null_atom(src); }
  ------------------
  |  Branch (67:7): [True: 3, False: 39]
  ------------------
   68|     39|  else if (len == 4) { return !str4ncmp(src, "null"); }
  ------------------
  |  Branch (68:12): [True: 36, False: 3]
  ------------------
   69|      3|  else { return false; }
   70|     42|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_null_atomEPKh:
   61|    474|simdjson_inline bool is_valid_null_atom(const uint8_t *src) {
   62|    474|  return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0;
   63|    474|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils18hex_to_u32_nocheckEPKh:
   32|  7.49k|    const uint8_t *src) { // strictly speaking, static inline is a C-ism
   33|  7.49k|  uint32_t v1 = internal::digit_to_val32[630 + src[0]];
   34|  7.49k|  uint32_t v2 = internal::digit_to_val32[420 + src[1]];
   35|  7.49k|  uint32_t v3 = internal::digit_to_val32[210 + src[2]];
   36|  7.49k|  uint32_t v4 = internal::digit_to_val32[0 + src[3]];
   37|  7.49k|  return v1 | v2 | v3 | v4;
   38|  7.49k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils17codepoint_to_utf8EjPh:
   52|  5.68k|simdjson_inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) {
   53|  5.68k|  if (cp <= 0x7F) {
  ------------------
  |  Branch (53:7): [True: 1.09k, False: 4.59k]
  ------------------
   54|  1.09k|    c[0] = uint8_t(cp);
   55|  1.09k|    return 1; // ascii
   56|  1.09k|  }
   57|  4.59k|  if (cp <= 0x7FF) {
  ------------------
  |  Branch (57:7): [True: 1.09k, False: 3.49k]
  ------------------
   58|  1.09k|    c[0] = uint8_t((cp >> 6) + 192);
   59|  1.09k|    c[1] = uint8_t((cp & 63) + 128);
   60|  1.09k|    return 2; // universal plane
   61|       |    //  Surrogates are treated elsewhere...
   62|       |    //} //else if (0xd800 <= cp && cp <= 0xdfff) {
   63|       |    //  return 0; // surrogates // could put assert here
   64|  3.49k|  } else if (cp <= 0xFFFF) {
  ------------------
  |  Branch (64:14): [True: 2.05k, False: 1.44k]
  ------------------
   65|  2.05k|    c[0] = uint8_t((cp >> 12) + 224);
   66|  2.05k|    c[1] = uint8_t(((cp >> 6) & 63) + 128);
   67|  2.05k|    c[2] = uint8_t((cp & 63) + 128);
   68|  2.05k|    return 3;
   69|  2.05k|  } else if (cp <= 0x10FFFF) { // if you know you have a valid code point, this
  ------------------
  |  Branch (69:14): [True: 1.39k, False: 52]
  ------------------
   70|       |                               // is not needed
   71|  1.39k|    c[0] = uint8_t((cp >> 18) + 240);
   72|  1.39k|    c[1] = uint8_t(((cp >> 12) & 63) + 128);
   73|  1.39k|    c[2] = uint8_t(((cp >> 6) & 63) + 128);
   74|  1.39k|    c[3] = uint8_t((cp & 63) + 128);
   75|  1.39k|    return 4;
   76|  1.39k|  }
   77|       |  // will return 0 when the code point was too large.
   78|     52|  return 0; // bad r
   79|  4.59k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113jsoncharutils31is_not_structural_or_whitespaceEh:
   17|  1.33M|simdjson_inline uint32_t is_not_structural_or_whitespace(uint8_t c) {
   18|  1.33M|  return internal::structural_or_whitespace_negated[c];
   19|  1.33M|}

simdjson.cpp:_ZN8simdjson7haswell13numberparsing12parse_numberINS0_12_GLOBAL__N_16stage211tape_writerEEENS_10error_codeEPKhRT_:
  576|  1.33M|simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
  577|       |  //
  578|       |  // Check for minus sign
  579|       |  //
  580|  1.33M|  bool negative = (*src == '-');
  581|  1.33M|  const uint8_t *p = src + uint8_t(negative);
  582|       |
  583|       |  //
  584|       |  // Parse the integer part.
  585|       |  //
  586|       |  // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare
  587|  1.33M|  const uint8_t *const start_digits = p;
  588|  1.33M|  uint64_t i = 0;
  589|  21.8M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (589:10): [True: 20.5M, False: 1.33M]
  ------------------
  590|       |
  591|       |  // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error.
  592|       |  // Optimization note: size_t is expected to be unsigned.
  593|  1.33M|  size_t digit_count = size_t(p - start_digits);
  594|  1.33M|  if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   25|     81|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (594:7): [True: 45, False: 1.33M]
  |  Branch (594:28): [True: 18.2k, False: 1.31M]
  |  Branch (594:52): [True: 36, False: 18.2k]
  ------------------
  595|       |
  596|       |  //
  597|       |  // Handle floats if there is a . or e (or both)
  598|       |  //
  599|  1.33M|  int64_t exponent = 0;
  600|  1.33M|  bool is_float = false;
  601|  1.33M|  if ('.' == *p) {
  ------------------
  |  Branch (601:7): [True: 9.28k, False: 1.32M]
  ------------------
  602|  9.28k|    is_float = true;
  603|  9.28k|    ++p;
  604|  9.28k|    SIMDJSON_TRY( parse_decimal_after_separator(src, p, i, exponent) );
  ------------------
  |  |  273|  9.28k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 174, False: 9.10k]
  |  |  ------------------
  ------------------
  605|  9.10k|    digit_count = int(p - start_digits); // used later to guard against overflows
  606|  9.10k|  }
  607|  1.33M|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (607:7): [True: 8.13k, False: 1.32M]
  |  Branch (607:22): [True: 7.26k, False: 1.31M]
  ------------------
  608|  15.4k|    is_float = true;
  609|  15.4k|    ++p;
  610|  15.4k|    SIMDJSON_TRY( parse_exponent(src, p, exponent) );
  ------------------
  |  |  273|  15.4k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 107, False: 15.2k]
  |  |  ------------------
  ------------------
  611|  15.2k|  }
  612|  1.33M|  if (is_float) {
  ------------------
  |  Branch (612:7): [True: 23.2k, False: 1.31M]
  ------------------
  613|  23.2k|    const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p);
  614|  23.2k|    SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) );
  ------------------
  |  |  273|  23.2k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 686, False: 22.6k]
  |  |  ------------------
  ------------------
  615|  22.6k|    if (dirty_end) { return INVALID_NUMBER(src); }
  ------------------
  |  |   25|    197|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (615:9): [True: 197, False: 22.4k]
  ------------------
  616|  22.4k|    return SUCCESS;
  617|  22.6k|  }
  618|       |
  619|       |  // The longest negative 64-bit number is 19 digits.
  620|       |  // The longest positive 64-bit number is 20 digits.
  621|       |  // We do it this way so we don't trigger this branch unless we must.
  622|  1.31M|  size_t longest_digit_count = negative ? 19 : 20;
  ------------------
  |  Branch (622:32): [True: 2.27k, False: 1.30M]
  ------------------
  623|  1.31M|  if (digit_count > longest_digit_count) { return BIGINT_NUMBER(src); }
  ------------------
  |  |   29|     69|#define BIGINT_NUMBER(SRC) (BIGINT_ERROR)
  ------------------
  |  Branch (623:7): [True: 69, False: 1.31M]
  ------------------
  624|  1.31M|  if (digit_count == longest_digit_count) {
  ------------------
  |  Branch (624:7): [True: 2.13k, False: 1.30M]
  ------------------
  625|  2.13k|    if (negative) {
  ------------------
  |  Branch (625:9): [True: 658, False: 1.47k]
  ------------------
  626|       |      // Anything negative above INT64_MAX+1 is invalid
  627|    658|      if (i > uint64_t(INT64_MAX)+1) { return BIGINT_NUMBER(src);  }
  ------------------
  |  |   29|     51|#define BIGINT_NUMBER(SRC) (BIGINT_ERROR)
  ------------------
  |  Branch (627:11): [True: 51, False: 607]
  ------------------
  628|    607|      WRITE_INTEGER(~i+1, src, writer);
  ------------------
  |  |   26|    607|#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE))
  ------------------
  629|    607|      if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   25|      4|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (629:11): [True: 4, False: 603]
  ------------------
  630|    603|      return SUCCESS;
  631|       |    // Positive overflow check:
  632|       |    // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the
  633|       |    //   biggest uint64_t.
  634|       |    // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX.
  635|       |    //   If we got here, it's a 20 digit number starting with the digit "1".
  636|       |    // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller
  637|       |    //   than 1,553,255,926,290,448,384.
  638|       |    // - That is smaller than the smallest possible 20-digit number the user could write:
  639|       |    //   10,000,000,000,000,000,000.
  640|       |    // - Therefore, if the number is positive and lower than that, it's overflow.
  641|       |    // - The value we are looking at is less than or equal to INT64_MAX.
  642|       |    //
  643|  1.47k|    }  else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   25|     74|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (643:17): [True: 8, False: 1.46k]
  |  Branch (643:43): [True: 66, False: 1.40k]
  ------------------
  644|  2.13k|  }
  645|       |
  646|       |  // Write unsigned if it does not fit in a signed integer.
  647|  1.30M|  if (i > uint64_t(INT64_MAX)) {
  ------------------
  |  Branch (647:7): [True: 1.57k, False: 1.30M]
  ------------------
  648|  1.57k|    WRITE_UNSIGNED(i, src, writer);
  ------------------
  |  |   27|  1.57k|#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE))
  ------------------
  649|  1.30M|  } else {
  650|       |#if SIMDJSON_MINUS_ZERO_AS_FLOAT
  651|       |    if(i == 0 && negative) {
  652|       |      // We have to write -0.0 instead of 0
  653|       |      WRITE_DOUBLE(-0.0, src, writer);
  654|       |    } else {
  655|       |      WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
  656|       |    }
  657|       |#else
  658|  1.30M|  WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
  ------------------
  |  |   26|  2.61M|#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE))
  |  |  ------------------
  |  |  |  Branch (26:64): [True: 1.60k, False: 1.30M]
  |  |  ------------------
  ------------------
  659|  1.30M|#endif
  660|  1.30M|  }
  661|  1.30M|  if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   25|     70|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (661:7): [True: 70, False: 1.30M]
  ------------------
  662|  1.30M|  return SUCCESS;
  663|  1.30M|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_111parse_digitImEEbhRT_:
  350|  25.2M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  351|  25.2M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  352|  25.2M|  if (digit > 9) {
  ------------------
  |  Branch (352:7): [True: 1.34M, False: 23.8M]
  ------------------
  353|  1.34M|    return false;
  354|  1.34M|  }
  355|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  356|  23.8M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  357|  23.8M|  return true;
  358|  25.2M|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_129parse_decimal_after_separatorEPKhRS4_RmRl:
  364|  9.28k|simdjson_inline error_code parse_decimal_after_separator(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) {
  365|       |  // we continue with the fiction that we have an integer. If the
  366|       |  // floating point number is representable as x * 10^z for some integer
  367|       |  // z that fits in 53 bits, then we will be able to convert back the
  368|       |  // the integer into a float in a lossless manner.
  369|  9.28k|  const uint8_t *const first_after_period = p;
  370|       |
  371|  9.28k|#ifdef SIMDJSON_SWAR_NUMBER_PARSING
  372|  9.28k|#if SIMDJSON_SWAR_NUMBER_PARSING
  373|       |  // this helps if we have lots of decimals!
  374|       |  // this turns out to be frequent enough.
  375|  9.28k|  if (is_made_of_eight_digits_fast(p)) {
  ------------------
  |  Branch (375:7): [True: 5.63k, False: 3.64k]
  ------------------
  376|  5.63k|    i = i * 100000000 + parse_eight_digits_unrolled(p);
  377|  5.63k|    p += 8;
  378|  5.63k|  }
  379|  9.28k|#endif // SIMDJSON_SWAR_NUMBER_PARSING
  380|  9.28k|#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING
  381|       |  // Unrolling the first digit makes a small difference on some implementations (e.g. westmere)
  382|  9.28k|  if (parse_digit(*p, i)) { ++p; }
  ------------------
  |  Branch (382:7): [True: 8.14k, False: 1.13k]
  ------------------
  383|  3.34M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (383:10): [True: 3.33M, False: 9.28k]
  ------------------
  384|  9.28k|  exponent = first_after_period - p;
  385|       |  // Decimal without digits (123.) is illegal
  386|  9.28k|  if (exponent == 0) {
  ------------------
  |  Branch (386:7): [True: 174, False: 9.10k]
  ------------------
  387|    174|    return INVALID_NUMBER(src);
  ------------------
  |  |   25|    174|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  388|    174|  }
  389|  9.10k|  return SUCCESS;
  390|  9.28k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_128is_made_of_eight_digits_fastEPKh:
  333|  9.28k|simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) {
  334|  9.28k|  uint64_t val;
  335|       |  // this can read up to 7 bytes beyond the buffer size, but we require
  336|       |  // SIMDJSON_PADDING of padding
  337|  9.28k|  static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7");
  338|  9.28k|  std::memcpy(&val, chars, 8);
  339|       |  // a branchy method might be faster:
  340|       |  // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030)
  341|       |  //  && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) ==
  342|       |  //  0x3030303030303030);
  343|  9.28k|  return (((val & 0xF0F0F0F0F0F0F0F0) |
  344|  9.28k|           (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) ==
  345|  9.28k|          0x3333333333333333);
  346|  9.28k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_114parse_exponentEPKhRS4_Rl:
  392|  15.4k|simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) {
  393|       |  // Exp Sign: -123.456e[-]78
  394|  15.4k|  bool neg_exp = ('-' == *p);
  395|  15.4k|  if (neg_exp || '+' == *p) { p++; } // Skip + as well
  ------------------
  |  Branch (395:7): [True: 5.45k, False: 9.94k]
  |  Branch (395:18): [True: 667, False: 9.28k]
  ------------------
  396|       |
  397|       |  // Exponent: -123.456e-[78]
  398|  15.4k|  auto start_exp = p;
  399|  15.4k|  int64_t exp_number = 0;
  400|  4.94M|  while (parse_digit(*p, exp_number)) { ++p; }
  ------------------
  |  Branch (400:10): [True: 4.92M, False: 15.4k]
  ------------------
  401|       |  // It is possible for parse_digit to overflow.
  402|       |  // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN.
  403|       |  // Thus we *must* check for possible overflow before we negate exp_number.
  404|       |
  405|       |  // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into
  406|       |  // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may
  407|       |  // not oblige and may, in fact, generate two distinct paths in any case. It might be
  408|       |  // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off
  409|       |  // instructions for a simdjson_likely branch, an unconclusive gain.
  410|       |
  411|       |  // If there were no digits, it's an error.
  412|  15.4k|  if (simdjson_unlikely(p == start_exp)) {
  ------------------
  |  |  106|  15.4k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 107, False: 15.2k]
  |  |  ------------------
  ------------------
  413|    107|    return INVALID_NUMBER(src);
  ------------------
  |  |   25|    107|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  414|    107|  }
  415|       |  // We have a valid positive exponent in exp_number at this point, except that
  416|       |  // it may have overflowed.
  417|       |
  418|       |  // If there were more than 18 digits, we may have overflowed the integer. We have to do
  419|       |  // something!!!!
  420|  15.2k|  if (simdjson_unlikely(p > start_exp+18)) {
  ------------------
  |  |  106|  15.2k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 988, False: 14.3k]
  |  |  ------------------
  ------------------
  421|       |    // Skip leading zeroes: 1e000000000000000000001 is technically valid and does not overflow
  422|   113k|    while (*start_exp == '0') { start_exp++; }
  ------------------
  |  Branch (422:12): [True: 112k, False: 988]
  ------------------
  423|       |    // 19 digits could overflow int64_t and is kind of absurd anyway. We don't
  424|       |    // support exponents smaller than -999,999,999,999,999,999 and bigger
  425|       |    // than 999,999,999,999,999,999.
  426|       |    // We can truncate.
  427|       |    // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before
  428|       |    // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could
  429|       |    // truncate at 324.
  430|       |    // Note that there is no reason to fail per se at this point in time.
  431|       |    // E.g., 0e999999999999999999999 is a fine number.
  432|    988|    if (p > start_exp+18) { exp_number = 999999999999999999; }
  ------------------
  |  Branch (432:9): [True: 456, False: 532]
  ------------------
  433|    988|  }
  434|       |  // At this point, we know that exp_number is a sane, positive, signed integer.
  435|       |  // It is <= 999,999,999,999,999,999. As long as 'exponent' is in
  436|       |  // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent'
  437|       |  // is bounded in magnitude by the size of the JSON input, we are fine in this universe.
  438|       |  // To sum it up: the next line should never overflow.
  439|  15.2k|  exponent += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (439:16): [True: 5.43k, False: 9.85k]
  ------------------
  440|  15.2k|  return SUCCESS;
  441|  15.4k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_111parse_digitIlEEbhRT_:
  350|  4.94M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  351|  4.94M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  352|  4.94M|  if (digit > 9) {
  ------------------
  |  Branch (352:7): [True: 15.4k, False: 4.92M]
  ------------------
  353|  15.4k|    return false;
  354|  15.4k|  }
  355|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  356|  4.92M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  357|  4.92M|  return true;
  358|  4.94M|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing11write_floatINS0_12_GLOBAL__N_16stage211tape_writerEEENS_10error_codeEPKhbmS8_mlRT_:
  481|  23.2k|simdjson_inline error_code write_float(const uint8_t *const src, bool negative, uint64_t i, const uint8_t * start_digits, size_t digit_count, int64_t exponent, W &writer) {
  482|       |  // If we frequently had to deal with long strings of digits,
  483|       |  // we could extend our code by using a 128-bit integer instead
  484|       |  // of a 64-bit integer. However, this is uncommon in practice.
  485|       |  //
  486|       |  // 9999999999999999999 < 2**64 so we can accommodate 19 digits.
  487|       |  // If we have a decimal separator, then digit_count - 1 is the number of digits, but we
  488|       |  // may not have a decimal separator!
  489|  23.2k|  if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) {
  ------------------
  |  |  106|  29.7k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 6.20k, False: 17.0k]
  |  |  |  Branch (106:52): [True: 6.46k, False: 16.8k]
  |  |  |  Branch (106:52): [True: 6.20k, False: 261]
  |  |  ------------------
  ------------------
  490|       |    // Ok, chances are good that we had an overflow!
  491|       |    // this is almost never going to get called!!!
  492|       |    // we start anew, going slowly!!!
  493|       |    // This will happen in the following examples:
  494|       |    // 10000000000000000000000000000000000000000000e+308
  495|       |    // 3.1415926535897932384626433832795028841971693993751
  496|       |    //
  497|       |    // NOTE: We do not pass a reference to the to slow_float_parsing. If we passed our writer
  498|       |    // reference to it, it would force it to be stored in memory, preventing the compiler from
  499|       |    // picking it apart and putting into registers. i.e. if we pass it as reference,
  500|       |    // it gets slow.
  501|  6.20k|    double d;
  502|  6.20k|    error_code error = slow_float_parsing(src, &d);
  503|  6.20k|    writer.append_double(d);
  504|  6.20k|    return error;
  505|  6.20k|  }
  506|       |  // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other
  507|       |  // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331
  508|       |  // To future reader: we'd love if someone found a better way, or at least could explain this result!
  509|  17.0k|  if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) {
  ------------------
  |  |  106|  34.1k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 1.32k, False: 15.7k]
  |  |  ------------------
  ------------------
  |  Branch (509:75): [True: 1.50k, False: 14.2k]
  ------------------
  510|       |    //
  511|       |    // Important: smallest_power is such that it leads to a zero value.
  512|       |    // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero
  513|       |    // so something x 10^-343 goes to zero, but not so with  something x 10^-342.
  514|  2.82k|    static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough");
  515|       |    //
  516|  2.82k|    if((exponent < simdjson::internal::smallest_power) || (i == 0)) {
  ------------------
  |  Branch (516:8): [True: 1.32k, False: 1.50k]
  |  Branch (516:59): [True: 1.16k, False: 336]
  ------------------
  517|       |      // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero
  518|  2.49k|      WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer);
  ------------------
  |  |   28|  4.98k|#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE))
  |  |  ------------------
  |  |  |  Branch (28:66): [True: 49, False: 2.44k]
  |  |  ------------------
  ------------------
  519|  2.49k|      return SUCCESS;
  520|  2.49k|    } else { // (exponent > largest_power) and (i != 0)
  521|       |      // We have, for sure, an infinite value and simdjson refuses to parse infinite values.
  522|    336|      return INVALID_NUMBER(src);
  ------------------
  |  |   25|    336|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  523|    336|    }
  524|  2.82k|  }
  525|  14.2k|  double d;
  526|  14.2k|  if (!compute_float_64(exponent, i, negative, d)) {
  ------------------
  |  Branch (526:7): [True: 193, False: 14.0k]
  ------------------
  527|       |    // we are almost never going to get here.
  528|    193|    if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   25|    193|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (528:9): [True: 193, False: 0]
  ------------------
  529|    193|  }
  530|  14.0k|  WRITE_DOUBLE(d, src, writer);
  ------------------
  |  |   28|  14.0k|#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE))
  ------------------
  531|  14.0k|  return SUCCESS;
  532|  14.2k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_118significant_digitsEPKhm:
  460|  6.46k|simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) {
  461|       |  // It is possible that the integer had an overflow.
  462|       |  // We have to handle the case where we have 0.0000somenumber.
  463|  6.46k|  const uint8_t *start = start_digits;
  464|  4.58M|  while ((*start == '0') || (*start == '.')) { ++start; }
  ------------------
  |  Branch (464:10): [True: 4.54M, False: 37.7k]
  |  Branch (464:29): [True: 31.2k, False: 6.46k]
  ------------------
  465|       |  // we over-decrement by one when there is a '.'
  466|  6.46k|  return digit_count - size_t(start - start_digits);
  467|  6.46k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsingL18slow_float_parsingEPKhPd:
  472|  6.20k|static error_code slow_float_parsing(simdjson_unused const uint8_t * src, double* answer) {
  473|  6.20k|  if (parse_float_fallback(src, answer)) {
  ------------------
  |  Branch (473:7): [True: 6.04k, False: 157]
  ------------------
  474|  6.04k|    return SUCCESS;
  475|  6.04k|  }
  476|    157|  return INVALID_NUMBER(src);
  ------------------
  |  |   25|    157|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  477|  6.20k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_116compute_float_64ElmbRd:
   52|  14.2k|simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) {
   53|       |  // we start with a fast path
   54|       |  // It was described in
   55|       |  // Clinger WD. How to read floating point numbers accurately.
   56|       |  // ACM SIGPLAN Notices. 1990
   57|       |#ifndef FLT_EVAL_METHOD
   58|       |#error "FLT_EVAL_METHOD should be defined, please include cfloat."
   59|       |#endif
   60|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
   61|       |  // We cannot be certain that x/y is rounded to nearest.
   62|       |  if (0 <= power && power <= 22 && i <= 9007199254740991)
   63|       |#else
   64|  14.2k|  if (-22 <= power && power <= 22 && i <= 9007199254740991)
  ------------------
  |  Branch (64:7): [True: 11.6k, False: 2.62k]
  |  Branch (64:23): [True: 6.33k, False: 5.30k]
  |  Branch (64:38): [True: 5.07k, False: 1.26k]
  ------------------
   65|  5.07k|#endif
   66|  5.07k|  {
   67|       |    // convert the integer into a double. This is lossless since
   68|       |    // 0 <= i <= 2^53 - 1.
   69|  5.07k|    d = double(i);
   70|       |    //
   71|       |    // The general idea is as follows.
   72|       |    // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then
   73|       |    // 1) Both s and p can be represented exactly as 64-bit floating-point
   74|       |    // values
   75|       |    // (binary64).
   76|       |    // 2) Because s and p can be represented exactly as floating-point values,
   77|       |    // then s * p
   78|       |    // and s / p will produce correctly rounded values.
   79|       |    //
   80|  5.07k|    if (power < 0) {
  ------------------
  |  Branch (80:9): [True: 2.99k, False: 2.07k]
  ------------------
   81|  2.99k|      d = d / simdjson::internal::power_of_ten[-power];
   82|  2.99k|    } else {
   83|  2.07k|      d = d * simdjson::internal::power_of_ten[power];
   84|  2.07k|    }
   85|  5.07k|    if (negative) {
  ------------------
  |  Branch (85:9): [True: 463, False: 4.60k]
  ------------------
   86|    463|      d = -d;
   87|    463|    }
   88|  5.07k|    return true;
   89|  5.07k|  }
   90|       |  // When 22 < power && power <  22 + 16, we could
   91|       |  // hope for another, secondary fast path.  It was
   92|       |  // described by David M. Gay in  "Correctly rounded
   93|       |  // binary-decimal and decimal-binary conversions." (1990)
   94|       |  // If you need to compute i * 10^(22 + x) for x < 16,
   95|       |  // first compute i * 10^x, if you know that result is exact
   96|       |  // (e.g., when i * 10^x < 2^53),
   97|       |  // then you can still proceed and do (i * 10^x) * 10^22.
   98|       |  // Is this worth your time?
   99|       |  // You need  22 < power *and* power <  22 + 16 *and* (i * 10^(x-22) < 2^53)
  100|       |  // for this second fast path to work.
  101|       |  // If you you have 22 < power *and* power <  22 + 16, and then you
  102|       |  // optimistically compute "i * 10^(x-22)", there is still a chance that you
  103|       |  // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of
  104|       |  // this optimization maybe less common than we would like. Source:
  105|       |  // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/
  106|       |  // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html
  107|       |
  108|       |  // The fast path has now failed, so we are failing back on the slower path.
  109|       |
  110|       |  // In the slow path, we need to adjust i so that it is > 1<<63 which is always
  111|       |  // possible, except if i == 0, so we handle i == 0 separately.
  112|  9.19k|  if(i == 0) {
  ------------------
  |  Branch (112:6): [True: 660, False: 8.53k]
  ------------------
  113|    660|    d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (113:9): [True: 161, False: 499]
  ------------------
  114|    660|    return true;
  115|    660|  }
  116|       |
  117|       |
  118|       |  // The exponent is 1024 + 63 + power
  119|       |  //     + floor(log(5**power)/log(2)).
  120|       |  // The 1024 comes from the ieee64 standard.
  121|       |  // The 63 comes from the fact that we use a 64-bit word.
  122|       |  //
  123|       |  // Computing floor(log(5**power)/log(2)) could be
  124|       |  // slow. Instead we use a fast function.
  125|       |  //
  126|       |  // For power in (-400,350), we have that
  127|       |  // (((152170 + 65536) * power ) >> 16);
  128|       |  // is equal to
  129|       |  //  floor(log(5**power)/log(2)) + power when power >= 0
  130|       |  // and it is equal to
  131|       |  //  ceil(log(5**-power)/log(2)) + power when power < 0
  132|       |  //
  133|       |  // The 65536 is (1<<16) and corresponds to
  134|       |  // (65536 * power) >> 16 ---> power
  135|       |  //
  136|       |  // ((152170 * power ) >> 16) is equal to
  137|       |  // floor(log(5**power)/log(2))
  138|       |  //
  139|       |  // Note that this is not magic: 152170/(1<<16) is
  140|       |  // approximately equal to log(5)/log(2).
  141|       |  // The 1<<16 value is a power of two; we could use a
  142|       |  // larger power of 2 if we wanted to.
  143|       |  //
  144|  8.53k|  int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63;
  145|       |
  146|       |
  147|       |  // We want the most significant bit of i to be 1. Shift if needed.
  148|  8.53k|  int lz = leading_zeroes(i);
  149|  8.53k|  i <<= lz;
  150|       |
  151|       |
  152|       |  // We are going to need to do some 64-bit arithmetic to get a precise product.
  153|       |  // We use a table lookup approach.
  154|       |  // It is safe because
  155|       |  // power >= smallest_power
  156|       |  // and power <= largest_power
  157|       |  // We recover the mantissa of the power, it has a leading 1. It is always
  158|       |  // rounded down.
  159|       |  //
  160|       |  // We want the most significant 64 bits of the product. We know
  161|       |  // this will be non-zero because the most significant bit of i is
  162|       |  // 1.
  163|  8.53k|  const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power);
  164|       |  // 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.)
  165|       |  //
  166|       |  // The full_multiplication function computes the 128-bit product of two 64-bit words
  167|       |  // with a returned value of type value128 with a "low component" corresponding to the
  168|       |  // 64-bit least significant bits of the product and with a "high component" corresponding
  169|       |  // to the 64-bit most significant bits of the product.
  170|  8.53k|  simdjson::internal::value128 firstproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index]);
  171|       |  // Both i and power_of_five_128[index] have their most significant bit set to 1 which
  172|       |  // implies that the either the most or the second most significant bit of the product
  173|       |  // is 1. We pack values in this manner for efficiency reasons: it maximizes the use
  174|       |  // we make of the product. It also makes it easy to reason about the product: there
  175|       |  // is 0 or 1 leading zero in the product.
  176|       |
  177|       |  // Unless the least significant 9 bits of the high (64-bit) part of the full
  178|       |  // product are all 1s, then we know that the most significant 55 bits are
  179|       |  // exact and no further work is needed. Having 55 bits is necessary because
  180|       |  // we need 53 bits for the mantissa but we have to have one rounding bit and
  181|       |  // we can waste a bit if the most significant bit of the product is zero.
  182|  8.53k|  if((firstproduct.high & 0x1FF) == 0x1FF) {
  ------------------
  |  Branch (182:6): [True: 1.43k, False: 7.09k]
  ------------------
  183|       |    // We want to compute i * 5^q, but only care about the top 55 bits at most.
  184|       |    // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing
  185|       |    // the full computation is wasteful. So we do what is called a "truncated
  186|       |    // multiplication".
  187|       |    // We take the most significant 64-bits, and we put them in
  188|       |    // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q
  189|       |    // to the desired approximation using one multiplication. Sometimes it does not suffice.
  190|       |    // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and
  191|       |    // then we get a better approximation to i * 5^q.
  192|       |    //
  193|       |    // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat
  194|       |    // more complicated.
  195|       |    //
  196|       |    // There is an extra layer of complexity in that we need more than 55 bits of
  197|       |    // accuracy in the round-to-even scenario.
  198|       |    //
  199|       |    // The full_multiplication function computes the 128-bit product of two 64-bit words
  200|       |    // with a returned value of type value128 with a "low component" corresponding to the
  201|       |    // 64-bit least significant bits of the product and with a "high component" corresponding
  202|       |    // to the 64-bit most significant bits of the product.
  203|  1.43k|    simdjson::internal::value128 secondproduct = full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]);
  204|  1.43k|    firstproduct.low += secondproduct.high;
  205|  1.43k|    if(secondproduct.high > firstproduct.low) { firstproduct.high++; }
  ------------------
  |  Branch (205:8): [True: 776, False: 660]
  ------------------
  206|       |    // As it has been proven by Noble Mushtak and Daniel Lemire in "Fast Number Parsing Without
  207|       |    // Fallback" (https://arxiv.org/abs/2212.06644), at this point we are sure that the product
  208|       |    // is sufficiently accurate, and more computation is not needed.
  209|  1.43k|  }
  210|  8.53k|  uint64_t lower = firstproduct.low;
  211|  8.53k|  uint64_t upper = firstproduct.high;
  212|       |  // The final mantissa should be 53 bits with a leading 1.
  213|       |  // We shift it so that it occupies 54 bits with a leading 1.
  214|       |  ///////
  215|  8.53k|  uint64_t upperbit = upper >> 63;
  216|  8.53k|  uint64_t mantissa = upper >> (upperbit + 9);
  217|  8.53k|  lz += int(1 ^ upperbit);
  218|       |
  219|       |  // Here we have mantissa < (1<<54).
  220|  8.53k|  int64_t real_exponent = exponent - lz;
  221|  8.53k|  if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal?
  ------------------
  |  |  106|  8.53k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 1.95k, False: 6.57k]
  |  |  ------------------
  ------------------
  222|       |    // Here have that real_exponent <= 0 so -real_exponent >= 0
  223|  1.95k|    if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure.
  ------------------
  |  Branch (223:8): [True: 440, False: 1.51k]
  ------------------
  224|    440|      d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (224:11): [True: 4, False: 436]
  ------------------
  225|    440|      return true;
  226|    440|    }
  227|       |    // next line is safe because -real_exponent + 1 < 0
  228|  1.51k|    mantissa >>= -real_exponent + 1;
  229|       |    // Thankfully, we can't have both "round-to-even" and subnormals because
  230|       |    // "round-to-even" only occurs for powers close to 0.
  231|  1.51k|    mantissa += (mantissa & 1); // round up
  232|  1.51k|    mantissa >>= 1;
  233|       |    // There is a weird scenario where we don't have a subnormal but just.
  234|       |    // Suppose we start with 2.2250738585072013e-308, we end up
  235|       |    // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal
  236|       |    // whereas 0x40000000000000 x 2^-1023-53  is normal. Now, we need to round
  237|       |    // up 0x3fffffffffffff x 2^-1023-53  and once we do, we are no longer
  238|       |    // subnormal, but we can only know this after rounding.
  239|       |    // So we only declare a subnormal if we are smaller than the threshold.
  240|  1.51k|    real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1;
  ------------------
  |  Branch (240:21): [True: 1.51k, False: 3]
  ------------------
  241|  1.51k|    d = to_double(mantissa, real_exponent, negative);
  242|  1.51k|    return true;
  243|  1.95k|  }
  244|       |  // We have to round to even. The "to even" part
  245|       |  // is only a problem when we are right in between two floats
  246|       |  // which we guard against.
  247|       |  // If we have lots of trailing zeros, we may fall right between two
  248|       |  // floating-point values.
  249|       |  //
  250|       |  // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54]
  251|       |  // times a power of two. That is, it is right between a number with binary significand
  252|       |  // m and another number with binary significand m+1; and it must be the case
  253|       |  // that it cannot be represented by a float itself.
  254|       |  //
  255|       |  // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p.
  256|       |  // Recall that 10^q = 5^q * 2^q.
  257|       |  // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that
  258|       |  //  5^23 <=  2^54 and it is the last power of five to qualify, so q <= 23.
  259|       |  // When q<0, we have  w  >=  (2m+1) x 5^{-q}.  We must have that w<2^{64} so
  260|       |  // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have
  261|       |  // 2^{53} x 5^{-q} < 2^{64}.
  262|       |  // Hence we have 5^{-q} < 2^{11}$ or q>= -4.
  263|       |  //
  264|       |  // We require lower <= 1 and not lower == 0 because we could not prove that
  265|       |  // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test.
  266|  6.57k|  if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) {
  ------------------
  |  |  106|  28.3k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 2.08k, False: 4.48k]
  |  |  |  Branch (106:52): [True: 3.43k, False: 3.13k]
  |  |  |  Branch (106:52): [True: 2.84k, False: 591]
  |  |  |  Branch (106:52): [True: 2.30k, False: 537]
  |  |  |  Branch (106:52): [True: 2.08k, False: 220]
  |  |  ------------------
  ------------------
  267|  2.08k|    if((mantissa  << (upperbit + 64 - 53 - 2)) ==  upper) {
  ------------------
  |  Branch (267:8): [True: 688, False: 1.39k]
  ------------------
  268|    688|      mantissa &= ~1;             // flip it so that we do not round up
  269|    688|    }
  270|  2.08k|  }
  271|       |
  272|  6.57k|  mantissa += mantissa & 1;
  273|  6.57k|  mantissa >>= 1;
  274|       |
  275|       |  // Here we have mantissa < (1<<53), unless there was an overflow
  276|  6.57k|  if (mantissa >= (1ULL << 53)) {
  ------------------
  |  Branch (276:7): [True: 427, False: 6.14k]
  ------------------
  277|       |    //////////
  278|       |    // This will happen when parsing values such as 7.2057594037927933e+16
  279|       |    ////////
  280|    427|    mantissa = (1ULL << 52);
  281|    427|    real_exponent++;
  282|    427|  }
  283|  6.57k|  mantissa &= ~(1ULL << 52);
  284|       |  // we have to check that real_exponent is in range, otherwise we bail out
  285|  6.57k|  if (simdjson_unlikely(real_exponent > 2046)) {
  ------------------
  |  |  106|  6.57k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 193, False: 6.38k]
  |  |  ------------------
  ------------------
  286|       |    // We have an infinite value!!! We could actually throw an error here if we could.
  287|    193|    return false;
  288|    193|  }
  289|  6.38k|  d = to_double(mantissa, real_exponent, negative);
  290|  6.38k|  return true;
  291|  6.57k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_19to_doubleEmmb:
   37|  7.89k|simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) {
   38|  7.89k|    double d;
   39|  7.89k|    mantissa &= ~(1ULL << 52);
   40|  7.89k|    mantissa |= real_exponent << 52;
   41|  7.89k|    mantissa |= ((static_cast<uint64_t>(negative)) << 63);
   42|  7.89k|    std::memcpy(&d, &mantissa, sizeof(d));
   43|  7.89k|    return d;
   44|  7.89k|}
simdjson.cpp:_ZN8simdjson7haswell13numberparsing12_GLOBAL__N_120parse_float_fallbackEPKhPd:
  300|  6.39k|static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) {
  301|  6.39k|  *outDouble = simdjson::internal::from_chars(reinterpret_cast<const char *>(ptr));
  302|       |  // We do not accept infinite values.
  303|       |
  304|       |  // Detecting finite values in a portable manner is ridiculously hard, ideally
  305|       |  // we would want to do:
  306|       |  // return !std::isfinite(*outDouble);
  307|       |  // but that mysteriously fails under legacy/old libc++ libraries, see
  308|       |  // https://github.com/simdjson/simdjson/issues/1286
  309|       |  //
  310|       |  // Therefore, fall back to this solution (the extra parens are there
  311|       |  // to handle that max may be a macro on windows).
  312|  6.39k|  return !(*outDouble > (std::numeric_limits<double>::max)() || *outDouble < std::numeric_limits<double>::lowest());
  ------------------
  |  Branch (312:12): [True: 336, False: 6.06k]
  |  Branch (312:65): [True: 14, False: 6.04k]
  ------------------
  313|  6.39k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115trailing_zeroesEm:
   22|  7.06M|simdjson_inline int trailing_zeroes(uint64_t input_num) {
   23|       |#if SIMDJSON_REGULAR_VISUAL_STUDIO
   24|       |  return (int)_tzcnt_u64(input_num);
   25|       |#else // SIMDJSON_REGULAR_VISUAL_STUDIO
   26|       |  ////////
   27|       |  // You might expect the next line to be equivalent to
   28|       |  // return (int)_tzcnt_u64(input_num);
   29|       |  // but the generated code differs and might be less efficient?
   30|       |  ////////
   31|  7.06M|  return __builtin_ctzll(input_num);
   32|  7.06M|#endif // SIMDJSON_REGULAR_VISUAL_STUDIO
   33|  7.06M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_110count_onesEm:
   51|   134k|simdjson_inline long long int count_ones(uint64_t input_num) {
   52|   134k|  return _popcnt64(input_num);
   53|   134k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116clear_lowest_bitEm:
   36|  6.77M|simdjson_inline uint64_t clear_lowest_bit(uint64_t input_num) {
   37|  6.77M|  return _blsr_u64(input_num);
   38|  6.77M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_114leading_zeroesEm:
   41|  8.53k|simdjson_inline int leading_zeroes(uint64_t input_num) {
   42|  8.53k|  return int(_lzcnt_u64(input_num));
   43|  8.53k|}

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

_ZN8simdjson7haswell14implementationC2Ev:
   19|      1|  simdjson_inline implementation() : simdjson::implementation(
   20|      1|      "haswell",
   21|      1|      "Intel/AMD AVX2",
   22|      1|      internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2
   23|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell13numberparsingL27parse_eight_digits_unrolledEPKh:
   18|  5.63k|static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) {
   19|       |  // this actually computes *16* values so we are being wasteful.
   20|  5.63k|  const __m128i ascii0 = _mm_set1_epi8('0');
   21|  5.63k|  const __m128i mul_1_10 =
   22|  5.63k|      _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1);
   23|  5.63k|  const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1);
   24|  5.63k|  const __m128i mul_1_10000 =
   25|  5.63k|      _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1);
   26|  5.63k|  const __m128i input = _mm_sub_epi8(
   27|  5.63k|      _mm_loadu_si128(reinterpret_cast<const __m128i *>(chars)), ascii0);
   28|  5.63k|  const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10);
   29|  5.63k|  const __m128i t2 = _mm_madd_epi16(t1, mul_1_100);
   30|  5.63k|  const __m128i t3 = _mm_packus_epi32(t2, t2);
   31|  5.63k|  const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000);
   32|  5.63k|  return _mm_cvtsi128_si32(
   33|  5.63k|      t4); // only captures the sum of the first 8 digits, drop the rest
   34|  5.63k|}
_ZN8simdjson7haswell13numberparsing19full_multiplicationEmm:
   37|  9.96k|simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) {
   38|  9.96k|  internal::value128 answer;
   39|       |#if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS
   40|       |#if SIMDJSON_IS_ARM64
   41|       |  // ARM64 has native support for 64-bit multiplications, no need to emultate
   42|       |  answer.high = __umulh(value1, value2);
   43|       |  answer.low = value1 * value2;
   44|       |#else
   45|       |  answer.low = _umul128(value1, value2, &answer.high); // _umul128 not available on ARM64
   46|       |#endif // SIMDJSON_IS_ARM64
   47|       |#else // SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS
   48|  9.96k|  __uint128_t r = (static_cast<__uint128_t>(value1)) * value2;
   49|  9.96k|  answer.low = uint64_t(r);
   50|  9.96k|  answer.high = uint64_t(r >> 64);
   51|  9.96k|#endif
   52|  9.96k|  return answer;
   53|  9.96k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ev:
  231|  26.2k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   98|  26.2k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   50|  26.2k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   22|  26.2k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  309|   833k|    simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8<T>::load(ptr), simd8<T>::load(ptr+32)} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE4loadEPKh:
   82|  2.00M|    static simdjson_inline simd8<T> load(const T values[32]) {
   83|  2.00M|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   84|  2.00M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  232|  17.1M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   99|  17.1M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   51|  17.1M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   25|  17.1M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  330|   833k|    simdjson_inline simd8<T> reduce_or() const {
  331|   833k|      return this->chunks[0] | this->chunks[1];
  332|   833k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   32|  3.35M|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   28|  36.2M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  283|   833k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   36|   846k|    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_:
   58|  10.0k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|  10.0k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|  10.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  289|  20.0k|    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_:
  177|  30.0k|        L replace12, L replace13, L replace14, L replace15) const {
  178|  30.0k|      return lookup_16(simd8<L>::repeat_16(
  179|  30.0k|        replace0,  replace1,  replace2,  replace3,
  180|  30.0k|        replace4,  replace5,  replace6,  replace7,
  181|  30.0k|        replace8,  replace9,  replace10, replace11,
  182|  30.0k|        replace12, replace13, replace14, replace15
  183|  30.0k|      ));
  184|  30.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  115|  30.0k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  116|  30.0k|      return _mm256_shuffle_epi8(lookup_table, *this);
  117|  30.0k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   29|  30.0k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  253|  1.69M|    ) {
  254|  1.69M|      return simd8<uint8_t>(
  255|  1.69M|        v0, v1, v2, v3, v4, v5, v6, v7,
  256|  1.69M|        v8, v9, v10,v11,v12,v13,v14,v15,
  257|  1.69M|        v0, v1, v2, v3, v4, v5, v6, v7,
  258|  1.69M|        v8, v9, v10,v11,v12,v13,v14,v15
  259|  1.69M|      );
  260|  1.69M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|  1.69M|    ) : simd8(_mm256_setr_epi8(
  244|  1.69M|      v0, v1, v2, v3, v4, v5, v6, v7,
  245|  1.69M|      v8, v9, v10,v11,v12,v13,v14,v15,
  246|  1.69M|      v16,v17,v18,v19,v20,v21,v22,v23,
  247|  1.69M|      v24,v25,v26,v27,v28,v29,v30,v31
  248|  1.69M|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   33|  60.0k|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  234|  2.39M|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   80|  4.89M|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   58|  10.0k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|  10.0k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|  10.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   58|  10.0k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|  10.0k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|  10.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  264|  25.0k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm256_subs_epu8(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   34|  10.0k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  236|   338k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  270|  5.00k|    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:
  285|  8.40k|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  284|  8.40k|    simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5storeEPh:
  102|   333k|    simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simdeqENS2_5simd8IhEES4_:
   53|  9.00M|    friend simdjson_really_inline Mask operator==(const simd8<T> lhs, const simd8<T> rhs) { return _mm256_cmpeq_epi8(lhs, rhs); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IbEC2EDv4_x:
   69|  9.00M|    simdjson_inline simd8(const __m256i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv4_x:
   51|  9.00M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv4_x:
   25|  9.00M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IbE10to_bitmaskEv:
   73|  9.00M|    simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRKDv4_xEv:
   28|  9.00M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqEh:
  342|  1.66M|    simdjson_inline uint64_t eq(const T m) const {
  343|  1.66M|      const simd8<T> mask = simd8<T>::splat(m);
  344|  1.66M|      return  simd8x64<bool>(
  345|  1.66M|        this->chunks[0] == mask,
  346|  1.66M|        this->chunks[1] == mask
  347|  1.66M|      ).to_bitmask();
  348|  1.66M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbEC2ENS2_5simd8IbEES6_:
  308|  4.16M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbE10to_bitmaskEv:
  324|  4.16M|    simdjson_inline uint64_t to_bitmask() const {
  325|  4.16M|      uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask());
  326|  4.16M|      uint64_t r_hi =                       this->chunks[1].to_bitmask();
  327|  4.16M|      return r_lo | (r_hi << 32);
  328|  4.16M|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqERKS4_:
  350|  1.66M|    simdjson_inline uint64_t eq(const simd8x64<uint8_t> &other) const {
  351|  1.66M|      return  simd8x64<bool>(
  352|  1.66M|        this->chunks[0] == other.chunks[0],
  353|  1.66M|        this->chunks[1] == other.chunks[1]
  354|  1.66M|      ).to_bitmask();
  355|  1.66M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2ENS2_5simd8IhEES6_:
  308|  2.50M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE4lteqEh:
  357|   833k|    simdjson_inline uint64_t lteq(const T m) const {
  358|   833k|      const simd8<T> mask = simd8<T>::splat(m);
  359|   833k|      return  simd8x64<bool>(
  360|   833k|        this->chunks[0] <= mask,
  361|   833k|        this->chunks[1] <= mask
  362|   833k|      ).to_bitmask();
  363|   833k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEleES4_:
  273|  1.66M|    simdjson_inline simd8<bool> operator<=(const simd8<uint8_t> other) const { return other.max_val(*this) == other; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7max_valES4_:
  267|  1.66M|    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:
   31|   333k|simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(const uint8_t *src, uint8_t *dst) {
   32|       |  // this can read up to 15 bytes beyond the buffer size, but we require
   33|       |  // SIMDJSON_PADDING of padding
   34|   333k|  static_assert(SIMDJSON_PADDING >= (BYTES_PROCESSED - 1), "backslash and quote finder must process fewer than SIMDJSON_PADDING bytes");
   35|   333k|  simd8<uint8_t> v(src);
   36|       |  // store to dest unconditionally - we can overwrite the bits we don't like later
   37|   333k|  v.store(dst);
   38|   333k|  return {
   39|   333k|      static_cast<uint32_t>((v == '\\').to_bitmask()),     // bs_bits
   40|   333k|      static_cast<uint32_t>((v == '"').to_bitmask()), // quote_bits
   41|   333k|  };
   42|   333k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote15has_quote_firstEv:
   22|   333k|  simdjson_inline bool has_quote_first() { return ((bs_bits - 1) & quote_bits) != 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote11quote_indexEv:
   24|   288k|  simdjson_inline int quote_index() { return trailing_zeroes(quote_bits); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote13has_backslashEv:
   23|  44.8k|  simdjson_inline bool has_backslash() { return ((quote_bits - 1) & bs_bits) != 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_119backslash_and_quote15backslash_indexEv:
   25|  9.70k|  simdjson_inline int backslash_index() { return trailing_zeroes(bs_bits); }

_ZN8simdjson7icelake14implementationC2Ev:
   19|      1|  simdjson_inline implementation() : simdjson::implementation(
   20|      1|      "icelake",
   21|      1|      "Intel/AMD AVX512",
   22|      1|      internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 | internal::instruction_set::AVX512F | internal::instruction_set::AVX512DQ | internal::instruction_set::AVX512CD | internal::instruction_set::AVX512BW | internal::instruction_set::AVX512VL | internal::instruction_set::AVX512VBMI2
   23|      1|  ) {}

_ZNK8simdjson14implementation25required_instruction_setsEv:
   84|      2|  virtual uint32_t required_instruction_sets() const { return _required_instruction_sets; }
_ZN8simdjson14implementationC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_j:
  137|      5|    _name(name),
  138|      5|    _description(description),
  139|      5|    _required_instruction_sets(required_instruction_sets)
  140|      5|  {
  141|      5|  }
_ZN8simdjson8internal29available_implementation_listC2Ev:
  171|      1|  simdjson_inline available_implementation_list() {}

_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEptEv:
   21|  8.75k|  T* operator->() { return ptr.load(); }
_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEaSEPS3_:
   22|      1|  atomic_ptr& operator=(T *_ptr) { ptr = _ptr; return *this; }
_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEcvPS3_Ev:
   19|      1|  operator T*() { return ptr.load(); }
_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEC2EPS3_:
   13|      1|  atomic_ptr(T *_ptr) : ptr{_ptr} {}

_ZNK8simdjson8internal25dom_parser_implementation8capacityEv:
  228|  8.74k|simdjson_pure simdjson_inline size_t dom_parser_implementation::capacity() const noexcept {
  229|  8.74k|  return _capacity;
  230|  8.74k|}
_ZNK8simdjson8internal25dom_parser_implementation9max_depthEv:
  232|  46.2k|simdjson_pure simdjson_inline size_t dom_parser_implementation::max_depth() const noexcept {
  233|  46.2k|  return _max_depth;
  234|  46.2k|}
_ZN8simdjson12is_streamingENS_11stage1_modeE:
   27|  17.4k|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|  17.4k|  return (mode != stage1_mode::regular);
   31|       |  // return (mode == stage1_mode::streaming_partial || mode == stage1_mode::streaming_final);
   32|  17.4k|}
_ZN8simdjson8internal25dom_parser_implementationC2Ev:
  224|  8.75k|simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept = default;
_ZN8simdjson8internal25dom_parser_implementationD2Ev:
  166|  8.75k|  virtual ~dom_parser_implementation() = default;

_ZN8simdjson8internal8tape_refC2Ev:
   19|  13.1k|simdjson_inline tape_ref::tape_ref() noexcept : doc{nullptr}, json_index{0} {}
_ZN8simdjson8internal8tape_refC2EPKNS_3dom8documentEm:
   20|   320k|simdjson_inline tape_ref::tape_ref(const dom::document *_doc, size_t _json_index) noexcept : doc{_doc}, json_index{_json_index} {}
_ZNK8simdjson8internal8tape_ref13tape_ref_typeEv:
   71|  2.77M|simdjson_inline tape_type tape_ref::tape_ref_type() const noexcept {
   72|  2.77M|  return static_cast<tape_type>(doc->tape[json_index] >> 56);
   73|  2.77M|}
_ZNK8simdjson8internal8tape_ref13after_elementEv:
   58|  1.37M|inline size_t tape_ref::after_element() const noexcept {
   59|  1.37M|  switch (tape_ref_type()) {
   60|  34.9k|    case tape_type::START_ARRAY:
  ------------------
  |  Branch (60:5): [True: 34.9k, False: 1.34M]
  ------------------
   61|  41.6k|    case tape_type::START_OBJECT:
  ------------------
  |  Branch (61:5): [True: 6.68k, False: 1.37M]
  ------------------
   62|  41.6k|      return matching_brace_index();
   63|  1.47k|    case tape_type::UINT64:
  ------------------
  |  Branch (63:5): [True: 1.47k, False: 1.37M]
  ------------------
   64|  1.30M|    case tape_type::INT64:
  ------------------
  |  Branch (64:5): [True: 1.30M, False: 71.5k]
  ------------------
   65|  1.32M|    case tape_type::DOUBLE:
  ------------------
  |  Branch (65:5): [True: 16.0k, False: 1.36M]
  ------------------
   66|  1.32M|      return json_index + 2;
   67|  12.3k|    default:
  ------------------
  |  Branch (67:5): [True: 12.3k, False: 1.36M]
  ------------------
   68|  12.3k|      return json_index + 1;
   69|  1.37M|  }
   70|  1.37M|}
_ZNK8simdjson8internal8tape_ref20matching_brace_indexEv:
   77|  41.6k|simdjson_inline uint32_t internal::tape_ref::matching_brace_index() const noexcept {
   78|  41.6k|  return uint32_t(doc->tape[json_index]);
   79|  41.6k|}
_ZNK8simdjson8internal8tape_ref15get_string_viewEv:
  108|   283k|inline std::string_view internal::tape_ref::get_string_view() const noexcept {
  109|   283k|  return std::string_view(
  110|   283k|      get_c_str(),
  111|   283k|      get_string_length()
  112|   283k|  );
  113|   283k|}
_ZNK8simdjson8internal8tape_ref9get_c_strEv:
  103|   283k|simdjson_inline const char * internal::tape_ref::get_c_str() const noexcept {
  104|   283k|  size_t string_buf_index = size_t(tape_value());
  105|   283k|  return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
  106|   283k|}
_ZNK8simdjson8internal8tape_ref10tape_valueEv:
   74|   566k|simdjson_inline uint64_t internal::tape_ref::tape_value() const noexcept {
   75|   566k|  return doc->tape[json_index] & internal::JSON_VALUE_MASK;
   76|   566k|}
_ZNK8simdjson8internal8tape_ref17get_string_lengthEv:
   96|   283k|simdjson_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
   97|   283k|  size_t string_buf_index = size_t(tape_value());
   98|   283k|  uint32_t len;
   99|   283k|  std::memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len));
  100|   283k|  return len;
  101|   283k|}
_ZNK8simdjson8internal8tape_ref8is_int64Ev:
   37|  1.30M|simdjson_inline bool tape_ref::is_int64() const noexcept {
   38|  1.30M|  constexpr uint64_t tape_int64 = uint64_t(tape_type::INT64)<<56;
   39|  1.30M|  return doc->tape[json_index] == tape_int64;
   40|  1.30M|}
_ZNK8simdjson8internal8tape_ref9is_uint64Ev:
   41|  1.55k|simdjson_inline bool tape_ref::is_uint64() const noexcept {
   42|  1.55k|  constexpr uint64_t tape_uint64 = uint64_t(tape_type::UINT64)<<56;
   43|  1.55k|  return doc->tape[json_index] == tape_uint64;
   44|  1.55k|}
_ZNK8simdjson8internal8tape_ref15next_tape_valueIlEET_v:
   85|  1.30M|simdjson_inline T tape_ref::next_tape_value() const noexcept {
   86|  1.30M|  static_assert(sizeof(T) == sizeof(uint64_t), "next_tape_value() template parameter must be 64-bit");
   87|       |  // Though the following is tempting...
   88|       |  //  return *reinterpret_cast<const T*>(&doc->tape[json_index + 1]);
   89|       |  // It is not generally safe. It is safer, and often faster to rely
   90|       |  // on memcpy. Yes, it is uglier, but it is also encapsulated.
   91|  1.30M|  T x;
   92|  1.30M|  std::memcpy(&x,&doc->tape[json_index + 1],sizeof(uint64_t));
   93|  1.30M|  return x;
   94|  1.30M|}
_ZNK8simdjson8internal8tape_ref9is_doubleEv:
   33|  17.0k|simdjson_inline bool tape_ref::is_double() const noexcept {
   34|  17.0k|  constexpr uint64_t tape_double = uint64_t(tape_type::DOUBLE)<<56;
   35|  17.0k|  return doc->tape[json_index] == tape_double;
   36|  17.0k|}
_ZNK8simdjson8internal8tape_ref15next_tape_valueIdEET_v:
   85|  17.0k|simdjson_inline T tape_ref::next_tape_value() const noexcept {
   86|  17.0k|  static_assert(sizeof(T) == sizeof(uint64_t), "next_tape_value() template parameter must be 64-bit");
   87|       |  // Though the following is tempting...
   88|       |  //  return *reinterpret_cast<const T*>(&doc->tape[json_index + 1]);
   89|       |  // It is not generally safe. It is safer, and often faster to rely
   90|       |  // on memcpy. Yes, it is uglier, but it is also encapsulated.
   91|  17.0k|  T x;
   92|  17.0k|  std::memcpy(&x,&doc->tape[json_index + 1],sizeof(uint64_t));
   93|  17.0k|  return x;
   94|  17.0k|}
_ZNK8simdjson8internal8tape_ref7is_trueEv:
   49|    783|simdjson_inline bool tape_ref::is_true() const noexcept {
   50|    783|  constexpr uint64_t tape_true = uint64_t(tape_type::TRUE_VALUE)<<56;
   51|    783|  return doc->tape[json_index] == tape_true;
   52|    783|}
_ZNK8simdjson8internal8tape_ref8is_falseEv:
   45|    394|simdjson_inline bool tape_ref::is_false() const noexcept {
   46|    394|  constexpr uint64_t tape_false = uint64_t(tape_type::FALSE_VALUE)<<56;
   47|    394|  return doc->tape[json_index] == tape_false;
   48|    394|}

_ZN8simdjson8internal22allocate_padded_bufferEm:
   21|  8.75k|inline char *allocate_padded_buffer(size_t length) noexcept {
   22|  8.75k|  const size_t totalpaddedlength = length + SIMDJSON_PADDING;
   23|  8.75k|  if(totalpaddedlength<length) {
  ------------------
  |  Branch (23:6): [True: 0, False: 8.75k]
  ------------------
   24|       |    // overflow
   25|      0|    return nullptr;
   26|      0|  }
   27|  8.75k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   28|       |  // avoid getting out of memory
   29|  8.75k|  if (totalpaddedlength>(1UL<<20)) {
  ------------------
  |  Branch (29:7): [True: 9, False: 8.74k]
  ------------------
   30|      9|    return nullptr;
   31|      9|  }
   32|  8.74k|#endif
   33|       |
   34|  8.74k|  char *padded_buffer = new (std::nothrow) char[totalpaddedlength];
   35|  8.74k|  if (padded_buffer == nullptr) {
  ------------------
  |  Branch (35:7): [True: 0, False: 8.74k]
  ------------------
   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|  8.74k|  std::memset(padded_buffer + length, 0, totalpaddedlength - length);
   41|  8.74k|  return padded_buffer;
   42|  8.74k|} // allocate_padded_buffer()

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

_ZN8simdjson8internal10is_integerEc:
   67|  16.7M|bool is_integer(char c)  noexcept  { return (c >= '0' && c <= '9'); }
  ------------------
  |  Branch (67:46): [True: 16.7M, False: 11.1k]
  |  Branch (67:58): [True: 16.7M, False: 2.68k]
  ------------------
_ZN8simdjson8internal13parse_decimalERPKc:
   70|  6.39k|decimal parse_decimal(const char *&p) noexcept {
   71|  6.39k|  decimal answer;
   72|  6.39k|  answer.num_digits = 0;
   73|  6.39k|  answer.decimal_point = 0;
   74|  6.39k|  answer.truncated = false;
   75|  6.39k|  answer.negative = (*p == '-');
   76|  6.39k|  if ((*p == '-') || (*p == '+')) {
  ------------------
  |  Branch (76:7): [True: 0, False: 6.39k]
  |  Branch (76:22): [True: 0, False: 6.39k]
  ------------------
   77|      0|    ++p;
   78|      0|  }
   79|       |
   80|  7.35k|  while (*p == '0') {
  ------------------
  |  Branch (80:10): [True: 953, False: 6.39k]
  ------------------
   81|    953|    ++p;
   82|    953|  }
   83|  12.0M|  while (is_integer(*p)) {
  ------------------
  |  Branch (83:10): [True: 12.0M, False: 6.39k]
  ------------------
   84|  12.0M|    if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (84:9): [True: 138k, False: 11.9M]
  ------------------
   85|   138k|      answer.digits[answer.num_digits] = uint8_t(*p - '0');
   86|   138k|    }
   87|  12.0M|    answer.num_digits++;
   88|  12.0M|    ++p;
   89|  12.0M|  }
   90|  6.39k|  if (*p == '.') {
  ------------------
  |  Branch (90:7): [True: 5.00k, False: 1.39k]
  ------------------
   91|  5.00k|    ++p;
   92|  5.00k|    const char *first_after_period = p;
   93|       |    // if we have not yet encountered a zero, we have to skip it as well
   94|  5.00k|    if (answer.num_digits == 0) {
  ------------------
  |  Branch (94:9): [True: 953, False: 4.04k]
  ------------------
   95|       |      // skip zeros
   96|  11.4k|      while (*p == '0') {
  ------------------
  |  Branch (96:14): [True: 10.4k, False: 953]
  ------------------
   97|  10.4k|        ++p;
   98|  10.4k|      }
   99|    953|    }
  100|  3.34M|    while (is_integer(*p)) {
  ------------------
  |  Branch (100:12): [True: 3.34M, False: 5.00k]
  ------------------
  101|  3.34M|      if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (101:11): [True: 371k, False: 2.97M]
  ------------------
  102|   371k|        answer.digits[answer.num_digits] = uint8_t(*p - '0');
  103|   371k|      }
  104|  3.34M|      answer.num_digits++;
  105|  3.34M|      ++p;
  106|  3.34M|    }
  107|  5.00k|    answer.decimal_point = int32_t(first_after_period - p);
  108|  5.00k|  }
  109|  6.39k|  if(answer.num_digits > 0) {
  ------------------
  |  Branch (109:6): [True: 6.31k, False: 79]
  ------------------
  110|  6.31k|    const char *preverse = p - 1;
  111|  6.31k|    int32_t trailing_zeros = 0;
  112|   760k|    while ((*preverse == '0') || (*preverse == '.')) {
  ------------------
  |  Branch (112:12): [True: 753k, False: 7.05k]
  |  Branch (112:34): [True: 737, False: 6.31k]
  ------------------
  113|   754k|      if(*preverse == '0') { trailing_zeros++; };
  ------------------
  |  Branch (113:10): [True: 753k, False: 737]
  ------------------
  114|   754k|      --preverse;
  115|   754k|    }
  116|  6.31k|    answer.decimal_point += int32_t(answer.num_digits);
  117|  6.31k|    answer.num_digits -= uint32_t(trailing_zeros);
  118|  6.31k|  }
  119|  6.39k|  if(answer.num_digits > max_digits ) {
  ------------------
  |  Branch (119:6): [True: 447, False: 5.95k]
  ------------------
  120|    447|    answer.num_digits = max_digits;
  121|    447|    answer.truncated = true;
  122|    447|  }
  123|  6.39k|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (123:7): [True: 1.63k, False: 4.75k]
  |  Branch (123:22): [True: 797, False: 3.96k]
  ------------------
  124|  2.43k|    ++p;
  125|  2.43k|    bool neg_exp = false;
  126|  2.43k|    if ('-' == *p) {
  ------------------
  |  Branch (126:9): [True: 1.10k, False: 1.32k]
  ------------------
  127|  1.10k|      neg_exp = true;
  128|  1.10k|      ++p;
  129|  1.32k|    } else if ('+' == *p) {
  ------------------
  |  Branch (129:16): [True: 266, False: 1.06k]
  ------------------
  130|    266|      ++p;
  131|    266|    }
  132|  2.43k|    int32_t exp_number = 0; // exponential part
  133|  1.33M|    while (is_integer(*p)) {
  ------------------
  |  Branch (133:12): [True: 1.32M, False: 2.43k]
  ------------------
  134|  1.32M|      uint8_t digit = uint8_t(*p - '0');
  135|  1.32M|      if (exp_number < 0x10000) {
  ------------------
  |  Branch (135:11): [True: 5.67k, False: 1.32M]
  ------------------
  136|  5.67k|        exp_number = 10 * exp_number + digit;
  137|  5.67k|      }
  138|  1.32M|      ++p;
  139|  1.32M|    }
  140|  2.43k|    answer.decimal_point += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (140:30): [True: 1.10k, False: 1.32k]
  ------------------
  141|  2.43k|  }
  142|  6.39k|  return answer;
  143|  6.39k|}
_ZN8simdjson8internal5roundERNS0_7decimalE:
  331|  6.94k|uint64_t round(decimal &h) {
  332|  6.94k|  if ((h.num_digits == 0) || (h.decimal_point < 0)) {
  ------------------
  |  Branch (332:7): [True: 0, False: 6.94k]
  |  Branch (332:30): [True: 203, False: 6.74k]
  ------------------
  333|    203|    return 0;
  334|  6.74k|  } else if (h.decimal_point > 18) {
  ------------------
  |  Branch (334:14): [True: 0, False: 6.74k]
  ------------------
  335|      0|    return UINT64_MAX;
  336|      0|  }
  337|       |  // at this point, we know that h.decimal_point >= 0
  338|  6.74k|  uint32_t dp = uint32_t(h.decimal_point);
  339|  6.74k|  uint64_t n = 0;
  340|   110k|  for (uint32_t i = 0; i < dp; i++) {
  ------------------
  |  Branch (340:24): [True: 104k, False: 6.74k]
  ------------------
  341|   104k|    n = (10 * n) + ((i < h.num_digits) ? h.digits[i] : 0);
  ------------------
  |  Branch (341:21): [True: 100k, False: 3.28k]
  ------------------
  342|   104k|  }
  343|  6.74k|  bool round_up = false;
  344|  6.74k|  if (dp < h.num_digits) {
  ------------------
  |  Branch (344:7): [True: 6.09k, False: 648]
  ------------------
  345|  6.09k|    round_up = h.digits[dp] >= 5; // normally, we round up
  346|       |    // but we may need to round to even!
  347|  6.09k|    if ((h.digits[dp] == 5) && (dp + 1 == h.num_digits)) {
  ------------------
  |  Branch (347:9): [True: 1.18k, False: 4.90k]
  |  Branch (347:32): [True: 630, False: 555]
  ------------------
  348|    630|      round_up = h.truncated || ((dp > 0) && (1 & h.digits[dp - 1]));
  ------------------
  |  Branch (348:18): [True: 334, False: 296]
  |  Branch (348:34): [True: 296, False: 0]
  |  Branch (348:46): [True: 254, False: 42]
  ------------------
  349|    630|    }
  350|  6.09k|  }
  351|  6.74k|  if (round_up) {
  ------------------
  |  Branch (351:7): [True: 4.78k, False: 1.95k]
  ------------------
  352|  4.78k|    n++;
  353|  4.78k|  }
  354|  6.74k|  return n;
  355|  6.94k|}
_ZN8simdjson8internal18decimal_left_shiftERNS0_7decimalEj:
  358|  22.6k|void decimal_left_shift(decimal &h, uint32_t shift) {
  359|  22.6k|  if (h.num_digits == 0) {
  ------------------
  |  Branch (359:7): [True: 0, False: 22.6k]
  ------------------
  360|      0|    return;
  361|      0|  }
  362|  22.6k|  uint32_t num_new_digits = number_of_digits_decimal_left_shift(h, shift);
  363|  22.6k|  int32_t read_index = int32_t(h.num_digits - 1);
  364|  22.6k|  uint32_t write_index = h.num_digits - 1 + num_new_digits;
  365|  22.6k|  uint64_t n = 0;
  366|       |
  367|  3.27M|  while (read_index >= 0) {
  ------------------
  |  Branch (367:10): [True: 3.25M, False: 22.6k]
  ------------------
  368|  3.25M|    n += uint64_t(h.digits[read_index]) << shift;
  369|  3.25M|    uint64_t quotient = n / 10;
  370|  3.25M|    uint64_t remainder = n - (10 * quotient);
  371|  3.25M|    if (write_index < max_digits) {
  ------------------
  |  Branch (371:9): [True: 3.25M, False: 4.14k]
  ------------------
  372|  3.25M|      h.digits[write_index] = uint8_t(remainder);
  373|  3.25M|    } else if (remainder > 0) {
  ------------------
  |  Branch (373:16): [True: 3.32k, False: 820]
  ------------------
  374|  3.32k|      h.truncated = true;
  375|  3.32k|    }
  376|  3.25M|    n = quotient;
  377|  3.25M|    write_index--;
  378|  3.25M|    read_index--;
  379|  3.25M|  }
  380|   319k|  while (n > 0) {
  ------------------
  |  Branch (380:10): [True: 296k, False: 22.6k]
  ------------------
  381|   296k|    uint64_t quotient = n / 10;
  382|   296k|    uint64_t remainder = n - (10 * quotient);
  383|   296k|    if (write_index < max_digits) {
  ------------------
  |  Branch (383:9): [True: 296k, False: 0]
  ------------------
  384|   296k|      h.digits[write_index] = uint8_t(remainder);
  385|   296k|    } else if (remainder > 0) {
  ------------------
  |  Branch (385:16): [True: 0, False: 0]
  ------------------
  386|      0|      h.truncated = true;
  387|      0|    }
  388|   296k|    n = quotient;
  389|   296k|    write_index--;
  390|   296k|  }
  391|  22.6k|  h.num_digits += num_new_digits;
  392|  22.6k|  if (h.num_digits > max_digits) {
  ------------------
  |  Branch (392:7): [True: 300, False: 22.3k]
  ------------------
  393|    300|    h.num_digits = max_digits;
  394|    300|  }
  395|  22.6k|  h.decimal_point += int32_t(num_new_digits);
  396|  22.6k|  trim(h);
  397|  22.6k|}
_ZN8simdjson8internal19decimal_right_shiftERNS0_7decimalEj:
  400|  14.0k|void decimal_right_shift(decimal &h, uint32_t shift) {
  401|  14.0k|  uint32_t read_index = 0;
  402|  14.0k|  uint32_t write_index = 0;
  403|       |
  404|  14.0k|  uint64_t n = 0;
  405|       |
  406|   173k|  while ((n >> shift) == 0) {
  ------------------
  |  Branch (406:10): [True: 160k, False: 12.8k]
  ------------------
  407|   160k|    if (read_index < h.num_digits) {
  ------------------
  |  Branch (407:9): [True: 159k, False: 1.23k]
  ------------------
  408|   159k|      n = (10 * n) + h.digits[read_index++];
  409|   159k|    } else if (n == 0) {
  ------------------
  |  Branch (409:16): [True: 0, False: 1.23k]
  ------------------
  410|      0|      return;
  411|  1.23k|    } else {
  412|  8.74k|      while ((n >> shift) == 0) {
  ------------------
  |  Branch (412:14): [True: 7.51k, False: 1.23k]
  ------------------
  413|  7.51k|        n = 10 * n;
  414|  7.51k|        read_index++;
  415|  7.51k|      }
  416|  1.23k|      break;
  417|  1.23k|    }
  418|   160k|  }
  419|  14.0k|  h.decimal_point -= int32_t(read_index - 1);
  420|  14.0k|  if (h.decimal_point < -decimal_point_range) { // it is zero
  ------------------
  |  Branch (420:7): [True: 0, False: 14.0k]
  ------------------
  421|      0|    h.num_digits = 0;
  422|      0|    h.decimal_point = 0;
  423|      0|    h.negative = false;
  424|      0|    h.truncated = false;
  425|      0|    return;
  426|      0|  }
  427|  14.0k|  uint64_t mask = (uint64_t(1) << shift) - 1;
  428|  2.83M|  while (read_index < h.num_digits) {
  ------------------
  |  Branch (428:10): [True: 2.82M, False: 14.0k]
  ------------------
  429|  2.82M|    uint8_t new_digit = uint8_t(n >> shift);
  430|  2.82M|    n = (10 * (n & mask)) + h.digits[read_index++];
  431|  2.82M|    h.digits[write_index++] = new_digit;
  432|  2.82M|  }
  433|   470k|  while (n > 0) {
  ------------------
  |  Branch (433:10): [True: 456k, False: 14.0k]
  ------------------
  434|   456k|    uint8_t new_digit = uint8_t(n >> shift);
  435|   456k|    n = 10 * (n & mask);
  436|   456k|    if (write_index < max_digits) {
  ------------------
  |  Branch (436:9): [True: 452k, False: 4.33k]
  ------------------
  437|   452k|      h.digits[write_index++] = new_digit;
  438|   452k|    } else if (new_digit > 0) {
  ------------------
  |  Branch (438:16): [True: 3.84k, False: 490]
  ------------------
  439|  3.84k|      h.truncated = true;
  440|  3.84k|    }
  441|   456k|  }
  442|  14.0k|  h.num_digits = write_index;
  443|  14.0k|  trim(h);
  444|  14.0k|}
_ZN8simdjson8internal10from_charsEPKc:
  570|  6.39k|double from_chars(const char *first) noexcept {
  571|  6.39k|  bool negative = first[0] == '-';
  572|  6.39k|  if (negative) {
  ------------------
  |  Branch (572:7): [True: 317, False: 6.08k]
  ------------------
  573|    317|    first++;
  574|    317|  }
  575|  6.39k|  adjusted_mantissa am = parse_long_mantissa<binary_format<double>>(first);
  576|  6.39k|  uint64_t word = am.mantissa;
  577|  6.39k|  word |= uint64_t(am.power2)
  578|  6.39k|          << binary_format<double>::mantissa_explicit_bits();
  579|  6.39k|  word = negative ? word | (uint64_t(1) << binary_format<double>::sign_index())
  ------------------
  |  Branch (579:10): [True: 317, False: 6.08k]
  ------------------
  580|  6.39k|                  : word;
  581|  6.39k|  double value;
  582|  6.39k|  std::memcpy(&value, &word, sizeof(double));
  583|  6.39k|  return value;
  584|  6.39k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_135number_of_digits_decimal_left_shiftERNS0_7decimalEj:
  234|  22.6k|uint32_t number_of_digits_decimal_left_shift(decimal &h, uint32_t shift) {
  235|  22.6k|  shift &= 63;
  236|  22.6k|  const static uint16_t number_of_digits_decimal_left_shift_table[65] = {
  237|  22.6k|      0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817,
  238|  22.6k|      0x181D, 0x2024, 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067,
  239|  22.6k|      0x3073, 0x3080, 0x388E, 0x389C, 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF,
  240|  22.6k|      0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169, 0x5180, 0x5998, 0x59B0,
  241|  22.6k|      0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B, 0x72AA,
  242|  22.6k|      0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC,
  243|  22.6k|      0x8C02, 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C,
  244|  22.6k|      0x051C, 0x051C,
  245|  22.6k|  };
  246|  22.6k|  uint32_t x_a = number_of_digits_decimal_left_shift_table[shift];
  247|  22.6k|  uint32_t x_b = number_of_digits_decimal_left_shift_table[shift + 1];
  248|  22.6k|  uint32_t num_new_digits = x_a >> 11;
  249|  22.6k|  uint32_t pow5_a = 0x7FF & x_a;
  250|  22.6k|  uint32_t pow5_b = 0x7FF & x_b;
  251|  22.6k|  const static uint8_t
  252|  22.6k|      number_of_digits_decimal_left_shift_table_powers_of_5[0x051C] = {
  253|  22.6k|          5, 2, 5, 1, 2, 5, 6, 2, 5, 3, 1, 2, 5, 1, 5, 6, 2, 5, 7, 8, 1, 2, 5,
  254|  22.6k|          3, 9, 0, 6, 2, 5, 1, 9, 5, 3, 1, 2, 5, 9, 7, 6, 5, 6, 2, 5, 4, 8, 8,
  255|  22.6k|          2, 8, 1, 2, 5, 2, 4, 4, 1, 4, 0, 6, 2, 5, 1, 2, 2, 0, 7, 0, 3, 1, 2,
  256|  22.6k|          5, 6, 1, 0, 3, 5, 1, 5, 6, 2, 5, 3, 0, 5, 1, 7, 5, 7, 8, 1, 2, 5, 1,
  257|  22.6k|          5, 2, 5, 8, 7, 8, 9, 0, 6, 2, 5, 7, 6, 2, 9, 3, 9, 4, 5, 3, 1, 2, 5,
  258|  22.6k|          3, 8, 1, 4, 6, 9, 7, 2, 6, 5, 6, 2, 5, 1, 9, 0, 7, 3, 4, 8, 6, 3, 2,
  259|  22.6k|          8, 1, 2, 5, 9, 5, 3, 6, 7, 4, 3, 1, 6, 4, 0, 6, 2, 5, 4, 7, 6, 8, 3,
  260|  22.6k|          7, 1, 5, 8, 2, 0, 3, 1, 2, 5, 2, 3, 8, 4, 1, 8, 5, 7, 9, 1, 0, 1, 5,
  261|  22.6k|          6, 2, 5, 1, 1, 9, 2, 0, 9, 2, 8, 9, 5, 5, 0, 7, 8, 1, 2, 5, 5, 9, 6,
  262|  22.6k|          0, 4, 6, 4, 4, 7, 7, 5, 3, 9, 0, 6, 2, 5, 2, 9, 8, 0, 2, 3, 2, 2, 3,
  263|  22.6k|          8, 7, 6, 9, 5, 3, 1, 2, 5, 1, 4, 9, 0, 1, 1, 6, 1, 1, 9, 3, 8, 4, 7,
  264|  22.6k|          6, 5, 6, 2, 5, 7, 4, 5, 0, 5, 8, 0, 5, 9, 6, 9, 2, 3, 8, 2, 8, 1, 2,
  265|  22.6k|          5, 3, 7, 2, 5, 2, 9, 0, 2, 9, 8, 4, 6, 1, 9, 1, 4, 0, 6, 2, 5, 1, 8,
  266|  22.6k|          6, 2, 6, 4, 5, 1, 4, 9, 2, 3, 0, 9, 5, 7, 0, 3, 1, 2, 5, 9, 3, 1, 3,
  267|  22.6k|          2, 2, 5, 7, 4, 6, 1, 5, 4, 7, 8, 5, 1, 5, 6, 2, 5, 4, 6, 5, 6, 6, 1,
  268|  22.6k|          2, 8, 7, 3, 0, 7, 7, 3, 9, 2, 5, 7, 8, 1, 2, 5, 2, 3, 2, 8, 3, 0, 6,
  269|  22.6k|          4, 3, 6, 5, 3, 8, 6, 9, 6, 2, 8, 9, 0, 6, 2, 5, 1, 1, 6, 4, 1, 5, 3,
  270|  22.6k|          2, 1, 8, 2, 6, 9, 3, 4, 8, 1, 4, 4, 5, 3, 1, 2, 5, 5, 8, 2, 0, 7, 6,
  271|  22.6k|          6, 0, 9, 1, 3, 4, 6, 7, 4, 0, 7, 2, 2, 6, 5, 6, 2, 5, 2, 9, 1, 0, 3,
  272|  22.6k|          8, 3, 0, 4, 5, 6, 7, 3, 3, 7, 0, 3, 6, 1, 3, 2, 8, 1, 2, 5, 1, 4, 5,
  273|  22.6k|          5, 1, 9, 1, 5, 2, 2, 8, 3, 6, 6, 8, 5, 1, 8, 0, 6, 6, 4, 0, 6, 2, 5,
  274|  22.6k|          7, 2, 7, 5, 9, 5, 7, 6, 1, 4, 1, 8, 3, 4, 2, 5, 9, 0, 3, 3, 2, 0, 3,
  275|  22.6k|          1, 2, 5, 3, 6, 3, 7, 9, 7, 8, 8, 0, 7, 0, 9, 1, 7, 1, 2, 9, 5, 1, 6,
  276|  22.6k|          6, 0, 1, 5, 6, 2, 5, 1, 8, 1, 8, 9, 8, 9, 4, 0, 3, 5, 4, 5, 8, 5, 6,
  277|  22.6k|          4, 7, 5, 8, 3, 0, 0, 7, 8, 1, 2, 5, 9, 0, 9, 4, 9, 4, 7, 0, 1, 7, 7,
  278|  22.6k|          2, 9, 2, 8, 2, 3, 7, 9, 1, 5, 0, 3, 9, 0, 6, 2, 5, 4, 5, 4, 7, 4, 7,
  279|  22.6k|          3, 5, 0, 8, 8, 6, 4, 6, 4, 1, 1, 8, 9, 5, 7, 5, 1, 9, 5, 3, 1, 2, 5,
  280|  22.6k|          2, 2, 7, 3, 7, 3, 6, 7, 5, 4, 4, 3, 2, 3, 2, 0, 5, 9, 4, 7, 8, 7, 5,
  281|  22.6k|          9, 7, 6, 5, 6, 2, 5, 1, 1, 3, 6, 8, 6, 8, 3, 7, 7, 2, 1, 6, 1, 6, 0,
  282|  22.6k|          2, 9, 7, 3, 9, 3, 7, 9, 8, 8, 2, 8, 1, 2, 5, 5, 6, 8, 4, 3, 4, 1, 8,
  283|  22.6k|          8, 6, 0, 8, 0, 8, 0, 1, 4, 8, 6, 9, 6, 8, 9, 9, 4, 1, 4, 0, 6, 2, 5,
  284|  22.6k|          2, 8, 4, 2, 1, 7, 0, 9, 4, 3, 0, 4, 0, 4, 0, 0, 7, 4, 3, 4, 8, 4, 4,
  285|  22.6k|          9, 7, 0, 7, 0, 3, 1, 2, 5, 1, 4, 2, 1, 0, 8, 5, 4, 7, 1, 5, 2, 0, 2,
  286|  22.6k|          0, 0, 3, 7, 1, 7, 4, 2, 2, 4, 8, 5, 3, 5, 1, 5, 6, 2, 5, 7, 1, 0, 5,
  287|  22.6k|          4, 2, 7, 3, 5, 7, 6, 0, 1, 0, 0, 1, 8, 5, 8, 7, 1, 1, 2, 4, 2, 6, 7,
  288|  22.6k|          5, 7, 8, 1, 2, 5, 3, 5, 5, 2, 7, 1, 3, 6, 7, 8, 8, 0, 0, 5, 0, 0, 9,
  289|  22.6k|          2, 9, 3, 5, 5, 6, 2, 1, 3, 3, 7, 8, 9, 0, 6, 2, 5, 1, 7, 7, 6, 3, 5,
  290|  22.6k|          6, 8, 3, 9, 4, 0, 0, 2, 5, 0, 4, 6, 4, 6, 7, 7, 8, 1, 0, 6, 6, 8, 9,
  291|  22.6k|          4, 5, 3, 1, 2, 5, 8, 8, 8, 1, 7, 8, 4, 1, 9, 7, 0, 0, 1, 2, 5, 2, 3,
  292|  22.6k|          2, 3, 3, 8, 9, 0, 5, 3, 3, 4, 4, 7, 2, 6, 5, 6, 2, 5, 4, 4, 4, 0, 8,
  293|  22.6k|          9, 2, 0, 9, 8, 5, 0, 0, 6, 2, 6, 1, 6, 1, 6, 9, 4, 5, 2, 6, 6, 7, 2,
  294|  22.6k|          3, 6, 3, 2, 8, 1, 2, 5, 2, 2, 2, 0, 4, 4, 6, 0, 4, 9, 2, 5, 0, 3, 1,
  295|  22.6k|          3, 0, 8, 0, 8, 4, 7, 2, 6, 3, 3, 3, 6, 1, 8, 1, 6, 4, 0, 6, 2, 5, 1,
  296|  22.6k|          1, 1, 0, 2, 2, 3, 0, 2, 4, 6, 2, 5, 1, 5, 6, 5, 4, 0, 4, 2, 3, 6, 3,
  297|  22.6k|          1, 6, 6, 8, 0, 9, 0, 8, 2, 0, 3, 1, 2, 5, 5, 5, 5, 1, 1, 1, 5, 1, 2,
  298|  22.6k|          3, 1, 2, 5, 7, 8, 2, 7, 0, 2, 1, 1, 8, 1, 5, 8, 3, 4, 0, 4, 5, 4, 1,
  299|  22.6k|          0, 1, 5, 6, 2, 5, 2, 7, 7, 5, 5, 5, 7, 5, 6, 1, 5, 6, 2, 8, 9, 1, 3,
  300|  22.6k|          5, 1, 0, 5, 9, 0, 7, 9, 1, 7, 0, 2, 2, 7, 0, 5, 0, 7, 8, 1, 2, 5, 1,
  301|  22.6k|          3, 8, 7, 7, 7, 8, 7, 8, 0, 7, 8, 1, 4, 4, 5, 6, 7, 5, 5, 2, 9, 5, 3,
  302|  22.6k|          9, 5, 8, 5, 1, 1, 3, 5, 2, 5, 3, 9, 0, 6, 2, 5, 6, 9, 3, 8, 8, 9, 3,
  303|  22.6k|          9, 0, 3, 9, 0, 7, 2, 2, 8, 3, 7, 7, 6, 4, 7, 6, 9, 7, 9, 2, 5, 5, 6,
  304|  22.6k|          7, 6, 2, 6, 9, 5, 3, 1, 2, 5, 3, 4, 6, 9, 4, 4, 6, 9, 5, 1, 9, 5, 3,
  305|  22.6k|          6, 1, 4, 1, 8, 8, 8, 2, 3, 8, 4, 8, 9, 6, 2, 7, 8, 3, 8, 1, 3, 4, 7,
  306|  22.6k|          6, 5, 6, 2, 5, 1, 7, 3, 4, 7, 2, 3, 4, 7, 5, 9, 7, 6, 8, 0, 7, 0, 9,
  307|  22.6k|          4, 4, 1, 1, 9, 2, 4, 4, 8, 1, 3, 9, 1, 9, 0, 6, 7, 3, 8, 2, 8, 1, 2,
  308|  22.6k|          5, 8, 6, 7, 3, 6, 1, 7, 3, 7, 9, 8, 8, 4, 0, 3, 5, 4, 7, 2, 0, 5, 9,
  309|  22.6k|          6, 2, 2, 4, 0, 6, 9, 5, 9, 5, 3, 3, 6, 9, 1, 4, 0, 6, 2, 5,
  310|  22.6k|      };
  311|  22.6k|  const uint8_t *pow5 =
  312|  22.6k|      &number_of_digits_decimal_left_shift_table_powers_of_5[pow5_a];
  313|  22.6k|  uint32_t i = 0;
  314|  22.6k|  uint32_t n = pow5_b - pow5_a;
  315|  24.6k|  for (; i < n; i++) {
  ------------------
  |  Branch (315:10): [True: 24.4k, False: 194]
  ------------------
  316|  24.4k|    if (i >= h.num_digits) {
  ------------------
  |  Branch (316:9): [True: 297, False: 24.1k]
  ------------------
  317|    297|      return num_new_digits - 1;
  318|  24.1k|    } else if (h.digits[i] == pow5[i]) {
  ------------------
  |  Branch (318:16): [True: 2.00k, False: 22.1k]
  ------------------
  319|  2.00k|      continue;
  320|  22.1k|    } else if (h.digits[i] < pow5[i]) {
  ------------------
  |  Branch (320:16): [True: 14.4k, False: 7.69k]
  ------------------
  321|  14.4k|      return num_new_digits - 1;
  322|  14.4k|    } else {
  323|  7.69k|      return num_new_digits;
  324|  7.69k|    }
  325|  24.4k|  }
  326|    194|  return num_new_digits;
  327|  22.6k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_14trimERNS0_7decimalE:
  228|  36.6k|inline void trim(decimal &h) {
  229|   414k|  while ((h.num_digits > 0) && (h.digits[h.num_digits - 1] == 0)) {
  ------------------
  |  Branch (229:10): [True: 414k, False: 0]
  |  Branch (229:32): [True: 378k, False: 36.6k]
  ------------------
  230|   378k|    h.num_digits--;
  231|   378k|  }
  232|  36.6k|}
_ZN8simdjson8internal13binary_formatIdE22mantissa_explicit_bitsEv:
   54|  17.8k|template <> constexpr int binary_format<double>::mantissa_explicit_bits() {
   55|  17.8k|  return 52;
   56|  17.8k|}
_ZN8simdjson8internal13binary_formatIdE10sign_indexEv:
   65|    317|template <> constexpr int binary_format<double>::sign_index() { return 63; }
_ZN8simdjson8internal19parse_long_mantissaINS0_13binary_formatIdEEEENS0_17adjusted_mantissaEPKc:
  559|  6.39k|adjusted_mantissa parse_long_mantissa(const char *first) {
  560|  6.39k|  decimal d = parse_decimal(first);
  561|  6.39k|  return compute_float<binary>(d);
  562|  6.39k|}
_ZN8simdjson8internal13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaERNS0_7decimalE:
  446|  6.39k|template <typename binary> adjusted_mantissa compute_float(decimal &d) {
  447|  6.39k|  adjusted_mantissa answer;
  448|  6.39k|  if (d.num_digits == 0) {
  ------------------
  |  Branch (448:7): [True: 79, False: 6.31k]
  ------------------
  449|       |    // should be zero
  450|     79|    answer.power2 = 0;
  451|     79|    answer.mantissa = 0;
  452|     79|    return answer;
  453|     79|  }
  454|       |  // At this point, going further, we can assume that d.num_digits > 0.
  455|       |  // We want to guard against excessive decimal point values because
  456|       |  // they can result in long running times. Indeed, we do
  457|       |  // shifts by at most 60 bits. We have that log(10**400)/log(2**60) ~= 22
  458|       |  // which is fine, but log(10**299995)/log(2**60) ~= 16609 which is not
  459|       |  // fine (runs for a long time).
  460|       |  //
  461|  6.31k|  if(d.decimal_point < -324) {
  ------------------
  |  Branch (461:6): [True: 257, False: 6.06k]
  ------------------
  462|       |    // We have something smaller than 1e-324 which is always zero
  463|       |    // in binary64 and binary32.
  464|       |    // It should be zero.
  465|    257|    answer.power2 = 0;
  466|    257|    answer.mantissa = 0;
  467|    257|    return answer;
  468|  6.06k|  } else if(d.decimal_point >= 310) {
  ------------------
  |  Branch (468:13): [True: 157, False: 5.90k]
  ------------------
  469|       |    // We have something at least as large as 0.1e310 which is
  470|       |    // always infinite.
  471|    157|    answer.power2 = binary::infinite_power();
  472|    157|    answer.mantissa = 0;
  473|    157|    return answer;
  474|    157|  }
  475|       |
  476|  5.90k|  static const uint32_t max_shift = 60;
  477|  5.90k|  static const uint32_t num_powers = 19;
  478|  5.90k|  static const uint8_t powers[19] = {
  479|  5.90k|      0,  3,  6,  9,  13, 16, 19, 23, 26, 29, //
  480|  5.90k|      33, 36, 39, 43, 46, 49, 53, 56, 59,     //
  481|  5.90k|  };
  482|  5.90k|  int32_t exp2 = 0;
  483|  18.1k|  while (d.decimal_point > 0) {
  ------------------
  |  Branch (483:10): [True: 12.2k, False: 5.90k]
  ------------------
  484|  12.2k|    uint32_t n = uint32_t(d.decimal_point);
  485|  12.2k|    uint32_t shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (485:22): [True: 5.87k, False: 6.40k]
  ------------------
  486|  12.2k|    decimal_right_shift(d, shift);
  487|  12.2k|    if (d.decimal_point < -decimal_point_range) {
  ------------------
  |  Branch (487:9): [True: 0, False: 12.2k]
  ------------------
  488|       |      // should be zero
  489|      0|      answer.power2 = 0;
  490|      0|      answer.mantissa = 0;
  491|      0|      return answer;
  492|      0|    }
  493|  12.2k|    exp2 += int32_t(shift);
  494|  12.2k|  }
  495|       |  // We shift left toward [1/2 ... 1].
  496|  22.8k|  while (d.decimal_point <= 0) {
  ------------------
  |  Branch (496:10): [True: 22.8k, False: 0]
  ------------------
  497|  22.8k|    uint32_t shift;
  498|  22.8k|    if (d.decimal_point == 0) {
  ------------------
  |  Branch (498:9): [True: 10.2k, False: 12.6k]
  ------------------
  499|  10.2k|      if (d.digits[0] >= 5) {
  ------------------
  |  Branch (499:11): [True: 5.90k, False: 4.31k]
  ------------------
  500|  5.90k|        break;
  501|  5.90k|      }
  502|  4.31k|      shift = (d.digits[0] < 2) ? 2 : 1;
  ------------------
  |  Branch (502:15): [True: 1.65k, False: 2.65k]
  ------------------
  503|  12.6k|    } else {
  504|  12.6k|      uint32_t n = uint32_t(-d.decimal_point);
  505|  12.6k|      shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (505:15): [True: 1.83k, False: 10.7k]
  ------------------
  506|  12.6k|    }
  507|  16.9k|    decimal_left_shift(d, shift);
  508|  16.9k|    if (d.decimal_point > decimal_point_range) {
  ------------------
  |  Branch (508:9): [True: 0, False: 16.9k]
  ------------------
  509|       |      // we want to get infinity:
  510|      0|      answer.power2 = 0xFF;
  511|      0|      answer.mantissa = 0;
  512|      0|      return answer;
  513|      0|    }
  514|  16.9k|    exp2 -= int32_t(shift);
  515|  16.9k|  }
  516|       |  // We are now in the range [1/2 ... 1] but the binary format uses [1 ... 2].
  517|  5.90k|  exp2--;
  518|  5.90k|  constexpr int32_t minimum_exponent = binary::minimum_exponent();
  519|  6.43k|  while ((minimum_exponent + 1) > exp2) {
  ------------------
  |  Branch (519:10): [True: 533, False: 5.90k]
  ------------------
  520|    533|    uint32_t n = uint32_t((minimum_exponent + 1) - exp2);
  521|    533|    if (n > max_shift) {
  ------------------
  |  Branch (521:9): [True: 0, False: 533]
  ------------------
  522|      0|      n = max_shift;
  523|      0|    }
  524|    533|    decimal_right_shift(d, n);
  525|    533|    exp2 += int32_t(n);
  526|    533|  }
  527|  5.90k|  if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (527:7): [True: 187, False: 5.71k]
  ------------------
  528|    187|    answer.power2 = binary::infinite_power();
  529|    187|    answer.mantissa = 0;
  530|    187|    return answer;
  531|    187|  }
  532|       |
  533|  5.71k|  const int mantissa_size_in_bits = binary::mantissa_explicit_bits() + 1;
  534|  5.71k|  decimal_left_shift(d, mantissa_size_in_bits);
  535|       |
  536|  5.71k|  uint64_t mantissa = round(d);
  537|       |  // It is possible that we have an overflow, in which case we need
  538|       |  // to shift back.
  539|  5.71k|  if (mantissa >= (uint64_t(1) << mantissa_size_in_bits)) {
  ------------------
  |  Branch (539:7): [True: 1.22k, False: 4.48k]
  ------------------
  540|  1.22k|    decimal_right_shift(d, 1);
  541|  1.22k|    exp2 += 1;
  542|  1.22k|    mantissa = round(d);
  543|  1.22k|    if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (543:9): [True: 6, False: 1.22k]
  ------------------
  544|      6|      answer.power2 = binary::infinite_power();
  545|      6|      answer.mantissa = 0;
  546|      6|      return answer;
  547|      6|    }
  548|  1.22k|  }
  549|  5.71k|  answer.power2 = exp2 - binary::minimum_exponent();
  550|  5.71k|  if (mantissa < (uint64_t(1) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (550:7): [True: 533, False: 5.17k]
  ------------------
  551|    533|    answer.power2--;
  552|    533|  }
  553|  5.71k|  answer.mantissa =
  554|  5.71k|      mantissa & ((uint64_t(1) << binary::mantissa_explicit_bits()) - 1);
  555|  5.71k|  return answer;
  556|  5.71k|}
_ZN8simdjson8internal17adjusted_mantissaC2Ev:
   36|  6.39k|  adjusted_mantissa() : mantissa(0), power2(0) {}
_ZN8simdjson8internal13binary_formatIdE14infinite_powerEv:
   61|  7.48k|template <> constexpr int binary_format<double>::infinite_power() {
   62|  7.48k|  return 0x7FF;
   63|  7.48k|}
_ZN8simdjson8internal13binary_formatIdE16minimum_exponentEv:
   58|  5.71k|template <> constexpr int binary_format<double>::minimum_exponent() {
   59|  5.71k|  return -1023;
   60|  5.71k|}

simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block6scalarEv:
   17|  1.66M|  simdjson_inline uint64_t scalar() const noexcept { return ~(op() | whitespace()); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block2opEv:
   16|  2.50M|  simdjson_inline uint64_t op() const noexcept { return _op; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block10whitespaceEv:
   15|  1.66M|  simdjson_inline uint64_t whitespace() const noexcept { return _whitespace; }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm128EEC2EPKhm:
   83|  8.74k|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} {}
  ------------------
  |  Branch (83:134): [True: 7.23k, False: 1.51k]
  ------------------
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm128EE14has_full_blockEv:
   89|   416k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   90|   416k|  return idx < lenminusstep;
   91|   416k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm128EE7advanceEv:
  107|   416k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
  108|   416k|  idx += STEP_SIZE;
  109|   416k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm128EE10full_blockEv:
   94|   407k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   95|   407k|  return &buf[idx];
   96|   407k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm128EE13get_remainderEPh:
   99|  8.74k|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
  100|  8.74k|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (100:6): [True: 0, False: 8.74k]
  ------------------
  101|  8.74k|  std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once.
  102|  8.74k|  std::memcpy(dst, buf + idx, len - idx);
  103|  8.74k|  return len - idx;
  104|  8.74k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm128EE11block_indexEv:
   86|   842k|simdjson_inline size_t buf_block_reader<STEP_SIZE>::block_index() { return idx; }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_escape_scanner4nextEm:
   50|   833k|  simdjson_really_inline escaped_and_escape next(uint64_t backslash) noexcept {
   51|       |
   52|   833k|#if !SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT
   53|   833k|    if (!backslash) { return {next_escaped_without_backslashes(), 0}; }
  ------------------
  |  Branch (53:9): [True: 826k, False: 7.26k]
  ------------------
   54|  7.26k|#endif
   55|       |
   56|       |    // |                                | Mask (shows characters instead of 1's) | Depth | Instructions        |
   57|       |    // |--------------------------------|----------------------------------------|-------|---------------------|
   58|       |    // | string                         | `\\n_\\\n___\\\n___\\\\___\\\\__\\\`   |       |                     |
   59|       |    // |                                | `    even   odd    even   odd   odd`   |       |                     |
   60|       |    // | potential_escape               | ` \  \\\    \\\    \\\\   \\\\  \\\`   | 1     | 1 (backslash & ~first_is_escaped)
   61|       |    // | escape_and_terminal_code       | ` \n \ \n   \ \n   \ \    \ \   \ \`   | 5     | 5 (next_escape_and_terminal_code())
   62|       |    // | escaped                        | `\    \ n    \ n    \ \    \ \   \ ` X | 6     | 7 (escape_and_terminal_code ^ (potential_escape | first_is_escaped))
   63|       |    // | escape                         | `    \ \    \ \    \ \    \ \   \ \`   | 6     | 8 (escape_and_terminal_code & backslash)
   64|       |    // | first_is_escaped               | `\                                 `   | 7 (*) | 9 (escape >> 63) ()
   65|       |    //                                                                               (*) this is not needed until the next iteration
   66|  7.26k|    uint64_t escape_and_terminal_code = next_escape_and_terminal_code(backslash & ~this->next_is_escaped);
   67|  7.26k|    uint64_t escaped = escape_and_terminal_code ^ (backslash | this->next_is_escaped);
   68|  7.26k|    uint64_t escape = escape_and_terminal_code & backslash;
   69|  7.26k|    this->next_is_escaped = escape >> 63;
   70|  7.26k|    return {escaped, escape};
   71|   833k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_escape_scanner32next_escaped_without_backslashesEv:
   76|   826k|  simdjson_really_inline uint64_t next_escaped_without_backslashes() noexcept {
   77|   826k|    uint64_t escaped = this->next_is_escaped;
   78|   826k|    this->next_is_escaped = 0;
   79|   826k|    return escaped;
   80|   826k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_escape_scanner29next_escape_and_terminal_codeEm:
   96|  7.26k|  static simdjson_really_inline uint64_t next_escape_and_terminal_code(uint64_t potential_escape) noexcept {
   97|       |    // If we were to just shift and mask out any odd bits, we'd actually get a *half* right answer:
   98|       |    // any even-aligned backslash runs would be correct! Odd-aligned backslash runs would be
   99|       |    // inverted (\\\ would be 010 instead of 101).
  100|       |    //
  101|       |    // ```
  102|       |    // string:              | ____\\\\_\\\\_____ |
  103|       |    // maybe_escaped | ODD  |     \ \   \ \      |
  104|       |    //               even-aligned ^^^  ^^^^ odd-aligned
  105|       |    // ```
  106|       |    //
  107|       |    // Taking that into account, our basic strategy is:
  108|       |    //
  109|       |    // 1. Use subtraction to produce a mask with 1's for even-aligned runs and 0's for
  110|       |    //    odd-aligned runs.
  111|       |    // 2. XOR all odd bits, which masks out the odd bits in even-aligned runs, and brings IN the
  112|       |    //    odd bits in odd-aligned runs.
  113|       |    // 3. & with backslash to clean up any stray bits.
  114|       |    // runs are set to 0, and then XORing with "odd":
  115|       |    //
  116|       |    // |                                | Mask (shows characters instead of 1's) | Instructions        |
  117|       |    // |--------------------------------|----------------------------------------|---------------------|
  118|       |    // | string                         | `\\n_\\\n___\\\n___\\\\___\\\\__\\\`   |
  119|       |    // |                                | `    even   odd    even   odd   odd`   |
  120|       |    // | maybe_escaped                  | `  n  \\n    \\n    \\\_   \\\_  \\` X | 1 (potential_escape << 1)
  121|       |    // | maybe_escaped_and_odd          | ` \n_ \\n _ \\\n_ _ \\\__ _\\\_ \\\`   | 1 (maybe_escaped | odd)
  122|       |    // | even_series_codes_and_odd      | `  n_\\\  _    n_ _\\\\ _     _    `   | 1 (maybe_escaped_and_odd - potential_escape)
  123|       |    // | escape_and_terminal_code       | ` \n \ \n   \ \n   \ \    \ \   \ \`   | 1 (^ odd)
  124|       |    //
  125|       |
  126|       |    // Escaped characters are characters following an escape.
  127|  7.26k|    uint64_t maybe_escaped = potential_escape << 1;
  128|       |
  129|       |    // To distinguish odd from even escape sequences, therefore, we turn on any *starting*
  130|       |    // escapes that are on an odd byte. (We actually bring in all odd bits, for speed.)
  131|       |    // - Odd runs of backslashes are 0000, and the code at the end ("n" in \n or \\n) is 1.
  132|       |    // - Odd runs of backslashes are 1111, and the code at the end ("n" in \n or \\n) is 0.
  133|       |    // - All other odd bytes are 1, and even bytes are 0.
  134|  7.26k|    uint64_t maybe_escaped_and_odd_bits     = maybe_escaped | ODD_BITS;
  135|  7.26k|    uint64_t even_series_codes_and_odd_bits = maybe_escaped_and_odd_bits - potential_escape;
  136|       |
  137|       |    // Now we flip all odd bytes back with xor. This:
  138|       |    // - Makes odd runs of backslashes go from 0000 to 1010
  139|       |    // - Makes even runs of backslashes go from 1111 to 1010
  140|       |    // - Sets actually-escaped codes to 1 (the n in \n and \\n: \n = 11, \\n = 100)
  141|       |    // - Resets all other bytes to 0
  142|  7.26k|    return even_series_codes_and_odd_bits ^ ODD_BITS;
  143|  7.26k|  }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scannerC2Ev:
  108|  8.74k|  json_scanner() = default;
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner4nextERKNS1_4simd8simd8x64IhEE:
  134|   833k|simdjson_inline json_block json_scanner::next(const simd::simd8x64<uint8_t>& in) {
  135|   833k|  json_string_block strings = string_scanner.next(in);
  136|       |  // identifies the white-space and the structural characters
  137|   833k|  json_character_block characters = json_character_block::classify(in);
  138|       |  // The term "scalar" refers to anything except structural characters and white space
  139|       |  // (so letters, numbers, quotes).
  140|       |  // We want follows_scalar to mark anything that follows a non-quote scalar (so letters and numbers).
  141|       |  //
  142|       |  // A terminal quote should either be followed by a structural character (comma, brace, bracket, colon)
  143|       |  // or nothing. However, we still want ' "a string"true ' to mark the 't' of 'true' as a potential
  144|       |  // pseudo-structural character just like we would if we had  ' "a string" true '; otherwise we
  145|       |  // may need to add an extra check when parsing strings.
  146|       |  //
  147|       |  // Performance: there are many ways to skin this cat.
  148|   833k|  const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote();
  149|   833k|  uint64_t follows_nonquote_scalar = follows(nonquote_scalar, prev_scalar);
  150|       |  // We are returning a function-local object so either we get a move constructor
  151|       |  // or we get copy elision.
  152|   833k|  return json_block(
  153|   833k|    strings,// strings is a function-local object so either it moves or the copy is elided.
  154|   833k|    characters,
  155|   833k|    follows_nonquote_scalar
  156|   833k|  );
  157|   833k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage17followsEmRm:
  128|   833k|simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
  129|   833k|  const uint64_t result = match << 1 | overflow;
  130|   833k|  overflow = match >> 63;
  131|   833k|  return result;
  132|   833k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage110json_blockC2ENS2_17json_string_blockENS1_20json_character_blockEm:
   38|   833k|  _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner6finishEv:
  159|  8.74k|simdjson_inline error_code json_scanner::finish() {
  160|  8.74k|  return string_scanner.finish();
  161|  8.74k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block16structural_startEv:
   44|   833k|  simdjson_inline uint64_t structural_start() const noexcept { return potential_structural_start() & ~_string.string_tail(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block26potential_structural_startEv:
   68|   833k|  simdjson_inline uint64_t potential_structural_start() const noexcept { return _characters.op() | potential_scalar_start(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block22potential_scalar_startEv:
   73|   833k|  simdjson_inline uint64_t potential_scalar_start() const noexcept {
   74|       |    // The term "scalar" refers to anything except structural characters and white space
   75|       |    // (so letters, numbers, quotes).
   76|       |    // Whenever it is preceded by something that is not a structural element ({,},[,],:, ") nor a white-space
   77|       |    // then we know that it is irrelevant structurally.
   78|   833k|    return _characters.scalar() & ~follows_potential_scalar();
   79|   833k|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block24follows_potential_scalarEv:
   84|   833k|  simdjson_inline uint64_t follows_potential_scalar() const noexcept {
   85|       |    // _follows_potential_nonquote_scalar: is defined as marking any character that follows a character
   86|       |    // that is not a structural element ({,},[,],:, comma) nor a quote (") and that is not a
   87|       |    // white space.
   88|       |    // It is understood that within quoted region, anything at all could be marked (irrelevant).
   89|   833k|    return _follows_potential_nonquote_scalar;
   90|   833k|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block23non_quote_inside_stringEm:
   51|   833k|  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:
   62|   833k|simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64<uint8_t>& in) {
   63|   833k|  const uint64_t backslash = in.eq('\\');
   64|   833k|  const uint64_t escaped = escape_scanner.next(backslash).escaped;
   65|   833k|  const uint64_t quote = in.eq('"') & ~escaped;
   66|       |
   67|       |  //
   68|       |  // prefix_xor flips on bits inside the string (and flips off the end quote).
   69|       |  //
   70|       |  // Then we xor with prev_in_string: if we were in a string already, its effect is flipped
   71|       |  // (characters inside strings are outside, and characters outside strings are inside).
   72|       |  //
   73|   833k|  const uint64_t in_string = prefix_xor(quote) ^ prev_in_string;
   74|       |
   75|       |  //
   76|       |  // Check if we're still in a string at the end of the box so the next block will know
   77|       |  //
   78|   833k|  prev_in_string = uint64_t(static_cast<int64_t>(in_string) >> 63);
   79|       |
   80|       |  // Use ^ to turn the beginning quote off, and the end quote on.
   81|       |
   82|       |  // We are returning a function-local object so either we get a move constructor
   83|       |  // or we get copy elision.
   84|   833k|  return json_string_block(escaped, quote, in_string);
   85|   833k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage117json_string_blockC2Emmm:
   17|   833k|  _escaped(escaped), _quote(quote), _in_string(in_string) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block5quoteEv:
   22|   833k|  simdjson_really_inline uint64_t quote() const { return _quote; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner6finishEv:
   87|  8.74k|simdjson_really_inline error_code json_string_scanner::finish() {
   88|  8.74k|  if (prev_in_string) {
  ------------------
  |  Branch (88:7): [True: 177, False: 8.57k]
  ------------------
   89|    177|    return UNCLOSED_STRING;
   90|    177|  }
   91|  8.57k|  return SUCCESS;
   92|  8.74k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block11string_tailEv:
   30|   833k|  simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block23non_quote_inside_stringEm:
   26|   833k|  simdjson_really_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:
  194|  8.74k|error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept {
  195|  8.74k|  if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; }
  ------------------
  |  |  106|  8.74k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 8.74k]
  |  |  ------------------
  ------------------
  196|       |  // We guard the rest of the code so that we can assume that len > 0 throughout.
  197|  8.74k|  if (len == 0) { return EMPTY; }
  ------------------
  |  Branch (197:7): [True: 1, False: 8.74k]
  ------------------
  198|  8.74k|  if (is_streaming(partial)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 8.74k]
  ------------------
  199|      0|    len = trim_partial_utf8(buf, len);
  200|       |    // If you end up with an empty window after trimming
  201|       |    // the partial UTF-8 bytes, then chances are good that you
  202|       |    // have an UTF-8 formatting error.
  203|      0|    if(len == 0) { return UTF8_ERROR; }
  ------------------
  |  Branch (203:8): [True: 0, False: 0]
  ------------------
  204|      0|  }
  205|  8.74k|  buf_block_reader<STEP_SIZE> reader(buf, len);
  206|  8.74k|  json_structural_indexer indexer(parser.structural_indexes.get());
  207|       |
  208|       |  // Read all but the last block
  209|   416k|  while (reader.has_full_block()) {
  ------------------
  |  Branch (209:10): [True: 407k, False: 8.74k]
  ------------------
  210|   407k|    indexer.step<STEP_SIZE>(reader.full_block(), reader);
  211|   407k|  }
  212|       |  // Take care of the last block (will always be there unless file is empty which is
  213|       |  // not supposed to happen.)
  214|  8.74k|  uint8_t block[STEP_SIZE];
  215|  8.74k|  if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; }
  ------------------
  |  |  106|  8.74k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 8.74k]
  |  |  ------------------
  ------------------
  216|  8.74k|  indexer.step<STEP_SIZE>(block, reader);
  217|  8.74k|  return indexer.finish(parser, reader.block_index(), len, partial);
  218|  8.74k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexerC2EPj:
  153|  8.74k|simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexerC2EPj:
   28|  8.74k|  simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4stepILm128EEEvPKhRNS2_16buf_block_readerIXT_EEE:
  221|   416k|simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept {
  222|   416k|  simd::simd8x64<uint8_t> in_1(block);
  223|   416k|  simd::simd8x64<uint8_t> in_2(block+64);
  224|   416k|  json_block block_1 = scanner.next(in_1);
  225|   416k|  json_block block_2 = scanner.next(in_2);
  226|   416k|  this->next(in_1, block_1, reader.block_index());
  227|   416k|  this->next(in_2, block_2, reader.block_index()+64);
  228|   416k|  reader.advance();
  229|   416k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4nextERKNS1_4simd8simd8x64IhEERKNS2_10json_blockEm:
  239|   833k|simdjson_inline void json_structural_indexer::next(const simd::simd8x64<uint8_t>& in, const json_block& block, size_t idx) {
  240|   833k|  uint64_t unescaped = in.lteq(0x1F);
  241|   833k|#if SIMDJSON_UTF8VALIDATION
  242|   833k|  checker.check_next_input(in);
  243|   833k|#endif
  244|   833k|  indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser
  245|   833k|  prev_structurals = block.structural_start();
  246|   833k|  unescaped_chars_error |= block.non_quote_inside_string(unescaped);
  247|   833k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer5writeEjm:
   93|   842k|  simdjson_inline void write(uint32_t idx, uint64_t bits) {
   94|       |    // In some instances, the next branch is expensive because it is mispredicted.
   95|       |    // Unfortunately, in other cases,
   96|       |    // it helps tremendously.
   97|   842k|    if (bits == 0)
  ------------------
  |  Branch (97:9): [True: 707k, False: 134k]
  ------------------
   98|   707k|        return;
   99|       |
  100|   134k|    int cnt = static_cast<int>(count_ones(bits));
  101|       |
  102|       |#if SIMDJSON_PREFER_REVERSE_BITS
  103|       |    bits = reverse_bits(bits);
  104|       |#endif
  105|       |#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP
  106|       |    static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP;
  107|       |#else
  108|   134k|    static constexpr const int STEP = 4;
  109|   134k|#endif
  110|   134k|    static constexpr const int STEP_UNTIL = 24;
  111|       |
  112|   134k|    write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt);
  113|   134k|    SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) {
  ------------------
  |  |   47|   134k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  114|   134k|      if (simdjson_unlikely(STEP_UNTIL < cnt)) {
  ------------------
  |  |  106|   134k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 108k, False: 25.7k]
  |  |  ------------------
  ------------------
  115|  4.03M|        for (int i=STEP_UNTIL; i<cnt; i++) {
  ------------------
  |  Branch (115:32): [True: 3.93M, False: 108k]
  ------------------
  116|  3.93M|          write_index(idx, bits, i);
  117|  3.93M|        }
  118|   108k|      }
  119|   134k|    }
  120|       |
  121|   134k|    this->tail += cnt;
  122|   134k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi0ELi24ELi4EEEijRmi:
   72|   134k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   134k|    write_indexes<START, STEP>(idx, bits);
   74|   134k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   134k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   134k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   134k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 123k, False: 10.4k]
  |  |  ------------------
  ------------------
   76|   123k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   123k|      }
   78|   134k|    }
   79|   134k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   134k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi0ELi4EEEijRm:
   63|   134k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   134k|    write_index(idx, bits, START);
   65|   134k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   134k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   134k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   134k|    }
   68|   134k|    return START+N;
   69|   134k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi1ELi3EEEijRm:
   63|   134k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   134k|    write_index(idx, bits, START);
   65|   134k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   134k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   134k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   134k|    }
   68|   134k|    return START+N;
   69|   134k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi2ELi2EEEijRm:
   63|   134k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   134k|    write_index(idx, bits, START);
   65|   134k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   134k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   134k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   134k|    }
   68|   134k|    return START+N;
   69|   134k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi3ELi1EEEijRm:
   63|   134k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   134k|    write_index(idx, bits, START);
   65|   134k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   134k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   134k|    return START+N;
   69|   134k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi4ELi24ELi4EEEijRmi:
   72|   123k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   123k|    write_indexes<START, STEP>(idx, bits);
   74|   123k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   123k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   123k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 116k, False: 7.64k]
  |  |  ------------------
  ------------------
   76|   116k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   116k|      }
   78|   123k|    }
   79|   123k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi4ELi4EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   123k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   123k|    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi5ELi3EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   123k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   123k|    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi6ELi2EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   123k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   123k|    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi7ELi1EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi8ELi24ELi4EEEijRmi:
   72|   116k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   116k|    write_indexes<START, STEP>(idx, bits);
   74|   116k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   116k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   116k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   116k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 114k, False: 2.06k]
  |  |  ------------------
  ------------------
   76|   114k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   114k|      }
   78|   116k|    }
   79|   116k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   116k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi8ELi4EEEijRm:
   63|   116k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   116k|    write_index(idx, bits, START);
   65|   116k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   116k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   116k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   116k|    }
   68|   116k|    return START+N;
   69|   116k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi9ELi3EEEijRm:
   63|   116k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   116k|    write_index(idx, bits, START);
   65|   116k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   116k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   116k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   116k|    }
   68|   116k|    return START+N;
   69|   116k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi10ELi2EEEijRm:
   63|   116k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   116k|    write_index(idx, bits, START);
   65|   116k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   116k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   116k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   116k|    }
   68|   116k|    return START+N;
   69|   116k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi11ELi1EEEijRm:
   63|   116k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   116k|    write_index(idx, bits, START);
   65|   116k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   116k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   116k|    return START+N;
   69|   116k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi12ELi24ELi4EEEijRmi:
   72|   114k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   114k|    write_indexes<START, STEP>(idx, bits);
   74|   114k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   114k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   114k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   114k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 112k, False: 1.62k]
  |  |  ------------------
  ------------------
   76|   112k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   112k|      }
   78|   114k|    }
   79|   114k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   114k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi12ELi4EEEijRm:
   63|   114k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   114k|    write_index(idx, bits, START);
   65|   114k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   114k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   114k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   114k|    }
   68|   114k|    return START+N;
   69|   114k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi13ELi3EEEijRm:
   63|   114k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   114k|    write_index(idx, bits, START);
   65|   114k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   114k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   114k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   114k|    }
   68|   114k|    return START+N;
   69|   114k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi14ELi2EEEijRm:
   63|   114k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   114k|    write_index(idx, bits, START);
   65|   114k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   114k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   114k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   114k|    }
   68|   114k|    return START+N;
   69|   114k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi15ELi1EEEijRm:
   63|   114k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   114k|    write_index(idx, bits, START);
   65|   114k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   114k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   114k|    return START+N;
   69|   114k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi16ELi24ELi4EEEijRmi:
   72|   112k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   112k|    write_indexes<START, STEP>(idx, bits);
   74|   112k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   112k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   112k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   112k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 109k, False: 3.12k]
  |  |  ------------------
  ------------------
   76|   109k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   109k|      }
   78|   112k|    }
   79|   112k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   112k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi16ELi4EEEijRm:
   63|   112k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   112k|    write_index(idx, bits, START);
   65|   112k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   112k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   112k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   112k|    }
   68|   112k|    return START+N;
   69|   112k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi17ELi3EEEijRm:
   63|   112k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   112k|    write_index(idx, bits, START);
   65|   112k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   112k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   112k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   112k|    }
   68|   112k|    return START+N;
   69|   112k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi18ELi2EEEijRm:
   63|   112k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   112k|    write_index(idx, bits, START);
   65|   112k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   112k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   112k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   112k|    }
   68|   112k|    return START+N;
   69|   112k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi19ELi1EEEijRm:
   63|   112k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   112k|    write_index(idx, bits, START);
   65|   112k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   112k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   112k|    return START+N;
   69|   112k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi20ELi24ELi4EEEijRmi:
   72|   109k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   109k|    write_indexes<START, STEP>(idx, bits);
   74|   109k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   109k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|       |      if (simdjson_unlikely((START+STEP) < cnt)) {
   76|       |        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|       |      }
   78|       |    }
   79|   109k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   109k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi20ELi4EEEijRm:
   63|   109k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   109k|    write_index(idx, bits, START);
   65|   109k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   109k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   109k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   109k|    }
   68|   109k|    return START+N;
   69|   109k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi21ELi3EEEijRm:
   63|   109k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   109k|    write_index(idx, bits, START);
   65|   109k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   109k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   109k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   109k|    }
   68|   109k|    return START+N;
   69|   109k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi22ELi2EEEijRm:
   63|   109k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   109k|    write_index(idx, bits, START);
   65|   109k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   109k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   109k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   109k|    }
   68|   109k|    return START+N;
   69|   109k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi23ELi1EEEijRm:
   63|   109k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   109k|    write_index(idx, bits, START);
   65|   109k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   109k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   109k|    return START+N;
   69|   109k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer11write_indexEjRmi:
   56|  6.77M|  simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) {
   57|  6.77M|    this->tail[i] = idx + trailing_zeroes(bits);
   58|  6.77M|    bits = clear_lowest_bit(bits);
   59|  6.77M|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer6finishERNS0_25dom_parser_implementationEmmNS_11stage1_modeE:
  249|  8.74k|simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) {
  250|       |  // Write out the final iteration's structurals
  251|  8.74k|  indexer.write(uint32_t(idx-64), prev_structurals);
  252|  8.74k|  error_code error = scanner.finish();
  253|       |  // We deliberately break down the next expression so that it is
  254|       |  // human readable.
  255|  8.74k|  const bool should_we_exit = is_streaming(partial) ?
  ------------------
  |  Branch (255:31): [True: 0, False: 8.74k]
  ------------------
  256|      0|    ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING
  ------------------
  |  Branch (256:6): [True: 0, False: 0]
  |  Branch (256:28): [True: 0, False: 0]
  ------------------
  257|  8.74k|    : (error != SUCCESS); // if partial is false, we must have SUCCESS
  258|  8.74k|  const bool have_unclosed_string = (error == UNCLOSED_STRING);
  259|  8.74k|  if (simdjson_unlikely(should_we_exit)) { return error; }
  ------------------
  |  |  106|  8.74k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 177, False: 8.57k]
  |  |  ------------------
  ------------------
  260|       |
  261|  8.57k|  if (unescaped_chars_error) {
  ------------------
  |  Branch (261:7): [True: 164, False: 8.40k]
  ------------------
  262|    164|    return UNESCAPED_CHARS;
  263|    164|  }
  264|  8.40k|  parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get());
  265|       |  /***
  266|       |   * The On-Demand API requires special padding.
  267|       |   *
  268|       |   * This is related to https://github.com/simdjson/simdjson/issues/906
  269|       |   * Basically, we want to make sure that if the parsing continues beyond the last (valid)
  270|       |   * structural character, it quickly stops.
  271|       |   * Only three structural characters can be repeated without triggering an error in JSON:  [,] and }.
  272|       |   * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing
  273|       |   * continues, then it must be [,] or }.
  274|       |   * Suppose it is ] or }. We backtrack to the first character, what could it be that would
  275|       |   * not trigger an error? It could be ] or } but no, because you can't start a document that way.
  276|       |   * It can't be a comma, a colon or any simple value. So the only way we could continue is
  277|       |   * if the repeated character is [. But if so, the document must start with [. But if the document
  278|       |   * starts with [, it should end with ]. If we enforce that rule, then we would get
  279|       |   * ][[ which is invalid.
  280|       |   *
  281|       |   * This is illustrated with the test array_iterate_unclosed_error() on the following input:
  282|       |   * R"({ "a": [,,)"
  283|       |   **/
  284|  8.40k|  parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final
  285|  8.40k|  parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len);
  286|  8.40k|  parser.structural_indexes[parser.n_structural_indexes + 2] = 0;
  287|  8.40k|  parser.next_structural_index = 0;
  288|       |  // a valid JSON file cannot have zero structural indexes - we should have found something
  289|  8.40k|  if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  106|  8.40k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 1, False: 8.40k]
  |  |  ------------------
  ------------------
  290|      1|    return EMPTY;
  291|      1|  }
  292|  8.40k|  if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) {
  ------------------
  |  |  106|  8.40k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 8.40k]
  |  |  ------------------
  ------------------
  293|      0|    return UNEXPECTED_ERROR;
  294|      0|  }
  295|  8.40k|  if (partial == stage1_mode::streaming_partial) {
  ------------------
  |  Branch (295:7): [True: 0, False: 8.40k]
  ------------------
  296|       |    // If we have an unclosed string, then the last structural
  297|       |    // will be the quote and we want to make sure to omit it.
  298|      0|    if(have_unclosed_string) {
  ------------------
  |  Branch (298:8): [True: 0, False: 0]
  ------------------
  299|      0|      parser.n_structural_indexes--;
  300|       |      // a valid JSON file cannot have zero structural indexes - we should have found something
  301|      0|      if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; }
  ------------------
  |  |  106|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  302|      0|    }
  303|       |    // We truncate the input to the end of the last complete document (or zero).
  304|      0|    auto new_structural_indexes = find_next_document_index(parser);
  305|      0|    if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) {
  ------------------
  |  Branch (305:9): [True: 0, False: 0]
  |  Branch (305:40): [True: 0, False: 0]
  ------------------
  306|      0|      if(parser.structural_indexes[0] == 0) {
  ------------------
  |  Branch (306:10): [True: 0, False: 0]
  ------------------
  307|       |        // If the buffer is partial and we started at index 0 but the document is
  308|       |        // incomplete, it's too big to parse.
  309|      0|        return CAPACITY;
  310|      0|      } else {
  311|       |        // It is possible that the document could be parsed, we just had a lot
  312|       |        // of white space.
  313|      0|        parser.n_structural_indexes = 0;
  314|      0|        return EMPTY;
  315|      0|      }
  316|      0|    }
  317|       |
  318|      0|    parser.n_structural_indexes = new_structural_indexes;
  319|  8.40k|  } else if (partial == stage1_mode::streaming_final) {
  ------------------
  |  Branch (319:14): [True: 0, False: 8.40k]
  ------------------
  320|      0|    if(have_unclosed_string) { parser.n_structural_indexes--; }
  ------------------
  |  Branch (320:8): [True: 0, False: 0]
  ------------------
  321|       |    // We truncate the input to the end of the last complete document (or zero).
  322|       |    // Because partial == stage1_mode::streaming_final, it means that we may
  323|       |    // silently ignore trailing garbage. Though it sounds bad, we do it
  324|       |    // deliberately because many people who have streams of JSON documents
  325|       |    // will truncate them for processing. E.g., imagine that you are uncompressing
  326|       |    // the data from a size file or receiving it in chunks from the network. You
  327|       |    // may not know where exactly the last document will be. Meanwhile the
  328|       |    // document_stream instances allow people to know the JSON documents they are
  329|       |    // parsing (see the iterator.source() method).
  330|      0|    parser.n_structural_indexes = find_next_document_index(parser);
  331|       |    // We store the initial n_structural_indexes so that the client can see
  332|       |    // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes,
  333|       |    // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len,
  334|       |    // otherwise, it will copy some prior index.
  335|      0|    parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes];
  336|       |    // This next line is critical, do not change it unless you understand what you are
  337|       |    // doing.
  338|      0|    parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len);
  339|      0|    if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  106|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  340|       |        // We tolerate an unclosed string at the very end of the stream. Indeed, users
  341|       |        // often load their data in bulk without being careful and they want us to ignore
  342|       |        // the trailing garbage.
  343|      0|        return EMPTY;
  344|      0|    }
  345|      0|  }
  346|  8.40k|  checker.check_eof();
  347|  8.40k|  return checker.errors();
  348|  8.40k|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iteratorC2ERNS0_25dom_parser_implementationEm:
  245|  7.81k|  : buf{_dom_parser.buf},
  246|  7.81k|    next_structural{&_dom_parser.structural_indexes[start_structural_index]},
  247|  7.81k|    dom_parser{_dom_parser} {
  248|  7.81k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13walk_documentILb0ENS2_12tape_builderEEENS_10error_codeERT0_:
  119|  7.81k|simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
  120|  7.81k|  logger::log_start();
  121|       |
  122|       |  //
  123|       |  // Start the document
  124|       |  //
  125|  7.81k|  if (at_eof()) { return EMPTY; }
  ------------------
  |  Branch (125:7): [True: 0, False: 7.81k]
  ------------------
  126|  7.81k|  log_start_value("document");
  127|  7.81k|  SIMDJSON_TRY( visitor.visit_document_start(*this) );
  ------------------
  |  |  273|  7.81k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 7.81k]
  |  |  ------------------
  ------------------
  128|       |
  129|       |  //
  130|       |  // Read first value
  131|       |  //
  132|  7.81k|  {
  133|  7.81k|    auto value = advance();
  134|       |
  135|       |    // Make sure the outer object or array is closed before continuing; otherwise, there are ways we
  136|       |    // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906
  137|  7.81k|    if (!STREAMING) {
  ------------------
  |  Branch (137:9): [Folded - Ignored]
  ------------------
  138|  7.81k|      switch (*value) {
  ------------------
  |  Branch (138:15): [True: 2.45k, False: 5.36k]
  ------------------
  139|  2.77k|        case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (139:9): [True: 2.77k, False: 5.04k]
  |  Branch (139:23): [True: 18, False: 2.75k]
  ------------------
  140|  2.59k|        case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (140:9): [True: 2.59k, False: 5.22k]
  |  Branch (140:23): [True: 28, False: 2.56k]
  ------------------
  141|  7.81k|      }
  142|  7.81k|    }
  143|       |
  144|  7.77k|    switch (*value) {
  145|  2.75k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|      1|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (145:7): [True: 2.75k, False: 5.01k]
  |  Branch (145:21): [True: 1, False: 2.75k]
  ------------------
  146|  2.75k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|      2|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (146:7): [True: 2.56k, False: 5.20k]
  |  Branch (146:21): [True: 2, False: 2.56k]
  ------------------
  147|  2.56k|      default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break;
  ------------------
  |  |  273|  2.45k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 997, False: 1.45k]
  |  |  ------------------
  ------------------
  |  Branch (147:7): [True: 2.45k, False: 5.32k]
  ------------------
  148|  7.77k|    }
  149|  7.77k|  }
  150|  1.45k|  goto document_end;
  151|       |
  152|       |//
  153|       |// Object parser states
  154|       |//
  155|  6.19k|object_begin:
  156|  6.19k|  log_start_value("object");
  157|  6.19k|  depth++;
  158|  6.19k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (158:7): [True: 1, False: 6.19k]
  ------------------
  159|  6.19k|  dom_parser.is_array[depth] = false;
  160|  6.19k|  SIMDJSON_TRY( visitor.visit_object_start(*this) );
  ------------------
  |  |  273|  6.19k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 6.19k]
  |  |  ------------------
  ------------------
  161|       |
  162|  6.19k|  {
  163|  6.19k|    auto key = advance();
  164|  6.19k|    if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; }
  ------------------
  |  Branch (164:9): [True: 72, False: 6.11k]
  ------------------
  165|  6.11k|    SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  6.11k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 6.11k]
  |  |  ------------------
  ------------------
  166|  6.11k|    SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  273|  6.11k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 97, False: 6.02k]
  |  |  ------------------
  ------------------
  167|  6.02k|  }
  168|       |
  169|   276k|object_field:
  170|   276k|  if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; }
  ------------------
  |  |  106|   276k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 436, False: 276k]
  |  |  ------------------
  ------------------
  171|   276k|  {
  172|   276k|    auto value = advance();
  173|   276k|    switch (*value) {
  174|    958|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    222|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 222]
  |  |  ------------------
  ------------------
  |  Branch (174:7): [True: 958, False: 275k]
  |  Branch (174:21): [True: 222, False: 736]
  ------------------
  175|  2.14k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|    241|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 241]
  |  |  ------------------
  ------------------
  |  Branch (175:7): [True: 2.14k, False: 274k]
  |  Branch (175:21): [True: 241, False: 1.90k]
  ------------------
  176|   273k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  273|   273k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 638, False: 272k]
  |  |  ------------------
  ------------------
  |  Branch (176:7): [True: 273k, False: 3.10k]
  ------------------
  177|   276k|    }
  178|   276k|  }
  179|       |
  180|   275k|object_continue:
  181|   275k|  switch (*advance()) {
  182|   270k|    case ',':
  ------------------
  |  Branch (182:5): [True: 270k, False: 4.09k]
  ------------------
  183|   270k|      SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|   270k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 270k]
  |  |  ------------------
  ------------------
  184|   270k|      {
  185|   270k|        auto key = advance();
  186|   270k|        if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; }
  ------------------
  |  |  106|   270k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 17, False: 270k]
  |  |  ------------------
  ------------------
  187|   270k|        SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  273|   270k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 95, False: 270k]
  |  |  ------------------
  ------------------
  188|   270k|      }
  189|      0|      goto object_field;
  190|  4.00k|    case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end;
  ------------------
  |  |  273|  4.00k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 4.00k]
  |  |  ------------------
  ------------------
  |  Branch (190:5): [True: 4.00k, False: 271k]
  ------------------
  191|     92|    default: log_error("No comma between object fields"); return TAPE_ERROR;
  ------------------
  |  Branch (191:5): [True: 92, False: 274k]
  ------------------
  192|   275k|  }
  193|       |
  194|  22.0k|scope_end:
  195|  22.0k|  depth--;
  196|  22.0k|  if (depth == 0) { goto document_end; }
  ------------------
  |  Branch (196:7): [True: 2.98k, False: 19.0k]
  ------------------
  197|  19.0k|  if (dom_parser.is_array[depth]) { goto array_continue; }
  ------------------
  |  Branch (197:7): [True: 17.1k, False: 1.89k]
  ------------------
  198|  1.89k|  goto object_continue;
  199|       |
  200|       |//
  201|       |// Array parser states
  202|       |//
  203|  40.0k|array_begin:
  204|  40.0k|  log_start_value("array");
  205|  40.0k|  depth++;
  206|  40.0k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (206:7): [True: 1, False: 40.0k]
  ------------------
  207|  40.0k|  dom_parser.is_array[depth] = true;
  208|  40.0k|  SIMDJSON_TRY( visitor.visit_array_start(*this) );
  ------------------
  |  |  273|  40.0k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 40.0k]
  |  |  ------------------
  ------------------
  209|  40.0k|  SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  40.0k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 40.0k]
  |  |  ------------------
  ------------------
  210|       |
  211|  1.11M|array_value:
  212|  1.11M|  {
  213|  1.11M|    auto value = advance();
  214|  1.11M|    switch (*value) {
  215|  2.99k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    296|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 296]
  |  |  ------------------
  ------------------
  |  Branch (215:7): [True: 2.99k, False: 1.10M]
  |  Branch (215:21): [True: 296, False: 2.70k]
  ------------------
  216|  36.1k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|    592|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 592]
  |  |  ------------------
  ------------------
  |  Branch (216:7): [True: 36.1k, False: 1.07M]
  |  Branch (216:21): [True: 592, False: 35.5k]
  ------------------
  217|  1.07M|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  273|  1.07M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 788, False: 1.07M]
  |  |  ------------------
  ------------------
  |  Branch (217:7): [True: 1.07M, False: 39.1k]
  ------------------
  218|  1.11M|    }
  219|  1.11M|  }
  220|       |
  221|  1.08M|array_continue:
  222|  1.08M|  switch (*advance()) {
  223|  1.07M|    case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value;
  ------------------
  |  |  273|  1.07M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 1.07M]
  |  |  ------------------
  ------------------
  |  Branch (223:5): [True: 1.07M, False: 18.1k]
  ------------------
  224|  18.0k|    case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end;
  ------------------
  |  |  273|  18.0k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 18.0k]
  |  |  ------------------
  ------------------
  |  Branch (224:5): [True: 18.0k, False: 1.07M]
  ------------------
  225|     99|    default: log_error("Missing comma between array values"); return TAPE_ERROR;
  ------------------
  |  Branch (225:5): [True: 99, False: 1.08M]
  ------------------
  226|  1.08M|  }
  227|       |
  228|  4.43k|document_end:
  229|  4.43k|  log_end_value("document");
  230|  4.43k|  SIMDJSON_TRY( visitor.visit_document_end(*this) );
  ------------------
  |  |  273|  4.43k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 4.43k]
  |  |  ------------------
  ------------------
  231|       |
  232|  4.43k|  dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]);
  233|       |
  234|       |  // If we didn't make it to the end, it's an error
  235|  4.43k|  if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
  ------------------
  |  Branch (235:8): [Folded - Ignored]
  |  Branch (235:22): [True: 41, False: 4.39k]
  ------------------
  236|     41|    log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
  237|     41|    return TAPE_ERROR;
  238|     41|  }
  239|       |
  240|  4.39k|  return SUCCESS;
  241|       |
  242|  4.43k|} // walk_document()
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator6at_eofEv:
  260|  7.81k|simdjson_inline bool json_iterator::at_eof() const noexcept {
  261|  7.81k|  return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes];
  262|  7.81k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15log_start_valueEPKc:
  274|  54.0k|simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept {
  275|  54.0k|  logger::log_line(*this, "+", type, "");
  276|  54.0k|  if (logger::LOG_ENABLED) { logger::log_depth++; }
  ------------------
  |  Branch (276:7): [Folded - Ignored]
  ------------------
  277|  54.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator7advanceEv:
  253|  3.31M|simdjson_inline const uint8_t *json_iterator::advance() noexcept {
  254|  3.31M|  return &buf[*(next_structural++)];
  255|  3.31M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15last_structuralEv:
  266|  5.36k|simdjson_inline uint8_t json_iterator::last_structural() const noexcept {
  267|  5.36k|  return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]];
  268|  5.36k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_valueEPKc:
  270|  1.62M|simdjson_inline void json_iterator::log_value(const char *type) const noexcept {
  271|  1.62M|  logger::log_line(*this, "", type, "");
  272|  1.62M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator4peekEv:
  250|  47.5k|simdjson_inline const uint8_t *json_iterator::peek() const noexcept {
  251|  47.5k|  return &buf[*(next_structural)];
  252|  47.5k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator20visit_root_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  289|  2.45k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept {
  290|  2.45k|  switch (*value) {
  291|    289|    case '"': return visitor.visit_root_string(*this, value);
  ------------------
  |  Branch (291:5): [True: 289, False: 2.16k]
  ------------------
  292|     57|    case 't': return visitor.visit_root_true_atom(*this, value);
  ------------------
  |  Branch (292:5): [True: 57, False: 2.39k]
  ------------------
  293|     99|    case 'f': return visitor.visit_root_false_atom(*this, value);
  ------------------
  |  Branch (293:5): [True: 99, False: 2.35k]
  ------------------
  294|     42|    case 'n': return visitor.visit_root_null_atom(*this, value);
  ------------------
  |  Branch (294:5): [True: 42, False: 2.40k]
  ------------------
  295|     95|    case '-':
  ------------------
  |  Branch (295:5): [True: 95, False: 2.35k]
  ------------------
  296|    929|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (296:5): [True: 145, False: 2.30k]
  |  Branch (296:15): [True: 269, False: 2.18k]
  |  Branch (296:25): [True: 213, False: 2.23k]
  |  Branch (296:35): [True: 107, False: 2.34k]
  |  Branch (296:45): [True: 100, False: 2.35k]
  ------------------
  297|  1.86k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (297:5): [True: 117, False: 2.33k]
  |  Branch (297:15): [True: 66, False: 2.38k]
  |  Branch (297:25): [True: 99, False: 2.35k]
  |  Branch (297:35): [True: 178, False: 2.27k]
  |  Branch (297:45): [True: 478, False: 1.97k]
  ------------------
  298|  1.86k|      return visitor.visit_root_number(*this, value);
  299|     97|    default:
  ------------------
  |  Branch (299:5): [True: 97, False: 2.35k]
  ------------------
  300|     97|      log_error("Document starts with a non-value character");
  301|     97|      return TAPE_ERROR;
  302|  2.45k|  }
  303|  2.45k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13remaining_lenEv:
  256|  5.79k|simdjson_inline size_t json_iterator::remaining_len() const noexcept {
  257|  5.79k|  return dom_parser.len - *(next_structural-1);
  258|  5.79k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_errorEPKc:
  284|  1.41k|simdjson_inline void json_iterator::log_error(const char *error) const noexcept {
  285|  1.41k|  logger::log_line(*this, "", "ERROR", error);
  286|  1.41k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15visit_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  305|  1.34M|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept {
  306|       |  // Use the fact that most scalars are going to be either strings or numbers.
  307|  1.34M|  if(*value == '"') {
  ------------------
  |  Branch (307:6): [True: 11.5k, False: 1.33M]
  ------------------
  308|  11.5k|    return visitor.visit_string(*this, value);
  309|  1.33M|  } else if (((*value - '0')  < 10) || (*value == '-')) {
  ------------------
  |  Branch (309:14): [True: 1.33M, False: 1.51k]
  |  Branch (309:40): [True: 0, False: 1.51k]
  ------------------
  310|  1.33M|    return visitor.visit_number(*this, value);
  311|  1.33M|  }
  312|       |  // true, false, null are uncommon.
  313|  1.51k|  switch (*value) {
  314|    469|    case 't': return visitor.visit_true_atom(*this, value);
  ------------------
  |  Branch (314:5): [True: 469, False: 1.04k]
  ------------------
  315|    498|    case 'f': return visitor.visit_false_atom(*this, value);
  ------------------
  |  Branch (315:5): [True: 498, False: 1.01k]
  ------------------
  316|    471|    case 'n': return visitor.visit_null_atom(*this, value);
  ------------------
  |  Branch (316:5): [True: 471, False: 1.04k]
  ------------------
  317|     74|    default:
  ------------------
  |  Branch (317:5): [True: 74, False: 1.43k]
  ------------------
  318|     74|      log_error("Non-value found when value was expected!");
  319|     74|      return TAPE_ERROR;
  320|  1.51k|  }
  321|  1.51k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13log_end_valueEPKc:
  279|  26.4k|simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept {
  280|  26.4k|  if (logger::LOG_ENABLED) { logger::log_depth--; }
  ------------------
  |  Branch (280:7): [Folded - Ignored]
  ------------------
  281|  26.4k|  logger::log_line(*this, "-", type, "");
  282|  26.4k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16logger9log_startEv:
   42|  7.81k|  static simdjson_inline void log_start() {
   43|  7.81k|    if (LOG_ENABLED) {
  ------------------
  |  Branch (43:9): [Folded - Ignored]
  ------------------
   44|      0|      log_depth = 0;
   45|      0|      printf("\n");
   46|      0|      printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#");
   47|      0|      printf("|%.*s|%.*s|%.*s|%.*s|--------|\n", LOG_EVENT_LEN+2, DASHES, LOG_BUFFER_LEN+2, DASHES, LOG_SMALL_BUFFER_LEN+2, DASHES, 5+2, DASHES);
   48|      0|    }
   49|  7.81k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16logger8log_lineIKNS1_6stage213json_iteratorEEEvRT_PKcSA_SA_:
   59|  1.70M|  static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) {
   60|  1.70M|    if (LOG_ENABLED) {
  ------------------
  |  Branch (60:9): [Folded - Ignored]
  ------------------
   61|      0|      printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title);
   62|      0|      auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1;
  ------------------
  |  Branch (62:28): [True: 0, False: 0]
  ------------------
   63|      0|      auto next_index = structurals.next_structural;
   64|      0|      auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast<const uint8_t*>("                                                       ");
  ------------------
  |  Branch (64:22): [True: 0, False: 0]
  ------------------
   65|      0|      auto next = &structurals.buf[*next_index];
   66|      0|      {
   67|       |        // Print the next N characters in the buffer.
   68|      0|        printf("| ");
   69|       |        // Otherwise, print the characters starting from the buffer position.
   70|       |        // Print spaces for unprintable or newline characters.
   71|      0|        for (int i=0;i<LOG_BUFFER_LEN;i++) {
  ------------------
  |  Branch (71:22): [True: 0, False: 0]
  ------------------
   72|      0|          printf("%c", printable_char(current[i]));
   73|      0|        }
   74|      0|        printf(" ");
   75|       |        // Print the next N characters in the buffer.
   76|      0|        printf("| ");
   77|       |        // Otherwise, print the characters starting from the buffer position.
   78|       |        // Print spaces for unprintable or newline characters.
   79|      0|        for (int i=0;i<LOG_SMALL_BUFFER_LEN;i++) {
  ------------------
  |  Branch (79:22): [True: 0, False: 0]
  ------------------
   80|      0|          printf("%c", printable_char(next[i]));
   81|      0|        }
   82|      0|        printf(" ");
   83|      0|      }
   84|      0|      if (current_index) {
  ------------------
  |  Branch (84:11): [True: 0, False: 0]
  ------------------
   85|      0|        printf("| %*u ", LOG_INDEX_LEN, *current_index);
   86|      0|      } else {
   87|      0|        printf("| %-*s ", LOG_INDEX_LEN, "");
   88|      0|      }
   89|       |      // printf("| %*u ", LOG_INDEX_LEN, structurals.next_tape_index());
   90|      0|      printf("| %-s ", detail);
   91|      0|      printf("|\n");
   92|      0|    }
   93|  1.70M|  }

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder14parse_documentILb0EEENS_10error_codeERNS0_25dom_parser_implementationERNS_3dom8documentE:
  101|  7.81k|    dom::document &doc) noexcept {
  102|  7.81k|  dom_parser.doc = &doc;
  103|  7.81k|  json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0);
  ------------------
  |  Branch (103:34): [Folded - Ignored]
  ------------------
  104|  7.81k|  tape_builder builder(doc);
  105|  7.81k|  return iter.walk_document<STREAMING>(builder);
  106|  7.81k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builderC2ERNS_3dom8documentE:
  155|  7.81k|simdjson_inline tape_builder::tape_builder(dom::document &doc) noexcept : tape{doc.tape.get()}, current_string_buf_loc{doc.string_buf.get()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_document_startERNS2_13json_iteratorE:
  121|  7.81k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept {
  122|  7.81k|  start_container(iter);
  123|  7.81k|  return SUCCESS;
  124|  7.81k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15start_containerERNS2_13json_iteratorE:
  255|  54.0k|simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept {
  256|  54.0k|  iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter);
  257|  54.0k|  iter.dom_parser.open_containers[iter.depth].count = 0;
  258|  54.0k|  tape.skip(); // We don't actually *write* the start element until the end.
  259|  54.0k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15next_tape_indexERNS2_13json_iteratorE:
  244|  81.8k|simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept {
  245|  81.8k|  return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get());
  246|  81.8k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder18visit_empty_objectERNS2_13json_iteratorE:
  114|    519|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept {
  115|    519|  return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT);
  116|    519|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15empty_containerERNS2_13json_iteratorENS_8internal9tape_typeES7_:
  248|  1.35k|simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept {
  249|  1.35k|  auto start_index = next_tape_index(iter);
  250|  1.35k|  tape.append(start_index+2, start);
  251|  1.35k|  tape.append(start_index, end);
  252|  1.35k|  return SUCCESS;
  253|  1.35k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_empty_arrayERNS2_13json_iteratorE:
  117|    835|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept {
  118|    835|  return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY);
  119|    835|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_root_primitiveERNS2_13json_iteratorEPKh:
  108|  2.45k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept {
  109|  2.45k|  return iter.visit_root_primitive(*this, value);
  110|  2.45k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_root_stringERNS2_13json_iteratorEPKh:
  169|    289|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept {
  170|    289|  return visit_string(iter, value);
  171|    289|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder12visit_stringERNS2_13json_iteratorEPKhb:
  157|   288k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept {
  158|   288k|  iter.log_value(key ? "key" : "string");
  ------------------
  |  Branch (158:18): [True: 277k, False: 11.8k]
  ------------------
  159|   288k|  uint8_t *dst = on_start_string(iter);
  160|   288k|  dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid.
  161|   288k|  if (dst == nullptr) {
  ------------------
  |  Branch (161:7): [True: 484, False: 288k]
  ------------------
  162|    484|    iter.log_error("Invalid escape in string");
  163|    484|    return STRING_ERROR;
  164|    484|  }
  165|   288k|  on_end_string(dst);
  166|   288k|  return SUCCESS;
  167|   288k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15on_start_stringERNS2_13json_iteratorE:
  274|   288k|simdjson_inline uint8_t *tape_builder::on_start_string(json_iterator &iter) noexcept {
  275|       |  // we advance the point, accounting for the fact that we have a NULL termination
  276|   288k|  tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING);
  277|   288k|  return current_string_buf_loc + sizeof(uint32_t);
  278|   288k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder13on_end_stringEPh:
  280|   288k|simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept {
  281|   288k|  uint32_t str_length = uint32_t(dst - (current_string_buf_loc + sizeof(uint32_t)));
  282|       |  // TODO check for overflow in case someone has a crazy string (>=4GB?)
  283|       |  // But only add the overflow check when the document itself exceeds 4GB
  284|       |  // Currently unneeded because we refuse to parse docs larger or equal to 4GB.
  285|   288k|  memcpy(current_string_buf_loc, &str_length, sizeof(uint32_t));
  286|       |  // NULL termination is still handy if you expect all your strings to
  287|       |  // be NULL terminated? It comes at a small cost
  288|   288k|  *dst = 0;
  289|   288k|  current_string_buf_loc = dst + 1;
  290|   288k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_root_true_atomERNS2_13json_iteratorEPKh:
  207|     57|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept {
  208|     57|  iter.log_value("true");
  209|     57|  if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; }
  ------------------
  |  Branch (209:7): [True: 55, False: 2]
  ------------------
  210|      2|  tape.append(0, internal::tape_type::TRUE_VALUE);
  211|      2|  return SUCCESS;
  212|     57|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder21visit_root_false_atomERNS2_13json_iteratorEPKh:
  221|     99|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept {
  222|     99|  iter.log_value("false");
  223|     99|  if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; }
  ------------------
  |  Branch (223:7): [True: 97, False: 2]
  ------------------
  224|      2|  tape.append(0, internal::tape_type::FALSE_VALUE);
  225|      2|  return SUCCESS;
  226|     99|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_root_null_atomERNS2_13json_iteratorEPKh:
  235|     42|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept {
  236|     42|  iter.log_value("null");
  237|     42|  if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; }
  ------------------
  |  Branch (237:7): [True: 41, False: 1]
  ------------------
  238|      1|  tape.append(0, internal::tape_type::NULL_VALUE);
  239|      1|  return SUCCESS;
  240|     42|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_root_numberERNS2_13json_iteratorEPKh:
  178|  1.86k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_number(json_iterator &iter, const uint8_t *value) noexcept {
  179|       |  //
  180|       |  // We need to make a copy to make sure that the string is space terminated.
  181|       |  // This is not about padding the input, which should already padded up
  182|       |  // to len + SIMDJSON_PADDING. However, we have no control at this stage
  183|       |  // on how the padding was done. What if the input string was padded with nulls?
  184|       |  // It is quite common for an input string to have an extra null character (C string).
  185|       |  // We do not want to allow 9\0 (where \0 is the null character) inside a JSON
  186|       |  // document, but the string "9\0" by itself is fine. So we make a copy and
  187|       |  // pad the input with spaces when we know that there is just one input element.
  188|       |  // This copy is relatively expensive, but it will almost never be called in
  189|       |  // practice unless you are in the strange scenario where you have many JSON
  190|       |  // documents made of single atoms.
  191|       |  //
  192|  1.86k|  std::unique_ptr<uint8_t[]>copy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]);
  193|  1.86k|  if (copy.get() == nullptr) { return MEMALLOC; }
  ------------------
  |  Branch (193:7): [True: 0, False: 1.86k]
  ------------------
  194|  1.86k|  std::memcpy(copy.get(), value, iter.remaining_len());
  195|  1.86k|  std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING);
  196|  1.86k|  error_code error = visit_number(iter, copy.get());
  197|  1.86k|  return error;
  198|  1.86k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder12visit_numberERNS2_13json_iteratorEPKh:
  173|  1.33M|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept {
  174|  1.33M|  iter.log_value("number");
  175|  1.33M|  return numberparsing::parse_number(value, tape);
  176|  1.33M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder18visit_object_startERNS2_13json_iteratorE:
  125|  6.19k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept {
  126|  6.19k|  start_container(iter);
  127|  6.19k|  return SUCCESS;
  128|  6.19k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15increment_countERNS2_13json_iteratorE:
  150|  1.38M|simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept {
  151|  1.38M|  iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1
  152|  1.38M|  return SUCCESS;
  153|  1.38M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder9visit_keyERNS2_13json_iteratorEPKh:
  146|   277k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept {
  147|   277k|  return visit_string(iter, key, true);
  148|   277k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_primitiveERNS2_13json_iteratorEPKh:
  111|  1.34M|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept {
  112|  1.34M|  return iter.visit_primitive(*this, value);
  113|  1.34M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_true_atomERNS2_13json_iteratorEPKh:
  200|    469|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept {
  201|    469|  iter.log_value("true");
  202|    469|  if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; }
  ------------------
  |  Branch (202:7): [True: 81, False: 388]
  ------------------
  203|    388|  tape.append(0, internal::tape_type::TRUE_VALUE);
  204|    388|  return SUCCESS;
  205|    469|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder16visit_false_atomERNS2_13json_iteratorEPKh:
  214|    498|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_false_atom(json_iterator &iter, const uint8_t *value) noexcept {
  215|    498|  iter.log_value("false");
  216|    498|  if (!atomparsing::is_valid_false_atom(value)) { return F_ATOM_ERROR; }
  ------------------
  |  Branch (216:7): [True: 98, False: 400]
  ------------------
  217|    400|  tape.append(0, internal::tape_type::FALSE_VALUE);
  218|    400|  return SUCCESS;
  219|    498|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_null_atomERNS2_13json_iteratorEPKh:
  228|    471|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept {
  229|    471|  iter.log_value("null");
  230|    471|  if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; }
  ------------------
  |  Branch (230:7): [True: 75, False: 396]
  ------------------
  231|    396|  tape.append(0, internal::tape_type::NULL_VALUE);
  232|    396|  return SUCCESS;
  233|    471|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder16visit_object_endERNS2_13json_iteratorE:
  134|  4.00k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept {
  135|  4.00k|  return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT);
  136|  4.00k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder13end_containerERNS2_13json_iteratorENS_8internal9tape_typeES7_:
  261|  22.0k|simdjson_warn_unused simdjson_inline error_code tape_builder::end_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept {
  262|       |  // Write the ending tape element, pointing at the start location
  263|  22.0k|  const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index;
  264|  22.0k|  tape.append(start_tape_index, end);
  265|       |  // Write the start tape element, pointing at the end location (and including count)
  266|       |  // count can overflow if it exceeds 24 bits... so we saturate
  267|       |  // the convention being that a cnt of 0xffffff or more is undetermined in value (>=  0xffffff).
  268|  22.0k|  const uint32_t count = iter.dom_parser.open_containers[iter.depth].count;
  269|  22.0k|  const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count;
  ------------------
  |  Branch (269:27): [True: 0, False: 22.0k]
  ------------------
  270|  22.0k|  tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start);
  271|  22.0k|  return SUCCESS;
  272|  22.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_array_startERNS2_13json_iteratorE:
  129|  40.0k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept {
  130|  40.0k|  start_container(iter);
  131|  40.0k|  return SUCCESS;
  132|  40.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_array_endERNS2_13json_iteratorE:
  137|  18.0k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept {
  138|  18.0k|  return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY);
  139|  18.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder18visit_document_endERNS2_13json_iteratorE:
  140|  4.43k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept {
  141|  4.43k|  constexpr uint32_t start_tape_index = 0;
  142|  4.43k|  tape.append(start_tape_index, internal::tape_type::ROOT);
  143|  4.43k|  tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT);
  144|  4.43k|  return SUCCESS;
  145|  4.43k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer4skipEv:
   83|  54.0k|simdjson_inline void tape_writer::skip() noexcept {
   84|  54.0k|  next_tape_loc++;
   85|  54.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer6appendEmNS_8internal9tape_typeE:
   95|  1.65M|simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept {
   96|  1.65M|  *next_tape_loc = val | ((uint64_t(char(t))) << 56);
   97|  1.65M|  next_tape_loc++;
   98|  1.65M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer13append_doubleEd:
   79|  22.7k|simdjson_inline void tape_writer::append_double(double value) noexcept {
   80|  22.7k|  append2(0, value, internal::tape_type::DOUBLE);
   81|  22.7k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer7append2IdEEvmT_NS_8internal9tape_typeE:
  101|  22.7k|simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept {
  102|  22.7k|  append(val, t);
  103|  22.7k|  static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!");
  104|  22.7k|  memcpy(next_tape_loc, &val2, sizeof(val2));
  105|  22.7k|  next_tape_loc++;
  106|  22.7k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer10append_s64El:
   68|  1.30M|simdjson_inline void tape_writer::append_s64(int64_t value) noexcept {
   69|  1.30M|  append2(0, value, internal::tape_type::INT64);
   70|  1.30M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer7append2IlEEvmT_NS_8internal9tape_typeE:
  101|  1.30M|simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept {
  102|  1.30M|  append(val, t);
  103|  1.30M|  static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!");
  104|  1.30M|  memcpy(next_tape_loc, &val2, sizeof(val2));
  105|  1.30M|  next_tape_loc++;
  106|  1.30M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer10append_u64Em:
   72|  1.57k|simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept {
   73|  1.57k|  append(0, internal::tape_type::UINT64);
   74|  1.57k|  *next_tape_loc = value;
   75|  1.57k|  next_tape_loc++;
   76|  1.57k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer5writeERmmNS_8internal9tape_typeE:
  108|  26.4k|simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept {
  109|  26.4k|  tape_loc = val | ((uint64_t(char(t))) << 56);
  110|  26.4k|}

_ZNK8simdjson7haswell14implementation32create_dom_parser_implementationEmmRNSt3__110unique_ptrINS_8internal25dom_parser_implementationENS2_14default_deleteIS5_EEEE:
   27|  8.75k|) const noexcept {
   28|  8.75k|  dst.reset( new (std::nothrow) dom_parser_implementation() );
   29|  8.75k|  if (!dst) { return MEMALLOC; }
  ------------------
  |  Branch (29:7): [True: 0, False: 8.75k]
  ------------------
   30|  8.75k|  if (auto err = dst->set_capacity(capacity))
  ------------------
  |  Branch (30:12): [True: 0, False: 8.75k]
  ------------------
   31|      0|    return err;
   32|  8.75k|  if (auto err = dst->set_max_depth(max_depth))
  ------------------
  |  Branch (32:12): [True: 0, False: 8.75k]
  ------------------
   33|      0|    return err;
   34|  8.75k|  return SUCCESS;
   35|  8.75k|}
_ZN8simdjson7haswell25dom_parser_implementation6stage1EPKhmNS_11stage1_modeE:
  132|  8.74k|simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept {
  133|  8.74k|  this->buf = _buf;
  134|  8.74k|  this->len = _len;
  135|  8.74k|  return haswell::stage1::json_structural_indexer::index<128>(_buf, _len, *this, streaming);
  136|  8.74k|}
_ZN8simdjson7haswell25dom_parser_implementation6stage2ERNS_3dom8documentE:
  142|  7.81k|simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
  143|  7.81k|  return stage2::tape_builder::parse_document<false>(*this, _doc);
  144|  7.81k|}
_ZN8simdjson7haswell25dom_parser_implementation5parseEPKhmRNS_3dom8documentE:
  159|  8.74k|simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {
  160|  8.74k|  auto error = stage1(_buf, _len, stage1_mode::regular);
  161|  8.74k|  if (error) { return error; }
  ------------------
  |  Branch (161:7): [True: 931, False: 7.81k]
  ------------------
  162|  7.81k|  return stage2(_doc);
  163|  8.74k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   96|   833k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   97|   833k|  return input.reduce_or().is_ascii();
   98|   833k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
  108|  10.0k|simdjson_inline simd8<uint8_t> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
  109|  10.0k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-0x80); // Only 111_____ will be >= 0x80
  110|  10.0k|  simd8<uint8_t> is_fourth_byte = prev3.saturating_sub(0xf0u-0x80); // Only 1111____ will be >= 0x80
  111|  10.0k|  return is_third_byte | is_fourth_byte;
  112|  10.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_120json_character_block8classifyERKNS1_4simd8simd8x64IhEE:
   43|   833k|simdjson_inline json_character_block json_character_block::classify(const simd::simd8x64<uint8_t>& in) {
   44|       |  // These lookups rely on the fact that anything < 127 will match the lower 4 bits, which is why
   45|       |  // we can't use the generic lookup_16.
   46|   833k|  const auto whitespace_table = simd8<uint8_t>::repeat_16(' ', 100, 100, 100, 17, 100, 113, 2, 100, '\t', '\n', 112, 100, '\r', 100, 100);
   47|       |
   48|       |  // The 6 operators (:,[]{}) have these values:
   49|       |  //
   50|       |  // , 2C
   51|       |  // : 3A
   52|       |  // [ 5B
   53|       |  // { 7B
   54|       |  // ] 5D
   55|       |  // } 7D
   56|       |  //
   57|       |  // If you use | 0x20 to turn [ and ] into { and }, the lower 4 bits of each character is unique.
   58|       |  // We exploit this, using a simd 4-bit lookup to tell us which character match against, and then
   59|       |  // match it (against | 0x20).
   60|       |  //
   61|       |  // To prevent recognizing other characters, everything else gets compared with 0, which cannot
   62|       |  // match due to the | 0x20.
   63|       |  //
   64|       |  // NOTE: Due to the | 0x20, this ALSO treats <FF> and <SUB> (control characters 0C and 1A) like ,
   65|       |  // and :. This gets caught in stage 2, which checks the actual character to ensure the right
   66|       |  // operators are in the right places.
   67|   833k|  const auto op_table = simd8<uint8_t>::repeat_16(
   68|   833k|    0, 0, 0, 0,
   69|   833k|    0, 0, 0, 0,
   70|   833k|    0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B
   71|   833k|    ',', '}', 0, 0  // , = 2C, ] = 5D, } = 7D
   72|   833k|  );
   73|       |
   74|       |  // We compute whitespace and op separately. If later code only uses one or the
   75|       |  // other, given the fact that all functions are aggressively inlined, we can
   76|       |  // hope that useless computations will be omitted. This is namely case when
   77|       |  // minifying (we only need whitespace).
   78|       |
   79|   833k|  const uint64_t whitespace = in.eq({
   80|   833k|    _mm256_shuffle_epi8(whitespace_table, in.chunks[0]),
   81|   833k|    _mm256_shuffle_epi8(whitespace_table, in.chunks[1])
   82|   833k|  });
   83|       |  // Turn [ and ] into { and }
   84|   833k|  const simd8x64<uint8_t> curlified{
   85|   833k|    in.chunks[0] | 0x20,
   86|   833k|    in.chunks[1] | 0x20
   87|   833k|  };
   88|   833k|  const uint64_t op = curlified.eq({
   89|   833k|    _mm256_shuffle_epi8(op_table, in.chunks[0]),
   90|   833k|    _mm256_shuffle_epi8(op_table, in.chunks[1])
   91|   833k|  });
   92|       |
   93|   833k|  return { whitespace, op };
   94|   833k|}

_ZNK8simdjson8internal29available_implementation_list21detect_best_supportedEv:
  268|      1|const implementation *available_implementation_list::detect_best_supported() const noexcept {
  269|       |  // They are prelisted in priority order, so we just go down the list
  270|      1|  uint32_t supported_instruction_sets = internal::detect_supported_architectures();
  271|      2|  for (const implementation *impl : internal::get_available_implementation_pointers()) {
  ------------------
  |  Branch (271:35): [True: 2, False: 0]
  ------------------
  272|      2|    uint32_t required_instruction_sets = impl->required_instruction_sets();
  273|      2|    if ((supported_instruction_sets & required_instruction_sets) == required_instruction_sets) { return impl; }
  ------------------
  |  Branch (273:9): [True: 1, False: 1]
  ------------------
  274|      2|  }
  275|      0|  return get_unsupported_singleton(); // this should never happen?
  276|      1|}
_ZNK8simdjson8internal49detect_best_supported_implementation_on_first_use8set_bestEv:
  278|      1|const implementation *detect_best_supported_implementation_on_first_use::set_best() const noexcept {
  279|      1|  SIMDJSON_PUSH_DISABLE_WARNINGS
  280|       |  SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe
  281|      1|  char *force_implementation_name = getenv("SIMDJSON_FORCE_IMPLEMENTATION");
  282|      1|  SIMDJSON_POP_DISABLE_WARNINGS
  283|       |
  284|      1|  if (force_implementation_name) {
  ------------------
  |  Branch (284:7): [True: 0, False: 1]
  ------------------
  285|      0|    auto force_implementation = get_available_implementations()[force_implementation_name];
  286|      0|    if (force_implementation) {
  ------------------
  |  Branch (286:9): [True: 0, False: 0]
  ------------------
  287|      0|      return get_active_implementation() = force_implementation;
  288|      0|    } else {
  289|       |      // Note: abort() and stderr usage within the library is forbidden.
  290|      0|      return get_active_implementation() = get_unsupported_singleton();
  291|      0|    }
  292|      0|  }
  293|      1|  return get_active_implementation() = get_available_implementations().detect_best_supported();
  294|      1|}
_ZN8simdjson29get_available_implementationsEv:
  298|      1|SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations() {
  299|      1|  static const internal::available_implementation_list available_implementations{};
  300|      1|  return available_implementations;
  301|      1|}
_ZN8simdjson25get_active_implementationEv:
  303|  8.75k|SIMDJSON_DLLIMPORTEXPORT internal::atomic_ptr<const implementation>& get_active_implementation() {
  304|       |#if SIMDJSON_SINGLE_IMPLEMENTATION
  305|       |  // We immediately select the only implementation we have, skipping the
  306|       |  // detect_best_supported_implementation_on_first_use_singleton.
  307|       |  static internal::atomic_ptr<const implementation> active_implementation{internal::get_single_implementation()};
  308|       |  return active_implementation;
  309|       |#else
  310|  8.75k|  static const internal::detect_best_supported_implementation_on_first_use detect_best_supported_implementation_on_first_use_singleton;
  311|  8.75k|  static internal::atomic_ptr<const implementation> active_implementation{&detect_best_supported_implementation_on_first_use_singleton};
  312|  8.75k|  return active_implementation;
  313|  8.75k|#endif
  314|  8.75k|}
simdjson.cpp:_ZN8simdjson8internalL37get_available_implementation_pointersEv:
  196|      1|static const std::initializer_list<const implementation *>& get_available_implementation_pointers() {
  197|      1|  static const std::initializer_list<const implementation *> available_implementation_pointers {
  198|      1|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  199|      1|    get_icelake_singleton(),
  200|      1|#endif
  201|      1|#if SIMDJSON_IMPLEMENTATION_HASWELL
  202|      1|    get_haswell_singleton(),
  203|      1|#endif
  204|      1|#if SIMDJSON_IMPLEMENTATION_WESTMERE
  205|      1|    get_westmere_singleton(),
  206|      1|#endif
  207|       |#if SIMDJSON_IMPLEMENTATION_ARM64
  208|       |    get_arm64_singleton(),
  209|       |#endif
  210|       |#if SIMDJSON_IMPLEMENTATION_PPC64
  211|       |    get_ppc64_singleton(),
  212|       |#endif
  213|       |#if SIMDJSON_IMPLEMENTATION_LSX
  214|       |    get_lsx_singleton(),
  215|       |#endif
  216|       |#if SIMDJSON_IMPLEMENTATION_LASX
  217|       |    get_lasx_singleton(),
  218|       |#endif
  219|      1|#if SIMDJSON_IMPLEMENTATION_FALLBACK
  220|      1|    get_fallback_singleton(),
  221|      1|#endif
  222|      1|  }; // available_implementation_pointers
  223|      1|  return available_implementation_pointers;
  224|      1|}
simdjson.cpp:_ZN8simdjson8internalL21get_icelake_singletonEv:
   65|      1|static const icelake::implementation* get_icelake_singleton() {
   66|      1|  static const icelake::implementation icelake_singleton{};
   67|      1|  return &icelake_singleton;
   68|      1|}
simdjson.cpp:_ZN8simdjson8internalL21get_haswell_singletonEv:
   53|      1|static const haswell::implementation* get_haswell_singleton() {
   54|      1|  static const haswell::implementation haswell_singleton{};
   55|      1|  return &haswell_singleton;
   56|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_westmere_singletonEv:
   89|      1|static const simdjson::westmere::implementation* get_westmere_singleton() {
   90|      1|  static const simdjson::westmere::implementation westmere_singleton{};
   91|      1|  return &westmere_singleton;
   92|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_fallback_singletonEv:
   40|      1|static const fallback::implementation* get_fallback_singleton() {
   41|      1|  static const fallback::implementation fallback_singleton{};
   42|      1|  return &fallback_singleton;
   43|      1|}
_ZN8simdjson8internal49detect_best_supported_implementation_on_first_useC2Ev:
  189|      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:
  180|      1|  ) const noexcept final {
  181|      1|    return set_best()->create_dom_parser_implementation(capacity, max_length, dst);
  182|      1|  }

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

