_Z8as_charsIhEPKcPKT_:
   15|  10.9k|template <typename T> inline const char* as_chars(const T* data) {
   16|  10.9k|  return static_cast<const char*>(static_cast<const void*>(data));
   17|  10.9k|}

LLVMFuzzerTestOneInput:
   10|  10.9k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   11|       |
   12|  10.9k|    auto begin = as_chars(Data);
   13|  10.9k|    auto end = begin + Size;
   14|       |
   15|  10.9k|    std::string str(begin, end);
   16|  10.9k|    simdjson::dom::parser parser;
   17|  10.9k|    simdjson::dom::element elem;
   18|  10.9k|    auto error = parser.parse(str).get(elem);
   19|  10.9k|    if (error) { return 0; }
  ------------------
  |  Branch (19:9): [True: 4.18k, False: 6.79k]
  ------------------
   20|       |
   21|  6.79k|    std::string minified=simdjson::minify(elem);
   22|  6.79k|    (void)minified;
   23|  6.79k|    return 0;
   24|  10.9k|}

_ZNK8simdjson3dom5array5beginEv:
   55|  7.30k|inline array::iterator array::begin() const noexcept {
   56|  7.30k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  7.30k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   57|  7.30k|  return internal::tape_ref(tape.doc, tape.json_index + 1);
   58|  7.30k|}
_ZN8simdjson3dom5array8iteratorC2ERKNS_8internal8tape_refE:
  125|  14.6k|simdjson_inline array::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom5array3endEv:
   59|  7.30k|inline array::iterator array::end() const noexcept {
   60|  7.30k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  7.30k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   61|  7.30k|  return internal::tape_ref(tape.doc, tape.after_element() - 1);
   62|  7.30k|}
_ZNK8simdjson3dom5array8iteratorneERKS2_:
  138|  2.05M|inline bool array::iterator::operator!=(const array::iterator& other) const noexcept {
  139|  2.05M|  return tape.json_index != other.tape.json_index;
  140|  2.05M|}
_ZNK8simdjson3dom5array8iteratordeEv:
  126|  2.05M|inline element array::iterator::operator*() const noexcept {
  127|  2.05M|  return element(tape);
  128|  2.05M|}
_ZN8simdjson3dom5array8iteratorppEv:
  129|  2.05M|inline array::iterator& array::iterator::operator++() noexcept {
  130|  2.05M|  tape.json_index = tape.after_element();
  131|  2.05M|  return *this;
  132|  2.05M|}
_ZN8simdjson3dom5arrayC2ERKNS_8internal8tape_refE:
   54|  7.30k|simdjson_inline array::array(const internal::tape_ref &_tape) noexcept : tape{_tape} {}

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

_ZN8simdjson3dom8documentC2Ev:
   25|  10.9k|  document() noexcept = default;
_ZN8simdjson3dom8documentD2Ev:
   26|  10.9k|  ~document() noexcept = default;

_ZN8simdjson3dom7elementC2Ev:
  185|  15.1k|simdjson_inline element::element() noexcept : tape{} {}
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2ENS_10error_codeE:
   20|  4.18k|    : internal::simdjson_result_base<dom::element>(error) {}
_ZN8simdjson3dom7elementC2ERKNS_8internal8tape_refE:
  186|  2.15M|simdjson_inline element::element(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2EOS2_:
   18|  6.79k|    : internal::simdjson_result_base<dom::element>(std::forward<dom::element>(value)) {}
_ZNK8simdjson15simdjson_resultINS_3dom7elementEE3getIS2_EENS_10error_codeERT_:
   36|  10.9k|simdjson_warn_unused simdjson_inline error_code simdjson_result<dom::element>::get(T &value) const noexcept {
   37|  10.9k|  if (error()) { return error(); }
  ------------------
  |  Branch (37:7): [True: 4.18k, False: 6.79k]
  ------------------
   38|  6.79k|  return first.get<T>(value);
   39|  10.9k|}
_ZNK8simdjson3dom7element3getIS1_EENS_10error_codeERT_:
  308|  6.79k|simdjson_warn_unused simdjson_inline error_code element::get<element>(element &value) const noexcept {
  309|  6.79k|  value = element(tape);
  310|  6.79k|  return SUCCESS;
  311|  6.79k|}

_ZNK8simdjson3dom6object5beginEv:
   67|  9.44k|inline object::iterator object::begin() const noexcept {
   68|  9.44k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  9.44k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   69|  9.44k|  return internal::tape_ref(tape.doc, tape.json_index + 1);
   70|  9.44k|}
_ZN8simdjson3dom6object8iteratorC2ERKNS_8internal8tape_refE:
  156|  18.8k|simdjson_inline object::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom6object3endEv:
   71|  9.44k|inline object::iterator object::end() const noexcept {
   72|  9.44k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  9.44k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   73|  9.44k|  return internal::tape_ref(tape.doc, tape.after_element() - 1);
   74|  9.44k|}
_ZNK8simdjson3dom6object8iteratorneERKS2_:
  160|  94.7k|inline bool object::iterator::operator!=(const object::iterator& other) const noexcept {
  161|  94.7k|  return tape.json_index != other.tape.json_index;
  162|  94.7k|}
_ZNK8simdjson3dom6object8iteratordeEv:
  157|  85.3k|inline const key_value_pair object::iterator::operator*() const noexcept {
  158|  85.3k|  return key_value_pair(key(), value());
  159|  85.3k|}
_ZNK8simdjson3dom6object8iterator3keyEv:
  188|  85.3k|inline std::string_view object::iterator::key() const noexcept {
  189|  85.3k|  return tape.get_string_view();
  190|  85.3k|}
_ZNK8simdjson3dom6object8iterator5valueEv:
  197|  85.3k|inline element object::iterator::value() const noexcept {
  198|  85.3k|  return element(internal::tape_ref(tape.doc, tape.json_index + 1));
  199|  85.3k|}
_ZN8simdjson3dom14key_value_pairC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS0_7elementE:
  241|  85.3k|  key(_key), value(_value) {}
_ZN8simdjson3dom6object8iteratorppEv:
  178|  85.3k|inline object::iterator& object::iterator::operator++() noexcept {
  179|  85.3k|  tape.json_index++;
  180|  85.3k|  tape.json_index = tape.after_element();
  181|  85.3k|  return *this;
  182|  85.3k|}
_ZN8simdjson3dom6objectC2ERKNS_8internal8tape_refE:
   66|  9.44k|simdjson_inline object::object(const internal::tape_ref &_tape) noexcept : tape{_tape} { }

_ZN8simdjson3dom6parserC2Em:
   20|  10.9k|    loaded_bytes(nullptr) {
   21|  10.9k|}
_ZNR8simdjson3dom6parser5parseERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  145|  10.9k|simdjson_inline simdjson_result<element> parser::parse(const std::string &s) & noexcept {
  146|  10.9k|  return parse(s.data(), s.length(), s.capacity() - s.length() < SIMDJSON_PADDING);
  147|  10.9k|}
_ZNR8simdjson3dom6parser5parseEPKcmb:
  142|  10.9k|simdjson_inline simdjson_result<element> parser::parse(const char *buf, size_t len, bool realloc_if_needed) & noexcept {
  143|  10.9k|  return parse(reinterpret_cast<const uint8_t *>(buf), len, realloc_if_needed);
  144|  10.9k|}
_ZNR8simdjson3dom6parser5parseEPKhmb:
  138|  10.9k|inline simdjson_result<element> parser::parse(const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept {
  139|  10.9k|  return parse_into_document(doc, buf, len, realloc_if_needed);
  140|  10.9k|}
_ZNR8simdjson3dom6parser19parse_into_documentERNS0_8documentEPKhmb:
  104|  10.9k|inline simdjson_result<element> parser::parse_into_document(document& provided_doc, const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept {
  105|       |  // Important: we need to ensure that document has enough capacity.
  106|       |  // Important: It is possible that provided_doc is actually the internal 'doc' within the parser!!!
  107|  10.9k|  error_code _error = ensure_capacity(provided_doc, len);
  108|  10.9k|  if (_error) { return _error; }
  ------------------
  |  Branch (108:7): [True: 0, False: 10.9k]
  ------------------
  109|  10.9k|  if (realloc_if_needed) {
  ------------------
  |  Branch (109:7): [True: 10.9k, False: 0]
  ------------------
  110|       |    // Make sure we have enough capacity to copy len bytes
  111|  10.9k|    if (!loaded_bytes || _loaded_bytes_capacity < len) {
  ------------------
  |  Branch (111:9): [True: 10.9k, False: 0]
  |  Branch (111:26): [True: 0, False: 0]
  ------------------
  112|  10.9k|      loaded_bytes.reset( internal::allocate_padded_buffer(len) );
  113|  10.9k|      if (!loaded_bytes) {
  ------------------
  |  Branch (113:11): [True: 8, False: 10.9k]
  ------------------
  114|      8|        return MEMALLOC;
  115|      8|      }
  116|  10.9k|      _loaded_bytes_capacity = len;
  117|  10.9k|    }
  118|  10.9k|    std::memcpy(static_cast<void *>(loaded_bytes.get()), buf, len);
  119|  10.9k|  }
  120|  10.9k|  _error = implementation->parse(realloc_if_needed ? reinterpret_cast<const uint8_t*>(loaded_bytes.get()): buf, len, provided_doc);
  ------------------
  |  Branch (120:34): [True: 10.9k, False: 0]
  ------------------
  121|       |
  122|  10.9k|  if (_error) { return _error; }
  ------------------
  |  Branch (122:7): [True: 4.18k, False: 6.79k]
  ------------------
  123|       |
  124|  6.79k|  return provided_doc.root();
  125|  10.9k|}
_ZN8simdjson3dom6parser15ensure_capacityERNS0_8documentEm:
  206|  10.9k|inline error_code parser::ensure_capacity(document& target_document, size_t desired_capacity) noexcept {
  207|       |  // 1. It is wasteful to allocate a document and a parser for documents spanning less than MINIMAL_DOCUMENT_CAPACITY bytes.
  208|       |  // 2. If we allow desired_capacity = 0 then it is possible to exit this function with implementation == nullptr.
  209|  10.9k|  if(desired_capacity < MINIMAL_DOCUMENT_CAPACITY) { desired_capacity = MINIMAL_DOCUMENT_CAPACITY; }
  ------------------
  |  Branch (209:6): [True: 7.06k, False: 3.91k]
  ------------------
  210|       |  // If we don't have enough capacity, (try to) automatically bump it.
  211|       |  // If the document needs allocation, do it too.
  212|       |  // Both in one if statement to minimize unlikely branching.
  213|       |  //
  214|       |  // Note: we must make sure that this function is called if capacity() == 0. We do so because we
  215|       |  // ensure that desired_capacity > 0.
  216|  10.9k|  if (simdjson_unlikely(capacity() < desired_capacity || target_document.capacity() < desired_capacity)) {
  ------------------
  |  |  120|  10.9k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 10.9k, False: 0]
  |  |  |  Branch (120:52): [True: 10.9k, False: 0]
  |  |  |  Branch (120:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  217|  10.9k|    if (desired_capacity > max_capacity()) {
  ------------------
  |  Branch (217:9): [True: 0, False: 10.9k]
  ------------------
  218|      0|      return error = CAPACITY;
  219|      0|    }
  220|  10.9k|    error_code err1 = target_document.capacity() < desired_capacity ? target_document.allocate(desired_capacity) : SUCCESS;
  ------------------
  |  Branch (220:23): [True: 10.9k, False: 0]
  ------------------
  221|  10.9k|    error_code err2 = capacity() < desired_capacity ? allocate(desired_capacity, max_depth()) : SUCCESS;
  ------------------
  |  Branch (221:23): [True: 10.9k, False: 0]
  ------------------
  222|  10.9k|    if(err1 != SUCCESS) { return error = err1; }
  ------------------
  |  Branch (222:8): [True: 0, False: 10.9k]
  ------------------
  223|  10.9k|    if(err2 != SUCCESS) { return error = err2; }
  ------------------
  |  Branch (223:8): [True: 0, False: 10.9k]
  ------------------
  224|  10.9k|  }
  225|  10.9k|  return SUCCESS;
  226|  10.9k|}
_ZNK8simdjson3dom6parser8capacityEv:
  169|  21.9k|simdjson_inline size_t parser::capacity() const noexcept {
  170|  21.9k|  return implementation ? implementation->capacity() : 0;
  ------------------
  |  Branch (170:10): [True: 0, False: 21.9k]
  ------------------
  171|  21.9k|}
_ZNK8simdjson3dom6parser12max_capacityEv:
  172|  10.9k|simdjson_inline size_t parser::max_capacity() const noexcept {
  173|  10.9k|  return _max_capacity;
  174|  10.9k|}
_ZN8simdjson3dom6parser8allocateEmm:
  180|  10.9k|inline error_code parser::allocate(size_t capacity, size_t max_depth) noexcept {
  181|       |  //
  182|       |  // Reallocate implementation if needed
  183|       |  //
  184|  10.9k|  error_code err;
  185|  10.9k|  if (implementation) {
  ------------------
  |  Branch (185:7): [True: 0, False: 10.9k]
  ------------------
  186|      0|    err = implementation->allocate(capacity, max_depth);
  187|  10.9k|  } else {
  188|  10.9k|    err = simdjson::get_active_implementation()->create_dom_parser_implementation(capacity, max_depth, implementation);
  189|  10.9k|  }
  190|  10.9k|  if (err) { return err; }
  ------------------
  |  Branch (190:7): [True: 0, False: 10.9k]
  ------------------
  191|  10.9k|  return SUCCESS;
  192|  10.9k|}
_ZNK8simdjson3dom6parser9max_depthEv:
  175|  10.9k|simdjson_inline size_t parser::max_depth() const noexcept {
  176|  10.9k|  return implementation ? implementation->max_depth() : DEFAULT_MAX_DEPTH;
  ------------------
  |  Branch (176:10): [True: 0, False: 10.9k]
  ------------------
  177|  10.9k|}

_ZN8simdjson3dom6parserD2Ev:
   88|  10.9k|  ~parser()=default;

_ZN8simdjson8internal14string_builderINS0_14mini_formatterEE6appendENS_3dom7elementE:
  248|  2.14M|inline void string_builder<serializer>::append(simdjson::dom::element value) {
  249|       |  // using tape_type = simdjson::internal::tape_type;
  250|  2.14M|  size_t depth = 0;
  251|  2.14M|  constexpr size_t MAX_DEPTH = 16;
  252|  2.14M|  bool is_object[MAX_DEPTH];
  253|  2.14M|  is_object[0] = false;
  254|  2.14M|  bool after_value = false;
  255|       |
  256|  2.14M|  internal::tape_ref iter(value.tape);
  257|  5.60M|  do {
  258|       |    // print commas after each value
  259|  5.60M|    if (after_value) {
  ------------------
  |  Branch (259:9): [True: 3.40M, False: 2.20M]
  ------------------
  260|  3.40M|      format.comma();
  261|  3.40M|    }
  262|       |    // If we are in an object, print the next key and :, and skip to the next
  263|       |    // value.
  264|  5.60M|    if (is_object[depth]) {
  ------------------
  |  Branch (264:9): [True: 185k, False: 5.41M]
  ------------------
  265|   185k|      format.key(iter.get_string_view());
  266|   185k|      iter.json_index++;
  267|   185k|    }
  268|  5.60M|    switch (iter.tape_ref_type()) {
  ------------------
  |  Branch (268:13): [True: 0, False: 5.60M]
  ------------------
  269|       |
  270|       |    // Arrays
  271|  65.5k|    case tape_type::START_ARRAY: {
  ------------------
  |  Branch (271:5): [True: 65.5k, False: 5.53M]
  ------------------
  272|       |      // If we're too deep, we need to recurse to go deeper.
  273|  65.5k|      depth++;
  274|  65.5k|      if (simdjson_unlikely(depth >= MAX_DEPTH)) {
  ------------------
  |  |  120|  65.5k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 7.30k, False: 58.2k]
  |  |  ------------------
  ------------------
  275|  7.30k|        append(simdjson::dom::array(iter));
  276|  7.30k|        iter.json_index = iter.matching_brace_index() - 1; // Jump to the ]
  277|  7.30k|        depth--;
  278|  7.30k|        break;
  279|  7.30k|      }
  280|       |
  281|       |      // Output start [
  282|  58.2k|      format.start_array();
  283|  58.2k|      iter.json_index++;
  284|       |
  285|       |      // Handle empty [] (we don't want to come back around and print commas)
  286|  58.2k|      if (iter.tape_ref_type() == tape_type::END_ARRAY) {
  ------------------
  |  Branch (286:11): [True: 4.84k, False: 53.4k]
  ------------------
  287|  4.84k|        format.end_array();
  288|  4.84k|        depth--;
  289|  4.84k|        break;
  290|  4.84k|      }
  291|       |
  292|  53.4k|      is_object[depth] = false;
  293|  53.4k|      after_value = false;
  294|  53.4k|      continue;
  295|  58.2k|    }
  296|       |
  297|       |    // Objects
  298|  15.1k|    case tape_type::START_OBJECT: {
  ------------------
  |  Branch (298:5): [True: 15.1k, False: 5.58M]
  ------------------
  299|       |      // If we're too deep, we need to recurse to go deeper.
  300|  15.1k|      depth++;
  301|  15.1k|      if (simdjson_unlikely(depth >= MAX_DEPTH)) {
  ------------------
  |  |  120|  15.1k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 9.44k, False: 5.68k]
  |  |  ------------------
  ------------------
  302|  9.44k|        append(simdjson::dom::object(iter));
  303|  9.44k|        iter.json_index = iter.matching_brace_index() - 1; // Jump to the }
  304|  9.44k|        depth--;
  305|  9.44k|        break;
  306|  9.44k|      }
  307|       |
  308|       |      // Output start {
  309|  5.68k|      format.start_object();
  310|  5.68k|      iter.json_index++;
  311|       |
  312|       |      // Handle empty {} (we don't want to come back around and print commas)
  313|  5.68k|      if (iter.tape_ref_type() == tape_type::END_OBJECT) {
  ------------------
  |  Branch (313:11): [True: 1.98k, False: 3.70k]
  ------------------
  314|  1.98k|        format.end_object();
  315|  1.98k|        depth--;
  316|  1.98k|        break;
  317|  1.98k|      }
  318|       |
  319|  3.70k|      is_object[depth] = true;
  320|  3.70k|      after_value = false;
  321|  3.70k|      continue;
  322|  5.68k|    }
  323|       |
  324|       |    // Scalars
  325|  4.76k|    case tape_type::STRING:
  ------------------
  |  Branch (325:5): [True: 4.76k, False: 5.59M]
  ------------------
  326|  4.76k|      format.string(iter.get_string_view());
  327|  4.76k|      break;
  328|  2.45M|    case tape_type::INT64:
  ------------------
  |  Branch (328:5): [True: 2.45M, False: 3.14M]
  ------------------
  329|  2.45M|      format.number(iter.next_tape_value<int64_t>());
  330|  2.45M|      iter.json_index++; // numbers take up 2 spots, so we need to increment
  331|       |                         // extra
  332|  2.45M|      break;
  333|  1.61k|    case tape_type::UINT64:
  ------------------
  |  Branch (333:5): [True: 1.61k, False: 5.59M]
  ------------------
  334|  1.61k|      format.number(iter.next_tape_value<uint64_t>());
  335|  1.61k|      iter.json_index++; // numbers take up 2 spots, so we need to increment
  336|       |                         // extra
  337|  1.61k|      break;
  338|  3.05M|    case tape_type::DOUBLE:
  ------------------
  |  Branch (338:5): [True: 3.05M, False: 2.54M]
  ------------------
  339|  3.05M|      format.number(iter.next_tape_value<double>());
  340|  3.05M|      iter.json_index++; // numbers take up 2 spots, so we need to increment
  341|       |                         // extra
  342|  3.05M|      break;
  343|    456|    case tape_type::TRUE_VALUE:
  ------------------
  |  Branch (343:5): [True: 456, False: 5.60M]
  ------------------
  344|    456|      format.true_atom();
  345|    456|      break;
  346|    390|    case tape_type::FALSE_VALUE:
  ------------------
  |  Branch (346:5): [True: 390, False: 5.60M]
  ------------------
  347|    390|      format.false_atom();
  348|    390|      break;
  349|    272|    case tape_type::NULL_VALUE:
  ------------------
  |  Branch (349:5): [True: 272, False: 5.60M]
  ------------------
  350|    272|      format.null_atom();
  351|    272|      break;
  352|       |
  353|       |    // These are impossible
  354|      0|    case tape_type::END_ARRAY:
  ------------------
  |  Branch (354:5): [True: 0, False: 5.60M]
  ------------------
  355|      0|    case tape_type::END_OBJECT:
  ------------------
  |  Branch (355:5): [True: 0, False: 5.60M]
  ------------------
  356|      0|    case tape_type::ROOT:
  ------------------
  |  Branch (356:5): [True: 0, False: 5.60M]
  ------------------
  357|      0|      SIMDJSON_UNREACHABLE();
  ------------------
  |  |  180|      0|#define SIMDJSON_UNREACHABLE() __builtin_unreachable();
  ------------------
  358|  5.60M|    }
  359|  5.54M|    iter.json_index++;
  360|  5.54M|    after_value = true;
  361|       |
  362|       |    // Handle multiple ends in a row
  363|  5.60M|    while (depth != 0 && (iter.tape_ref_type() == tape_type::END_ARRAY ||
  ------------------
  |  Branch (363:12): [True: 3.45M, False: 2.14M]
  |  Branch (363:27): [True: 53.4k, False: 3.40M]
  ------------------
  364|  3.45M|                          iter.tape_ref_type() == tape_type::END_OBJECT)) {
  ------------------
  |  Branch (364:27): [True: 3.70k, False: 3.40M]
  ------------------
  365|  57.1k|      if (iter.tape_ref_type() == tape_type::END_ARRAY) {
  ------------------
  |  Branch (365:11): [True: 53.4k, False: 3.70k]
  ------------------
  366|  53.4k|        format.end_array();
  367|  53.4k|      } else {
  368|  3.70k|        format.end_object();
  369|  3.70k|      }
  370|  57.1k|      depth--;
  371|  57.1k|      iter.json_index++;
  372|  57.1k|    }
  373|       |
  374|       |    // Stop when we're at depth 0
  375|  5.60M|  } while (depth != 0);
  ------------------
  |  Branch (375:12): [True: 3.45M, False: 2.14M]
  ------------------
  376|  2.14M|}
_ZN8simdjson8internal14mini_formatter5commaEv:
  135|  5.52M|simdjson_inline void mini_formatter::comma() { one_char(','); }
_ZN8simdjson8internal14mini_formatter8one_charEc:
  150|  12.1M|simdjson_inline void mini_formatter::one_char(char c) { buffer.push_back(c); }
_ZN8simdjson8internal14mini_formatter3keyENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  151|   271k|simdjson_inline void mini_formatter::key(std::string_view unescaped) {
  152|   271k|  string(unescaped);
  153|   271k|  one_char(':');
  154|   271k|}
_ZN8simdjson8internal14string_builderINS0_14mini_formatterEE6appendENS_3dom5arrayE:
  394|  7.30k|inline void string_builder<serializer>::append(simdjson::dom::array value) {
  395|  7.30k|  format.start_array();
  396|  7.30k|  auto iter = value.begin();
  397|  7.30k|  auto end = value.end();
  398|  7.30k|  if (iter != end) {
  ------------------
  |  Branch (398:7): [True: 5.60k, False: 1.70k]
  ------------------
  399|  5.60k|    append(*iter);
  400|  2.05M|    for (++iter; iter != end; ++iter) {
  ------------------
  |  Branch (400:18): [True: 2.04M, False: 5.60k]
  ------------------
  401|  2.04M|      format.comma();
  402|  2.04M|      append(*iter);
  403|  2.04M|    }
  404|  5.60k|  }
  405|  7.30k|  format.end_array();
  406|  7.30k|}
_ZN8simdjson8internal14mini_formatter11start_arrayEv:
  131|  65.5k|simdjson_inline void mini_formatter::start_array() { one_char('['); }
_ZN8simdjson8internal14mini_formatter9end_arrayEv:
  132|  65.5k|simdjson_inline void mini_formatter::end_array() { one_char(']'); }
_ZN8simdjson8internal14string_builderINS0_14mini_formatterEE6appendENS_3dom6objectE:
  379|  9.44k|inline void string_builder<serializer>::append(simdjson::dom::object value) {
  380|  9.44k|  format.start_object();
  381|  9.44k|  auto pair = value.begin();
  382|  9.44k|  auto end = value.end();
  383|  9.44k|  if (pair != end) {
  ------------------
  |  Branch (383:7): [True: 8.97k, False: 470]
  ------------------
  384|  8.97k|    append(*pair);
  385|  85.3k|    for (++pair; pair != end; ++pair) {
  ------------------
  |  Branch (385:18): [True: 76.3k, False: 8.97k]
  ------------------
  386|  76.3k|      format.comma();
  387|  76.3k|      append(*pair);
  388|  76.3k|    }
  389|  8.97k|  }
  390|  9.44k|  format.end_object();
  391|  9.44k|}
_ZN8simdjson8internal14string_builderINS0_14mini_formatterEE6appendENS_3dom14key_value_pairE:
  409|  85.3k|simdjson_inline void string_builder<serializer>::append(simdjson::dom::key_value_pair kv) {
  410|  85.3k|  format.key(kv.key);
  411|  85.3k|  append(kv.value);
  412|  85.3k|}
_ZN8simdjson8internal14mini_formatter12start_objectEv:
  133|  15.1k|simdjson_inline void mini_formatter::start_object() { one_char('{'); }
_ZN8simdjson8internal14mini_formatter10end_objectEv:
  134|  15.1k|simdjson_inline void mini_formatter::end_object() { one_char('}'); }
_ZN8simdjson8internal14mini_formatter6stringENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  155|   275k|simdjson_inline void mini_formatter::string(std::string_view unescaped) {
  156|   275k|  one_char('\"');
  157|   275k|  size_t i = 0;
  158|       |  // Fast path for the case where we have no control character, no ", and no backslash.
  159|       |  // This should include most keys.
  160|       |  //
  161|       |  // We would like to use 'bool' but some compilers take offense to bitwise operation
  162|       |  // with bool types.
  163|   275k|  constexpr static char needs_escaping[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  164|   275k|    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
  165|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  166|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
  167|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  168|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  169|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  170|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  171|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  172|   275k|    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  173|  3.22M|  for(;i + 8 <= unescaped.length(); i += 8) {
  ------------------
  |  Branch (173:8): [True: 2.95M, False: 270k]
  ------------------
  174|       |    // Poor's man vectorization. This could get much faster if we used SIMD.
  175|       |    //
  176|       |    // It is not the case that replacing '|' with '||' would be neutral performance-wise.
  177|  2.95M|    if(needs_escaping[uint8_t(unescaped[i])] | needs_escaping[uint8_t(unescaped[i+1])]
  ------------------
  |  Branch (177:8): [True: 5.52k, False: 2.94M]
  ------------------
  178|  2.95M|      | needs_escaping[uint8_t(unescaped[i+2])] | needs_escaping[uint8_t(unescaped[i+3])]
  179|  2.95M|      | needs_escaping[uint8_t(unescaped[i+4])] | needs_escaping[uint8_t(unescaped[i+5])]
  180|  2.95M|      | needs_escaping[uint8_t(unescaped[i+6])] | needs_escaping[uint8_t(unescaped[i+7])]
  181|  2.95M|      ) { break; }
  182|  2.95M|  }
  183|   322k|  for(;i < unescaped.length(); i++) {
  ------------------
  |  Branch (183:8): [True: 57.2k, False: 265k]
  ------------------
  184|  57.2k|    if(needs_escaping[uint8_t(unescaped[i])]) { break; }
  ------------------
  |  Branch (184:8): [True: 10.3k, False: 46.9k]
  ------------------
  185|  57.2k|  }
  186|       |  // The following is also possible and omits a 256-byte table, but it is slower:
  187|       |  // for (; (i < unescaped.length()) && (uint8_t(unescaped[i]) > 0x1F)
  188|       |  //      && (unescaped[i] != '\"') && (unescaped[i] != '\\'); i++) {}
  189|       |
  190|       |  // At least for long strings, the following should be fast. We could
  191|       |  // do better by integrating the checks and the insertion.
  192|   275k|  buffer.insert(buffer.end(), unescaped.data(), unescaped.data() + i);
  193|       |  // We caught a control character if we enter this loop (slow).
  194|       |  // Note that we are do not restart from the beginning, but rather we continue
  195|       |  // from the point where we encountered something that requires escaping.
  196|  5.95M|  for (; i < unescaped.length(); i++) {
  ------------------
  |  Branch (196:10): [True: 5.67M, False: 275k]
  ------------------
  197|  5.67M|    switch (unescaped[i]) {
  198|  2.40k|    case '\"':
  ------------------
  |  Branch (198:5): [True: 2.40k, False: 5.67M]
  ------------------
  199|  2.40k|      {
  200|  2.40k|        const char * s = "\\\"";
  201|  2.40k|        buffer.insert(buffer.end(), s, s + 2);
  202|  2.40k|      }
  203|  2.40k|      break;
  204|  3.38k|    case '\\':
  ------------------
  |  Branch (204:5): [True: 3.38k, False: 5.67M]
  ------------------
  205|  3.38k|      {
  206|  3.38k|        const char * s = "\\\\";
  207|  3.38k|        buffer.insert(buffer.end(), s, s + 2);
  208|  3.38k|      }
  209|  3.38k|      break;
  210|  5.66M|    default:
  ------------------
  |  Branch (210:5): [True: 5.66M, False: 5.79k]
  ------------------
  211|  5.66M|      if (uint8_t(unescaped[i]) <= 0x1F) {
  ------------------
  |  Branch (211:11): [True: 27.7k, False: 5.64M]
  ------------------
  212|       |        // If packed, this uses 8 * 32 bytes.
  213|       |        // Note that we expect most compilers to embed this code in the data
  214|       |        // section.
  215|  27.7k|        constexpr static escape_sequence escaped[32] = {
  216|  27.7k|          {6, "\\u0000"}, {6, "\\u0001"}, {6, "\\u0002"}, {6, "\\u0003"},
  217|  27.7k|          {6, "\\u0004"}, {6, "\\u0005"}, {6, "\\u0006"}, {6, "\\u0007"},
  218|  27.7k|          {2, "\\b"},     {2, "\\t"},     {2, "\\n"},     {6, "\\u000b"},
  219|  27.7k|          {2, "\\f"},     {2, "\\r"},     {6, "\\u000e"}, {6, "\\u000f"},
  220|  27.7k|          {6, "\\u0010"}, {6, "\\u0011"}, {6, "\\u0012"}, {6, "\\u0013"},
  221|  27.7k|          {6, "\\u0014"}, {6, "\\u0015"}, {6, "\\u0016"}, {6, "\\u0017"},
  222|  27.7k|          {6, "\\u0018"}, {6, "\\u0019"}, {6, "\\u001a"}, {6, "\\u001b"},
  223|  27.7k|          {6, "\\u001c"}, {6, "\\u001d"}, {6, "\\u001e"}, {6, "\\u001f"}};
  224|  27.7k|        auto u = escaped[uint8_t(unescaped[i])];
  225|  27.7k|        buffer.insert(buffer.end(), u.string, u.string + u.length);
  226|  5.64M|      } else {
  227|  5.64M|        one_char(unescaped[i]);
  228|  5.64M|      }
  229|  5.67M|    } // switch
  230|  5.67M|  }   // for
  231|   275k|  one_char('\"');
  232|   275k|}
_ZN8simdjson8internal14mini_formatter6numberEl:
  116|  2.45M|simdjson_inline void mini_formatter::number(int64_t x) {
  117|  2.45M|  char number_buffer[24];
  118|  2.45M|  char *newp = fast_itoa(number_buffer, x);
  119|  2.45M|  buffer.insert(buffer.end(), number_buffer, newp);
  120|  2.45M|}
fuzz_minify.cpp:_ZN8simdjson12_GLOBAL__N_19fast_itoaEPcl:
   44|  2.45M|char *fast_itoa(char *output, int64_t value) noexcept {
   45|       |  // This is a standard implementation of itoa.
   46|  2.45M|  char buffer[20];
   47|  2.45M|  uint64_t value_positive;
   48|       |  // In general, negating a signed integer is unsafe.
   49|  2.45M|  if(value < 0) {
  ------------------
  |  Branch (49:6): [True: 2.54k, False: 2.45M]
  ------------------
   50|  2.54k|    *output++ = '-';
   51|       |    // Doing value_positive = -value; while avoiding
   52|       |    // undefined behavior warnings.
   53|       |    // It assumes two complement's which is universal at this
   54|       |    // point in time.
   55|  2.54k|    std::memcpy(&value_positive, &value, sizeof(value));
   56|  2.54k|    value_positive = (~value_positive) + 1; // this is a negation
   57|  2.45M|  } else {
   58|  2.45M|    value_positive = value;
   59|  2.45M|  }
   60|       |  // We work solely with value_positive. It *might* be easier
   61|       |  // for an optimizing compiler to deal with an unsigned variable
   62|       |  // as far as performance goes.
   63|  2.45M|  const char *const end_buffer = buffer + 20;
   64|  2.45M|  char *write_pointer = buffer + 19;
   65|       |  // A faster approach is possible if we expect large integers:
   66|       |  // unroll the loop (work in 100s, 1000s) and use some kind of
   67|       |  // memoization.
   68|  2.64M|  while(value_positive >= 10) {
  ------------------
  |  Branch (68:9): [True: 187k, False: 2.45M]
  ------------------
   69|   187k|    *write_pointer-- = char('0' + (value_positive % 10));
   70|   187k|    value_positive /= 10;
   71|   187k|  }
   72|  2.45M|  *write_pointer = char('0' + value_positive);
   73|  2.45M|  size_t len = end_buffer - write_pointer;
   74|  2.45M|  std::memcpy(output, write_pointer, len);
   75|  2.45M|  return output + len;
   76|  2.45M|}
_ZN8simdjson8internal14mini_formatter6numberEm:
  110|  1.61k|simdjson_inline void mini_formatter::number(uint64_t x) {
  111|  1.61k|  char number_buffer[24];
  112|  1.61k|  char *newp = fast_itoa(number_buffer, x);
  113|  1.61k|  buffer.insert(buffer.end(), number_buffer, newp);
  114|  1.61k|}
fuzz_minify.cpp:_ZN8simdjson12_GLOBAL__N_19fast_itoaEPcm:
   86|  1.61k|char *fast_itoa(char *output, uint64_t value) noexcept {
   87|       |  // This is a standard implementation of itoa.
   88|  1.61k|  char buffer[20];
   89|  1.61k|  const char *const end_buffer = buffer + 20;
   90|  1.61k|  char *write_pointer = buffer + 19;
   91|       |  // A faster approach is possible if we expect large integers:
   92|       |  // unroll the loop (work in 100s, 1000s) and use some kind of
   93|       |  // memoization.
   94|  31.4k|  while(value >= 10) {
  ------------------
  |  Branch (94:9): [True: 29.8k, False: 1.61k]
  ------------------
   95|  29.8k|    *write_pointer-- = char('0' + (value % 10));
   96|  29.8k|    value /= 10;
   97|  29.8k|  };
   98|  1.61k|  *write_pointer = char('0' + value);
   99|  1.61k|  size_t len = end_buffer - write_pointer;
  100|  1.61k|  std::memcpy(output, write_pointer, len);
  101|  1.61k|  return output + len;
  102|  1.61k|}
_ZN8simdjson8internal14mini_formatter6numberEd:
  122|  3.05M|simdjson_inline void mini_formatter::number(double x) {
  123|  3.05M|  char number_buffer[24];
  124|       |  // Currently, passing the nullptr to the second argument is
  125|       |  // safe because our implementation does not check the second
  126|       |  // argument.
  127|  3.05M|  char *newp = internal::to_chars(number_buffer, nullptr, x);
  128|  3.05M|  buffer.insert(buffer.end(), number_buffer, newp);
  129|  3.05M|}
_ZN8simdjson8internal14mini_formatter9true_atomEv:
  138|    456|simdjson_inline void mini_formatter::true_atom() {
  139|    456|  const char * s = "true";
  140|    456|  buffer.insert(buffer.end(), s, s + 4);
  141|    456|}
_ZN8simdjson8internal14mini_formatter10false_atomEv:
  142|    390|simdjson_inline void mini_formatter::false_atom() {
  143|    390|  const char * s = "false";
  144|    390|  buffer.insert(buffer.end(), s, s + 5);
  145|    390|}
_ZN8simdjson8internal14mini_formatter9null_atomEv:
  146|    272|simdjson_inline void mini_formatter::null_atom() {
  147|    272|  const char * s = "null";
  148|    272|  buffer.insert(buffer.end(), s, s + 4);
  149|    272|}
_ZNK8simdjson8internal14string_builderINS0_14mini_formatterEE3strEv:
  420|  6.79k|simdjson_inline std::string_view string_builder<serializer>::str() const {
  421|  6.79k|  return format.str();
  422|  6.79k|}
_ZNK8simdjson8internal14mini_formatter3strEv:
  238|  6.79k|simdjson_inline std::string_view mini_formatter::str() const {
  239|  6.79k|  return std::string_view(buffer.data(), buffer.size());
  240|  6.79k|}

_ZN8simdjson6minifyINS_3dom7elementEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEET_:
  203|  6.79k|std::string minify(T x)  {
  204|  6.79k|  return to_string(x);
  205|  6.79k|}
_ZN8simdjson9to_stringINS_3dom7elementEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEET_:
  177|  6.79k|std::string to_string(T x)   {
  178|       |    // in C++, to_string is standard: http://www.cplusplus.com/reference/string/to_string/
  179|       |    // Currently minify and to_string are identical but in the future, they may
  180|       |    // differ.
  181|  6.79k|    simdjson::internal::string_builder<> sb;
  182|  6.79k|    sb.append(x);
  183|  6.79k|    std::string_view answer = sb.str();
  184|  6.79k|    return std::string(answer.data(), answer.size());
  185|  6.79k|}
_ZN8simdjson8internal14string_builderINS0_14mini_formatterEEC2Ev:
   35|  6.79k|  string_builder() = default;
_ZN8simdjson8internal14mini_formatterC2Ev:
   65|  6.79k|  mini_formatter() = default;

_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2ENS_10error_codeE:
  107|  4.18k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_NS_10error_codeE:
  104|  10.9k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_:
  110|  6.79k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8internal20simdjson_result_baseINS_3dom7elementEE5errorEv:
   62|  15.1k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  15.1k|  return this->second;
   64|  15.1k|}

_ZN8simdjson8fallback14implementationC2Ev:
   23|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_true_atomEPKhm:
   32|     58|simdjson_inline bool is_valid_true_atom(const uint8_t *src, size_t len) {
   33|     58|  if (len > 4) { return is_valid_true_atom(src); }
  ------------------
  |  Branch (33:7): [True: 20, False: 38]
  ------------------
   34|     38|  else if (len == 4) { return !str4ncmp(src, "true"); }
  ------------------
  |  Branch (34:12): [True: 36, False: 2]
  ------------------
   35|      2|  else { return false; }
   36|     58|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_true_atomEPKh:
   27|    562|simdjson_inline bool is_valid_true_atom(const uint8_t *src) {
   28|    562|  return (str4ncmp(src, "true") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0;
   29|    562|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing8str4ncmpEPKhPKc:
   19|  1.67k|simdjson_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) {
   20|  1.67k|  uint32_t srcval; // we want to avoid unaligned 32-bit loads (undefined in C/C++)
   21|  1.67k|  static_assert(sizeof(uint32_t) <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be larger than 4 bytes");
   22|  1.67k|  std::memcpy(&srcval, src, sizeof(uint32_t));
   23|  1.67k|  return srcval ^ string_to_uint32(atom);
   24|  1.67k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing16string_to_uint32EPKc:
   13|  1.67k|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:
   44|     97|simdjson_inline bool is_valid_false_atom(const uint8_t *src, size_t len) {
   45|     97|  if (len > 5) { return is_valid_false_atom(src); }
  ------------------
  |  Branch (45:7): [True: 44, False: 53]
  ------------------
   46|     53|  else if (len == 5) { return !str4ncmp(src+1, "alse"); }
  ------------------
  |  Branch (46:12): [True: 49, False: 4]
  ------------------
   47|      4|  else { return false; }
   48|     97|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing19is_valid_false_atomEPKh:
   39|    529|simdjson_inline bool is_valid_false_atom(const uint8_t *src) {
   40|    529|  return (str4ncmp(src+1, "alse") | jsoncharutils::is_not_structural_or_whitespace(src[5])) == 0;
   41|    529|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_null_atomEPKhm:
   56|     52|simdjson_inline bool is_valid_null_atom(const uint8_t *src, size_t len) {
   57|     52|  if (len > 4) { return is_valid_null_atom(src); }
  ------------------
  |  Branch (57:7): [True: 13, False: 39]
  ------------------
   58|     39|  else if (len == 4) { return !str4ncmp(src, "null"); }
  ------------------
  |  Branch (58:12): [True: 37, False: 2]
  ------------------
   59|      2|  else { return false; }
   60|     52|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_111atomparsing18is_valid_null_atomEPKh:
   51|    466|simdjson_inline bool is_valid_null_atom(const uint8_t *src) {
   52|    466|  return (str4ncmp(src, "null") | jsoncharutils::is_not_structural_or_whitespace(src[4])) == 0;
   53|    466|}

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing12parse_numberINS1_6stage211tape_writerEEENS_10error_codeEPKhRT_:
  547|  5.56M|simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
  548|       |
  549|       |  //
  550|       |  // Check for minus sign
  551|       |  //
  552|  5.56M|  bool negative = (*src == '-');
  553|  5.56M|  const uint8_t *p = src + uint8_t(negative);
  554|       |
  555|       |  //
  556|       |  // Parse the integer part.
  557|       |  //
  558|       |  // PERF NOTE: we don't use is_made_of_eight_digits_fast because large integers like 123456789 are rare
  559|  5.56M|  const uint8_t *const start_digits = p;
  560|  5.56M|  uint64_t i = 0;
  561|  32.0M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (561:10): [True: 26.4M, False: 5.56M]
  ------------------
  562|       |
  563|       |  // If there were no digits, or if the integer starts with 0 and has more than one digit, it's an error.
  564|       |  // Optimization note: size_t is expected to be unsigned.
  565|  5.56M|  size_t digit_count = size_t(p - start_digits);
  566|  5.56M|  if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|     66|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (566:7): [True: 19, False: 5.56M]
  |  Branch (566:28): [True: 10.0k, False: 5.55M]
  |  Branch (566:52): [True: 47, False: 10.0k]
  ------------------
  567|       |
  568|       |  //
  569|       |  // Handle floats if there is a . or e (or both)
  570|       |  //
  571|  5.56M|  int64_t exponent = 0;
  572|  5.56M|  bool is_float = false;
  573|  5.56M|  if ('.' == *p) {
  ------------------
  |  Branch (573:7): [True: 15.0k, False: 5.54M]
  ------------------
  574|  15.0k|    is_float = true;
  575|  15.0k|    ++p;
  576|  15.0k|    SIMDJSON_TRY( parse_decimal(src, p, i, exponent) );
  ------------------
  |  |  279|  15.0k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 153, False: 14.9k]
  |  |  ------------------
  ------------------
  577|  14.9k|    digit_count = int(p - start_digits); // used later to guard against overflows
  578|  14.9k|  }
  579|  5.56M|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (579:7): [True: 26.8k, False: 5.53M]
  |  Branch (579:22): [True: 3.02M, False: 2.51M]
  ------------------
  580|  3.05M|    is_float = true;
  581|  3.05M|    ++p;
  582|  3.05M|    SIMDJSON_TRY( parse_exponent(src, p, exponent) );
  ------------------
  |  |  279|  3.05M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 100, False: 3.05M]
  |  |  ------------------
  ------------------
  583|  3.05M|  }
  584|  5.56M|  if (is_float) {
  ------------------
  |  Branch (584:7): [True: 3.06M, False: 2.49M]
  ------------------
  585|  3.06M|    const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p);
  586|  3.06M|    SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) );
  ------------------
  |  |  279|  3.06M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 666, False: 3.06M]
  |  |  ------------------
  ------------------
  587|  3.06M|    if (dirty_end) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|    205|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (587:9): [True: 205, False: 3.06M]
  ------------------
  588|  3.06M|    return SUCCESS;
  589|  3.06M|  }
  590|       |
  591|       |  // The longest negative 64-bit number is 19 digits.
  592|       |  // The longest positive 64-bit number is 20 digits.
  593|       |  // We do it this way so we don't trigger this branch unless we must.
  594|  2.49M|  size_t longest_digit_count = negative ? 19 : 20;
  ------------------
  |  Branch (594:32): [True: 3.05k, False: 2.49M]
  ------------------
  595|  2.49M|  if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|    104|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (595:7): [True: 104, False: 2.49M]
  ------------------
  596|  2.49M|  if (digit_count == longest_digit_count) {
  ------------------
  |  Branch (596:7): [True: 1.58k, False: 2.49M]
  ------------------
  597|  1.58k|    if (negative) {
  ------------------
  |  Branch (597:9): [True: 681, False: 906]
  ------------------
  598|       |      // Anything negative above INT64_MAX+1 is invalid
  599|    681|      if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src);  }
  ------------------
  |  |   30|     54|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (599:11): [True: 54, False: 627]
  ------------------
  600|    627|      WRITE_INTEGER(~i+1, src, writer);
  ------------------
  |  |   31|    627|#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE))
  ------------------
  601|    627|      if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|      3|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (601:11): [True: 3, False: 624]
  ------------------
  602|    624|      return SUCCESS;
  603|       |    // Positive overflow check:
  604|       |    // - A 20 digit number starting with 2-9 is overflow, because 18,446,744,073,709,551,615 is the
  605|       |    //   biggest uint64_t.
  606|       |    // - A 20 digit number starting with 1 is overflow if it is less than INT64_MAX.
  607|       |    //   If we got here, it's a 20 digit number starting with the digit "1".
  608|       |    // - If a 20 digit number starting with 1 overflowed (i*10+digit), the result will be smaller
  609|       |    //   than 1,553,255,926,290,448,384.
  610|       |    // - That is smaller than the smallest possible 20-digit number the user could write:
  611|       |    //   10,000,000,000,000,000,000.
  612|       |    // - Therefore, if the number is positive and lower than that, it's overflow.
  613|       |    // - The value we are looking at is less than or equal to INT64_MAX.
  614|       |    //
  615|    906|    }  else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|     68|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (615:17): [True: 5, False: 901]
  |  Branch (615:43): [True: 63, False: 838]
  ------------------
  616|  1.58k|  }
  617|       |
  618|       |  // Write unsigned if it doesn't fit in a signed integer.
  619|  2.49M|  if (i > uint64_t(INT64_MAX)) {
  ------------------
  |  Branch (619:7): [True: 1.97k, False: 2.49M]
  ------------------
  620|  1.97k|    WRITE_UNSIGNED(i, src, writer);
  ------------------
  |  |   32|  1.97k|#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE))
  ------------------
  621|  2.49M|  } else {
  622|  2.49M|    WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
  ------------------
  |  |   31|  4.98M|#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE))
  |  |  ------------------
  |  |  |  Branch (31:64): [True: 2.35k, False: 2.49M]
  |  |  ------------------
  ------------------
  623|  2.49M|  }
  624|  2.49M|  if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|     54|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (624:7): [True: 54, False: 2.49M]
  ------------------
  625|  2.49M|  return SUCCESS;
  626|  2.49M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing11parse_digitImEEbhRT_:
  365|  41.5M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  366|  41.5M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  367|  41.5M|  if (digit > 9) {
  ------------------
  |  Branch (367:7): [True: 5.57M, False: 35.9M]
  ------------------
  368|  5.57M|    return false;
  369|  5.57M|  }
  370|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  371|  35.9M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  372|  35.9M|  return true;
  373|  41.5M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing13parse_decimalEPKhRS4_RmRl:
  375|  15.0k|simdjson_inline error_code parse_decimal(simdjson_unused const uint8_t *const src, const uint8_t *&p, uint64_t &i, int64_t &exponent) {
  376|       |  // we continue with the fiction that we have an integer. If the
  377|       |  // floating point number is representable as x * 10^z for some integer
  378|       |  // z that fits in 53 bits, then we will be able to convert back the
  379|       |  // the integer into a float in a lossless manner.
  380|  15.0k|  const uint8_t *const first_after_period = p;
  381|       |
  382|  15.0k|#ifdef SIMDJSON_SWAR_NUMBER_PARSING
  383|  15.0k|#if SIMDJSON_SWAR_NUMBER_PARSING
  384|       |  // this helps if we have lots of decimals!
  385|       |  // this turns out to be frequent enough.
  386|  15.0k|  if (is_made_of_eight_digits_fast(p)) {
  ------------------
  |  Branch (386:7): [True: 5.87k, False: 9.19k]
  ------------------
  387|  5.87k|    i = i * 100000000 + parse_eight_digits_unrolled(p);
  388|  5.87k|    p += 8;
  389|  5.87k|  }
  390|  15.0k|#endif // SIMDJSON_SWAR_NUMBER_PARSING
  391|  15.0k|#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING
  392|       |  // Unrolling the first digit makes a small difference on some implementations (e.g. westmere)
  393|  15.0k|  if (parse_digit(*p, i)) { ++p; }
  ------------------
  |  Branch (393:7): [True: 14.1k, False: 873]
  ------------------
  394|  9.48M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (394:10): [True: 9.46M, False: 15.0k]
  ------------------
  395|  15.0k|  exponent = first_after_period - p;
  396|       |  // Decimal without digits (123.) is illegal
  397|  15.0k|  if (exponent == 0) {
  ------------------
  |  Branch (397:7): [True: 153, False: 14.9k]
  ------------------
  398|    153|    return INVALID_NUMBER(src);
  ------------------
  |  |   30|    153|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  399|    153|  }
  400|  14.9k|  return SUCCESS;
  401|  15.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing28is_made_of_eight_digits_fastEPKh:
  338|  15.0k|simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) {
  339|  15.0k|  uint64_t val;
  340|       |  // this can read up to 7 bytes beyond the buffer size, but we require
  341|       |  // SIMDJSON_PADDING of padding
  342|  15.0k|  static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7");
  343|  15.0k|  std::memcpy(&val, chars, 8);
  344|       |  // a branchy method might be faster:
  345|       |  // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030)
  346|       |  //  && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) ==
  347|       |  //  0x3030303030303030);
  348|  15.0k|  return (((val & 0xF0F0F0F0F0F0F0F0) |
  349|  15.0k|           (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) ==
  350|  15.0k|          0x3333333333333333);
  351|  15.0k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing14parse_exponentEPKhRS4_Rl:
  403|  3.05M|simdjson_inline error_code parse_exponent(simdjson_unused const uint8_t *const src, const uint8_t *&p, int64_t &exponent) {
  404|       |  // Exp Sign: -123.456e[-]78
  405|  3.05M|  bool neg_exp = ('-' == *p);
  406|  3.05M|  if (neg_exp || '+' == *p) { p++; } // Skip + as well
  ------------------
  |  Branch (406:7): [True: 7.23k, False: 3.04M]
  |  Branch (406:18): [True: 1.38k, False: 3.04M]
  ------------------
  407|       |
  408|       |  // Exponent: -123.456e-[78]
  409|  3.05M|  auto start_exp = p;
  410|  3.05M|  int64_t exp_number = 0;
  411|  16.7M|  while (parse_digit(*p, exp_number)) { ++p; }
  ------------------
  |  Branch (411:10): [True: 13.6M, False: 3.05M]
  ------------------
  412|       |  // It is possible for parse_digit to overflow.
  413|       |  // In particular, it could overflow to INT64_MIN, and we cannot do - INT64_MIN.
  414|       |  // Thus we *must* check for possible overflow before we negate exp_number.
  415|       |
  416|       |  // Performance notes: it may seem like combining the two "simdjson_unlikely checks" below into
  417|       |  // a single simdjson_unlikely path would be faster. The reasoning is sound, but the compiler may
  418|       |  // not oblige and may, in fact, generate two distinct paths in any case. It might be
  419|       |  // possible to do uint64_t(p - start_exp - 1) >= 18 but it could end up trading off
  420|       |  // instructions for a simdjson_likely branch, an unconclusive gain.
  421|       |
  422|       |  // If there were no digits, it's an error.
  423|  3.05M|  if (simdjson_unlikely(p == start_exp)) {
  ------------------
  |  |  120|  3.05M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 100, False: 3.05M]
  |  |  ------------------
  ------------------
  424|    100|    return INVALID_NUMBER(src);
  ------------------
  |  |   30|    100|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  425|    100|  }
  426|       |  // We have a valid positive exponent in exp_number at this point, except that
  427|       |  // it may have overflowed.
  428|       |
  429|       |  // If there were more than 18 digits, we may have overflowed the integer. We have to do
  430|       |  // something!!!!
  431|  3.05M|  if (simdjson_unlikely(p > start_exp+18)) {
  ------------------
  |  |  120|  3.05M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 929, False: 3.05M]
  |  |  ------------------
  ------------------
  432|       |    // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow
  433|   272k|    while (*start_exp == '0') { start_exp++; }
  ------------------
  |  Branch (433:12): [True: 271k, False: 929]
  ------------------
  434|       |    // 19 digits could overflow int64_t and is kind of absurd anyway. We don't
  435|       |    // support exponents smaller than -999,999,999,999,999,999 and bigger
  436|       |    // than 999,999,999,999,999,999.
  437|       |    // We can truncate.
  438|       |    // Note that 999999999999999999 is assuredly too large. The maximal ieee64 value before
  439|       |    // infinity is ~1.8e308. The smallest subnormal is ~5e-324. So, actually, we could
  440|       |    // truncate at 324.
  441|       |    // Note that there is no reason to fail per se at this point in time.
  442|       |    // E.g., 0e999999999999999999999 is a fine number.
  443|    929|    if (p > start_exp+18) { exp_number = 999999999999999999; }
  ------------------
  |  Branch (443:9): [True: 508, False: 421]
  ------------------
  444|    929|  }
  445|       |  // At this point, we know that exp_number is a sane, positive, signed integer.
  446|       |  // It is <= 999,999,999,999,999,999. As long as 'exponent' is in
  447|       |  // [-8223372036854775808, 8223372036854775808], we won't overflow. Because 'exponent'
  448|       |  // is bounded in magnitude by the size of the JSON input, we are fine in this universe.
  449|       |  // To sum it up: the next line should never overflow.
  450|  3.05M|  exponent += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (450:16): [True: 7.22k, False: 3.04M]
  ------------------
  451|  3.05M|  return SUCCESS;
  452|  3.05M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing11parse_digitIlEEbhRT_:
  365|  16.7M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  366|  16.7M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  367|  16.7M|  if (digit > 9) {
  ------------------
  |  Branch (367:7): [True: 3.05M, False: 13.6M]
  ------------------
  368|  3.05M|    return false;
  369|  3.05M|  }
  370|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  371|  13.6M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  372|  13.6M|  return true;
  373|  16.7M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing11write_floatINS1_6stage211tape_writerEEENS_10error_codeEPKhbmS8_mlRT_:
  464|  3.06M|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) {
  465|       |  // If we frequently had to deal with long strings of digits,
  466|       |  // we could extend our code by using a 128-bit integer instead
  467|       |  // of a 64-bit integer. However, this is uncommon in practice.
  468|       |  //
  469|       |  // 9999999999999999999 < 2**64 so we can accommodate 19 digits.
  470|       |  // If we have a decimal separator, then digit_count - 1 is the number of digits, but we
  471|       |  // may not have a decimal separator!
  472|  3.06M|  if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) {
  ------------------
  |  |  120|  3.07M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 6.17k, False: 3.05M]
  |  |  |  Branch (120:52): [True: 6.52k, False: 3.05M]
  |  |  |  Branch (120:52): [True: 6.17k, False: 351]
  |  |  ------------------
  ------------------
  473|       |    // Ok, chances are good that we had an overflow!
  474|       |    // this is almost never going to get called!!!
  475|       |    // we start anew, going slowly!!!
  476|       |    // This will happen in the following examples:
  477|       |    // 10000000000000000000000000000000000000000000e+308
  478|       |    // 3.1415926535897932384626433832795028841971693993751
  479|       |    //
  480|       |    // NOTE: This makes a *copy* of the writer and passes it to slow_float_parsing. This happens
  481|       |    // because slow_float_parsing is a non-inlined function. If we passed our writer reference to
  482|       |    // it, it would force it to be stored in memory, preventing the compiler from picking it apart
  483|       |    // and putting into registers. i.e. if we pass it as reference, it gets slow.
  484|       |    // This is what forces the skip_double, as well.
  485|  6.17k|    error_code error = slow_float_parsing(src, writer);
  486|  6.17k|    writer.skip_double();
  487|  6.17k|    return error;
  488|  6.17k|  }
  489|       |  // NOTE: it's weird that the simdjson_unlikely() only wraps half the if, but it seems to get slower any other
  490|       |  // way we've tried: https://github.com/simdjson/simdjson/pull/990#discussion_r448497331
  491|       |  // To future reader: we'd love if someone found a better way, or at least could explain this result!
  492|  3.05M|  if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) {
  ------------------
  |  |  120|  6.11M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 1.55k, False: 3.05M]
  |  |  ------------------
  ------------------
  |  Branch (492:75): [True: 1.19k, False: 3.05M]
  ------------------
  493|       |    //
  494|       |    // Important: smallest_power is such that it leads to a zero value.
  495|       |    // Observe that 18446744073709551615e-343 == 0, i.e. (2**64 - 1) e -343 is zero
  496|       |    // so something x 10^-343 goes to zero, but not so with  something x 10^-342.
  497|  2.75k|    static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough");
  498|       |    //
  499|  2.75k|    if((exponent < simdjson::internal::smallest_power) || (i == 0)) {
  ------------------
  |  Branch (499:8): [True: 1.55k, False: 1.19k]
  |  Branch (499:59): [True: 811, False: 384]
  ------------------
  500|       |      // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero
  501|  2.37k|      WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer);
  ------------------
  |  |   33|  4.74k|#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE))
  |  |  ------------------
  |  |  |  Branch (33:66): [True: 5, False: 2.36k]
  |  |  ------------------
  ------------------
  502|  2.37k|      return SUCCESS;
  503|  2.37k|    } else { // (exponent > largest_power) and (i != 0)
  504|       |      // We have, for sure, an infinite value and simdjson refuses to parse infinite values.
  505|    384|      return INVALID_NUMBER(src);
  ------------------
  |  |   30|    384|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  506|    384|    }
  507|  2.75k|  }
  508|  3.05M|  double d;
  509|  3.05M|  if (!compute_float_64(exponent, i, negative, d)) {
  ------------------
  |  Branch (509:7): [True: 152, False: 3.05M]
  ------------------
  510|       |    // we are almost never going to get here.
  511|    152|    if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|    152|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (511:9): [True: 152, False: 0]
  ------------------
  512|    152|  }
  513|  3.05M|  WRITE_DOUBLE(d, src, writer);
  ------------------
  |  |   33|  3.05M|#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE))
  ------------------
  514|  3.05M|  return SUCCESS;
  515|  3.05M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing18significant_digitsEPKhm:
  454|  6.52k|simdjson_inline size_t significant_digits(const uint8_t * start_digits, size_t digit_count) {
  455|       |  // It is possible that the integer had an overflow.
  456|       |  // We have to handle the case where we have 0.0000somenumber.
  457|  6.52k|  const uint8_t *start = start_digits;
  458|  4.74M|  while ((*start == '0') || (*start == '.')) { ++start; }
  ------------------
  |  Branch (458:10): [True: 4.72M, False: 27.0k]
  |  Branch (458:29): [True: 20.5k, False: 6.52k]
  ------------------
  459|       |  // we over-decrement by one when there is a '.'
  460|  6.52k|  return digit_count - size_t(start - start_digits);
  461|  6.52k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing18slow_float_parsingINS1_6stage211tape_writerEEENS_10error_codeEPKhT_:
  354|  6.17k|error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) {
  355|  6.17k|  double d;
  356|  6.17k|  if (parse_float_fallback(src, &d)) {
  ------------------
  |  Branch (356:7): [True: 6.04k, False: 130]
  ------------------
  357|  6.04k|    writer.append_double(d);
  358|  6.04k|    return SUCCESS;
  359|  6.04k|  }
  360|    130|  return INVALID_NUMBER(src);
  ------------------
  |  |   30|    130|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  361|  6.17k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing16compute_float_64ElmbRd:
   55|  3.05M|simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative, double &d) {
   56|       |  // we start with a fast path
   57|       |  // It was described in
   58|       |  // Clinger WD. How to read floating point numbers accurately.
   59|       |  // ACM SIGPLAN Notices. 1990
   60|       |#ifndef FLT_EVAL_METHOD
   61|       |#error "FLT_EVAL_METHOD should be defined, please include cfloat."
   62|       |#endif
   63|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
   64|       |  // We cannot be certain that x/y is rounded to nearest.
   65|       |  if (0 <= power && power <= 22 && i <= 9007199254740991) {
   66|       |#else
   67|  3.05M|  if (-22 <= power && power <= 22 && i <= 9007199254740991) {
  ------------------
  |  Branch (67:7): [True: 3.05M, False: 4.08k]
  |  Branch (67:23): [True: 65.2k, False: 2.98M]
  |  Branch (67:38): [True: 64.0k, False: 1.20k]
  ------------------
   68|  64.0k|#endif
   69|       |    // convert the integer into a double. This is lossless since
   70|       |    // 0 <= i <= 2^53 - 1.
   71|  64.0k|    d = double(i);
   72|       |    //
   73|       |    // The general idea is as follows.
   74|       |    // If 0 <= s < 2^53 and if 10^0 <= p <= 10^22 then
   75|       |    // 1) Both s and p can be represented exactly as 64-bit floating-point
   76|       |    // values
   77|       |    // (binary64).
   78|       |    // 2) Because s and p can be represented exactly as floating-point values,
   79|       |    // then s * p
   80|       |    // and s / p will produce correctly rounded values.
   81|       |    //
   82|  64.0k|    if (power < 0) {
  ------------------
  |  Branch (82:9): [True: 9.20k, False: 54.8k]
  ------------------
   83|  9.20k|      d = d / simdjson::internal::power_of_ten[-power];
   84|  54.8k|    } else {
   85|  54.8k|      d = d * simdjson::internal::power_of_ten[power];
   86|  54.8k|    }
   87|  64.0k|    if (negative) {
  ------------------
  |  Branch (87:9): [True: 3.03k, False: 61.0k]
  ------------------
   88|  3.03k|      d = -d;
   89|  3.03k|    }
   90|  64.0k|    return true;
   91|  64.0k|  }
   92|       |  // When 22 < power && power <  22 + 16, we could
   93|       |  // hope for another, secondary fast path.  It was
   94|       |  // described by David M. Gay in  "Correctly rounded
   95|       |  // binary-decimal and decimal-binary conversions." (1990)
   96|       |  // If you need to compute i * 10^(22 + x) for x < 16,
   97|       |  // first compute i * 10^x, if you know that result is exact
   98|       |  // (e.g., when i * 10^x < 2^53),
   99|       |  // then you can still proceed and do (i * 10^x) * 10^22.
  100|       |  // Is this worth your time?
  101|       |  // You need  22 < power *and* power <  22 + 16 *and* (i * 10^(x-22) < 2^53)
  102|       |  // for this second fast path to work.
  103|       |  // If you you have 22 < power *and* power <  22 + 16, and then you
  104|       |  // optimistically compute "i * 10^(x-22)", there is still a chance that you
  105|       |  // have wasted your time if i * 10^(x-22) >= 2^53. It makes the use cases of
  106|       |  // this optimization maybe less common than we would like. Source:
  107|       |  // http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/
  108|       |  // also used in RapidJSON: https://rapidjson.org/strtod_8h_source.html
  109|       |
  110|       |  // The fast path has now failed, so we are failing back on the slower path.
  111|       |
  112|       |  // In the slow path, we need to adjust i so that it is > 1<<63 which is always
  113|       |  // possible, except if i == 0, so we handle i == 0 separately.
  114|  2.99M|  if(i == 0) {
  ------------------
  |  Branch (114:6): [True: 2.26k, False: 2.98M]
  ------------------
  115|  2.26k|    d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (115:9): [True: 147, False: 2.11k]
  ------------------
  116|  2.26k|    return true;
  117|  2.26k|  }
  118|       |
  119|       |
  120|       |  // The exponent is 1024 + 63 + power
  121|       |  //     + floor(log(5**power)/log(2)).
  122|       |  // The 1024 comes from the ieee64 standard.
  123|       |  // The 63 comes from the fact that we use a 64-bit word.
  124|       |  //
  125|       |  // Computing floor(log(5**power)/log(2)) could be
  126|       |  // slow. Instead we use a fast function.
  127|       |  //
  128|       |  // For power in (-400,350), we have that
  129|       |  // (((152170 + 65536) * power ) >> 16);
  130|       |  // is equal to
  131|       |  //  floor(log(5**power)/log(2)) + power when power >= 0
  132|       |  // and it is equal to
  133|       |  //  ceil(log(5**-power)/log(2)) + power when power < 0
  134|       |  //
  135|       |  // The 65536 is (1<<16) and corresponds to
  136|       |  // (65536 * power) >> 16 ---> power
  137|       |  //
  138|       |  // ((152170 * power ) >> 16) is equal to
  139|       |  // floor(log(5**power)/log(2))
  140|       |  //
  141|       |  // Note that this is not magic: 152170/(1<<16) is
  142|       |  // approximatively equal to log(5)/log(2).
  143|       |  // The 1<<16 value is a power of two; we could use a
  144|       |  // larger power of 2 if we wanted to.
  145|       |  //
  146|  2.98M|  int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63;
  147|       |
  148|       |
  149|       |  // We want the most significant bit of i to be 1. Shift if needed.
  150|  2.98M|  int lz = leading_zeroes(i);
  151|  2.98M|  i <<= lz;
  152|       |
  153|       |
  154|       |  // We are going to need to do some 64-bit arithmetic to get a precise product.
  155|       |  // We use a table lookup approach.
  156|       |  // It is safe because
  157|       |  // power >= smallest_power
  158|       |  // and power <= largest_power
  159|       |  // We recover the mantissa of the power, it has a leading 1. It is always
  160|       |  // rounded down.
  161|       |  //
  162|       |  // We want the most significant 64 bits of the product. We know
  163|       |  // this will be non-zero because the most significant bit of i is
  164|       |  // 1.
  165|  2.98M|  const uint32_t index = 2 * uint32_t(power - simdjson::internal::smallest_power);
  166|       |  // Optimization: It may be that materializing the index as a variable might confuse some compilers and prevent effective complex-addressing loads. (Done for code clarity.)
  167|       |  //
  168|       |  // The full_multiplication function computes the 128-bit product of two 64-bit words
  169|       |  // with a returned value of type value128 with a "low component" corresponding to the
  170|       |  // 64-bit least significant bits of the product and with a "high component" corresponding
  171|       |  // to the 64-bit most significant bits of the product.
  172|  2.98M|  simdjson::internal::value128 firstproduct = jsoncharutils::full_multiplication(i, simdjson::internal::power_of_five_128[index]);
  173|       |  // Both i and power_of_five_128[index] have their most significant bit set to 1 which
  174|       |  // implies that the either the most or the second most significant bit of the product
  175|       |  // is 1. We pack values in this manner for efficiency reasons: it maximizes the use
  176|       |  // we make of the product. It also makes it easy to reason about the product: there
  177|       |  // is 0 or 1 leading zero in the product.
  178|       |
  179|       |  // Unless the least significant 9 bits of the high (64-bit) part of the full
  180|       |  // product are all 1s, then we know that the most significant 55 bits are
  181|       |  // exact and no further work is needed. Having 55 bits is necessary because
  182|       |  // we need 53 bits for the mantissa but we have to have one rounding bit and
  183|       |  // we can waste a bit if the most significant bit of the product is zero.
  184|  2.98M|  if((firstproduct.high & 0x1FF) == 0x1FF) {
  ------------------
  |  Branch (184:6): [True: 1.96k, False: 2.98M]
  ------------------
  185|       |    // We want to compute i * 5^q, but only care about the top 55 bits at most.
  186|       |    // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing
  187|       |    // the full computation is wasteful. So we do what is called a "truncated
  188|       |    // multiplication".
  189|       |    // We take the most significant 64-bits, and we put them in
  190|       |    // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q
  191|       |    // to the desired approximation using one multiplication. Sometimes it does not suffice.
  192|       |    // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and
  193|       |    // then we get a better approximation to i * 5^q. In very rare cases, even that
  194|       |    // will not suffice, though it is seemingly very hard to find such a scenario.
  195|       |    //
  196|       |    // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat
  197|       |    // more complicated.
  198|       |    //
  199|       |    // There is an extra layer of complexity in that we need more than 55 bits of
  200|       |    // accuracy in the round-to-even scenario.
  201|       |    //
  202|       |    // The full_multiplication function computes the 128-bit product of two 64-bit words
  203|       |    // with a returned value of type value128 with a "low component" corresponding to the
  204|       |    // 64-bit least significant bits of the product and with a "high component" corresponding
  205|       |    // to the 64-bit most significant bits of the product.
  206|  1.96k|    simdjson::internal::value128 secondproduct = jsoncharutils::full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]);
  207|  1.96k|    firstproduct.low += secondproduct.high;
  208|  1.96k|    if(secondproduct.high > firstproduct.low) { firstproduct.high++; }
  ------------------
  |  Branch (208:8): [True: 1.15k, False: 811]
  ------------------
  209|       |    // At this point, we might need to add at most one to firstproduct, but this
  210|       |    // can only change the value of firstproduct.high if firstproduct.low is maximal.
  211|  1.96k|    if(simdjson_unlikely(firstproduct.low  == 0xFFFFFFFFFFFFFFFF)) {
  ------------------
  |  |  120|  1.96k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 1.96k]
  |  |  ------------------
  ------------------
  212|       |      // This is very unlikely, but if so, we need to do much more work!
  213|      0|      return false;
  214|      0|    }
  215|  1.96k|  }
  216|  2.98M|  uint64_t lower = firstproduct.low;
  217|  2.98M|  uint64_t upper = firstproduct.high;
  218|       |  // The final mantissa should be 53 bits with a leading 1.
  219|       |  // We shift it so that it occupies 54 bits with a leading 1.
  220|       |  ///////
  221|  2.98M|  uint64_t upperbit = upper >> 63;
  222|  2.98M|  uint64_t mantissa = upper >> (upperbit + 9);
  223|  2.98M|  lz += int(1 ^ upperbit);
  224|       |
  225|       |  // Here we have mantissa < (1<<54).
  226|  2.98M|  int64_t real_exponent = exponent - lz;
  227|  2.98M|  if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal?
  ------------------
  |  |  120|  2.98M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 3.10k, False: 2.98M]
  |  |  ------------------
  ------------------
  228|       |    // Here have that real_exponent <= 0 so -real_exponent >= 0
  229|  3.10k|    if(-real_exponent + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure.
  ------------------
  |  Branch (229:8): [True: 405, False: 2.70k]
  ------------------
  230|    405|      d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (230:11): [True: 1, False: 404]
  ------------------
  231|    405|      return true;
  232|    405|    }
  233|       |    // next line is safe because -real_exponent + 1 < 0
  234|  2.70k|    mantissa >>= -real_exponent + 1;
  235|       |    // Thankfully, we can't have both "round-to-even" and subnormals because
  236|       |    // "round-to-even" only occurs for powers close to 0.
  237|  2.70k|    mantissa += (mantissa & 1); // round up
  238|  2.70k|    mantissa >>= 1;
  239|       |    // There is a weird scenario where we don't have a subnormal but just.
  240|       |    // Suppose we start with 2.2250738585072013e-308, we end up
  241|       |    // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal
  242|       |    // whereas 0x40000000000000 x 2^-1023-53  is normal. Now, we need to round
  243|       |    // up 0x3fffffffffffff x 2^-1023-53  and once we do, we are no longer
  244|       |    // subnormal, but we can only know this after rounding.
  245|       |    // So we only declare a subnormal if we are smaller than the threshold.
  246|  2.70k|    real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1;
  ------------------
  |  Branch (246:21): [True: 2.69k, False: 3]
  ------------------
  247|  2.70k|    d = to_double(mantissa, real_exponent, negative);
  248|  2.70k|    return true;
  249|  3.10k|  }
  250|       |  // We have to round to even. The "to even" part
  251|       |  // is only a problem when we are right in between two floats
  252|       |  // which we guard against.
  253|       |  // If we have lots of trailing zeros, we may fall right between two
  254|       |  // floating-point values.
  255|       |  //
  256|       |  // The round-to-even cases take the form of a number 2m+1 which is in (2^53,2^54]
  257|       |  // times a power of two. That is, it is right between a number with binary significand
  258|       |  // m and another number with binary significand m+1; and it must be the case
  259|       |  // that it cannot be represented by a float itself.
  260|       |  //
  261|       |  // We must have that w * 10 ^q == (2m+1) * 2^p for some power of two 2^p.
  262|       |  // Recall that 10^q = 5^q * 2^q.
  263|       |  // When q >= 0, we must have that (2m+1) is divible by 5^q, so 5^q <= 2^54. We have that
  264|       |  //  5^23 <=  2^54 and it is the last power of five to qualify, so q <= 23.
  265|       |  // When q<0, we have  w  >=  (2m+1) x 5^{-q}.  We must have that w<2^{64} so
  266|       |  // (2m+1) x 5^{-q} < 2^{64}. We have that 2m+1>2^{53}. Hence, we must have
  267|       |  // 2^{53} x 5^{-q} < 2^{64}.
  268|       |  // Hence we have 5^{-q} < 2^{11}$ or q>= -4.
  269|       |  //
  270|       |  // We require lower <= 1 and not lower == 0 because we could not prove that
  271|       |  // that lower == 0 is implied; but we could prove that lower <= 1 is a necessary and sufficient test.
  272|  2.98M|  if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) {
  ------------------
  |  |  120|  17.8M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 2.96M, False: 18.6k]
  |  |  |  Branch (120:52): [True: 2.97M, False: 8.77k]
  |  |  |  Branch (120:52): [True: 2.97M, False: 518]
  |  |  |  Branch (120:52): [True: 2.96M, False: 8.17k]
  |  |  |  Branch (120:52): [True: 2.96M, False: 1.17k]
  |  |  ------------------
  ------------------
  273|  2.96M|    if((mantissa  << (upperbit + 64 - 53 - 2)) ==  upper) {
  ------------------
  |  Branch (273:8): [True: 2.96M, False: 2.37k]
  ------------------
  274|  2.96M|      mantissa &= ~1;             // flip it so that we do not round up
  275|  2.96M|    }
  276|  2.96M|  }
  277|       |
  278|  2.98M|  mantissa += mantissa & 1;
  279|  2.98M|  mantissa >>= 1;
  280|       |
  281|       |  // Here we have mantissa < (1<<53), unless there was an overflow
  282|  2.98M|  if (mantissa >= (1ULL << 53)) {
  ------------------
  |  Branch (282:7): [True: 395, False: 2.98M]
  ------------------
  283|       |    //////////
  284|       |    // This will happen when parsing values such as 7.2057594037927933e+16
  285|       |    ////////
  286|    395|    mantissa = (1ULL << 52);
  287|    395|    real_exponent++;
  288|    395|  }
  289|  2.98M|  mantissa &= ~(1ULL << 52);
  290|       |  // we have to check that real_exponent is in range, otherwise we bail out
  291|  2.98M|  if (simdjson_unlikely(real_exponent > 2046)) {
  ------------------
  |  |  120|  2.98M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 152, False: 2.98M]
  |  |  ------------------
  ------------------
  292|       |    // We have an infinite value!!! We could actually throw an error here if we could.
  293|    152|    return false;
  294|    152|  }
  295|  2.98M|  d = to_double(mantissa, real_exponent, negative);
  296|  2.98M|  return true;
  297|  2.98M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing12_GLOBAL__N_19to_doubleEmmb:
   40|  2.98M|simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) {
   41|  2.98M|    double d;
   42|  2.98M|    mantissa &= ~(1ULL << 52);
   43|  2.98M|    mantissa |= real_exponent << 52;
   44|  2.98M|    mantissa |= ((static_cast<uint64_t>(negative)) << 63);
   45|  2.98M|    std::memcpy(&d, &mantissa, sizeof(d));
   46|  2.98M|    return d;
   47|  2.98M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing20parse_float_fallbackEPKhPd:
  306|  6.32k|static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) {
  307|  6.32k|  *outDouble = simdjson::internal::from_chars(reinterpret_cast<const char *>(ptr));
  308|       |  // We do not accept infinite values.
  309|       |
  310|       |  // Detecting finite values in a portable manner is ridiculously hard, ideally
  311|       |  // we would want to do:
  312|       |  // return !std::isfinite(*outDouble);
  313|       |  // but that mysteriously fails under legacy/old libc++ libraries, see
  314|       |  // https://github.com/simdjson/simdjson/issues/1286
  315|       |  //
  316|       |  // Therefore, fall back to this solution (the extra parens are there
  317|       |  // to handle that max may be a macro on windows).
  318|  6.32k|  return !(*outDouble > (std::numeric_limits<double>::max)() || *outDouble < std::numeric_limits<double>::lowest());
  ------------------
  |  Branch (318:12): [True: 274, False: 6.05k]
  |  Branch (318:65): [True: 8, False: 6.04k]
  ------------------
  319|  6.32k|}

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

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

_ZN8simdjson7haswell14implementationC2Ev:
   21|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_127parse_eight_digits_unrolledEPKh:
    8|  5.87k|static simdjson_inline uint32_t parse_eight_digits_unrolled(const uint8_t *chars) {
    9|       |  // this actually computes *16* values so we are being wasteful.
   10|  5.87k|  const __m128i ascii0 = _mm_set1_epi8('0');
   11|  5.87k|  const __m128i mul_1_10 =
   12|  5.87k|      _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1);
   13|  5.87k|  const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1);
   14|  5.87k|  const __m128i mul_1_10000 =
   15|  5.87k|      _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1);
   16|  5.87k|  const __m128i input = _mm_sub_epi8(
   17|  5.87k|      _mm_loadu_si128(reinterpret_cast<const __m128i *>(chars)), ascii0);
   18|  5.87k|  const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10);
   19|  5.87k|  const __m128i t2 = _mm_madd_epi16(t1, mul_1_100);
   20|  5.87k|  const __m128i t3 = _mm_packus_epi32(t2, t2);
   21|  5.87k|  const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000);
   22|  5.87k|  return _mm_cvtsi128_si32(
   23|  5.87k|      t4); // only captures the sum of the first 8 digits, drop the rest
   24|  5.87k|}

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

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

_ZN8simdjson7icelake14implementationC2Ev:
   21|      1|  ) {}

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

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

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

_ZN8simdjson8internal8tape_refC2Ev:
   13|  15.1k|simdjson_inline tape_ref::tape_ref() noexcept : doc{nullptr}, json_index{0} {}
_ZN8simdjson8internal8tape_refC2EPKNS_3dom8documentEm:
   14|   125k|simdjson_inline tape_ref::tape_ref(const dom::document *_doc, size_t _json_index) noexcept : doc{_doc}, json_index{_json_index} {}
_ZNK8simdjson8internal8tape_ref15get_string_viewEv:
  102|   275k|inline std::string_view internal::tape_ref::get_string_view() const noexcept {
  103|   275k|  return std::string_view(
  104|   275k|      get_c_str(),
  105|   275k|      get_string_length()
  106|   275k|  );
  107|   275k|}
_ZNK8simdjson8internal8tape_ref9get_c_strEv:
   97|   275k|simdjson_inline const char * internal::tape_ref::get_c_str() const noexcept {
   98|   275k|  size_t string_buf_index = size_t(tape_value());
   99|   275k|  return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
  100|   275k|}
_ZNK8simdjson8internal8tape_ref10tape_valueEv:
   68|   551k|simdjson_inline uint64_t internal::tape_ref::tape_value() const noexcept {
   69|   551k|  return doc->tape[json_index] & internal::JSON_VALUE_MASK;
   70|   551k|}
_ZNK8simdjson8internal8tape_ref17get_string_lengthEv:
   90|   275k|simdjson_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
   91|   275k|  size_t string_buf_index = size_t(tape_value());
   92|   275k|  uint32_t len;
   93|   275k|  std::memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len));
   94|   275k|  return len;
   95|   275k|}
_ZNK8simdjson8internal8tape_ref13tape_ref_typeEv:
   65|  14.7M|simdjson_inline tape_type tape_ref::tape_ref_type() const noexcept {
   66|  14.7M|  return static_cast<tape_type>(doc->tape[json_index] >> 56);
   67|  14.7M|}
_ZNK8simdjson8internal8tape_ref13after_elementEv:
   52|  2.15M|inline size_t tape_ref::after_element() const noexcept {
   53|  2.15M|  switch (tape_ref_type()) {
   54|  13.1k|    case tape_type::START_ARRAY:
  ------------------
  |  Branch (54:5): [True: 13.1k, False: 2.14M]
  ------------------
   55|  24.1k|    case tape_type::START_OBJECT:
  ------------------
  |  Branch (55:5): [True: 11.0k, False: 2.14M]
  ------------------
   56|  24.1k|      return matching_brace_index();
   57|    777|    case tape_type::UINT64:
  ------------------
  |  Branch (57:5): [True: 777, False: 2.15M]
  ------------------
   58|   476k|    case tape_type::INT64:
  ------------------
  |  Branch (58:5): [True: 475k, False: 1.67M]
  ------------------
   59|  2.12M|    case tape_type::DOUBLE:
  ------------------
  |  Branch (59:5): [True: 1.65M, False: 501k]
  ------------------
   60|  2.12M|      return json_index + 2;
   61|  1.53k|    default:
  ------------------
  |  Branch (61:5): [True: 1.53k, False: 2.15M]
  ------------------
   62|  1.53k|      return json_index + 1;
   63|  2.15M|  }
   64|  2.15M|}
_ZNK8simdjson8internal8tape_ref20matching_brace_indexEv:
   71|  40.9k|simdjson_inline uint32_t internal::tape_ref::matching_brace_index() const noexcept {
   72|  40.9k|  return uint32_t(doc->tape[json_index]);
   73|  40.9k|}
_ZNK8simdjson8internal8tape_ref15next_tape_valueIlEET_v:
   79|  2.45M|simdjson_inline T tape_ref::next_tape_value() const noexcept {
   80|  2.45M|  static_assert(sizeof(T) == sizeof(uint64_t), "next_tape_value() template parameter must be 64-bit");
   81|       |  // Though the following is tempting...
   82|       |  //  return *reinterpret_cast<const T*>(&doc->tape[json_index + 1]);
   83|       |  // It is not generally safe. It is safer, and often faster to rely
   84|       |  // on memcpy. Yes, it is uglier, but it is also encapsulated.
   85|  2.45M|  T x;
   86|  2.45M|  std::memcpy(&x,&doc->tape[json_index + 1],sizeof(uint64_t));
   87|  2.45M|  return x;
   88|  2.45M|}
_ZNK8simdjson8internal8tape_ref15next_tape_valueImEET_v:
   79|  1.61k|simdjson_inline T tape_ref::next_tape_value() const noexcept {
   80|  1.61k|  static_assert(sizeof(T) == sizeof(uint64_t), "next_tape_value() template parameter must be 64-bit");
   81|       |  // Though the following is tempting...
   82|       |  //  return *reinterpret_cast<const T*>(&doc->tape[json_index + 1]);
   83|       |  // It is not generally safe. It is safer, and often faster to rely
   84|       |  // on memcpy. Yes, it is uglier, but it is also encapsulated.
   85|  1.61k|  T x;
   86|  1.61k|  std::memcpy(&x,&doc->tape[json_index + 1],sizeof(uint64_t));
   87|  1.61k|  return x;
   88|  1.61k|}
_ZNK8simdjson8internal8tape_ref15next_tape_valueIdEET_v:
   79|  3.05M|simdjson_inline T tape_ref::next_tape_value() const noexcept {
   80|  3.05M|  static_assert(sizeof(T) == sizeof(uint64_t), "next_tape_value() template parameter must be 64-bit");
   81|       |  // Though the following is tempting...
   82|       |  //  return *reinterpret_cast<const T*>(&doc->tape[json_index + 1]);
   83|       |  // It is not generally safe. It is safer, and often faster to rely
   84|       |  // on memcpy. Yes, it is uglier, but it is also encapsulated.
   85|  3.05M|  T x;
   86|  3.05M|  std::memcpy(&x,&doc->tape[json_index + 1],sizeof(uint64_t));
   87|  3.05M|  return x;
   88|  3.05M|}

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

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

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

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

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

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iteratorC2ERNS0_25dom_parser_implementationEm:
  240|  10.1k|    dom_parser{_dom_parser} {
  241|  10.1k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13walk_documentILb0ENS2_12tape_builderEEENS_10error_codeERT0_:
  112|  10.1k|simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
  113|  10.1k|  logger::log_start();
  114|       |
  115|       |  //
  116|       |  // Start the document
  117|       |  //
  118|  10.1k|  if (at_eof()) { return EMPTY; }
  ------------------
  |  Branch (118:7): [True: 0, False: 10.1k]
  ------------------
  119|  10.1k|  log_start_value("document");
  120|  10.1k|  SIMDJSON_TRY( visitor.visit_document_start(*this) );
  ------------------
  |  |  279|  10.1k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 10.1k]
  |  |  ------------------
  ------------------
  121|       |
  122|       |  //
  123|       |  // Read first value
  124|       |  //
  125|  10.1k|  {
  126|  10.1k|    auto value = advance();
  127|       |
  128|       |    // Make sure the outer object or array is closed before continuing; otherwise, there are ways we
  129|       |    // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906
  130|  10.1k|    if (!STREAMING) {
  ------------------
  |  Branch (130:9): [Folded - Ignored]
  ------------------
  131|  10.1k|      switch (*value) {
  ------------------
  |  Branch (131:15): [True: 3.45k, False: 6.69k]
  ------------------
  132|  2.89k|        case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (132:9): [True: 2.89k, False: 7.25k]
  |  Branch (132:23): [True: 13, False: 2.87k]
  ------------------
  133|  3.79k|        case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (133:9): [True: 3.79k, False: 6.34k]
  |  Branch (133:23): [True: 31, False: 3.76k]
  ------------------
  134|  10.1k|      }
  135|  10.1k|    }
  136|       |
  137|  10.0k|    switch (*value) {
  138|  2.87k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|      1|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (138:7): [True: 2.87k, False: 7.21k]
  |  Branch (138:21): [True: 1, False: 2.87k]
  ------------------
  139|  3.76k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|      6|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  |  Branch (139:7): [True: 3.76k, False: 6.33k]
  |  Branch (139:21): [True: 6, False: 3.76k]
  ------------------
  140|  3.76k|      default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break;
  ------------------
  |  |  279|  3.45k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 946, False: 2.50k]
  |  |  ------------------
  ------------------
  |  Branch (140:7): [True: 3.45k, False: 6.64k]
  ------------------
  141|  10.0k|    }
  142|  10.0k|  }
  143|  2.51k|  goto document_end;
  144|       |
  145|       |//
  146|       |// Object parser states
  147|       |//
  148|  15.1k|object_begin:
  149|  15.1k|  log_start_value("object");
  150|  15.1k|  depth++;
  151|  15.1k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (151:7): [True: 1, False: 15.1k]
  ------------------
  152|  15.1k|  dom_parser.is_array[depth] = false;
  153|  15.1k|  SIMDJSON_TRY( visitor.visit_object_start(*this) );
  ------------------
  |  |  279|  15.1k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  154|       |
  155|  15.1k|  {
  156|  15.1k|    auto key = advance();
  157|  15.1k|    if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; }
  ------------------
  |  Branch (157:9): [True: 66, False: 15.0k]
  ------------------
  158|  15.0k|    SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  15.0k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 15.0k]
  |  |  ------------------
  ------------------
  159|  15.0k|    SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  279|  15.0k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 81, False: 14.9k]
  |  |  ------------------
  ------------------
  160|  14.9k|  }
  161|       |
  162|   280k|object_field:
  163|   280k|  if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; }
  ------------------
  |  |  120|   280k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 404, False: 279k]
  |  |  ------------------
  ------------------
  164|   279k|  {
  165|   279k|    auto value = advance();
  166|   279k|    switch (*value) {
  167|  2.18k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|  1.10k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.10k]
  |  |  ------------------
  ------------------
  |  Branch (167:7): [True: 2.18k, False: 277k]
  |  Branch (167:21): [True: 1.10k, False: 1.07k]
  ------------------
  168|  6.90k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|  5.91k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 5.91k]
  |  |  ------------------
  ------------------
  |  Branch (168:7): [True: 6.90k, False: 272k]
  |  Branch (168:21): [True: 5.91k, False: 989]
  ------------------
  169|   270k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  279|   270k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 604, False: 270k]
  |  |  ------------------
  ------------------
  |  Branch (169:7): [True: 270k, False: 9.09k]
  ------------------
  170|   279k|    }
  171|   279k|  }
  172|       |
  173|   278k|object_continue:
  174|   278k|  switch (*advance()) {
  175|   265k|    case ',':
  ------------------
  |  Branch (175:5): [True: 265k, False: 13.3k]
  ------------------
  176|   265k|      SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|   265k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 265k]
  |  |  ------------------
  ------------------
  177|   265k|      {
  178|   265k|        auto key = advance();
  179|   265k|        if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; }
  ------------------
  |  |  120|   265k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 13, False: 265k]
  |  |  ------------------
  ------------------
  180|   265k|        SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  279|   265k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 83, False: 265k]
  |  |  ------------------
  ------------------
  181|   265k|      }
  182|      0|      goto object_field;
  183|  13.2k|    case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end;
  ------------------
  |  |  279|  13.2k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 13.2k]
  |  |  ------------------
  ------------------
  |  Branch (183:5): [True: 13.2k, False: 265k]
  ------------------
  184|    114|    default: log_error("No comma between object fields"); return TAPE_ERROR;
  ------------------
  |  Branch (184:5): [True: 114, False: 278k]
  ------------------
  185|   278k|  }
  186|       |
  187|  76.8k|scope_end:
  188|  76.8k|  depth--;
  189|  76.8k|  if (depth == 0) { goto document_end; }
  ------------------
  |  Branch (189:7): [True: 4.39k, False: 72.4k]
  ------------------
  190|  72.4k|  if (dom_parser.is_array[depth]) { goto array_continue; }
  ------------------
  |  Branch (190:7): [True: 70.9k, False: 1.51k]
  ------------------
  191|  1.51k|  goto object_continue;
  192|       |
  193|       |//
  194|       |// Array parser states
  195|       |//
  196|  78.5k|array_begin:
  197|  78.5k|  log_start_value("array");
  198|  78.5k|  depth++;
  199|  78.5k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (199:7): [True: 2, False: 78.5k]
  ------------------
  200|  78.5k|  dom_parser.is_array[depth] = true;
  201|  78.5k|  SIMDJSON_TRY( visitor.visit_array_start(*this) );
  ------------------
  |  |  279|  78.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 78.5k]
  |  |  ------------------
  ------------------
  202|  78.5k|  SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  78.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 78.5k]
  |  |  ------------------
  ------------------
  203|       |
  204|  5.38M|array_value:
  205|  5.38M|  {
  206|  5.38M|    auto value = advance();
  207|  5.38M|    switch (*value) {
  208|  12.7k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|  1.60k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.60k]
  |  |  ------------------
  ------------------
  |  Branch (208:7): [True: 12.7k, False: 5.37M]
  |  Branch (208:21): [True: 1.60k, False: 11.1k]
  ------------------
  209|  75.3k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|  1.59k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.59k]
  |  |  ------------------
  ------------------
  |  Branch (209:7): [True: 75.3k, False: 5.30M]
  |  Branch (209:21): [True: 1.59k, False: 73.7k]
  ------------------
  210|  5.29M|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  279|  5.29M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 785, False: 5.29M]
  |  |  ------------------
  ------------------
  |  Branch (210:7): [True: 5.29M, False: 88.1k]
  ------------------
  211|  5.38M|    }
  212|  5.38M|  }
  213|       |
  214|  5.36M|array_continue:
  215|  5.36M|  switch (*advance()) {
  216|  5.30M|    case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value;
  ------------------
  |  |  279|  5.30M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 5.30M]
  |  |  ------------------
  ------------------
  |  Branch (216:5): [True: 5.30M, False: 63.7k]
  ------------------
  217|  63.6k|    case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end;
  ------------------
  |  |  279|  63.6k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 63.6k]
  |  |  ------------------
  ------------------
  |  Branch (217:5): [True: 63.6k, False: 5.30M]
  ------------------
  218|     89|    default: log_error("Missing comma between array values"); return TAPE_ERROR;
  ------------------
  |  Branch (218:5): [True: 89, False: 5.36M]
  ------------------
  219|  5.36M|  }
  220|       |
  221|  6.91k|document_end:
  222|  6.91k|  log_end_value("document");
  223|  6.91k|  SIMDJSON_TRY( visitor.visit_document_end(*this) );
  ------------------
  |  |  279|  6.91k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 6.91k]
  |  |  ------------------
  ------------------
  224|       |
  225|  6.91k|  dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]);
  226|       |
  227|       |  // If we didn't make it to the end, it's an error
  228|  6.91k|  if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
  ------------------
  |  Branch (228:8): [Folded - Ignored]
  |  Branch (228:22): [True: 118, False: 6.79k]
  ------------------
  229|    118|    log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
  230|    118|    return TAPE_ERROR;
  231|    118|  }
  232|       |
  233|  6.79k|  return SUCCESS;
  234|       |
  235|  6.91k|} // walk_document()
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator6at_eofEv:
  253|  10.1k|simdjson_inline bool json_iterator::at_eof() const noexcept {
  254|  10.1k|  return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes];
  255|  10.1k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15log_start_valueEPKc:
  267|   103k|simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept {
  268|   103k|  logger::log_line(*this, "+", type, "");
  269|   103k|  if (logger::LOG_ENABLED) { logger::log_depth++; }
  ------------------
  |  Branch (269:7): [Folded - Ignored]
  ------------------
  270|   103k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator7advanceEv:
  246|  11.8M|simdjson_inline const uint8_t *json_iterator::advance() noexcept {
  247|  11.8M|  return &buf[*(next_structural++)];
  248|  11.8M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15last_structuralEv:
  259|  6.69k|simdjson_inline uint8_t json_iterator::last_structural() const noexcept {
  260|  6.69k|  return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]];
  261|  6.69k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_valueEPKc:
  263|  5.86M|simdjson_inline void json_iterator::log_value(const char *type) const noexcept {
  264|  5.86M|  logger::log_line(*this, "", type, "");
  265|  5.86M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator4peekEv:
  243|   103k|simdjson_inline const uint8_t *json_iterator::peek() const noexcept {
  244|   103k|  return &buf[*(next_structural)];
  245|   103k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator20visit_root_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  282|  3.45k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept {
  283|  3.45k|  switch (*value) {
  284|    461|    case '"': return visitor.visit_root_string(*this, value);
  ------------------
  |  Branch (284:5): [True: 461, False: 2.99k]
  ------------------
  285|     58|    case 't': return visitor.visit_root_true_atom(*this, value);
  ------------------
  |  Branch (285:5): [True: 58, False: 3.39k]
  ------------------
  286|     97|    case 'f': return visitor.visit_root_false_atom(*this, value);
  ------------------
  |  Branch (286:5): [True: 97, False: 3.35k]
  ------------------
  287|     52|    case 'n': return visitor.visit_root_null_atom(*this, value);
  ------------------
  |  Branch (287:5): [True: 52, False: 3.39k]
  ------------------
  288|    200|    case '-':
  ------------------
  |  Branch (288:5): [True: 200, False: 3.25k]
  ------------------
  289|  1.28k|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (289:5): [True: 162, False: 3.28k]
  |  Branch (289:15): [True: 371, False: 3.08k]
  |  Branch (289:25): [True: 231, False: 3.22k]
  |  Branch (289:35): [True: 131, False: 3.32k]
  |  Branch (289:45): [True: 185, False: 3.26k]
  ------------------
  290|  2.70k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (290:5): [True: 170, False: 3.28k]
  |  Branch (290:15): [True: 130, False: 3.32k]
  |  Branch (290:25): [True: 158, False: 3.29k]
  |  Branch (290:35): [True: 261, False: 3.19k]
  |  Branch (290:45): [True: 701, False: 2.75k]
  ------------------
  291|  2.70k|      return visitor.visit_root_number(*this, value);
  292|     83|    default:
  ------------------
  |  Branch (292:5): [True: 83, False: 3.36k]
  ------------------
  293|     83|      log_error("Document starts with a non-value character");
  294|     83|      return TAPE_ERROR;
  295|  3.45k|  }
  296|  3.45k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13remaining_lenEv:
  249|  8.30k|simdjson_inline size_t json_iterator::remaining_len() const noexcept {
  250|  8.30k|  return dom_parser.len - *(next_structural-1);
  251|  8.30k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_errorEPKc:
  277|  1.40k|simdjson_inline void json_iterator::log_error(const char *error) const noexcept {
  278|  1.40k|  logger::log_line(*this, "", "ERROR", error);
  279|  1.40k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15visit_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  298|  5.56M|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept {
  299|  5.56M|  switch (*value) {
  300|  4.91k|    case '"': return visitor.visit_string(*this, value);
  ------------------
  |  Branch (300:5): [True: 4.91k, False: 5.56M]
  ------------------
  301|    542|    case 't': return visitor.visit_true_atom(*this, value);
  ------------------
  |  Branch (301:5): [True: 542, False: 5.56M]
  ------------------
  302|    485|    case 'f': return visitor.visit_false_atom(*this, value);
  ------------------
  |  Branch (302:5): [True: 485, False: 5.56M]
  ------------------
  303|    453|    case 'n': return visitor.visit_null_atom(*this, value);
  ------------------
  |  Branch (303:5): [True: 453, False: 5.56M]
  ------------------
  304|  7.03k|    case '-':
  ------------------
  |  Branch (304:5): [True: 7.03k, False: 5.55M]
  ------------------
  305|  4.14M|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (305:5): [True: 7.08k, False: 5.55M]
  |  Branch (305:15): [True: 90.6k, False: 5.47M]
  |  Branch (305:25): [True: 884k, False: 4.68M]
  |  Branch (305:35): [True: 227k, False: 5.33M]
  |  Branch (305:45): [True: 2.92M, False: 2.64M]
  ------------------
  306|  5.56M|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (306:5): [True: 157k, False: 5.40M]
  |  Branch (306:15): [True: 518k, False: 5.04M]
  |  Branch (306:25): [True: 438k, False: 5.12M]
  |  Branch (306:35): [True: 208k, False: 5.35M]
  |  Branch (306:45): [True: 93.9k, False: 5.47M]
  ------------------
  307|  5.56M|      return visitor.visit_number(*this, value);
  308|     66|    default:
  ------------------
  |  Branch (308:5): [True: 66, False: 5.56M]
  ------------------
  309|     66|      log_error("Non-value found when value was expected!");
  310|     66|      return TAPE_ERROR;
  311|  5.56M|  }
  312|  5.56M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13log_end_valueEPKc:
  272|  83.7k|simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept {
  273|  83.7k|  if (logger::LOG_ENABLED) { logger::log_depth--; }
  ------------------
  |  Branch (273:7): [Folded - Ignored]
  ------------------
  274|  83.7k|  logger::log_line(*this, "-", type, "");
  275|  83.7k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16logger9log_startEv:
   32|  10.1k|  static simdjson_inline void log_start() {
   33|  10.1k|    if (LOG_ENABLED) {
  ------------------
  |  Branch (33:9): [Folded - Ignored]
  ------------------
   34|      0|      log_depth = 0;
   35|      0|      printf("\n");
   36|      0|      printf("| %-*s | %-*s | %-*s | %-*s | Detail |\n", LOG_EVENT_LEN, "Event", LOG_BUFFER_LEN, "Buffer", LOG_SMALL_BUFFER_LEN, "Next", 5, "Next#");
   37|      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);
   38|      0|    }
   39|  10.1k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16logger8log_lineIKNS1_6stage213json_iteratorEEEvRT_PKcSA_SA_:
   49|  6.04M|  static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) {
   50|  6.04M|    if (LOG_ENABLED) {
  ------------------
  |  Branch (50:9): [Folded - Ignored]
  ------------------
   51|      0|      printf("| %*s%s%-*s ", log_depth*2, "", title_prefix, LOG_EVENT_LEN - log_depth*2 - int(strlen(title_prefix)), title);
   52|      0|      auto current_index = structurals.at_beginning() ? nullptr : structurals.next_structural-1;
  ------------------
  |  Branch (52:28): [True: 0, False: 0]
  ------------------
   53|      0|      auto next_index = structurals.next_structural;
   54|      0|      auto current = current_index ? &structurals.buf[*current_index] : reinterpret_cast<const uint8_t*>("                                                       ");
  ------------------
  |  Branch (54:22): [True: 0, False: 0]
  ------------------
   55|      0|      auto next = &structurals.buf[*next_index];
   56|      0|      {
   57|       |        // Print the next N characters in the buffer.
   58|      0|        printf("| ");
   59|       |        // Otherwise, print the characters starting from the buffer position.
   60|       |        // Print spaces for unprintable or newline characters.
   61|      0|        for (int i=0;i<LOG_BUFFER_LEN;i++) {
  ------------------
  |  Branch (61:22): [True: 0, False: 0]
  ------------------
   62|      0|          printf("%c", printable_char(current[i]));
   63|      0|        }
   64|      0|        printf(" ");
   65|       |        // Print the next N characters in the buffer.
   66|      0|        printf("| ");
   67|       |        // Otherwise, print the characters starting from the buffer position.
   68|       |        // Print spaces for unprintable or newline characters.
   69|      0|        for (int i=0;i<LOG_SMALL_BUFFER_LEN;i++) {
  ------------------
  |  Branch (69:22): [True: 0, False: 0]
  ------------------
   70|      0|          printf("%c", printable_char(next[i]));
   71|      0|        }
   72|      0|        printf(" ");
   73|      0|      }
   74|      0|      if (current_index) {
  ------------------
  |  Branch (74:11): [True: 0, False: 0]
  ------------------
   75|      0|        printf("| %*u ", LOG_INDEX_LEN, *current_index);
   76|      0|      } else {
   77|      0|        printf("| %-*s ", LOG_INDEX_LEN, "");
   78|      0|      }
   79|       |      // printf("| %*u ", LOG_INDEX_LEN, structurals.next_tape_index());
   80|      0|      printf("| %-s ", detail);
   81|      0|      printf("|\n");
   82|      0|    }
   83|  6.04M|  }

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer4skipEv:
   73|   103k|simdjson_inline void tape_writer::skip() noexcept {
   74|   103k|  next_tape_loc++;
   75|   103k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer6appendEmNS_8internal9tape_typeE:
   85|  5.95M|simdjson_inline void tape_writer::append(uint64_t val, internal::tape_type t) noexcept {
   86|  5.95M|  *next_tape_loc = val | ((uint64_t(char(t))) << 56);
   87|  5.95M|  next_tape_loc++;
   88|  5.95M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer11skip_doubleEv:
   81|  6.17k|simdjson_inline void tape_writer::skip_double() noexcept {
   82|  6.17k|  next_tape_loc += 2;
   83|  6.17k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer13append_doubleEd:
   69|  3.06M|simdjson_inline void tape_writer::append_double(double value) noexcept {
   70|  3.06M|  append2(0, value, internal::tape_type::DOUBLE);
   71|  3.06M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer7append2IdEEvmT_NS_8internal9tape_typeE:
   91|  3.06M|simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept {
   92|  3.06M|  append(val, t);
   93|  3.06M|  static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!");
   94|  3.06M|  memcpy(next_tape_loc, &val2, sizeof(val2));
   95|  3.06M|  next_tape_loc++;
   96|  3.06M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer10append_s64El:
   58|  2.49M|simdjson_inline void tape_writer::append_s64(int64_t value) noexcept {
   59|  2.49M|  append2(0, value, internal::tape_type::INT64);
   60|  2.49M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer7append2IlEEvmT_NS_8internal9tape_typeE:
   91|  2.49M|simdjson_inline void tape_writer::append2(uint64_t val, T val2, internal::tape_type t) noexcept {
   92|  2.49M|  append(val, t);
   93|  2.49M|  static_assert(sizeof(val2) == sizeof(*next_tape_loc), "Type is not 64 bits!");
   94|  2.49M|  memcpy(next_tape_loc, &val2, sizeof(val2));
   95|  2.49M|  next_tape_loc++;
   96|  2.49M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer10append_u64Em:
   62|  1.97k|simdjson_inline void tape_writer::append_u64(uint64_t value) noexcept {
   63|  1.97k|  append(0, internal::tape_type::UINT64);
   64|  1.97k|  *next_tape_loc = value;
   65|  1.97k|  next_tape_loc++;
   66|  1.97k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage211tape_writer5writeERmmNS_8internal9tape_typeE:
   98|  83.7k|simdjson_inline void tape_writer::write(uint64_t &tape_loc, uint64_t val, internal::tape_type t) noexcept {
   99|  83.7k|  tape_loc = val | ((uint64_t(char(t))) << 56);
  100|  83.7k|}

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

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

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

_ZN8simdjson8internal8to_charsEPcPKcd:
  916|  3.05M|char *to_chars(char *first, const char *last, double value) {
  917|  3.05M|  static_cast<void>(last); // maybe unused - fix warning
  918|  3.05M|  bool negative = std::signbit(value);
  919|  3.05M|  if (negative) {
  ------------------
  |  Branch (919:7): [True: 4.06k, False: 3.05M]
  ------------------
  920|  4.06k|    value = -value;
  921|  4.06k|    *first++ = '-';
  922|  4.06k|  }
  923|       |
  924|  3.05M|  if (value == 0) // +-0
  ------------------
  |  Branch (924:7): [True: 9.16k, False: 3.04M]
  ------------------
  925|  9.16k|  {
  926|  9.16k|    *first++ = '0';
  927|       |    // Make it look like a floating-point number (#362, #378)
  928|  9.16k|    *first++ = '.';
  929|  9.16k|    *first++ = '0';
  930|  9.16k|    return first;
  931|  9.16k|  }
  932|       |  // Compute v = buffer * 10^decimal_exponent.
  933|       |  // The decimal digits are stored in the buffer, which needs to be interpreted
  934|       |  // as an unsigned decimal integer.
  935|       |  // len is the length of the buffer, i.e. the number of decimal digits.
  936|  3.04M|  int len = 0;
  937|  3.04M|  int decimal_exponent = 0;
  938|  3.04M|  dtoa_impl::grisu2(first, len, decimal_exponent, value);
  939|       |  // Format the buffer like printf("%.*g", prec, value)
  940|  3.04M|  constexpr int kMinExp = -4;
  941|  3.04M|  constexpr int kMaxExp = std::numeric_limits<double>::digits10;
  942|       |
  943|  3.04M|  return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp,
  944|  3.04M|                                  kMaxExp);
  945|  3.05M|}
_ZN8simdjson8internal9dtoa_impl13format_bufferEPciiii:
  848|  3.04M|                           int min_exp, int max_exp) {
  849|       |
  850|  3.04M|  const int k = len;
  851|  3.04M|  const int n = len + decimal_exponent;
  852|       |
  853|       |  // v = buf * 10^(n-k)
  854|       |  // k is the length of the buffer (number of decimal digits)
  855|       |  // n is the position of the decimal point relative to the start of the buffer.
  856|       |
  857|  3.04M|  if (k <= n && n <= max_exp) {
  ------------------
  |  Branch (857:7): [True: 3.03M, False: 10.0k]
  |  Branch (857:17): [True: 34.1k, False: 3.00M]
  ------------------
  858|       |    // digits[000]
  859|       |    // len <= max_exp + 2
  860|       |
  861|  34.1k|    std::memset(buf + k, '0', static_cast<size_t>(n) - static_cast<size_t>(k));
  862|       |    // Make it look like a floating-point number (#362, #378)
  863|  34.1k|    buf[n + 0] = '.';
  864|  34.1k|    buf[n + 1] = '0';
  865|  34.1k|    return buf + (static_cast<size_t>(n)) + 2;
  866|  34.1k|  }
  867|       |
  868|  3.01M|  if (0 < n && n <= max_exp) {
  ------------------
  |  Branch (868:7): [True: 3.00M, False: 4.54k]
  |  Branch (868:16): [True: 5.46k, False: 3.00M]
  ------------------
  869|       |    // dig.its
  870|       |    // len <= max_digits10 + 1
  871|  5.46k|    std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n,
  872|  5.46k|                 static_cast<size_t>(k) - static_cast<size_t>(n));
  873|  5.46k|    buf[n] = '.';
  874|  5.46k|    return buf + (static_cast<size_t>(k) + 1U);
  875|  5.46k|  }
  876|       |
  877|  3.00M|  if (min_exp < n && n <= 0) {
  ------------------
  |  Branch (877:7): [True: 3.00M, False: 3.09k]
  |  Branch (877:22): [True: 1.44k, False: 3.00M]
  ------------------
  878|       |    // 0.[000]digits
  879|       |    // len <= 2 + (-min_exp - 1) + max_digits10
  880|       |
  881|  1.44k|    std::memmove(buf + (2 + static_cast<size_t>(-n)), buf,
  882|  1.44k|                 static_cast<size_t>(k));
  883|  1.44k|    buf[0] = '0';
  884|  1.44k|    buf[1] = '.';
  885|  1.44k|    std::memset(buf + 2, '0', static_cast<size_t>(-n));
  886|  1.44k|    return buf + (2U + static_cast<size_t>(-n) + static_cast<size_t>(k));
  887|  1.44k|  }
  888|       |
  889|  3.00M|  if (k == 1) {
  ------------------
  |  Branch (889:7): [True: 21.2k, False: 2.98M]
  ------------------
  890|       |    // dE+123
  891|       |    // len <= 1 + 5
  892|       |
  893|  21.2k|    buf += 1;
  894|  2.98M|  } else {
  895|       |    // d.igitsE+123
  896|       |    // len <= max_digits10 + 1 + 5
  897|       |
  898|  2.98M|    std::memmove(buf + 2, buf + 1, static_cast<size_t>(k) - 1);
  899|  2.98M|    buf[1] = '.';
  900|  2.98M|    buf += 1 + static_cast<size_t>(k);
  901|  2.98M|  }
  902|       |
  903|  3.00M|  *buf++ = 'e';
  904|  3.00M|  return append_exponent(buf, n - 1);
  905|  3.00M|}
_ZN8simdjson8internal9dtoa_impl15append_exponentEPci:
  810|  3.00M|inline char *append_exponent(char *buf, int e) {
  811|       |
  812|  3.00M|  if (e < 0) {
  ------------------
  |  Branch (812:7): [True: 3.09k, False: 3.00M]
  ------------------
  813|  3.09k|    e = -e;
  814|  3.09k|    *buf++ = '-';
  815|  3.00M|  } else {
  816|  3.00M|    *buf++ = '+';
  817|  3.00M|  }
  818|       |
  819|  3.00M|  auto k = static_cast<std::uint32_t>(e);
  820|  3.00M|  if (k < 10) {
  ------------------
  |  Branch (820:7): [True: 468, False: 3.00M]
  ------------------
  821|       |    // Always print at least two digits in the exponent.
  822|       |    // This is for compatibility with printf("%g").
  823|    468|    *buf++ = '0';
  824|    468|    *buf++ = static_cast<char>('0' + k);
  825|  3.00M|  } else if (k < 100) {
  ------------------
  |  Branch (825:14): [True: 2.99M, False: 9.39k]
  ------------------
  826|  2.99M|    *buf++ = static_cast<char>('0' + k / 10);
  827|  2.99M|    k %= 10;
  828|  2.99M|    *buf++ = static_cast<char>('0' + k);
  829|  2.99M|  } else {
  830|  9.39k|    *buf++ = static_cast<char>('0' + k / 100);
  831|  9.39k|    k %= 100;
  832|  9.39k|    *buf++ = static_cast<char>('0' + k / 10);
  833|  9.39k|    k %= 10;
  834|  9.39k|    *buf++ = static_cast<char>('0' + k);
  835|  9.39k|  }
  836|       |
  837|  3.00M|  return buf;
  838|  3.00M|}
_ZN8simdjson8internal9dtoa_impl6grisu2IdEEvPcRiS4_T_:
  773|  3.04M|void grisu2(char *buf, int &len, int &decimal_exponent, FloatType value) {
  774|  3.04M|  static_assert(diyfp::kPrecision >= std::numeric_limits<FloatType>::digits + 3,
  775|  3.04M|                "internal error: not enough precision");
  776|       |
  777|       |  // If the neighbors (and boundaries) of 'value' are always computed for
  778|       |  // double-precision numbers, all float's can be recovered using strtod (and
  779|       |  // strtof). However, the resulting decimal representations are not exactly
  780|       |  // "short".
  781|       |  //
  782|       |  // The documentation for 'std::to_chars'
  783|       |  // (https://en.cppreference.com/w/cpp/utility/to_chars) says "value is
  784|       |  // converted to a string as if by std::sprintf in the default ("C") locale"
  785|       |  // and since sprintf promotes float's to double's, I think this is exactly
  786|       |  // what 'std::to_chars' does. On the other hand, the documentation for
  787|       |  // 'std::to_chars' requires that "parsing the representation using the
  788|       |  // corresponding std::from_chars function recovers value exactly". That
  789|       |  // indicates that single precision floating-point numbers should be recovered
  790|       |  // using 'std::strtof'.
  791|       |  //
  792|       |  // NB: If the neighbors are computed for single-precision numbers, there is a
  793|       |  // single float
  794|       |  //     (7.0385307e-26f) which can't be recovered using strtod. The resulting
  795|       |  //     double precision value is off by 1 ulp.
  796|       |#if 0
  797|       |    const boundaries w = compute_boundaries(static_cast<double>(value));
  798|       |#else
  799|  3.04M|  const boundaries w = compute_boundaries(value);
  800|  3.04M|#endif
  801|       |
  802|  3.04M|  grisu2(buf, len, decimal_exponent, w.minus, w.w, w.plus);
  803|  3.04M|}
_ZN8simdjson8internal9dtoa_impl18compute_boundariesIdEENS1_10boundariesET_:
  155|  3.04M|template <typename FloatType> boundaries compute_boundaries(FloatType value) {
  156|       |
  157|       |  // Convert the IEEE representation into a diyfp.
  158|       |  //
  159|       |  // If v is denormal:
  160|       |  //      value = 0.F * 2^(1 - bias) = (          F) * 2^(1 - bias - (p-1))
  161|       |  // If v is normalized:
  162|       |  //      value = 1.F * 2^(E - bias) = (2^(p-1) + F) * 2^(E - bias - (p-1))
  163|       |
  164|  3.04M|  static_assert(std::numeric_limits<FloatType>::is_iec559,
  165|  3.04M|                "internal error: dtoa_short requires an IEEE-754 "
  166|  3.04M|                "floating-point implementation");
  167|       |
  168|  3.04M|  constexpr int kPrecision =
  169|  3.04M|      std::numeric_limits<FloatType>::digits; // = p (includes the hidden bit)
  170|  3.04M|  constexpr int kBias =
  171|  3.04M|      std::numeric_limits<FloatType>::max_exponent - 1 + (kPrecision - 1);
  172|  3.04M|  constexpr int kMinExp = 1 - kBias;
  173|  3.04M|  constexpr std::uint64_t kHiddenBit = std::uint64_t{1}
  174|  3.04M|                                       << (kPrecision - 1); // = 2^(p-1)
  175|       |
  176|  3.04M|  using bits_type = typename std::conditional<kPrecision == 24, std::uint32_t,
  177|  3.04M|                                              std::uint64_t>::type;
  178|       |
  179|  3.04M|  const std::uint64_t bits = reinterpret_bits<bits_type>(value);
  180|  3.04M|  const std::uint64_t E = bits >> (kPrecision - 1);
  181|  3.04M|  const std::uint64_t F = bits & (kHiddenBit - 1);
  182|       |
  183|  3.04M|  const bool is_denormal = E == 0;
  184|  3.04M|  const diyfp v = is_denormal
  ------------------
  |  Branch (184:19): [True: 1.58k, False: 3.04M]
  ------------------
  185|  3.04M|                      ? diyfp(F, kMinExp)
  186|  3.04M|                      : diyfp(F + kHiddenBit, static_cast<int>(E) - kBias);
  187|       |
  188|       |  // Compute the boundaries m- and m+ of the floating-point value
  189|       |  // v = f * 2^e.
  190|       |  //
  191|       |  // Determine v- and v+, the floating-point predecessor and successor if v,
  192|       |  // respectively.
  193|       |  //
  194|       |  //      v- = v - 2^e        if f != 2^(p-1) or e == e_min                (A)
  195|       |  //         = v - 2^(e-1)    if f == 2^(p-1) and e > e_min                (B)
  196|       |  //
  197|       |  //      v+ = v + 2^e
  198|       |  //
  199|       |  // Let m- = (v- + v) / 2 and m+ = (v + v+) / 2. All real numbers _strictly_
  200|       |  // between m- and m+ round to v, regardless of how the input rounding
  201|       |  // algorithm breaks ties.
  202|       |  //
  203|       |  //      ---+-------------+-------------+-------------+-------------+---  (A)
  204|       |  //         v-            m-            v             m+            v+
  205|       |  //
  206|       |  //      -----------------+------+------+-------------+-------------+---  (B)
  207|       |  //                       v-     m-     v             m+            v+
  208|       |
  209|  3.04M|  const bool lower_boundary_is_closer = F == 0 && E > 1;
  ------------------
  |  Branch (209:41): [True: 2.78k, False: 3.04M]
  |  Branch (209:51): [True: 2.77k, False: 3]
  ------------------
  210|  3.04M|  const diyfp m_plus = diyfp(2 * v.f + 1, v.e - 1);
  211|  3.04M|  const diyfp m_minus = lower_boundary_is_closer
  ------------------
  |  Branch (211:25): [True: 2.77k, False: 3.04M]
  ------------------
  212|  3.04M|                            ? diyfp(4 * v.f - 1, v.e - 2)  // (B)
  213|  3.04M|                            : diyfp(2 * v.f - 1, v.e - 1); // (A)
  214|       |
  215|       |  // Determine the normalized w+ = m+.
  216|  3.04M|  const diyfp w_plus = diyfp::normalize(m_plus);
  217|       |
  218|       |  // Determine w- = m- such that e_(w-) = e_(w+).
  219|  3.04M|  const diyfp w_minus = diyfp::normalize_to(m_minus, w_plus.e);
  220|       |
  221|  3.04M|  return {diyfp::normalize(v), w_minus, w_plus};
  222|  3.04M|}
_ZN8simdjson8internal9dtoa_impl16reinterpret_bitsImdEET_T0_:
   27|  3.04M|Target reinterpret_bits(const Source source) {
   28|  3.04M|  static_assert(sizeof(Target) == sizeof(Source), "size mismatch");
   29|       |
   30|  3.04M|  Target target;
   31|  3.04M|  std::memcpy(&target, &source, sizeof(Source));
   32|  3.04M|  return target;
   33|  3.04M|}
_ZN8simdjson8internal9dtoa_impl5diyfpC2Emi:
   42|  39.6M|  constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_) {}
_ZN8simdjson8internal9dtoa_impl5diyfp9normalizeES2_:
  122|  6.09M|  static diyfp normalize(diyfp x) noexcept {
  123|       |
  124|  70.2M|    while ((x.f >> 63u) == 0) {
  ------------------
  |  Branch (124:12): [True: 64.1M, False: 6.09M]
  ------------------
  125|  64.1M|      x.f <<= 1u;
  126|  64.1M|      x.e--;
  127|  64.1M|    }
  128|       |
  129|  6.09M|    return x;
  130|  6.09M|  }
_ZN8simdjson8internal9dtoa_impl5diyfp12normalize_toERKS2_i:
  137|  3.04M|                            const int target_exponent) noexcept {
  138|  3.04M|    const int delta = x.e - target_exponent;
  139|       |
  140|  3.04M|    return {x.f << delta, target_exponent};
  141|  3.04M|  }
_ZN8simdjson8internal9dtoa_impl6grisu2EPcRiS3_NS1_5diyfpES4_S4_:
  717|  3.04M|                   diyfp v, diyfp m_plus) {
  718|       |
  719|       |  //  --------(-----------------------+-----------------------)--------    (A)
  720|       |  //          m-                      v                       m+
  721|       |  //
  722|       |  //  --------------------(-----------+-----------------------)--------    (B)
  723|       |  //                      m-          v                       m+
  724|       |  //
  725|       |  // First scale v (and m- and m+) such that the exponent is in the range
  726|       |  // [alpha, gamma].
  727|       |
  728|  3.04M|  const cached_power cached = get_cached_power_for_binary_exponent(m_plus.e);
  729|       |
  730|  3.04M|  const diyfp c_minus_k(cached.f, cached.e); // = c ~= 10^-k
  731|       |
  732|       |  // The exponent of the products is = v.e + c_minus_k.e + q and is in the range
  733|       |  // [alpha,gamma]
  734|  3.04M|  const diyfp w = diyfp::mul(v, c_minus_k);
  735|  3.04M|  const diyfp w_minus = diyfp::mul(m_minus, c_minus_k);
  736|  3.04M|  const diyfp w_plus = diyfp::mul(m_plus, c_minus_k);
  737|       |
  738|       |  //  ----(---+---)---------------(---+---)---------------(---+---)----
  739|       |  //          w-                      w                       w+
  740|       |  //          = c*m-                  = c*v                   = c*m+
  741|       |  //
  742|       |  // diyfp::mul rounds its result and c_minus_k is approximated too. w, w- and
  743|       |  // w+ are now off by a small amount.
  744|       |  // In fact:
  745|       |  //
  746|       |  //      w - v * 10^k < 1 ulp
  747|       |  //
  748|       |  // To account for this inaccuracy, add resp. subtract 1 ulp.
  749|       |  //
  750|       |  //  --------+---[---------------(---+---)---------------]---+--------
  751|       |  //          w-  M-                  w                   M+  w+
  752|       |  //
  753|       |  // Now any number in [M-, M+] (bounds included) will round to w when input,
  754|       |  // regardless of how the input rounding algorithm breaks ties.
  755|       |  //
  756|       |  // And digit_gen generates the shortest possible such number in [M-, M+].
  757|       |  // Note that this does not mean that Grisu2 always generates the shortest
  758|       |  // possible number in the interval (m-, m+).
  759|  3.04M|  const diyfp M_minus(w_minus.f + 1, w_minus.e);
  760|  3.04M|  const diyfp M_plus(w_plus.f - 1, w_plus.e);
  761|       |
  762|  3.04M|  decimal_exponent = -cached.k; // = -(-k) = k
  763|       |
  764|  3.04M|  grisu2_digit_gen(buf, len, decimal_exponent, M_minus, w, M_plus);
  765|  3.04M|}
_ZN8simdjson8internal9dtoa_impl36get_cached_power_for_binary_exponentEi:
  295|  3.04M|inline cached_power get_cached_power_for_binary_exponent(int e) {
  296|       |  // Now
  297|       |  //
  298|       |  //      alpha <= e_c + e + q <= gamma                                    (1)
  299|       |  //      ==> f_c * 2^alpha <= c * 2^e * 2^q
  300|       |  //
  301|       |  // and since the c's are normalized, 2^(q-1) <= f_c,
  302|       |  //
  303|       |  //      ==> 2^(q - 1 + alpha) <= c * 2^(e + q)
  304|       |  //      ==> 2^(alpha - e - 1) <= c
  305|       |  //
  306|       |  // If c were an exact power of ten, i.e. c = 10^k, one may determine k as
  307|       |  //
  308|       |  //      k = ceil( log_10( 2^(alpha - e - 1) ) )
  309|       |  //        = ceil( (alpha - e - 1) * log_10(2) )
  310|       |  //
  311|       |  // From the paper:
  312|       |  // "In theory the result of the procedure could be wrong since c is rounded,
  313|       |  //  and the computation itself is approximated [...]. In practice, however,
  314|       |  //  this simple function is sufficient."
  315|       |  //
  316|       |  // For IEEE double precision floating-point numbers converted into
  317|       |  // normalized diyfp's w = f * 2^e, with q = 64,
  318|       |  //
  319|       |  //      e >= -1022      (min IEEE exponent)
  320|       |  //           -52        (p - 1)
  321|       |  //           -52        (p - 1, possibly normalize denormal IEEE numbers)
  322|       |  //           -11        (normalize the diyfp)
  323|       |  //         = -1137
  324|       |  //
  325|       |  // and
  326|       |  //
  327|       |  //      e <= +1023      (max IEEE exponent)
  328|       |  //           -52        (p - 1)
  329|       |  //           -11        (normalize the diyfp)
  330|       |  //         = 960
  331|       |  //
  332|       |  // This binary exponent range [-1137,960] results in a decimal exponent
  333|       |  // range [-307,324]. One does not need to store a cached power for each
  334|       |  // k in this range. For each such k it suffices to find a cached power
  335|       |  // such that the exponent of the product lies in [alpha,gamma].
  336|       |  // This implies that the difference of the decimal exponents of adjacent
  337|       |  // table entries must be less than or equal to
  338|       |  //
  339|       |  //      floor( (gamma - alpha) * log_10(2) ) = 8.
  340|       |  //
  341|       |  // (A smaller distance gamma-alpha would require a larger table.)
  342|       |
  343|       |  // NB:
  344|       |  // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34.
  345|       |
  346|  3.04M|  constexpr int kCachedPowersMinDecExp = -300;
  347|  3.04M|  constexpr int kCachedPowersDecStep = 8;
  348|       |
  349|  3.04M|  static constexpr std::array<cached_power, 79> kCachedPowers = {{
  350|  3.04M|      {0xAB70FE17C79AC6CA, -1060, -300}, {0xFF77B1FCBEBCDC4F, -1034, -292},
  351|  3.04M|      {0xBE5691EF416BD60C, -1007, -284}, {0x8DD01FAD907FFC3C, -980, -276},
  352|  3.04M|      {0xD3515C2831559A83, -954, -268},  {0x9D71AC8FADA6C9B5, -927, -260},
  353|  3.04M|      {0xEA9C227723EE8BCB, -901, -252},  {0xAECC49914078536D, -874, -244},
  354|  3.04M|      {0x823C12795DB6CE57, -847, -236},  {0xC21094364DFB5637, -821, -228},
  355|  3.04M|      {0x9096EA6F3848984F, -794, -220},  {0xD77485CB25823AC7, -768, -212},
  356|  3.04M|      {0xA086CFCD97BF97F4, -741, -204},  {0xEF340A98172AACE5, -715, -196},
  357|  3.04M|      {0xB23867FB2A35B28E, -688, -188},  {0x84C8D4DFD2C63F3B, -661, -180},
  358|  3.04M|      {0xC5DD44271AD3CDBA, -635, -172},  {0x936B9FCEBB25C996, -608, -164},
  359|  3.04M|      {0xDBAC6C247D62A584, -582, -156},  {0xA3AB66580D5FDAF6, -555, -148},
  360|  3.04M|      {0xF3E2F893DEC3F126, -529, -140},  {0xB5B5ADA8AAFF80B8, -502, -132},
  361|  3.04M|      {0x87625F056C7C4A8B, -475, -124},  {0xC9BCFF6034C13053, -449, -116},
  362|  3.04M|      {0x964E858C91BA2655, -422, -108},  {0xDFF9772470297EBD, -396, -100},
  363|  3.04M|      {0xA6DFBD9FB8E5B88F, -369, -92},   {0xF8A95FCF88747D94, -343, -84},
  364|  3.04M|      {0xB94470938FA89BCF, -316, -76},   {0x8A08F0F8BF0F156B, -289, -68},
  365|  3.04M|      {0xCDB02555653131B6, -263, -60},   {0x993FE2C6D07B7FAC, -236, -52},
  366|  3.04M|      {0xE45C10C42A2B3B06, -210, -44},   {0xAA242499697392D3, -183, -36},
  367|  3.04M|      {0xFD87B5F28300CA0E, -157, -28},   {0xBCE5086492111AEB, -130, -20},
  368|  3.04M|      {0x8CBCCC096F5088CC, -103, -12},   {0xD1B71758E219652C, -77, -4},
  369|  3.04M|      {0x9C40000000000000, -50, 4},      {0xE8D4A51000000000, -24, 12},
  370|  3.04M|      {0xAD78EBC5AC620000, 3, 20},       {0x813F3978F8940984, 30, 28},
  371|  3.04M|      {0xC097CE7BC90715B3, 56, 36},      {0x8F7E32CE7BEA5C70, 83, 44},
  372|  3.04M|      {0xD5D238A4ABE98068, 109, 52},     {0x9F4F2726179A2245, 136, 60},
  373|  3.04M|      {0xED63A231D4C4FB27, 162, 68},     {0xB0DE65388CC8ADA8, 189, 76},
  374|  3.04M|      {0x83C7088E1AAB65DB, 216, 84},     {0xC45D1DF942711D9A, 242, 92},
  375|  3.04M|      {0x924D692CA61BE758, 269, 100},    {0xDA01EE641A708DEA, 295, 108},
  376|  3.04M|      {0xA26DA3999AEF774A, 322, 116},    {0xF209787BB47D6B85, 348, 124},
  377|  3.04M|      {0xB454E4A179DD1877, 375, 132},    {0x865B86925B9BC5C2, 402, 140},
  378|  3.04M|      {0xC83553C5C8965D3D, 428, 148},    {0x952AB45CFA97A0B3, 455, 156},
  379|  3.04M|      {0xDE469FBD99A05FE3, 481, 164},    {0xA59BC234DB398C25, 508, 172},
  380|  3.04M|      {0xF6C69A72A3989F5C, 534, 180},    {0xB7DCBF5354E9BECE, 561, 188},
  381|  3.04M|      {0x88FCF317F22241E2, 588, 196},    {0xCC20CE9BD35C78A5, 614, 204},
  382|  3.04M|      {0x98165AF37B2153DF, 641, 212},    {0xE2A0B5DC971F303A, 667, 220},
  383|  3.04M|      {0xA8D9D1535CE3B396, 694, 228},    {0xFB9B7CD9A4A7443C, 720, 236},
  384|  3.04M|      {0xBB764C4CA7A44410, 747, 244},    {0x8BAB8EEFB6409C1A, 774, 252},
  385|  3.04M|      {0xD01FEF10A657842C, 800, 260},    {0x9B10A4E5E9913129, 827, 268},
  386|  3.04M|      {0xE7109BFBA19C0C9D, 853, 276},    {0xAC2820D9623BF429, 880, 284},
  387|  3.04M|      {0x80444B5E7AA7CF85, 907, 292},    {0xBF21E44003ACDD2D, 933, 300},
  388|  3.04M|      {0x8E679C2F5E44FF8F, 960, 308},    {0xD433179D9C8CB841, 986, 316},
  389|  3.04M|      {0x9E19DB92B4E31BA9, 1013, 324},
  390|  3.04M|  }};
  391|       |
  392|       |  // This computation gives exactly the same results for k as
  393|       |  //      k = ceil((kAlpha - e - 1) * 0.30102999566398114)
  394|       |  // for |e| <= 1500, but doesn't require floating-point operations.
  395|       |  // NB: log_10(2) ~= 78913 / 2^18
  396|  3.04M|  const int f = kAlpha - e - 1;
  397|  3.04M|  const int k = (f * 78913) / (1 << 18) + static_cast<int>(f > 0);
  398|       |
  399|  3.04M|  const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) /
  400|  3.04M|                    kCachedPowersDecStep;
  401|       |
  402|  3.04M|  const cached_power cached = kCachedPowers[static_cast<std::size_t>(index)];
  403|       |
  404|  3.04M|  return cached;
  405|  3.04M|}
_ZN8simdjson8internal9dtoa_impl5diyfp3mulERKS2_S4_:
   57|  9.14M|  static diyfp mul(const diyfp &x, const diyfp &y) noexcept {
   58|  9.14M|    static_assert(kPrecision == 64, "internal error");
   59|       |
   60|       |    // Computes:
   61|       |    //  f = round((x.f * y.f) / 2^q)
   62|       |    //  e = x.e + y.e + q
   63|       |
   64|       |    // Emulate the 64-bit * 64-bit multiplication:
   65|       |    //
   66|       |    // p = u * v
   67|       |    //   = (u_lo + 2^32 u_hi) (v_lo + 2^32 v_hi)
   68|       |    //   = (u_lo v_lo         ) + 2^32 ((u_lo v_hi         ) + (u_hi v_lo )) +
   69|       |    //   2^64 (u_hi v_hi         ) = (p0                ) + 2^32 ((p1 ) + (p2 ))
   70|       |    //   + 2^64 (p3                ) = (p0_lo + 2^32 p0_hi) + 2^32 ((p1_lo +
   71|       |    //   2^32 p1_hi) + (p2_lo + 2^32 p2_hi)) + 2^64 (p3                ) =
   72|       |    //   (p0_lo             ) + 2^32 (p0_hi + p1_lo + p2_lo ) + 2^64 (p1_hi +
   73|       |    //   p2_hi + p3) = (p0_lo             ) + 2^32 (Q ) + 2^64 (H ) = (p0_lo ) +
   74|       |    //   2^32 (Q_lo + 2^32 Q_hi                           ) + 2^64 (H )
   75|       |    //
   76|       |    // (Since Q might be larger than 2^32 - 1)
   77|       |    //
   78|       |    //   = (p0_lo + 2^32 Q_lo) + 2^64 (Q_hi + H)
   79|       |    //
   80|       |    // (Q_hi + H does not overflow a 64-bit int)
   81|       |    //
   82|       |    //   = p_lo + 2^64 p_hi
   83|       |
   84|  9.14M|    const std::uint64_t u_lo = x.f & 0xFFFFFFFFu;
   85|  9.14M|    const std::uint64_t u_hi = x.f >> 32u;
   86|  9.14M|    const std::uint64_t v_lo = y.f & 0xFFFFFFFFu;
   87|  9.14M|    const std::uint64_t v_hi = y.f >> 32u;
   88|       |
   89|  9.14M|    const std::uint64_t p0 = u_lo * v_lo;
   90|  9.14M|    const std::uint64_t p1 = u_lo * v_hi;
   91|  9.14M|    const std::uint64_t p2 = u_hi * v_lo;
   92|  9.14M|    const std::uint64_t p3 = u_hi * v_hi;
   93|       |
   94|  9.14M|    const std::uint64_t p0_hi = p0 >> 32u;
   95|  9.14M|    const std::uint64_t p1_lo = p1 & 0xFFFFFFFFu;
   96|  9.14M|    const std::uint64_t p1_hi = p1 >> 32u;
   97|  9.14M|    const std::uint64_t p2_lo = p2 & 0xFFFFFFFFu;
   98|  9.14M|    const std::uint64_t p2_hi = p2 >> 32u;
   99|       |
  100|  9.14M|    std::uint64_t Q = p0_hi + p1_lo + p2_lo;
  101|       |
  102|       |    // The full product might now be computed as
  103|       |    //
  104|       |    // p_hi = p3 + p2_hi + p1_hi + (Q >> 32)
  105|       |    // p_lo = p0_lo + (Q << 32)
  106|       |    //
  107|       |    // But in this particular case here, the full p_lo is not required.
  108|       |    // Effectively we only need to add the highest bit in p_lo to p_hi (and
  109|       |    // Q_hi + 1 does not overflow).
  110|       |
  111|  9.14M|    Q += std::uint64_t{1} << (64u - 32u - 1u); // round, ties up
  112|       |
  113|  9.14M|    const std::uint64_t h = p3 + p2_hi + p1_hi + (Q >> 32u);
  114|       |
  115|  9.14M|    return {h, x.e + y.e + 64};
  116|  9.14M|  }
_ZN8simdjson8internal9dtoa_impl16grisu2_digit_genEPcRiS3_NS1_5diyfpES4_S4_:
  483|  3.04M|                             diyfp M_minus, diyfp w, diyfp M_plus) {
  484|  3.04M|  static_assert(kAlpha >= -60, "internal error");
  485|  3.04M|  static_assert(kGamma <= -32, "internal error");
  486|       |
  487|       |  // Generates the digits (and the exponent) of a decimal floating-point
  488|       |  // number V = buffer * 10^decimal_exponent in the range [M-, M+]. The diyfp's
  489|       |  // w, M- and M+ share the same exponent e, which satisfies alpha <= e <=
  490|       |  // gamma.
  491|       |  //
  492|       |  //               <--------------------------- delta ---->
  493|       |  //                                  <---- dist --------->
  494|       |  // --------------[------------------+-------------------]--------------
  495|       |  //               M-                 w                   M+
  496|       |  //
  497|       |  // Grisu2 generates the digits of M+ from left to right and stops as soon as
  498|       |  // V is in [M-,M+].
  499|       |
  500|  3.04M|  std::uint64_t delta =
  501|  3.04M|      diyfp::sub(M_plus, M_minus)
  502|  3.04M|          .f; // (significand of (M+ - M-), implicit exponent is e)
  503|  3.04M|  std::uint64_t dist =
  504|  3.04M|      diyfp::sub(M_plus, w)
  505|  3.04M|          .f; // (significand of (M+ - w ), implicit exponent is e)
  506|       |
  507|       |  // Split M+ = f * 2^e into two parts p1 and p2 (note: e < 0):
  508|       |  //
  509|       |  //      M+ = f * 2^e
  510|       |  //         = ((f div 2^-e) * 2^-e + (f mod 2^-e)) * 2^e
  511|       |  //         = ((p1        ) * 2^-e + (p2        )) * 2^e
  512|       |  //         = p1 + p2 * 2^e
  513|       |
  514|  3.04M|  const diyfp one(std::uint64_t{1} << -M_plus.e, M_plus.e);
  515|       |
  516|  3.04M|  auto p1 = static_cast<std::uint32_t>(
  517|  3.04M|      M_plus.f >>
  518|  3.04M|      -one.e); // p1 = f div 2^-e (Since -e >= 32, p1 fits into a 32-bit int.)
  519|  3.04M|  std::uint64_t p2 = M_plus.f & (one.f - 1); // p2 = f mod 2^-e
  520|       |
  521|       |  // 1)
  522|       |  //
  523|       |  // Generate the digits of the integral part p1 = d[n-1]...d[1]d[0]
  524|       |
  525|  3.04M|  std::uint32_t pow10;
  526|  3.04M|  const int k = find_largest_pow10(p1, pow10);
  527|       |
  528|       |  //      10^(k-1) <= p1 < 10^k, pow10 = 10^(k-1)
  529|       |  //
  530|       |  //      p1 = (p1 div 10^(k-1)) * 10^(k-1) + (p1 mod 10^(k-1))
  531|       |  //         = (d[k-1]         ) * 10^(k-1) + (p1 mod 10^(k-1))
  532|       |  //
  533|       |  //      M+ = p1                                             + p2 * 2^e
  534|       |  //         = d[k-1] * 10^(k-1) + (p1 mod 10^(k-1))          + p2 * 2^e
  535|       |  //         = d[k-1] * 10^(k-1) + ((p1 mod 10^(k-1)) * 2^-e + p2) * 2^e
  536|       |  //         = d[k-1] * 10^(k-1) + (                         rest) * 2^e
  537|       |  //
  538|       |  // Now generate the digits d[n] of p1 from left to right (n = k-1,...,0)
  539|       |  //
  540|       |  //      p1 = d[k-1]...d[n] * 10^n + d[n-1]...d[0]
  541|       |  //
  542|       |  // but stop as soon as
  543|       |  //
  544|       |  //      rest * 2^e = (d[n-1]...d[0] * 2^-e + p2) * 2^e <= delta * 2^e
  545|       |
  546|  3.04M|  int n = k;
  547|  14.8M|  while (n > 0) {
  ------------------
  |  Branch (547:10): [True: 11.9M, False: 2.96M]
  ------------------
  548|       |    // Invariants:
  549|       |    //      M+ = buffer * 10^n + (p1 + p2 * 2^e)    (buffer = 0 for n = k)
  550|       |    //      pow10 = 10^(n-1) <= p1 < 10^n
  551|       |    //
  552|  11.9M|    const std::uint32_t d = p1 / pow10; // d = p1 div 10^(n-1)
  553|  11.9M|    const std::uint32_t r = p1 % pow10; // r = p1 mod 10^(n-1)
  554|       |    //
  555|       |    //      M+ = buffer * 10^n + (d * 10^(n-1) + r) + p2 * 2^e
  556|       |    //         = (buffer * 10 + d) * 10^(n-1) + (r + p2 * 2^e)
  557|       |    //
  558|  11.9M|    buffer[length++] = static_cast<char>('0' + d); // buffer := buffer * 10 + d
  559|       |    //
  560|       |    //      M+ = buffer * 10^(n-1) + (r + p2 * 2^e)
  561|       |    //
  562|  11.9M|    p1 = r;
  563|  11.9M|    n--;
  564|       |    //
  565|       |    //      M+ = buffer * 10^n + (p1 + p2 * 2^e)
  566|       |    //      pow10 = 10^n
  567|       |    //
  568|       |
  569|       |    // Now check if enough digits have been generated.
  570|       |    // Compute
  571|       |    //
  572|       |    //      p1 + p2 * 2^e = (p1 * 2^-e + p2) * 2^e = rest * 2^e
  573|       |    //
  574|       |    // Note:
  575|       |    // Since rest and delta share the same exponent e, it suffices to
  576|       |    // compare the significands.
  577|  11.9M|    const std::uint64_t rest = (std::uint64_t{p1} << -one.e) + p2;
  578|  11.9M|    if (rest <= delta) {
  ------------------
  |  Branch (578:9): [True: 77.9k, False: 11.8M]
  ------------------
  579|       |      // V = buffer * 10^n, with M- <= V <= M+.
  580|       |
  581|  77.9k|      decimal_exponent += n;
  582|       |
  583|       |      // We may now just stop. But instead look if the buffer could be
  584|       |      // decremented to bring V closer to w.
  585|       |      //
  586|       |      // pow10 = 10^n is now 1 ulp in the decimal representation V.
  587|       |      // The rounding procedure works with diyfp's with an implicit
  588|       |      // exponent of e.
  589|       |      //
  590|       |      //      10^n = (10^n * 2^-e) * 2^e = ulp * 2^e
  591|       |      //
  592|  77.9k|      const std::uint64_t ten_n = std::uint64_t{pow10} << -one.e;
  593|  77.9k|      grisu2_round(buffer, length, dist, delta, rest, ten_n);
  594|       |
  595|  77.9k|      return;
  596|  77.9k|    }
  597|       |
  598|  11.8M|    pow10 /= 10;
  599|       |    //
  600|       |    //      pow10 = 10^(n-1) <= p1 < 10^n
  601|       |    // Invariants restored.
  602|  11.8M|  }
  603|       |
  604|       |  // 2)
  605|       |  //
  606|       |  // The digits of the integral part have been generated:
  607|       |  //
  608|       |  //      M+ = d[k-1]...d[1]d[0] + p2 * 2^e
  609|       |  //         = buffer            + p2 * 2^e
  610|       |  //
  611|       |  // Now generate the digits of the fractional part p2 * 2^e.
  612|       |  //
  613|       |  // Note:
  614|       |  // No decimal point is generated: the exponent is adjusted instead.
  615|       |  //
  616|       |  // p2 actually represents the fraction
  617|       |  //
  618|       |  //      p2 * 2^e
  619|       |  //          = p2 / 2^-e
  620|       |  //          = d[-1] / 10^1 + d[-2] / 10^2 + ...
  621|       |  //
  622|       |  // Now generate the digits d[-m] of p1 from left to right (m = 1,2,...)
  623|       |  //
  624|       |  //      p2 * 2^e = d[-1]d[-2]...d[-m] * 10^-m
  625|       |  //                      + 10^-m * (d[-m-1] / 10^1 + d[-m-2] / 10^2 + ...)
  626|       |  //
  627|       |  // using
  628|       |  //
  629|       |  //      10^m * p2 = ((10^m * p2) div 2^-e) * 2^-e + ((10^m * p2) mod 2^-e)
  630|       |  //                = (                   d) * 2^-e + (                   r)
  631|       |  //
  632|       |  // or
  633|       |  //      10^m * p2 * 2^e = d + r * 2^e
  634|       |  //
  635|       |  // i.e.
  636|       |  //
  637|       |  //      M+ = buffer + p2 * 2^e
  638|       |  //         = buffer + 10^-m * (d + r * 2^e)
  639|       |  //         = (buffer * 10^m + d) * 10^-m + 10^-m * r * 2^e
  640|       |  //
  641|       |  // and stop as soon as 10^-m * r * 2^e <= delta * 2^e
  642|       |
  643|  2.96M|  int m = 0;
  644|  38.5M|  for (;;) {
  645|       |    // Invariant:
  646|       |    //      M+ = buffer * 10^-m + 10^-m * (d[-m-1] / 10 + d[-m-2] / 10^2 + ...)
  647|       |    //      * 2^e
  648|       |    //         = buffer * 10^-m + 10^-m * (p2                                 )
  649|       |    //         * 2^e = buffer * 10^-m + 10^-m * (1/10 * (10 * p2) ) * 2^e =
  650|       |    //         buffer * 10^-m + 10^-m * (1/10 * ((10*p2 div 2^-e) * 2^-e +
  651|       |    //         (10*p2 mod 2^-e)) * 2^e
  652|       |    //
  653|  38.5M|    p2 *= 10;
  654|  38.5M|    const std::uint64_t d = p2 >> -one.e;     // d = (10 * p2) div 2^-e
  655|  38.5M|    const std::uint64_t r = p2 & (one.f - 1); // r = (10 * p2) mod 2^-e
  656|       |    //
  657|       |    //      M+ = buffer * 10^-m + 10^-m * (1/10 * (d * 2^-e + r) * 2^e
  658|       |    //         = buffer * 10^-m + 10^-m * (1/10 * (d + r * 2^e))
  659|       |    //         = (buffer * 10 + d) * 10^(-m-1) + 10^(-m-1) * r * 2^e
  660|       |    //
  661|  38.5M|    buffer[length++] = static_cast<char>('0' + d); // buffer := buffer * 10 + d
  662|       |    //
  663|       |    //      M+ = buffer * 10^(-m-1) + 10^(-m-1) * r * 2^e
  664|       |    //
  665|  38.5M|    p2 = r;
  666|  38.5M|    m++;
  667|       |    //
  668|       |    //      M+ = buffer * 10^-m + 10^-m * p2 * 2^e
  669|       |    // Invariant restored.
  670|       |
  671|       |    // Check if enough digits have been generated.
  672|       |    //
  673|       |    //      10^-m * p2 * 2^e <= delta * 2^e
  674|       |    //              p2 * 2^e <= 10^m * delta * 2^e
  675|       |    //                    p2 <= 10^m * delta
  676|  38.5M|    delta *= 10;
  677|  38.5M|    dist *= 10;
  678|  38.5M|    if (p2 <= delta) {
  ------------------
  |  Branch (678:9): [True: 2.96M, False: 35.5M]
  ------------------
  679|  2.96M|      break;
  680|  2.96M|    }
  681|  38.5M|  }
  682|       |
  683|       |  // V = buffer * 10^-m, with M- <= V <= M+.
  684|       |
  685|  2.96M|  decimal_exponent -= m;
  686|       |
  687|       |  // 1 ulp in the decimal representation is now 10^-m.
  688|       |  // Since delta and dist are now scaled by 10^m, we need to do the
  689|       |  // same with ulp in order to keep the units in sync.
  690|       |  //
  691|       |  //      10^m * 10^-m = 1 = 2^-e * 2^e = ten_m * 2^e
  692|       |  //
  693|  2.96M|  const std::uint64_t ten_m = one.f;
  694|  2.96M|  grisu2_round(buffer, length, dist, delta, p2, ten_m);
  695|       |
  696|       |  // By construction this algorithm generates the shortest possible decimal
  697|       |  // number (Loitsch, Theorem 6.2) which rounds back to w.
  698|       |  // For an input number of precision p, at least
  699|       |  //
  700|       |  //      N = 1 + ceil(p * log_10(2))
  701|       |  //
  702|       |  // decimal digits are sufficient to identify all binary floating-point
  703|       |  // numbers (Matula, "In-and-Out conversions").
  704|       |  // This implies that the algorithm does not produce more than N decimal
  705|       |  // digits.
  706|       |  //
  707|       |  //      N = 17 for p = 53 (IEEE double precision)
  708|       |  //      N = 9  for p = 24 (IEEE single precision)
  709|  2.96M|}
_ZN8simdjson8internal9dtoa_impl5diyfp3subERKS2_S4_:
   48|  6.09M|  static diyfp sub(const diyfp &x, const diyfp &y) noexcept {
   49|       |
   50|  6.09M|    return {x.f - y.f, x.e};
   51|  6.09M|  }
_ZN8simdjson8internal9dtoa_impl18find_largest_pow10EjRj:
  411|  3.04M|inline int find_largest_pow10(const std::uint32_t n, std::uint32_t &pow10) {
  412|       |  // LCOV_EXCL_START
  413|  3.04M|  if (n >= 1000000000) {
  ------------------
  |  Branch (413:7): [True: 0, False: 3.04M]
  ------------------
  414|      0|    pow10 = 1000000000;
  415|      0|    return 10;
  416|      0|  }
  417|       |  // LCOV_EXCL_STOP
  418|  3.04M|  else if (n >= 100000000) {
  ------------------
  |  Branch (418:12): [True: 3.15k, False: 3.04M]
  ------------------
  419|  3.15k|    pow10 = 100000000;
  420|  3.15k|    return 9;
  421|  3.04M|  } else if (n >= 10000000) {
  ------------------
  |  Branch (421:14): [True: 10.5k, False: 3.03M]
  ------------------
  422|  10.5k|    pow10 = 10000000;
  423|  10.5k|    return 8;
  424|  3.03M|  } else if (n >= 1000000) {
  ------------------
  |  Branch (424:14): [True: 19.0k, False: 3.01M]
  ------------------
  425|  19.0k|    pow10 = 1000000;
  426|  19.0k|    return 7;
  427|  3.01M|  } else if (n >= 100000) {
  ------------------
  |  Branch (427:14): [True: 6.70k, False: 3.00M]
  ------------------
  428|  6.70k|    pow10 = 100000;
  429|  6.70k|    return 6;
  430|  3.00M|  } else if (n >= 10000) {
  ------------------
  |  Branch (430:14): [True: 14.7k, False: 2.99M]
  ------------------
  431|  14.7k|    pow10 = 10000;
  432|  14.7k|    return 5;
  433|  2.99M|  } else if (n >= 1000) {
  ------------------
  |  Branch (433:14): [True: 2.89M, False: 101k]
  ------------------
  434|  2.89M|    pow10 = 1000;
  435|  2.89M|    return 4;
  436|  2.89M|  } else if (n >= 100) {
  ------------------
  |  Branch (436:14): [True: 78.9k, False: 22.2k]
  ------------------
  437|  78.9k|    pow10 = 100;
  438|  78.9k|    return 3;
  439|  78.9k|  } else if (n >= 10) {
  ------------------
  |  Branch (439:14): [True: 20.9k, False: 1.31k]
  ------------------
  440|  20.9k|    pow10 = 10;
  441|  20.9k|    return 2;
  442|  20.9k|  } else {
  443|  1.31k|    pow10 = 1;
  444|  1.31k|    return 1;
  445|  1.31k|  }
  446|  3.04M|}
_ZN8simdjson8internal9dtoa_impl12grisu2_roundEPcimmmm:
  450|  3.04M|                         std::uint64_t ten_k) {
  451|       |
  452|       |  //               <--------------------------- delta ---->
  453|       |  //                                  <---- dist --------->
  454|       |  // --------------[------------------+-------------------]--------------
  455|       |  //               M-                 w                   M+
  456|       |  //
  457|       |  //                                  ten_k
  458|       |  //                                <------>
  459|       |  //                                       <---- rest ---->
  460|       |  // --------------[------------------+----+--------------]--------------
  461|       |  //                                  w    V
  462|       |  //                                       = buf * 10^k
  463|       |  //
  464|       |  // ten_k represents a unit-in-the-last-place in the decimal representation
  465|       |  // stored in buf.
  466|       |  // Decrement buf by ten_k while this takes buf closer to w.
  467|       |
  468|       |  // The tests are written in this order to avoid overflow in unsigned
  469|       |  // integer arithmetic.
  470|       |
  471|  8.76M|  while (rest < dist && delta - rest >= ten_k &&
  ------------------
  |  Branch (471:10): [True: 8.57M, False: 196k]
  |  Branch (471:25): [True: 8.55M, False: 15.8k]
  ------------------
  472|  8.76M|         (rest + ten_k < dist || dist - rest > rest + ten_k - dist)) {
  ------------------
  |  Branch (472:11): [True: 5.67M, False: 2.88M]
  |  Branch (472:34): [True: 50.5k, False: 2.83M]
  ------------------
  473|  5.72M|    buf[len - 1]--;
  474|  5.72M|    rest += ten_k;
  475|  5.72M|  }
  476|  3.04M|}

