LLVMFuzzerTestOneInput:
    5|  8.93k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
    6|  8.93k|  simdjson::dom::parser parser;
    7|  8.93k|  simdjson_unused simdjson::dom::element elem;
  ------------------
  |  |  113|  8.93k|  #define simdjson_unused __attribute__((unused))
  ------------------
    8|  8.93k|  simdjson_unused auto error = parser.parse(Data, Size).get(elem);
  ------------------
  |  |  113|  8.93k|  #define simdjson_unused __attribute__((unused))
  ------------------
    9|  8.93k|  return 0;
   10|  8.93k|}

_ZNK8simdjson3dom8document8capacityEv:
   23|  8.93k|inline size_t document::capacity() const noexcept {
   24|  8.93k|  return allocated_capacity;
   25|  8.93k|}
_ZN8simdjson3dom8document8allocateEm:
   28|  8.93k|inline error_code document::allocate(size_t capacity) noexcept {
   29|  8.93k|  if (capacity == 0) {
  ------------------
  |  Branch (29:7): [True: 0, False: 8.93k]
  ------------------
   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|  8.93k|  size_t tape_capacity = SIMDJSON_ROUNDUP_N(capacity + 3, 64);
  ------------------
  |  |   68|  8.93k|#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|  8.93k|  size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * capacity / 3 + SIMDJSON_PADDING, 64);
  ------------------
  |  |   68|  8.93k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   45|  8.93k|  string_buf.reset( new (std::nothrow) uint8_t[string_capacity]);
   46|  8.93k|  tape.reset(new (std::nothrow) uint64_t[tape_capacity]);
   47|  8.93k|  if(!(string_buf && tape)) {
  ------------------
  |  Branch (47:8): [True: 8.93k, False: 0]
  |  Branch (47:22): [True: 8.93k, 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|  8.93k|  allocated_capacity = capacity;
   56|  8.93k|  return SUCCESS;
   57|  8.93k|}
_ZNK8simdjson3dom8document4rootEv:
   19|  4.52k|inline element document::root() const noexcept {
   20|  4.52k|  return element(internal::tape_ref(this, 1));
   21|  4.52k|}

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

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

_ZN8simdjson3dom6parserC2Em:
   20|  8.93k|    loaded_bytes(nullptr) {
   21|  8.93k|}
_ZNR8simdjson3dom6parser5parseEPKhmb:
  138|  8.93k|inline simdjson_result<element> parser::parse(const uint8_t *buf, size_t len, bool realloc_if_needed) & noexcept {
  139|  8.93k|  return parse_into_document(doc, buf, len, realloc_if_needed);
  140|  8.93k|}
_ZNR8simdjson3dom6parser19parse_into_documentERNS0_8documentEPKhmb:
  104|  8.93k|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|  8.93k|  error_code _error = ensure_capacity(provided_doc, len);
  108|  8.93k|  if (_error) { return _error; }
  ------------------
  |  Branch (108:7): [True: 0, False: 8.93k]
  ------------------
  109|  8.93k|  if (realloc_if_needed) {
  ------------------
  |  Branch (109:7): [True: 8.93k, False: 0]
  ------------------
  110|       |    // Make sure we have enough capacity to copy len bytes
  111|  8.93k|    if (!loaded_bytes || _loaded_bytes_capacity < len) {
  ------------------
  |  Branch (111:9): [True: 8.93k, False: 0]
  |  Branch (111:26): [True: 0, False: 0]
  ------------------
  112|  8.93k|      loaded_bytes.reset( internal::allocate_padded_buffer(len) );
  113|  8.93k|      if (!loaded_bytes) {
  ------------------
  |  Branch (113:11): [True: 6, False: 8.92k]
  ------------------
  114|      6|        return MEMALLOC;
  115|      6|      }
  116|  8.92k|      _loaded_bytes_capacity = len;
  117|  8.92k|    }
  118|  8.92k|    std::memcpy(static_cast<void *>(loaded_bytes.get()), buf, len);
  119|  8.92k|  }
  120|  8.92k|  _error = implementation->parse(realloc_if_needed ? reinterpret_cast<const uint8_t*>(loaded_bytes.get()): buf, len, provided_doc);
  ------------------
  |  Branch (120:34): [True: 8.92k, False: 0]
  ------------------
  121|       |
  122|  8.92k|  if (_error) { return _error; }
  ------------------
  |  Branch (122:7): [True: 4.39k, False: 4.52k]
  ------------------
  123|       |
  124|  4.52k|  return provided_doc.root();
  125|  8.92k|}
_ZN8simdjson3dom6parser15ensure_capacityERNS0_8documentEm:
  206|  8.93k|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|  8.93k|  if(desired_capacity < MINIMAL_DOCUMENT_CAPACITY) { desired_capacity = MINIMAL_DOCUMENT_CAPACITY; }
  ------------------
  |  Branch (209:6): [True: 6.12k, False: 2.81k]
  ------------------
  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|  8.93k|  if (simdjson_unlikely(capacity() < desired_capacity || target_document.capacity() < desired_capacity)) {
  ------------------
  |  |  120|  8.93k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 8.93k, False: 0]
  |  |  |  Branch (120:52): [True: 8.93k, False: 0]
  |  |  |  Branch (120:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  217|  8.93k|    if (desired_capacity > max_capacity()) {
  ------------------
  |  Branch (217:9): [True: 0, False: 8.93k]
  ------------------
  218|      0|      return error = CAPACITY;
  219|      0|    }
  220|  8.93k|    error_code err1 = target_document.capacity() < desired_capacity ? target_document.allocate(desired_capacity) : SUCCESS;
  ------------------
  |  Branch (220:23): [True: 8.93k, False: 0]
  ------------------
  221|  8.93k|    error_code err2 = capacity() < desired_capacity ? allocate(desired_capacity, max_depth()) : SUCCESS;
  ------------------
  |  Branch (221:23): [True: 8.93k, False: 0]
  ------------------
  222|  8.93k|    if(err1 != SUCCESS) { return error = err1; }
  ------------------
  |  Branch (222:8): [True: 0, False: 8.93k]
  ------------------
  223|  8.93k|    if(err2 != SUCCESS) { return error = err2; }
  ------------------
  |  Branch (223:8): [True: 0, False: 8.93k]
  ------------------
  224|  8.93k|  }
  225|  8.93k|  return SUCCESS;
  226|  8.93k|}
_ZNK8simdjson3dom6parser8capacityEv:
  169|  17.8k|simdjson_inline size_t parser::capacity() const noexcept {
  170|  17.8k|  return implementation ? implementation->capacity() : 0;
  ------------------
  |  Branch (170:10): [True: 0, False: 17.8k]
  ------------------
  171|  17.8k|}
_ZNK8simdjson3dom6parser12max_capacityEv:
  172|  8.93k|simdjson_inline size_t parser::max_capacity() const noexcept {
  173|  8.93k|  return _max_capacity;
  174|  8.93k|}
_ZN8simdjson3dom6parser8allocateEmm:
  180|  8.93k|inline error_code parser::allocate(size_t capacity, size_t max_depth) noexcept {
  181|       |  //
  182|       |  // Reallocate implementation if needed
  183|       |  //
  184|  8.93k|  error_code err;
  185|  8.93k|  if (implementation) {
  ------------------
  |  Branch (185:7): [True: 0, False: 8.93k]
  ------------------
  186|      0|    err = implementation->allocate(capacity, max_depth);
  187|  8.93k|  } else {
  188|  8.93k|    err = simdjson::get_active_implementation()->create_dom_parser_implementation(capacity, max_depth, implementation);
  189|  8.93k|  }
  190|  8.93k|  if (err) { return err; }
  ------------------
  |  Branch (190:7): [True: 0, False: 8.93k]
  ------------------
  191|  8.93k|  return SUCCESS;
  192|  8.93k|}
_ZNK8simdjson3dom6parser9max_depthEv:
  175|  8.93k|simdjson_inline size_t parser::max_depth() const noexcept {
  176|  8.93k|  return implementation ? implementation->max_depth() : DEFAULT_MAX_DEPTH;
  ------------------
  |  Branch (176:10): [True: 0, False: 8.93k]
  ------------------
  177|  8.93k|}

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

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

_ZN8simdjson8fallback14implementationC2Ev:
   23|      1|  ) {}

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing12parse_numberINS1_6stage211tape_writerEEENS_10error_codeEPKhRT_:
  547|   619k|simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
  548|       |
  549|       |  //
  550|       |  // Check for minus sign
  551|       |  //
  552|   619k|  bool negative = (*src == '-');
  553|   619k|  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|   619k|  const uint8_t *const start_digits = p;
  560|   619k|  uint64_t i = 0;
  561|  22.8M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (561:10): [True: 22.2M, False: 619k]
  ------------------
  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|   619k|  size_t digit_count = size_t(p - start_digits);
  566|   619k|  if (digit_count == 0 || ('0' == *start_digits && digit_count > 1)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|     63|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (566:7): [True: 19, False: 619k]
  |  Branch (566:28): [True: 218k, False: 400k]
  |  Branch (566:52): [True: 44, False: 218k]
  ------------------
  567|       |
  568|       |  //
  569|       |  // Handle floats if there is a . or e (or both)
  570|       |  //
  571|   619k|  int64_t exponent = 0;
  572|   619k|  bool is_float = false;
  573|   619k|  if ('.' == *p) {
  ------------------
  |  Branch (573:7): [True: 20.2k, False: 599k]
  ------------------
  574|  20.2k|    is_float = true;
  575|  20.2k|    ++p;
  576|  20.2k|    SIMDJSON_TRY( parse_decimal(src, p, i, exponent) );
  ------------------
  |  |  279|  20.2k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 165, False: 20.1k]
  |  |  ------------------
  ------------------
  577|  20.1k|    digit_count = int(p - start_digits); // used later to guard against overflows
  578|  20.1k|  }
  579|   619k|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (579:7): [True: 11.1k, False: 608k]
  |  Branch (579:22): [True: 10.5k, False: 597k]
  ------------------
  580|  21.7k|    is_float = true;
  581|  21.7k|    ++p;
  582|  21.7k|    SIMDJSON_TRY( parse_exponent(src, p, exponent) );
  ------------------
  |  |  279|  21.7k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 103, False: 21.6k]
  |  |  ------------------
  ------------------
  583|  21.6k|  }
  584|   619k|  if (is_float) {
  ------------------
  |  Branch (584:7): [True: 37.5k, False: 581k]
  ------------------
  585|  37.5k|    const bool dirty_end = jsoncharutils::is_not_structural_or_whitespace(*p);
  586|  37.5k|    SIMDJSON_TRY( write_float(src, negative, i, start_digits, digit_count, exponent, writer) );
  ------------------
  |  |  279|  37.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 666, False: 36.8k]
  |  |  ------------------
  ------------------
  587|  36.8k|    if (dirty_end) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|    205|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (587:9): [True: 205, False: 36.6k]
  ------------------
  588|  36.6k|    return SUCCESS;
  589|  36.8k|  }
  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|   581k|  size_t longest_digit_count = negative ? 19 : 20;
  ------------------
  |  Branch (594:32): [True: 1.54k, False: 580k]
  ------------------
  595|   581k|  if (digit_count > longest_digit_count) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|    123|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (595:7): [True: 123, False: 581k]
  ------------------
  596|   581k|  if (digit_count == longest_digit_count) {
  ------------------
  |  Branch (596:7): [True: 1.38k, False: 580k]
  ------------------
  597|  1.38k|    if (negative) {
  ------------------
  |  Branch (597:9): [True: 685, False: 695]
  ------------------
  598|       |      // Anything negative above INT64_MAX+1 is invalid
  599|    685|      if (i > uint64_t(INT64_MAX)+1) { return INVALID_NUMBER(src);  }
  ------------------
  |  |   30|     66|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (599:11): [True: 66, False: 619]
  ------------------
  600|    619|      WRITE_INTEGER(~i+1, src, writer);
  ------------------
  |  |   31|    619|#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE))
  ------------------
  601|    619|      if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|      4|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (601:11): [True: 4, False: 615]
  ------------------
  602|    615|      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|    695|    }  else if (src[0] != uint8_t('1') || i <= uint64_t(INT64_MAX)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|     81|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (615:17): [True: 7, False: 688]
  |  Branch (615:43): [True: 74, False: 614]
  ------------------
  616|  1.38k|  }
  617|       |
  618|       |  // Write unsigned if it doesn't fit in a signed integer.
  619|   580k|  if (i > uint64_t(INT64_MAX)) {
  ------------------
  |  Branch (619:7): [True: 878, False: 579k]
  ------------------
  620|    878|    WRITE_UNSIGNED(i, src, writer);
  ------------------
  |  |   32|    878|#define WRITE_UNSIGNED(VALUE, SRC, WRITER) (WRITER).append_u64((VALUE))
  ------------------
  621|   579k|  } else {
  622|   579k|    WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
  ------------------
  |  |   31|  1.15M|#define WRITE_INTEGER(VALUE, SRC, WRITER) (WRITER).append_s64((VALUE))
  |  |  ------------------
  |  |  |  Branch (31:64): [True: 839, False: 579k]
  |  |  ------------------
  ------------------
  623|   579k|  }
  624|   580k|  if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|     64|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (624:7): [True: 64, False: 580k]
  ------------------
  625|   580k|  return SUCCESS;
  626|   580k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing11parse_digitImEEbhRT_:
  365|  32.5M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  366|  32.5M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  367|  32.5M|  if (digit > 9) {
  ------------------
  |  Branch (367:7): [True: 641k, False: 31.9M]
  ------------------
  368|   641k|    return false;
  369|   641k|  }
  370|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  371|  31.9M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  372|  31.9M|  return true;
  373|  32.5M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing13parse_decimalEPKhRS4_RmRl:
  375|  20.2k|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|  20.2k|  const uint8_t *const first_after_period = p;
  381|       |
  382|  20.2k|#ifdef SIMDJSON_SWAR_NUMBER_PARSING
  383|  20.2k|#if SIMDJSON_SWAR_NUMBER_PARSING
  384|       |  // this helps if we have lots of decimals!
  385|       |  // this turns out to be frequent enough.
  386|  20.2k|  if (is_made_of_eight_digits_fast(p)) {
  ------------------
  |  Branch (386:7): [True: 16.7k, False: 3.54k]
  ------------------
  387|  16.7k|    i = i * 100000000 + parse_eight_digits_unrolled(p);
  388|  16.7k|    p += 8;
  389|  16.7k|  }
  390|  20.2k|#endif // SIMDJSON_SWAR_NUMBER_PARSING
  391|  20.2k|#endif // #ifdef SIMDJSON_SWAR_NUMBER_PARSING
  392|       |  // Unrolling the first digit makes a small difference on some implementations (e.g. westmere)
  393|  20.2k|  if (parse_digit(*p, i)) { ++p; }
  ------------------
  |  Branch (393:7): [True: 18.9k, False: 1.33k]
  ------------------
  394|  9.70M|  while (parse_digit(*p, i)) { p++; }
  ------------------
  |  Branch (394:10): [True: 9.68M, False: 20.2k]
  ------------------
  395|  20.2k|  exponent = first_after_period - p;
  396|       |  // Decimal without digits (123.) is illegal
  397|  20.2k|  if (exponent == 0) {
  ------------------
  |  Branch (397:7): [True: 165, False: 20.1k]
  ------------------
  398|    165|    return INVALID_NUMBER(src);
  ------------------
  |  |   30|    165|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  399|    165|  }
  400|  20.1k|  return SUCCESS;
  401|  20.2k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing28is_made_of_eight_digits_fastEPKh:
  338|  20.2k|simdjson_inline bool is_made_of_eight_digits_fast(const uint8_t *chars) {
  339|  20.2k|  uint64_t val;
  340|       |  // this can read up to 7 bytes beyond the buffer size, but we require
  341|       |  // SIMDJSON_PADDING of padding
  342|  20.2k|  static_assert(7 <= SIMDJSON_PADDING, "SIMDJSON_PADDING must be bigger than 7");
  343|  20.2k|  std::memcpy(&val, chars, 8);
  344|       |  // a branchy method might be faster:
  345|       |  // return (( val & 0xF0F0F0F0F0F0F0F0 ) == 0x3030303030303030)
  346|       |  //  && (( (val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0 ) ==
  347|       |  //  0x3030303030303030);
  348|  20.2k|  return (((val & 0xF0F0F0F0F0F0F0F0) |
  349|  20.2k|           (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) ==
  350|  20.2k|          0x3333333333333333);
  351|  20.2k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing14parse_exponentEPKhRS4_Rl:
  403|  21.7k|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|  21.7k|  bool neg_exp = ('-' == *p);
  406|  21.7k|  if (neg_exp || '+' == *p) { p++; } // Skip + as well
  ------------------
  |  Branch (406:7): [True: 3.84k, False: 17.8k]
  |  Branch (406:18): [True: 585, False: 17.2k]
  ------------------
  407|       |
  408|       |  // Exponent: -123.456e-[78]
  409|  21.7k|  auto start_exp = p;
  410|  21.7k|  int64_t exp_number = 0;
  411|  4.75M|  while (parse_digit(*p, exp_number)) { ++p; }
  ------------------
  |  Branch (411:10): [True: 4.72M, False: 21.7k]
  ------------------
  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|  21.7k|  if (simdjson_unlikely(p == start_exp)) {
  ------------------
  |  |  120|  21.7k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 103, False: 21.6k]
  |  |  ------------------
  ------------------
  424|    103|    return INVALID_NUMBER(src);
  ------------------
  |  |   30|    103|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  425|    103|  }
  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|  21.6k|  if (simdjson_unlikely(p > start_exp+18)) {
  ------------------
  |  |  120|  21.6k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 910, False: 20.7k]
  |  |  ------------------
  ------------------
  432|       |    // Skip leading zeroes: 1e000000000000000000001 is technically valid and doesn't overflow
  433|   122k|    while (*start_exp == '0') { start_exp++; }
  ------------------
  |  Branch (433:12): [True: 121k, False: 910]
  ------------------
  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|    910|    if (p > start_exp+18) { exp_number = 999999999999999999; }
  ------------------
  |  Branch (443:9): [True: 496, False: 414]
  ------------------
  444|    910|  }
  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|  21.6k|  exponent += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (450:16): [True: 3.83k, False: 17.7k]
  ------------------
  451|  21.6k|  return SUCCESS;
  452|  21.7k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing11parse_digitIlEEbhRT_:
  365|  4.75M|simdjson_inline bool parse_digit(const uint8_t c, I &i) {
  366|  4.75M|  const uint8_t digit = static_cast<uint8_t>(c - '0');
  367|  4.75M|  if (digit > 9) {
  ------------------
  |  Branch (367:7): [True: 21.7k, False: 4.72M]
  ------------------
  368|  21.7k|    return false;
  369|  21.7k|  }
  370|       |  // PERF NOTE: multiplication by 10 is cheaper than arbitrary integer multiplication
  371|  4.72M|  i = 10 * i + digit; // might overflow, we will handle the overflow later
  372|  4.72M|  return true;
  373|  4.75M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing11write_floatINS1_6stage211tape_writerEEENS_10error_codeEPKhbmS8_mlRT_:
  464|  37.5k|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|  37.5k|  if (simdjson_unlikely(digit_count > 19 && significant_digits(start_digits, digit_count) > 19)) {
  ------------------
  |  |  120|  54.1k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 16.3k, False: 21.2k]
  |  |  |  Branch (120:52): [True: 16.5k, False: 21.0k]
  |  |  |  Branch (120:52): [True: 16.3k, False: 239]
  |  |  ------------------
  ------------------
  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|  16.3k|    error_code error = slow_float_parsing(src, writer);
  486|  16.3k|    writer.skip_double();
  487|  16.3k|    return error;
  488|  16.3k|  }
  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|  21.2k|  if (simdjson_unlikely(exponent < simdjson::internal::smallest_power) || (exponent > simdjson::internal::largest_power)) {
  ------------------
  |  |  120|  42.5k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 665, False: 20.5k]
  |  |  ------------------
  ------------------
  |  Branch (492:75): [True: 1.28k, False: 19.3k]
  ------------------
  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|  1.94k|    static_assert(simdjson::internal::smallest_power <= -342, "smallest_power is not small enough");
  498|       |    //
  499|  1.94k|    if((exponent < simdjson::internal::smallest_power) || (i == 0)) {
  ------------------
  |  Branch (499:8): [True: 665, False: 1.28k]
  |  Branch (499:59): [True: 909, False: 373]
  ------------------
  500|       |      // E.g. Parse "-0.0e-999" into the same value as "-0.0". See https://en.wikipedia.org/wiki/Signed_zero
  501|  1.57k|      WRITE_DOUBLE(negative ? -0.0 : 0.0, src, writer);
  ------------------
  |  |   33|  3.14k|#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE))
  |  |  ------------------
  |  |  |  Branch (33:66): [True: 5, False: 1.56k]
  |  |  ------------------
  ------------------
  502|  1.57k|      return SUCCESS;
  503|  1.57k|    } else { // (exponent > largest_power) and (i != 0)
  504|       |      // We have, for sure, an infinite value and simdjson refuses to parse infinite values.
  505|    373|      return INVALID_NUMBER(src);
  ------------------
  |  |   30|    373|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  506|    373|    }
  507|  1.94k|  }
  508|  19.3k|  double d;
  509|  19.3k|  if (!compute_float_64(exponent, i, negative, d)) {
  ------------------
  |  Branch (509:7): [True: 162, False: 19.1k]
  ------------------
  510|       |    // we are almost never going to get here.
  511|    162|    if (!parse_float_fallback(src, &d)) { return INVALID_NUMBER(src); }
  ------------------
  |  |   30|    162|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  |  Branch (511:9): [True: 162, False: 0]
  ------------------
  512|    162|  }
  513|  19.1k|  WRITE_DOUBLE(d, src, writer);
  ------------------
  |  |   33|  19.1k|#define WRITE_DOUBLE(VALUE, SRC, WRITER) (WRITER).append_double((VALUE))
  ------------------
  514|  19.1k|  return SUCCESS;
  515|  19.3k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing18significant_digitsEPKhm:
  454|  16.5k|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|  16.5k|  const uint8_t *start = start_digits;
  458|  4.66M|  while ((*start == '0') || (*start == '.')) { ++start; }
  ------------------
  |  Branch (458:10): [True: 4.63M, False: 25.5k]
  |  Branch (458:29): [True: 9.01k, False: 16.5k]
  ------------------
  459|       |  // we over-decrement by one when there is a '.'
  460|  16.5k|  return digit_count - size_t(start - start_digits);
  461|  16.5k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing18slow_float_parsingINS1_6stage211tape_writerEEENS_10error_codeEPKhT_:
  354|  16.3k|error_code slow_float_parsing(simdjson_unused const uint8_t * src, W writer) {
  355|  16.3k|  double d;
  356|  16.3k|  if (parse_float_fallback(src, &d)) {
  ------------------
  |  Branch (356:7): [True: 16.1k, False: 131]
  ------------------
  357|  16.1k|    writer.append_double(d);
  358|  16.1k|    return SUCCESS;
  359|  16.1k|  }
  360|    131|  return INVALID_NUMBER(src);
  ------------------
  |  |   30|    131|#define INVALID_NUMBER(SRC) (NUMBER_ERROR)
  ------------------
  361|  16.3k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing16compute_float_64ElmbRd:
   55|  19.3k|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|  19.3k|  if (-22 <= power && power <= 22 && i <= 9007199254740991) {
  ------------------
  |  Branch (67:7): [True: 17.5k, False: 1.77k]
  |  Branch (67:23): [True: 13.5k, False: 3.97k]
  |  Branch (67:38): [True: 11.7k, False: 1.82k]
  ------------------
   68|  11.7k|#endif
   69|       |    // convert the integer into a double. This is lossless since
   70|       |    // 0 <= i <= 2^53 - 1.
   71|  11.7k|    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|  11.7k|    if (power < 0) {
  ------------------
  |  Branch (82:9): [True: 6.72k, False: 5.00k]
  ------------------
   83|  6.72k|      d = d / simdjson::internal::power_of_ten[-power];
   84|  6.72k|    } else {
   85|  5.00k|      d = d * simdjson::internal::power_of_ten[power];
   86|  5.00k|    }
   87|  11.7k|    if (negative) {
  ------------------
  |  Branch (87:9): [True: 2.50k, False: 9.22k]
  ------------------
   88|  2.50k|      d = -d;
   89|  2.50k|    }
   90|  11.7k|    return true;
   91|  11.7k|  }
   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|  7.57k|  if(i == 0) {
  ------------------
  |  Branch (114:6): [True: 425, False: 7.14k]
  ------------------
  115|    425|    d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (115:9): [True: 6, False: 419]
  ------------------
  116|    425|    return true;
  117|    425|  }
  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|  7.14k|  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|  7.14k|  int lz = leading_zeroes(i);
  151|  7.14k|  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|  7.14k|  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|  7.14k|  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|  7.14k|  if((firstproduct.high & 0x1FF) == 0x1FF) {
  ------------------
  |  Branch (184:6): [True: 1.74k, False: 5.40k]
  ------------------
  185|       |    // We want to compute i * 5^q, but only care about the top 55 bits at most.
  186|       |    // Consider the scenario where q>=0. Then 5^q may not fit in 64-bits. Doing
  187|       |    // the full computation is wasteful. So we do what is called a "truncated
  188|       |    // multiplication".
  189|       |    // We take the most significant 64-bits, and we put them in
  190|       |    // power_of_five_128[index]. Usually, that's good enough to approximate i * 5^q
  191|       |    // to the desired approximation using one multiplication. Sometimes it does not suffice.
  192|       |    // Then we store the next most significant 64 bits in power_of_five_128[index + 1], and
  193|       |    // then we get a better approximation to i * 5^q. In very rare cases, even that
  194|       |    // will not suffice, though it is seemingly very hard to find such a scenario.
  195|       |    //
  196|       |    // That's for when q>=0. The logic for q<0 is somewhat similar but it is somewhat
  197|       |    // more complicated.
  198|       |    //
  199|       |    // There is an extra layer of complexity in that we need more than 55 bits of
  200|       |    // accuracy in the round-to-even scenario.
  201|       |    //
  202|       |    // The full_multiplication function computes the 128-bit product of two 64-bit words
  203|       |    // with a returned value of type value128 with a "low component" corresponding to the
  204|       |    // 64-bit least significant bits of the product and with a "high component" corresponding
  205|       |    // to the 64-bit most significant bits of the product.
  206|  1.74k|    simdjson::internal::value128 secondproduct = jsoncharutils::full_multiplication(i, simdjson::internal::power_of_five_128[index + 1]);
  207|  1.74k|    firstproduct.low += secondproduct.high;
  208|  1.74k|    if(secondproduct.high > firstproduct.low) { firstproduct.high++; }
  ------------------
  |  Branch (208:8): [True: 936, False: 804]
  ------------------
  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.74k|    if(simdjson_unlikely(firstproduct.low  == 0xFFFFFFFFFFFFFFFF)) {
  ------------------
  |  |  120|  1.74k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 1.74k]
  |  |  ------------------
  ------------------
  212|       |      // This is very unlikely, but if so, we need to do much more work!
  213|      0|      return false;
  214|      0|    }
  215|  1.74k|  }
  216|  7.14k|  uint64_t lower = firstproduct.low;
  217|  7.14k|  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|  7.14k|  uint64_t upperbit = upper >> 63;
  222|  7.14k|  uint64_t mantissa = upper >> (upperbit + 9);
  223|  7.14k|  lz += int(1 ^ upperbit);
  224|       |
  225|       |  // Here we have mantissa < (1<<54).
  226|  7.14k|  int64_t real_exponent = exponent - lz;
  227|  7.14k|  if (simdjson_unlikely(real_exponent <= 0)) { // we have a subnormal?
  ------------------
  |  |  120|  7.14k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 1.16k, False: 5.97k]
  |  |  ------------------
  ------------------
  228|       |    // Here have that real_exponent <= 0 so -real_exponent >= 0
  229|  1.16k|    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: 421, False: 747]
  ------------------
  230|    421|      d = negative ? -0.0 : 0.0;
  ------------------
  |  Branch (230:11): [True: 9, False: 412]
  ------------------
  231|    421|      return true;
  232|    421|    }
  233|       |    // next line is safe because -real_exponent + 1 < 0
  234|    747|    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|    747|    mantissa += (mantissa & 1); // round up
  238|    747|    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|    747|    real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1;
  ------------------
  |  Branch (246:21): [True: 744, False: 3]
  ------------------
  247|    747|    d = to_double(mantissa, real_exponent, negative);
  248|    747|    return true;
  249|  1.16k|  }
  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|  5.97k|  if (simdjson_unlikely((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1))) {
  ------------------
  |  |  120|  24.3k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 1.25k, False: 4.72k]
  |  |  |  Branch (120:52): [True: 2.72k, False: 3.25k]
  |  |  |  Branch (120:52): [True: 2.09k, False: 629]
  |  |  |  Branch (120:52): [True: 1.63k, False: 465]
  |  |  |  Branch (120:52): [True: 1.25k, False: 376]
  |  |  ------------------
  ------------------
  273|  1.25k|    if((mantissa  << (upperbit + 64 - 53 - 2)) ==  upper) {
  ------------------
  |  Branch (273:8): [True: 474, False: 784]
  ------------------
  274|    474|      mantissa &= ~1;             // flip it so that we do not round up
  275|    474|    }
  276|  1.25k|  }
  277|       |
  278|  5.97k|  mantissa += mantissa & 1;
  279|  5.97k|  mantissa >>= 1;
  280|       |
  281|       |  // Here we have mantissa < (1<<53), unless there was an overflow
  282|  5.97k|  if (mantissa >= (1ULL << 53)) {
  ------------------
  |  Branch (282:7): [True: 396, False: 5.58k]
  ------------------
  283|       |    //////////
  284|       |    // This will happen when parsing values such as 7.2057594037927933e+16
  285|       |    ////////
  286|    396|    mantissa = (1ULL << 52);
  287|    396|    real_exponent++;
  288|    396|  }
  289|  5.97k|  mantissa &= ~(1ULL << 52);
  290|       |  // we have to check that real_exponent is in range, otherwise we bail out
  291|  5.97k|  if (simdjson_unlikely(real_exponent > 2046)) {
  ------------------
  |  |  120|  5.97k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 162, False: 5.81k]
  |  |  ------------------
  ------------------
  292|       |    // We have an infinite value!!! We could actually throw an error here if we could.
  293|    162|    return false;
  294|    162|  }
  295|  5.81k|  d = to_double(mantissa, real_exponent, negative);
  296|  5.81k|  return true;
  297|  5.97k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing12_GLOBAL__N_19to_doubleEmmb:
   40|  6.56k|simdjson_inline double to_double(uint64_t mantissa, uint64_t real_exponent, bool negative) {
   41|  6.56k|    double d;
   42|  6.56k|    mantissa &= ~(1ULL << 52);
   43|  6.56k|    mantissa |= real_exponent << 52;
   44|  6.56k|    mantissa |= ((static_cast<uint64_t>(negative)) << 63);
   45|  6.56k|    std::memcpy(&d, &mantissa, sizeof(d));
   46|  6.56k|    return d;
   47|  6.56k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_113numberparsing20parse_float_fallbackEPKhPd:
  306|  16.4k|static bool parse_float_fallback(const uint8_t *ptr, double *outDouble) {
  307|  16.4k|  *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|  16.4k|  return !(*outDouble > (std::numeric_limits<double>::max)() || *outDouble < std::numeric_limits<double>::lowest());
  ------------------
  |  Branch (318:12): [True: 284, False: 16.1k]
  |  Branch (318:65): [True: 9, False: 16.1k]
  ------------------
  319|  16.4k|}

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

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

_ZN8simdjson7haswell14implementationC2Ev:
   21|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_127parse_eight_digits_unrolledEPKh:
    8|  16.7k|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|  16.7k|  const __m128i ascii0 = _mm_set1_epi8('0');
   11|  16.7k|  const __m128i mul_1_10 =
   12|  16.7k|      _mm_setr_epi8(10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1);
   13|  16.7k|  const __m128i mul_1_100 = _mm_setr_epi16(100, 1, 100, 1, 100, 1, 100, 1);
   14|  16.7k|  const __m128i mul_1_10000 =
   15|  16.7k|      _mm_setr_epi16(10000, 1, 10000, 1, 10000, 1, 10000, 1);
   16|  16.7k|  const __m128i input = _mm_sub_epi8(
   17|  16.7k|      _mm_loadu_si128(reinterpret_cast<const __m128i *>(chars)), ascii0);
   18|  16.7k|  const __m128i t1 = _mm_maddubs_epi16(input, mul_1_10);
   19|  16.7k|  const __m128i t2 = _mm_madd_epi16(t1, mul_1_100);
   20|  16.7k|  const __m128i t3 = _mm_packus_epi32(t2, t2);
   21|  16.7k|  const __m128i t4 = _mm_madd_epi16(t3, mul_1_10000);
   22|  16.7k|  return _mm_cvtsi128_si32(
   23|  16.7k|      t4); // only captures the sum of the first 8 digits, drop the rest
   24|  16.7k|}

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

_ZN8simdjson7icelake14implementationC2Ev:
   21|      1|  ) {}

_ZN8simdjson8internal10atomic_ptrIKNS_14implementationEEptEv:
  230|  8.93k|  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|  8.92k|simdjson_inline size_t dom_parser_implementation::capacity() const noexcept {
  229|  8.92k|  return _capacity;
  230|  8.92k|}
_ZNK8simdjson8internal25dom_parser_implementation9max_depthEv:
  232|  19.7k|simdjson_inline size_t dom_parser_implementation::max_depth() const noexcept {
  233|  19.7k|  return _max_depth;
  234|  19.7k|}
_ZN8simdjson12is_streamingENS_11stage1_modeE:
   27|  17.8k|inline bool is_streaming(stage1_mode mode) {
   28|       |  // performance note: it is probably faster to check that mode is different
   29|       |  // from regular than checking that it is either streaming_partial or streaming_final.
   30|  17.8k|  return (mode != stage1_mode::regular);
   31|       |  // return (mode == stage1_mode::streaming_partial || mode == stage1_mode::streaming_final);
   32|  17.8k|}
_ZN8simdjson8internal25dom_parser_implementationC2Ev:
  224|  8.93k|simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept = default;
_ZN8simdjson8internal25dom_parser_implementationD2Ev:
  166|  8.93k|  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|  13.3k|simdjson_inline tape_ref::tape_ref() noexcept : doc{nullptr}, json_index{0} {}
_ZN8simdjson8internal8tape_refC2EPKNS_3dom8documentEm:
   14|  4.52k|simdjson_inline tape_ref::tape_ref(const dom::document *_doc, size_t _json_index) noexcept : doc{_doc}, json_index{_json_index} {}

_ZN8simdjson8internal22allocate_padded_bufferEm:
   21|  8.93k|inline char *allocate_padded_buffer(size_t length) noexcept {
   22|  8.93k|  const size_t totalpaddedlength = length + SIMDJSON_PADDING;
   23|  8.93k|  if(totalpaddedlength<length) {
  ------------------
  |  Branch (23:6): [True: 0, False: 8.93k]
  ------------------
   24|       |    // overflow
   25|      0|    return nullptr;
   26|      0|  }
   27|  8.93k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   28|       |  // avoid getting out of memory
   29|  8.93k|  if (totalpaddedlength>(1UL<<20)) {
  ------------------
  |  Branch (29:7): [True: 6, False: 8.92k]
  ------------------
   30|      6|    return nullptr;
   31|      6|  }
   32|  8.92k|#endif
   33|       |
   34|  8.92k|  char *padded_buffer = new (std::nothrow) char[totalpaddedlength];
   35|  8.92k|  if (padded_buffer == nullptr) {
  ------------------
  |  Branch (35:7): [True: 0, False: 8.92k]
  ------------------
   36|      0|    return nullptr;
   37|      0|  }
   38|       |  // We write nulls in the padded region to avoid having uninitialized
   39|       |  // content which may trigger warning for some sanitizers
   40|  8.92k|  std::memset(padded_buffer + length, 0, totalpaddedlength - length);
   41|  8.92k|  return padded_buffer;
   42|  8.92k|} // 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.7M|bool is_integer(char c)  noexcept  { return (c >= '0' && c <= '9'); }
  ------------------
  |  Branch (59:46): [True: 17.6M, False: 27.5k]
  |  Branch (59:58): [True: 17.6M, False: 7.56k]
  ------------------
_ZN8simdjson8internal13parse_decimalERPKc:
   62|  16.4k|decimal parse_decimal(const char *&p) noexcept {
   63|  16.4k|  decimal answer;
   64|  16.4k|  answer.num_digits = 0;
   65|  16.4k|  answer.decimal_point = 0;
   66|  16.4k|  answer.truncated = false;
   67|  16.4k|  answer.negative = (*p == '-');
   68|  16.4k|  if ((*p == '-') || (*p == '+')) {
  ------------------
  |  Branch (68:7): [True: 0, False: 16.4k]
  |  Branch (68:22): [True: 0, False: 16.4k]
  ------------------
   69|      0|    ++p;
   70|      0|  }
   71|       |
   72|  21.4k|  while (*p == '0') {
  ------------------
  |  Branch (72:10): [True: 4.93k, False: 16.4k]
  ------------------
   73|  4.93k|    ++p;
   74|  4.93k|  }
   75|  8.37M|  while (is_integer(*p)) {
  ------------------
  |  Branch (75:10): [True: 8.36M, False: 16.4k]
  ------------------
   76|  8.36M|    if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (76:9): [True: 203k, False: 8.15M]
  ------------------
   77|   203k|      answer.digits[answer.num_digits] = uint8_t(*p - '0');
   78|   203k|    }
   79|  8.36M|    answer.num_digits++;
   80|  8.36M|    ++p;
   81|  8.36M|  }
   82|  16.4k|  if (*p == '.') {
  ------------------
  |  Branch (82:7): [True: 11.3k, False: 5.09k]
  ------------------
   83|  11.3k|    ++p;
   84|  11.3k|    const char *first_after_period = p;
   85|       |    // if we have not yet encountered a zero, we have to skip it as well
   86|  11.3k|    if (answer.num_digits == 0) {
  ------------------
  |  Branch (86:9): [True: 4.93k, False: 6.44k]
  ------------------
   87|       |      // skip zeros
   88|   432k|      while (*p == '0') {
  ------------------
  |  Branch (88:14): [True: 427k, False: 4.93k]
  ------------------
   89|   427k|        ++p;
   90|   427k|      }
   91|  4.93k|    }
   92|  9.27M|    while (is_integer(*p)) {
  ------------------
  |  Branch (92:12): [True: 9.26M, False: 11.3k]
  ------------------
   93|  9.26M|      if (answer.num_digits < max_digits) {
  ------------------
  |  Branch (93:11): [True: 656k, False: 8.60M]
  ------------------
   94|   656k|        answer.digits[answer.num_digits] = uint8_t(*p - '0');
   95|   656k|      }
   96|  9.26M|      answer.num_digits++;
   97|  9.26M|      ++p;
   98|  9.26M|    }
   99|  11.3k|    answer.decimal_point = int32_t(first_after_period - p);
  100|  11.3k|  }
  101|  16.4k|  if(answer.num_digits > 0) {
  ------------------
  |  Branch (101:6): [True: 16.3k, False: 82]
  ------------------
  102|  16.3k|    const char *preverse = p - 1;
  103|  16.3k|    int32_t trailing_zeros = 0;
  104|   547k|    while ((*preverse == '0') || (*preverse == '.')) {
  ------------------
  |  Branch (104:12): [True: 529k, False: 17.3k]
  |  Branch (104:34): [True: 979, False: 16.3k]
  ------------------
  105|   530k|      if(*preverse == '0') { trailing_zeros++; };
  ------------------
  |  Branch (105:10): [True: 529k, False: 979]
  ------------------
  106|   530k|      --preverse;
  107|   530k|    }
  108|  16.3k|    answer.decimal_point += int32_t(answer.num_digits);
  109|  16.3k|    answer.num_digits -= uint32_t(trailing_zeros);
  110|  16.3k|  }
  111|  16.4k|  if(answer.num_digits > max_digits ) {
  ------------------
  |  Branch (111:6): [True: 525, False: 15.9k]
  ------------------
  112|    525|    answer.num_digits = max_digits;
  113|    525|    answer.truncated = true;
  114|    525|  }
  115|  16.4k|  if (('e' == *p) || ('E' == *p)) {
  ------------------
  |  Branch (115:7): [True: 5.47k, False: 10.9k]
  |  Branch (115:22): [True: 1.81k, False: 9.18k]
  ------------------
  116|  7.29k|    ++p;
  117|  7.29k|    bool neg_exp = false;
  118|  7.29k|    if ('-' == *p) {
  ------------------
  |  Branch (118:9): [True: 975, False: 6.31k]
  ------------------
  119|    975|      neg_exp = true;
  120|    975|      ++p;
  121|  6.31k|    } else if ('+' == *p) {
  ------------------
  |  Branch (121:16): [True: 194, False: 6.12k]
  ------------------
  122|    194|      ++p;
  123|    194|    }
  124|  7.29k|    int32_t exp_number = 0; // exponential part
  125|  58.2k|    while (is_integer(*p)) {
  ------------------
  |  Branch (125:12): [True: 50.9k, False: 7.29k]
  ------------------
  126|  50.9k|      uint8_t digit = uint8_t(*p - '0');
  127|  50.9k|      if (exp_number < 0x10000) {
  ------------------
  |  Branch (127:11): [True: 29.0k, False: 21.8k]
  ------------------
  128|  29.0k|        exp_number = 10 * exp_number + digit;
  129|  29.0k|      }
  130|  50.9k|      ++p;
  131|  50.9k|    }
  132|  7.29k|    answer.decimal_point += (neg_exp ? -exp_number : exp_number);
  ------------------
  |  Branch (132:30): [True: 975, False: 6.31k]
  ------------------
  133|  7.29k|  }
  134|  16.4k|  return answer;
  135|  16.4k|}
_ZN8simdjson8internal5roundERNS0_7decimalE:
  323|  17.0k|uint64_t round(decimal &h) {
  324|  17.0k|  if ((h.num_digits == 0) || (h.decimal_point < 0)) {
  ------------------
  |  Branch (324:7): [True: 0, False: 17.0k]
  |  Branch (324:30): [True: 202, False: 16.8k]
  ------------------
  325|    202|    return 0;
  326|  16.8k|  } else if (h.decimal_point > 18) {
  ------------------
  |  Branch (326:14): [True: 0, False: 16.8k]
  ------------------
  327|      0|    return UINT64_MAX;
  328|      0|  }
  329|       |  // at this point, we know that h.decimal_point >= 0
  330|  16.8k|  uint32_t dp = uint32_t(h.decimal_point);
  331|  16.8k|  uint64_t n = 0;
  332|   283k|  for (uint32_t i = 0; i < dp; i++) {
  ------------------
  |  Branch (332:24): [True: 266k, False: 16.8k]
  ------------------
  333|   266k|    n = (10 * n) + ((i < h.num_digits) ? h.digits[i] : 0);
  ------------------
  |  Branch (333:21): [True: 263k, False: 2.88k]
  ------------------
  334|   266k|  }
  335|  16.8k|  bool round_up = false;
  336|  16.8k|  if (dp < h.num_digits) {
  ------------------
  |  Branch (336:7): [True: 15.8k, False: 1.01k]
  ------------------
  337|  15.8k|    round_up = h.digits[dp] >= 5; // normally, we round up
  338|       |    // but we may need to round to even!
  339|  15.8k|    if ((h.digits[dp] == 5) && (dp + 1 == h.num_digits)) {
  ------------------
  |  Branch (339:9): [True: 5.35k, False: 10.5k]
  |  Branch (339:32): [True: 645, False: 4.70k]
  ------------------
  340|    645|      round_up = h.truncated || ((dp > 0) && (1 & h.digits[dp - 1]));
  ------------------
  |  Branch (340:18): [True: 381, False: 264]
  |  Branch (340:34): [True: 264, False: 0]
  |  Branch (340:46): [True: 190, False: 74]
  ------------------
  341|    645|    }
  342|  15.8k|  }
  343|  16.8k|  if (round_up) {
  ------------------
  |  Branch (343:7): [True: 12.3k, False: 4.57k]
  ------------------
  344|  12.3k|    n++;
  345|  12.3k|  }
  346|  16.8k|  return n;
  347|  17.0k|}
_ZN8simdjson8internal18decimal_left_shiftERNS0_7decimalEj:
  350|  44.3k|void decimal_left_shift(decimal &h, uint32_t shift) {
  351|  44.3k|  if (h.num_digits == 0) {
  ------------------
  |  Branch (351:7): [True: 0, False: 44.3k]
  ------------------
  352|      0|    return;
  353|      0|  }
  354|  44.3k|  uint32_t num_new_digits = number_of_digits_decimal_left_shift(h, shift);
  355|  44.3k|  int32_t read_index = int32_t(h.num_digits - 1);
  356|  44.3k|  uint32_t write_index = h.num_digits - 1 + num_new_digits;
  357|  44.3k|  uint64_t n = 0;
  358|       |
  359|  4.73M|  while (read_index >= 0) {
  ------------------
  |  Branch (359:10): [True: 4.68M, False: 44.3k]
  ------------------
  360|  4.68M|    n += uint64_t(h.digits[read_index]) << shift;
  361|  4.68M|    uint64_t quotient = n / 10;
  362|  4.68M|    uint64_t remainder = n - (10 * quotient);
  363|  4.68M|    if (write_index < max_digits) {
  ------------------
  |  Branch (363:9): [True: 4.68M, False: 3.95k]
  ------------------
  364|  4.68M|      h.digits[write_index] = uint8_t(remainder);
  365|  4.68M|    } else if (remainder > 0) {
  ------------------
  |  Branch (365:16): [True: 3.20k, False: 745]
  ------------------
  366|  3.20k|      h.truncated = true;
  367|  3.20k|    }
  368|  4.68M|    n = quotient;
  369|  4.68M|    write_index--;
  370|  4.68M|    read_index--;
  371|  4.68M|  }
  372|   464k|  while (n > 0) {
  ------------------
  |  Branch (372:10): [True: 420k, False: 44.3k]
  ------------------
  373|   420k|    uint64_t quotient = n / 10;
  374|   420k|    uint64_t remainder = n - (10 * quotient);
  375|   420k|    if (write_index < max_digits) {
  ------------------
  |  Branch (375:9): [True: 420k, False: 0]
  ------------------
  376|   420k|      h.digits[write_index] = uint8_t(remainder);
  377|   420k|    } else if (remainder > 0) {
  ------------------
  |  Branch (377:16): [True: 0, False: 0]
  ------------------
  378|      0|      h.truncated = true;
  379|      0|    }
  380|   420k|    n = quotient;
  381|   420k|    write_index--;
  382|   420k|  }
  383|  44.3k|  h.num_digits += num_new_digits;
  384|  44.3k|  if (h.num_digits > max_digits) {
  ------------------
  |  Branch (384:7): [True: 287, False: 44.0k]
  ------------------
  385|    287|    h.num_digits = max_digits;
  386|    287|  }
  387|  44.3k|  h.decimal_point += int32_t(num_new_digits);
  388|  44.3k|  trim(h);
  389|  44.3k|}
_ZN8simdjson8internal19decimal_right_shiftERNS0_7decimalEj:
  392|  28.8k|void decimal_right_shift(decimal &h, uint32_t shift) {
  393|  28.8k|  uint32_t read_index = 0;
  394|  28.8k|  uint32_t write_index = 0;
  395|       |
  396|  28.8k|  uint64_t n = 0;
  397|       |
  398|   388k|  while ((n >> shift) == 0) {
  ------------------
  |  Branch (398:10): [True: 360k, False: 27.3k]
  ------------------
  399|   360k|    if (read_index < h.num_digits) {
  ------------------
  |  Branch (399:9): [True: 359k, False: 1.42k]
  ------------------
  400|   359k|      n = (10 * n) + h.digits[read_index++];
  401|   359k|    } else if (n == 0) {
  ------------------
  |  Branch (401:16): [True: 0, False: 1.42k]
  ------------------
  402|      0|      return;
  403|  1.42k|    } else {
  404|  7.84k|      while ((n >> shift) == 0) {
  ------------------
  |  Branch (404:14): [True: 6.42k, False: 1.42k]
  ------------------
  405|  6.42k|        n = 10 * n;
  406|  6.42k|        read_index++;
  407|  6.42k|      }
  408|  1.42k|      break;
  409|  1.42k|    }
  410|   360k|  }
  411|  28.8k|  h.decimal_point -= int32_t(read_index - 1);
  412|  28.8k|  if (h.decimal_point < -decimal_point_range) { // it is zero
  ------------------
  |  Branch (412:7): [True: 0, False: 28.8k]
  ------------------
  413|      0|    h.num_digits = 0;
  414|      0|    h.decimal_point = 0;
  415|      0|    h.negative = false;
  416|      0|    h.truncated = false;
  417|      0|    return;
  418|      0|  }
  419|  28.8k|  uint64_t mask = (uint64_t(1) << shift) - 1;
  420|  3.37M|  while (read_index < h.num_digits) {
  ------------------
  |  Branch (420:10): [True: 3.34M, False: 28.8k]
  ------------------
  421|  3.34M|    uint8_t new_digit = uint8_t(n >> shift);
  422|  3.34M|    n = (10 * (n & mask)) + h.digits[read_index++];
  423|  3.34M|    h.digits[write_index++] = new_digit;
  424|  3.34M|  }
  425|  1.08M|  while (n > 0) {
  ------------------
  |  Branch (425:10): [True: 1.05M, False: 28.8k]
  ------------------
  426|  1.05M|    uint8_t new_digit = uint8_t(n >> shift);
  427|  1.05M|    n = 10 * (n & mask);
  428|  1.05M|    if (write_index < max_digits) {
  ------------------
  |  Branch (428:9): [True: 1.05M, False: 6.82k]
  ------------------
  429|  1.05M|      h.digits[write_index++] = new_digit;
  430|  1.05M|    } else if (new_digit > 0) {
  ------------------
  |  Branch (430:16): [True: 6.01k, False: 810]
  ------------------
  431|  6.01k|      h.truncated = true;
  432|  6.01k|    }
  433|  1.05M|  }
  434|  28.8k|  h.num_digits = write_index;
  435|  28.8k|  trim(h);
  436|  28.8k|}
_ZN8simdjson8internal10from_charsEPKc:
  562|  16.4k|double from_chars(const char *first) noexcept {
  563|  16.4k|  bool negative = first[0] == '-';
  564|  16.4k|  if (negative) {
  ------------------
  |  Branch (564:7): [True: 245, False: 16.2k]
  ------------------
  565|    245|    first++;
  566|    245|  }
  567|  16.4k|  adjusted_mantissa am = parse_long_mantissa<binary_format<double>>(first);
  568|  16.4k|  uint64_t word = am.mantissa;
  569|  16.4k|  word |= uint64_t(am.power2)
  570|  16.4k|          << binary_format<double>::mantissa_explicit_bits();
  571|  16.4k|  word = negative ? word | (uint64_t(1) << binary_format<double>::sign_index())
  ------------------
  |  Branch (571:10): [True: 245, False: 16.2k]
  ------------------
  572|  16.4k|                  : word;
  573|  16.4k|  double value;
  574|  16.4k|  std::memcpy(&value, &word, sizeof(double));
  575|  16.4k|  return value;
  576|  16.4k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_135number_of_digits_decimal_left_shiftERNS0_7decimalEj:
  226|  44.3k|uint32_t number_of_digits_decimal_left_shift(decimal &h, uint32_t shift) {
  227|  44.3k|  shift &= 63;
  228|  44.3k|  const static uint16_t number_of_digits_decimal_left_shift_table[65] = {
  229|  44.3k|      0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817,
  230|  44.3k|      0x181D, 0x2024, 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067,
  231|  44.3k|      0x3073, 0x3080, 0x388E, 0x389C, 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF,
  232|  44.3k|      0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169, 0x5180, 0x5998, 0x59B0,
  233|  44.3k|      0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B, 0x72AA,
  234|  44.3k|      0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC,
  235|  44.3k|      0x8C02, 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C,
  236|  44.3k|      0x051C, 0x051C,
  237|  44.3k|  };
  238|  44.3k|  uint32_t x_a = number_of_digits_decimal_left_shift_table[shift];
  239|  44.3k|  uint32_t x_b = number_of_digits_decimal_left_shift_table[shift + 1];
  240|  44.3k|  uint32_t num_new_digits = x_a >> 11;
  241|  44.3k|  uint32_t pow5_a = 0x7FF & x_a;
  242|  44.3k|  uint32_t pow5_b = 0x7FF & x_b;
  243|  44.3k|  const static uint8_t
  244|  44.3k|      number_of_digits_decimal_left_shift_table_powers_of_5[0x051C] = {
  245|  44.3k|          5, 2, 5, 1, 2, 5, 6, 2, 5, 3, 1, 2, 5, 1, 5, 6, 2, 5, 7, 8, 1, 2, 5,
  246|  44.3k|          3, 9, 0, 6, 2, 5, 1, 9, 5, 3, 1, 2, 5, 9, 7, 6, 5, 6, 2, 5, 4, 8, 8,
  247|  44.3k|          2, 8, 1, 2, 5, 2, 4, 4, 1, 4, 0, 6, 2, 5, 1, 2, 2, 0, 7, 0, 3, 1, 2,
  248|  44.3k|          5, 6, 1, 0, 3, 5, 1, 5, 6, 2, 5, 3, 0, 5, 1, 7, 5, 7, 8, 1, 2, 5, 1,
  249|  44.3k|          5, 2, 5, 8, 7, 8, 9, 0, 6, 2, 5, 7, 6, 2, 9, 3, 9, 4, 5, 3, 1, 2, 5,
  250|  44.3k|          3, 8, 1, 4, 6, 9, 7, 2, 6, 5, 6, 2, 5, 1, 9, 0, 7, 3, 4, 8, 6, 3, 2,
  251|  44.3k|          8, 1, 2, 5, 9, 5, 3, 6, 7, 4, 3, 1, 6, 4, 0, 6, 2, 5, 4, 7, 6, 8, 3,
  252|  44.3k|          7, 1, 5, 8, 2, 0, 3, 1, 2, 5, 2, 3, 8, 4, 1, 8, 5, 7, 9, 1, 0, 1, 5,
  253|  44.3k|          6, 2, 5, 1, 1, 9, 2, 0, 9, 2, 8, 9, 5, 5, 0, 7, 8, 1, 2, 5, 5, 9, 6,
  254|  44.3k|          0, 4, 6, 4, 4, 7, 7, 5, 3, 9, 0, 6, 2, 5, 2, 9, 8, 0, 2, 3, 2, 2, 3,
  255|  44.3k|          8, 7, 6, 9, 5, 3, 1, 2, 5, 1, 4, 9, 0, 1, 1, 6, 1, 1, 9, 3, 8, 4, 7,
  256|  44.3k|          6, 5, 6, 2, 5, 7, 4, 5, 0, 5, 8, 0, 5, 9, 6, 9, 2, 3, 8, 2, 8, 1, 2,
  257|  44.3k|          5, 3, 7, 2, 5, 2, 9, 0, 2, 9, 8, 4, 6, 1, 9, 1, 4, 0, 6, 2, 5, 1, 8,
  258|  44.3k|          6, 2, 6, 4, 5, 1, 4, 9, 2, 3, 0, 9, 5, 7, 0, 3, 1, 2, 5, 9, 3, 1, 3,
  259|  44.3k|          2, 2, 5, 7, 4, 6, 1, 5, 4, 7, 8, 5, 1, 5, 6, 2, 5, 4, 6, 5, 6, 6, 1,
  260|  44.3k|          2, 8, 7, 3, 0, 7, 7, 3, 9, 2, 5, 7, 8, 1, 2, 5, 2, 3, 2, 8, 3, 0, 6,
  261|  44.3k|          4, 3, 6, 5, 3, 8, 6, 9, 6, 2, 8, 9, 0, 6, 2, 5, 1, 1, 6, 4, 1, 5, 3,
  262|  44.3k|          2, 1, 8, 2, 6, 9, 3, 4, 8, 1, 4, 4, 5, 3, 1, 2, 5, 5, 8, 2, 0, 7, 6,
  263|  44.3k|          6, 0, 9, 1, 3, 4, 6, 7, 4, 0, 7, 2, 2, 6, 5, 6, 2, 5, 2, 9, 1, 0, 3,
  264|  44.3k|          8, 3, 0, 4, 5, 6, 7, 3, 3, 7, 0, 3, 6, 1, 3, 2, 8, 1, 2, 5, 1, 4, 5,
  265|  44.3k|          5, 1, 9, 1, 5, 2, 2, 8, 3, 6, 6, 8, 5, 1, 8, 0, 6, 6, 4, 0, 6, 2, 5,
  266|  44.3k|          7, 2, 7, 5, 9, 5, 7, 6, 1, 4, 1, 8, 3, 4, 2, 5, 9, 0, 3, 3, 2, 0, 3,
  267|  44.3k|          1, 2, 5, 3, 6, 3, 7, 9, 7, 8, 8, 0, 7, 0, 9, 1, 7, 1, 2, 9, 5, 1, 6,
  268|  44.3k|          6, 0, 1, 5, 6, 2, 5, 1, 8, 1, 8, 9, 8, 9, 4, 0, 3, 5, 4, 5, 8, 5, 6,
  269|  44.3k|          4, 7, 5, 8, 3, 0, 0, 7, 8, 1, 2, 5, 9, 0, 9, 4, 9, 4, 7, 0, 1, 7, 7,
  270|  44.3k|          2, 9, 2, 8, 2, 3, 7, 9, 1, 5, 0, 3, 9, 0, 6, 2, 5, 4, 5, 4, 7, 4, 7,
  271|  44.3k|          3, 5, 0, 8, 8, 6, 4, 6, 4, 1, 1, 8, 9, 5, 7, 5, 1, 9, 5, 3, 1, 2, 5,
  272|  44.3k|          2, 2, 7, 3, 7, 3, 6, 7, 5, 4, 4, 3, 2, 3, 2, 0, 5, 9, 4, 7, 8, 7, 5,
  273|  44.3k|          9, 7, 6, 5, 6, 2, 5, 1, 1, 3, 6, 8, 6, 8, 3, 7, 7, 2, 1, 6, 1, 6, 0,
  274|  44.3k|          2, 9, 7, 3, 9, 3, 7, 9, 8, 8, 2, 8, 1, 2, 5, 5, 6, 8, 4, 3, 4, 1, 8,
  275|  44.3k|          8, 6, 0, 8, 0, 8, 0, 1, 4, 8, 6, 9, 6, 8, 9, 9, 4, 1, 4, 0, 6, 2, 5,
  276|  44.3k|          2, 8, 4, 2, 1, 7, 0, 9, 4, 3, 0, 4, 0, 4, 0, 0, 7, 4, 3, 4, 8, 4, 4,
  277|  44.3k|          9, 7, 0, 7, 0, 3, 1, 2, 5, 1, 4, 2, 1, 0, 8, 5, 4, 7, 1, 5, 2, 0, 2,
  278|  44.3k|          0, 0, 3, 7, 1, 7, 4, 2, 2, 4, 8, 5, 3, 5, 1, 5, 6, 2, 5, 7, 1, 0, 5,
  279|  44.3k|          4, 2, 7, 3, 5, 7, 6, 0, 1, 0, 0, 1, 8, 5, 8, 7, 1, 1, 2, 4, 2, 6, 7,
  280|  44.3k|          5, 7, 8, 1, 2, 5, 3, 5, 5, 2, 7, 1, 3, 6, 7, 8, 8, 0, 0, 5, 0, 0, 9,
  281|  44.3k|          2, 9, 3, 5, 5, 6, 2, 1, 3, 3, 7, 8, 9, 0, 6, 2, 5, 1, 7, 7, 6, 3, 5,
  282|  44.3k|          6, 8, 3, 9, 4, 0, 0, 2, 5, 0, 4, 6, 4, 6, 7, 7, 8, 1, 0, 6, 6, 8, 9,
  283|  44.3k|          4, 5, 3, 1, 2, 5, 8, 8, 8, 1, 7, 8, 4, 1, 9, 7, 0, 0, 1, 2, 5, 2, 3,
  284|  44.3k|          2, 3, 3, 8, 9, 0, 5, 3, 3, 4, 4, 7, 2, 6, 5, 6, 2, 5, 4, 4, 4, 0, 8,
  285|  44.3k|          9, 2, 0, 9, 8, 5, 0, 0, 6, 2, 6, 1, 6, 1, 6, 9, 4, 5, 2, 6, 6, 7, 2,
  286|  44.3k|          3, 6, 3, 2, 8, 1, 2, 5, 2, 2, 2, 0, 4, 4, 6, 0, 4, 9, 2, 5, 0, 3, 1,
  287|  44.3k|          3, 0, 8, 0, 8, 4, 7, 2, 6, 3, 3, 3, 6, 1, 8, 1, 6, 4, 0, 6, 2, 5, 1,
  288|  44.3k|          1, 1, 0, 2, 2, 3, 0, 2, 4, 6, 2, 5, 1, 5, 6, 5, 4, 0, 4, 2, 3, 6, 3,
  289|  44.3k|          1, 6, 6, 8, 0, 9, 0, 8, 2, 0, 3, 1, 2, 5, 5, 5, 5, 1, 1, 1, 5, 1, 2,
  290|  44.3k|          3, 1, 2, 5, 7, 8, 2, 7, 0, 2, 1, 1, 8, 1, 5, 8, 3, 4, 0, 4, 5, 4, 1,
  291|  44.3k|          0, 1, 5, 6, 2, 5, 2, 7, 7, 5, 5, 5, 7, 5, 6, 1, 5, 6, 2, 8, 9, 1, 3,
  292|  44.3k|          5, 1, 0, 5, 9, 0, 7, 9, 1, 7, 0, 2, 2, 7, 0, 5, 0, 7, 8, 1, 2, 5, 1,
  293|  44.3k|          3, 8, 7, 7, 7, 8, 7, 8, 0, 7, 8, 1, 4, 4, 5, 6, 7, 5, 5, 2, 9, 5, 3,
  294|  44.3k|          9, 5, 8, 5, 1, 1, 3, 5, 2, 5, 3, 9, 0, 6, 2, 5, 6, 9, 3, 8, 8, 9, 3,
  295|  44.3k|          9, 0, 3, 9, 0, 7, 2, 2, 8, 3, 7, 7, 6, 4, 7, 6, 9, 7, 9, 2, 5, 5, 6,
  296|  44.3k|          7, 6, 2, 6, 9, 5, 3, 1, 2, 5, 3, 4, 6, 9, 4, 4, 6, 9, 5, 1, 9, 5, 3,
  297|  44.3k|          6, 1, 4, 1, 8, 8, 8, 2, 3, 8, 4, 8, 9, 6, 2, 7, 8, 3, 8, 1, 3, 4, 7,
  298|  44.3k|          6, 5, 6, 2, 5, 1, 7, 3, 4, 7, 2, 3, 4, 7, 5, 9, 7, 6, 8, 0, 7, 0, 9,
  299|  44.3k|          4, 4, 1, 1, 9, 2, 4, 4, 8, 1, 3, 9, 1, 9, 0, 6, 7, 3, 8, 2, 8, 1, 2,
  300|  44.3k|          5, 8, 6, 7, 3, 6, 1, 7, 3, 7, 9, 8, 8, 4, 0, 3, 5, 4, 7, 2, 0, 5, 9,
  301|  44.3k|          6, 2, 2, 4, 0, 6, 9, 5, 9, 5, 3, 3, 6, 9, 1, 4, 0, 6, 2, 5,
  302|  44.3k|      };
  303|  44.3k|  const uint8_t *pow5 =
  304|  44.3k|      &number_of_digits_decimal_left_shift_table_powers_of_5[pow5_a];
  305|  44.3k|  uint32_t i = 0;
  306|  44.3k|  uint32_t n = pow5_b - pow5_a;
  307|  46.6k|  for (; i < n; i++) {
  ------------------
  |  Branch (307:10): [True: 46.2k, False: 349]
  ------------------
  308|  46.2k|    if (i >= h.num_digits) {
  ------------------
  |  Branch (308:9): [True: 196, False: 46.0k]
  ------------------
  309|    196|      return num_new_digits - 1;
  310|  46.0k|    } else if (h.digits[i] == pow5[i]) {
  ------------------
  |  Branch (310:16): [True: 2.29k, False: 43.7k]
  ------------------
  311|  2.29k|      continue;
  312|  43.7k|    } else if (h.digits[i] < pow5[i]) {
  ------------------
  |  Branch (312:16): [True: 26.3k, False: 17.3k]
  ------------------
  313|  26.3k|      return num_new_digits - 1;
  314|  26.3k|    } else {
  315|  17.3k|      return num_new_digits;
  316|  17.3k|    }
  317|  46.2k|  }
  318|    349|  return num_new_digits;
  319|  44.3k|}
simdjson.cpp:_ZN8simdjson8internal12_GLOBAL__N_14trimERNS0_7decimalE:
  220|  73.1k|inline void trim(decimal &h) {
  221|   769k|  while ((h.num_digits > 0) && (h.digits[h.num_digits - 1] == 0)) {
  ------------------
  |  Branch (221:10): [True: 769k, False: 0]
  |  Branch (221:32): [True: 696k, False: 73.1k]
  ------------------
  222|   696k|    h.num_digits--;
  223|   696k|  }
  224|  73.1k|}
_ZN8simdjson8internal13binary_formatIdE22mantissa_explicit_bitsEv:
   46|  48.2k|template <> constexpr int binary_format<double>::mantissa_explicit_bits() {
   47|  48.2k|  return 52;
   48|  48.2k|}
_ZN8simdjson8internal13binary_formatIdE10sign_indexEv:
   57|    245|template <> constexpr int binary_format<double>::sign_index() { return 63; }
_ZN8simdjson8internal19parse_long_mantissaINS0_13binary_formatIdEEEENS0_17adjusted_mantissaEPKc:
  551|  16.4k|adjusted_mantissa parse_long_mantissa(const char *first) {
  552|  16.4k|  decimal d = parse_decimal(first);
  553|  16.4k|  return compute_float<binary>(d);
  554|  16.4k|}
_ZN8simdjson8internal13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaERNS0_7decimalE:
  438|  16.4k|template <typename binary> adjusted_mantissa compute_float(decimal &d) {
  439|  16.4k|  adjusted_mantissa answer;
  440|  16.4k|  if (d.num_digits == 0) {
  ------------------
  |  Branch (440:7): [True: 82, False: 16.3k]
  ------------------
  441|       |    // should be zero
  442|     82|    answer.power2 = 0;
  443|     82|    answer.mantissa = 0;
  444|     82|    return answer;
  445|     82|  }
  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|  16.3k|  if(d.decimal_point < -324) {
  ------------------
  |  Branch (453:6): [True: 215, False: 16.1k]
  ------------------
  454|       |    // We have something smaller than 1e-324 which is always zero
  455|       |    // in binary64 and binary32.
  456|       |    // It should be zero.
  457|    215|    answer.power2 = 0;
  458|    215|    answer.mantissa = 0;
  459|    215|    return answer;
  460|  16.1k|  } else if(d.decimal_point >= 310) {
  ------------------
  |  Branch (460:13): [True: 133, False: 16.0k]
  ------------------
  461|       |    // We have something at least as large as 0.1e310 which is
  462|       |    // always infinite.
  463|    133|    answer.power2 = binary::infinite_power();
  464|    133|    answer.mantissa = 0;
  465|    133|    return answer;
  466|    133|  }
  467|       |
  468|  16.0k|  static const uint32_t max_shift = 60;
  469|  16.0k|  static const uint32_t num_powers = 19;
  470|  16.0k|  static const uint8_t powers[19] = {
  471|  16.0k|      0,  3,  6,  9,  13, 16, 19, 23, 26, 29, //
  472|  16.0k|      33, 36, 39, 43, 46, 49, 53, 56, 59,     //
  473|  16.0k|  };
  474|  16.0k|  int32_t exp2 = 0;
  475|  43.1k|  while (d.decimal_point > 0) {
  ------------------
  |  Branch (475:10): [True: 27.0k, False: 16.0k]
  ------------------
  476|  27.0k|    uint32_t n = uint32_t(d.decimal_point);
  477|  27.0k|    uint32_t shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (477:22): [True: 12.4k, False: 14.6k]
  ------------------
  478|  27.0k|    decimal_right_shift(d, shift);
  479|  27.0k|    if (d.decimal_point < -decimal_point_range) {
  ------------------
  |  Branch (479:9): [True: 0, False: 27.0k]
  ------------------
  480|       |      // should be zero
  481|      0|      answer.power2 = 0;
  482|      0|      answer.mantissa = 0;
  483|      0|      return answer;
  484|      0|    }
  485|  27.0k|    exp2 += int32_t(shift);
  486|  27.0k|  }
  487|       |  // We shift left toward [1/2 ... 1].
  488|  44.4k|  while (d.decimal_point <= 0) {
  ------------------
  |  Branch (488:10): [True: 44.4k, False: 0]
  ------------------
  489|  44.4k|    uint32_t shift;
  490|  44.4k|    if (d.decimal_point == 0) {
  ------------------
  |  Branch (490:9): [True: 34.0k, False: 10.4k]
  ------------------
  491|  34.0k|      if (d.digits[0] >= 5) {
  ------------------
  |  Branch (491:11): [True: 16.0k, False: 18.0k]
  ------------------
  492|  16.0k|        break;
  493|  16.0k|      }
  494|  18.0k|      shift = (d.digits[0] < 2) ? 2 : 1;
  ------------------
  |  Branch (494:15): [True: 2.03k, False: 15.9k]
  ------------------
  495|  18.0k|    } else {
  496|  10.4k|      uint32_t n = uint32_t(-d.decimal_point);
  497|  10.4k|      shift = (n < num_powers) ? powers[n] : max_shift;
  ------------------
  |  Branch (497:15): [True: 1.72k, False: 8.68k]
  ------------------
  498|  10.4k|    }
  499|  28.4k|    decimal_left_shift(d, shift);
  500|  28.4k|    if (d.decimal_point > decimal_point_range) {
  ------------------
  |  Branch (500:9): [True: 0, False: 28.4k]
  ------------------
  501|       |      // we want to get infinity:
  502|      0|      answer.power2 = 0xFF;
  503|      0|      answer.mantissa = 0;
  504|      0|      return answer;
  505|      0|    }
  506|  28.4k|    exp2 -= int32_t(shift);
  507|  28.4k|  }
  508|       |  // We are now in the range [1/2 ... 1] but the binary format uses [1 ... 2].
  509|  16.0k|  exp2--;
  510|  16.0k|  constexpr int32_t minimum_exponent = binary::minimum_exponent();
  511|  16.5k|  while ((minimum_exponent + 1) > exp2) {
  ------------------
  |  Branch (511:10): [True: 490, False: 16.0k]
  ------------------
  512|    490|    uint32_t n = uint32_t((minimum_exponent + 1) - exp2);
  513|    490|    if (n > max_shift) {
  ------------------
  |  Branch (513:9): [True: 0, False: 490]
  ------------------
  514|      0|      n = max_shift;
  515|      0|    }
  516|    490|    decimal_right_shift(d, n);
  517|    490|    exp2 += int32_t(n);
  518|    490|  }
  519|  16.0k|  if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (519:7): [True: 160, False: 15.8k]
  ------------------
  520|    160|    answer.power2 = binary::infinite_power();
  521|    160|    answer.mantissa = 0;
  522|    160|    return answer;
  523|    160|  }
  524|       |
  525|  15.8k|  const int mantissa_size_in_bits = binary::mantissa_explicit_bits() + 1;
  526|  15.8k|  decimal_left_shift(d, mantissa_size_in_bits);
  527|       |
  528|  15.8k|  uint64_t mantissa = round(d);
  529|       |  // It is possible that we have an overflow, in which case we need
  530|       |  // to shift back.
  531|  15.8k|  if (mantissa >= (uint64_t(1) << mantissa_size_in_bits)) {
  ------------------
  |  Branch (531:7): [True: 1.21k, False: 14.6k]
  ------------------
  532|  1.21k|    decimal_right_shift(d, 1);
  533|  1.21k|    exp2 += 1;
  534|  1.21k|    mantissa = round(d);
  535|  1.21k|    if ((exp2 - minimum_exponent) >= binary::infinite_power()) {
  ------------------
  |  Branch (535:9): [True: 0, False: 1.21k]
  ------------------
  536|      0|      answer.power2 = binary::infinite_power();
  537|      0|      answer.mantissa = 0;
  538|      0|      return answer;
  539|      0|    }
  540|  1.21k|  }
  541|  15.8k|  answer.power2 = exp2 - binary::minimum_exponent();
  542|  15.8k|  if (mantissa < (uint64_t(1) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (542:7): [True: 490, False: 15.3k]
  ------------------
  543|    490|    answer.power2--;
  544|    490|  }
  545|  15.8k|  answer.mantissa =
  546|  15.8k|      mantissa & ((uint64_t(1) << binary::mantissa_explicit_bits()) - 1);
  547|  15.8k|  return answer;
  548|  15.8k|}
_ZN8simdjson8internal17adjusted_mantissaC2Ev:
   28|  16.4k|  adjusted_mantissa() : mantissa(0), power2(0) {}
_ZN8simdjson8internal13binary_formatIdE14infinite_powerEv:
   53|  17.5k|template <> constexpr int binary_format<double>::infinite_power() {
   54|  17.5k|  return 0x7FF;
   55|  17.5k|}
_ZN8simdjson8internal13binary_formatIdE16minimum_exponentEv:
   50|  15.8k|template <> constexpr int binary_format<double>::minimum_exponent() {
   51|  15.8k|  return -1023;
   52|  15.8k|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scannerC2Ev:
   99|  8.92k|  json_scanner() = default;
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner4nextERKNS1_4simd8simd8x64IhEE:
  125|  1.10M|simdjson_inline json_block json_scanner::next(const simd::simd8x64<uint8_t>& in) {
  126|  1.10M|  json_string_block strings = string_scanner.next(in);
  127|       |  // identifies the white-space and the structural characters
  128|  1.10M|  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.10M|  const uint64_t nonquote_scalar = characters.scalar() & ~strings.quote();
  140|  1.10M|  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.10M|  return json_block(
  144|  1.10M|    strings,// strings is a function-local object so either it moves or the copy is elided.
  145|  1.10M|    characters,
  146|  1.10M|    follows_nonquote_scalar
  147|  1.10M|  );
  148|  1.10M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage17followsEmRm:
  119|  1.10M|simdjson_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
  120|  1.10M|  const uint64_t result = match << 1 | overflow;
  121|  1.10M|  overflow = match >> 63;
  122|  1.10M|  return result;
  123|  1.10M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage110json_blockC2ENS2_17json_string_blockENS1_20json_character_blockEm:
   29|  1.10M|  _string(string), _characters(characters), _follows_potential_nonquote_scalar(follows_potential_nonquote_scalar) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage112json_scanner6finishEv:
  150|  8.92k|simdjson_inline error_code json_scanner::finish() {
  151|  8.92k|  return string_scanner.finish();
  152|  8.92k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block16structural_startEv:
   35|  1.10M|  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.10M|  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.10M|  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.10M|    return _characters.scalar() & ~follows_potential_scalar();
   70|  1.10M|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block24follows_potential_scalarEv:
   75|  1.10M|  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.10M|    return _follows_potential_nonquote_scalar;
   81|  1.10M|  }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage110json_block23non_quote_inside_stringEm:
   42|  1.10M|  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.10M|simdjson_inline json_string_block json_string_scanner::next(const simd::simd8x64<uint8_t>& in) {
  111|  1.10M|  const uint64_t backslash = in.eq('\\');
  112|  1.10M|  const uint64_t escaped = find_escaped(backslash);
  113|  1.10M|  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.10M|  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.10M|  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.10M|  return json_string_block(
  136|  1.10M|    backslash,
  137|  1.10M|    escaped,
  138|  1.10M|    quote,
  139|  1.10M|    in_string
  140|  1.10M|  );
  141|  1.10M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner23find_escaped_branchlessEm:
   85|  4.95k|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|  4.95k|  backslash &= ~prev_escaped;
   88|  4.95k|  uint64_t follows_escape = backslash << 1 | prev_escaped;
   89|       |
   90|       |  // Get sequences starting on even bits by clearing out the odd series using +
   91|  4.95k|  const uint64_t even_bits = 0x5555555555555555ULL;
   92|  4.95k|  uint64_t odd_sequence_starts = backslash & ~even_bits & ~follows_escape;
   93|  4.95k|  uint64_t sequences_starting_on_even_bits;
   94|  4.95k|  prev_escaped = add_overflow(odd_sequence_starts, backslash, &sequences_starting_on_even_bits);
   95|  4.95k|  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|  4.95k|  return (even_bits ^ invert_mask) & follows_escape;
  100|  4.95k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage117json_string_blockC2Emmmm:
    9|  1.10M|  _backslash(backslash), _escaped(escaped), _quote(quote), _in_string(in_string) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block5quoteEv:
   16|  1.10M|  simdjson_inline uint64_t quote() const { return _quote; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner6finishEv:
  143|  8.92k|simdjson_inline error_code json_string_scanner::finish() {
  144|  8.92k|  if (prev_in_string) {
  ------------------
  |  Branch (144:7): [True: 160, False: 8.76k]
  ------------------
  145|    160|    return UNCLOSED_STRING;
  146|    160|  }
  147|  8.76k|  return SUCCESS;
  148|  8.92k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block11string_tailEv:
   28|  1.10M|  simdjson_inline uint64_t string_tail() const { return _in_string ^ _quote; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block23non_quote_inside_stringEm:
   24|  1.10M|  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|  8.92k|error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept {
  198|  8.92k|  if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; }
  ------------------
  |  |  120|  8.92k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 8.92k]
  |  |  ------------------
  ------------------
  199|       |  // We guard the rest of the code so that we can assume that len > 0 throughout.
  200|  8.92k|  if (len == 0) { return EMPTY; }
  ------------------
  |  Branch (200:7): [True: 0, False: 8.92k]
  ------------------
  201|  8.92k|  if (is_streaming(partial)) {
  ------------------
  |  Branch (201:7): [True: 0, False: 8.92k]
  ------------------
  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|  8.92k|  buf_block_reader<STEP_SIZE> reader(buf, len);
  209|  8.92k|  json_structural_indexer indexer(parser.structural_indexes.get());
  210|       |
  211|       |  // Read all but the last block
  212|   551k|  while (reader.has_full_block()) {
  ------------------
  |  Branch (212:10): [True: 542k, False: 8.92k]
  ------------------
  213|   542k|    indexer.step<STEP_SIZE>(reader.full_block(), reader);
  214|   542k|  }
  215|       |  // Take care of the last block (will always be there unless file is empty which is
  216|       |  // not supposed to happen.)
  217|  8.92k|  uint8_t block[STEP_SIZE];
  218|  8.92k|  if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; }
  ------------------
  |  |  120|  8.92k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 8.92k]
  |  |  ------------------
  ------------------
  219|  8.92k|  indexer.step<STEP_SIZE>(block, reader);
  220|  8.92k|  return indexer.finish(parser, reader.block_index(), len, partial);
  221|  8.92k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexerC2EPj:
  156|  8.92k|simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexerC2EPj:
   21|  8.92k|  simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4stepILm128EEEvPKhRNS1_16buf_block_readerIXT_EEE:
  224|   551k|simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept {
  225|   551k|  simd::simd8x64<uint8_t> in_1(block);
  226|   551k|  simd::simd8x64<uint8_t> in_2(block+64);
  227|   551k|  json_block block_1 = scanner.next(in_1);
  228|   551k|  json_block block_2 = scanner.next(in_2);
  229|   551k|  this->next(in_1, block_1, reader.block_index());
  230|   551k|  this->next(in_2, block_2, reader.block_index()+64);
  231|   551k|  reader.advance();
  232|   551k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4nextERKNS1_4simd8simd8x64IhEERKNS2_10json_blockEm:
  242|  1.10M|simdjson_inline void json_structural_indexer::next(const simd::simd8x64<uint8_t>& in, const json_block& block, size_t idx) {
  243|  1.10M|  uint64_t unescaped = in.lteq(0x1F);
  244|  1.10M|#if SIMDJSON_UTF8VALIDATION
  245|  1.10M|  checker.check_next_input(in);
  246|  1.10M|#endif
  247|  1.10M|  indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser
  248|  1.10M|  prev_structurals = block.structural_start();
  249|  1.10M|  unescaped_chars_error |= block.non_quote_inside_string(unescaped);
  250|  1.10M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer5writeEjm:
   34|  1.11M|  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.11M|    if (bits == 0)
  ------------------
  |  Branch (38:9): [True: 951k, False: 161k]
  ------------------
   39|   951k|        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|   161k|    int cnt = static_cast<int>(count_ones(bits));
   96|       |    // Do the first 8 all together
   97|  1.45M|    for (int i=0; i<8; i++) {
  ------------------
  |  Branch (97:19): [True: 1.29M, False: 161k]
  ------------------
   98|  1.29M|      this->tail[i] = idx + trailing_zeroes(bits);
   99|  1.29M|      bits = clear_lowest_bit(bits);
  100|  1.29M|    }
  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|   161k|    if (simdjson_unlikely(cnt > 8)) {
  ------------------
  |  |  120|   161k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 122k, False: 38.9k]
  |  |  ------------------
  ------------------
  105|  1.10M|      for (int i=8; i<16; i++) {
  ------------------
  |  Branch (105:21): [True: 980k, False: 122k]
  ------------------
  106|   980k|        this->tail[i] = idx + trailing_zeroes(bits);
  107|   980k|        bits = clear_lowest_bit(bits);
  108|   980k|      }
  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|   122k|      if (simdjson_unlikely(cnt > 16)) {
  ------------------
  |  |  120|   122k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 117k, False: 5.42k]
  |  |  ------------------
  ------------------
  114|   117k|        int i = 16;
  115|  5.41M|        do {
  116|  5.41M|          this->tail[i] = idx + trailing_zeroes(bits);
  117|  5.41M|          bits = clear_lowest_bit(bits);
  118|  5.41M|          i++;
  119|  5.41M|        } while (i < cnt);
  ------------------
  |  Branch (119:18): [True: 5.30M, False: 117k]
  ------------------
  120|   117k|      }
  121|   122k|    }
  122|       |
  123|   161k|    this->tail += cnt;
  124|   161k|#endif
  125|   161k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer6finishERNS0_25dom_parser_implementationEmmNS_11stage1_modeE:
  252|  8.92k|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|  8.92k|  indexer.write(uint32_t(idx-64), prev_structurals);
  255|  8.92k|  error_code error = scanner.finish();
  256|       |  // We deliberately break down the next expression so that it is
  257|       |  // human readable.
  258|  8.92k|  const bool should_we_exit = is_streaming(partial) ?
  ------------------
  |  Branch (258:31): [True: 0, False: 8.92k]
  ------------------
  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|  8.92k|    : (error != SUCCESS); // if partial is false, we must have SUCCESS
  261|  8.92k|  const bool have_unclosed_string = (error == UNCLOSED_STRING);
  262|  8.92k|  if (simdjson_unlikely(should_we_exit)) { return error; }
  ------------------
  |  |  120|  8.92k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 160, False: 8.76k]
  |  |  ------------------
  ------------------
  263|       |
  264|  8.76k|  if (unescaped_chars_error) {
  ------------------
  |  Branch (264:7): [True: 186, False: 8.58k]
  ------------------
  265|    186|    return UNESCAPED_CHARS;
  266|    186|  }
  267|  8.58k|  parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get());
  268|       |  /***
  269|       |   * The On Demand API requires special padding.
  270|       |   *
  271|       |   * This is related to https://github.com/simdjson/simdjson/issues/906
  272|       |   * Basically, we want to make sure that if the parsing continues beyond the last (valid)
  273|       |   * structural character, it quickly stops.
  274|       |   * Only three structural characters can be repeated without triggering an error in JSON:  [,] and }.
  275|       |   * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing
  276|       |   * continues, then it must be [,] or }.
  277|       |   * Suppose it is ] or }. We backtrack to the first character, what could it be that would
  278|       |   * not trigger an error? It could be ] or } but no, because you can't start a document that way.
  279|       |   * It can't be a comma, a colon or any simple value. So the only way we could continue is
  280|       |   * if the repeated character is [. But if so, the document must start with [. But if the document
  281|       |   * starts with [, it should end with ]. If we enforce that rule, then we would get
  282|       |   * ][[ which is invalid.
  283|       |   *
  284|       |   * This is illustrated with the test array_iterate_unclosed_error() on the following input:
  285|       |   * R"({ "a": [,,)"
  286|       |   **/
  287|  8.58k|  parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final
  288|  8.58k|  parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len);
  289|  8.58k|  parser.structural_indexes[parser.n_structural_indexes + 2] = 0;
  290|  8.58k|  parser.next_structural_index = 0;
  291|       |  // a valid JSON file cannot have zero structural indexes - we should have found something
  292|  8.58k|  if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  120|  8.58k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 1, False: 8.58k]
  |  |  ------------------
  ------------------
  293|      1|    return EMPTY;
  294|      1|  }
  295|  8.58k|  if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) {
  ------------------
  |  |  120|  8.58k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 8.58k]
  |  |  ------------------
  ------------------
  296|      0|    return UNEXPECTED_ERROR;
  297|      0|  }
  298|  8.58k|  if (partial == stage1_mode::streaming_partial) {
  ------------------
  |  Branch (298:7): [True: 0, False: 8.58k]
  ------------------
  299|       |    // If we have an unclosed string, then the last structural
  300|       |    // will be the quote and we want to make sure to omit it.
  301|      0|    if(have_unclosed_string) {
  ------------------
  |  Branch (301:8): [True: 0, False: 0]
  ------------------
  302|      0|      parser.n_structural_indexes--;
  303|       |      // a valid JSON file cannot have zero structural indexes - we should have found something
  304|      0|      if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; }
  ------------------
  |  |  120|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  305|      0|    }
  306|       |    // We truncate the input to the end of the last complete document (or zero).
  307|      0|    auto new_structural_indexes = find_next_document_index(parser);
  308|      0|    if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) {
  ------------------
  |  Branch (308:9): [True: 0, False: 0]
  |  Branch (308:40): [True: 0, False: 0]
  ------------------
  309|      0|      if(parser.structural_indexes[0] == 0) {
  ------------------
  |  Branch (309:10): [True: 0, False: 0]
  ------------------
  310|       |        // If the buffer is partial and we started at index 0 but the document is
  311|       |        // incomplete, it's too big to parse.
  312|      0|        return CAPACITY;
  313|      0|      } else {
  314|       |        // It is possible that the document could be parsed, we just had a lot
  315|       |        // of white space.
  316|      0|        parser.n_structural_indexes = 0;
  317|      0|        return EMPTY;
  318|      0|      }
  319|      0|    }
  320|       |
  321|      0|    parser.n_structural_indexes = new_structural_indexes;
  322|  8.58k|  } else if (partial == stage1_mode::streaming_final) {
  ------------------
  |  Branch (322:14): [True: 0, False: 8.58k]
  ------------------
  323|      0|    if(have_unclosed_string) { parser.n_structural_indexes--; }
  ------------------
  |  Branch (323:8): [True: 0, False: 0]
  ------------------
  324|       |    // We truncate the input to the end of the last complete document (or zero).
  325|       |    // Because partial == stage1_mode::streaming_final, it means that we may
  326|       |    // silently ignore trailing garbage. Though it sounds bad, we do it
  327|       |    // deliberately because many people who have streams of JSON documents
  328|       |    // will truncate them for processing. E.g., imagine that you are uncompressing
  329|       |    // the data from a size file or receiving it in chunks from the network. You
  330|       |    // may not know where exactly the last document will be. Meanwhile the
  331|       |    // document_stream instances allow people to know the JSON documents they are
  332|       |    // parsing (see the iterator.source() method).
  333|      0|    parser.n_structural_indexes = find_next_document_index(parser);
  334|       |    // We store the initial n_structural_indexes so that the client can see
  335|       |    // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes,
  336|       |    // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len,
  337|       |    // otherwise, it will copy some prior index.
  338|      0|    parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes];
  339|       |    // This next line is critical, do not change it unless you understand what you are
  340|       |    // doing.
  341|      0|    parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len);
  342|      0|    if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  120|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  343|       |        // We tolerate an unclosed string at the very end of the stream. Indeed, users
  344|       |        // often load their data in bulk without being careful and they want us to ignore
  345|       |        // the trailing garbage.
  346|      0|        return EMPTY;
  347|      0|    }
  348|      0|  }
  349|  8.58k|  checker.check_eof();
  350|  8.58k|  return checker.errors();
  351|  8.58k|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iteratorC2ERNS0_25dom_parser_implementationEm:
  240|  8.02k|    dom_parser{_dom_parser} {
  241|  8.02k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13walk_documentILb0ENS2_12tape_builderEEENS_10error_codeERT0_:
  112|  8.02k|simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
  113|  8.02k|  logger::log_start();
  114|       |
  115|       |  //
  116|       |  // Start the document
  117|       |  //
  118|  8.02k|  if (at_eof()) { return EMPTY; }
  ------------------
  |  Branch (118:7): [True: 0, False: 8.02k]
  ------------------
  119|  8.02k|  log_start_value("document");
  120|  8.02k|  SIMDJSON_TRY( visitor.visit_document_start(*this) );
  ------------------
  |  |  279|  8.02k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 8.02k]
  |  |  ------------------
  ------------------
  121|       |
  122|       |  //
  123|       |  // Read first value
  124|       |  //
  125|  8.02k|  {
  126|  8.02k|    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|  8.02k|    if (!STREAMING) {
  ------------------
  |  Branch (130:9): [Folded - Ignored]
  ------------------
  131|  8.02k|      switch (*value) {
  ------------------
  |  Branch (131:15): [True: 2.55k, False: 5.46k]
  ------------------
  132|  2.86k|        case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (132:9): [True: 2.86k, False: 5.15k]
  |  Branch (132:23): [True: 21, False: 2.84k]
  ------------------
  133|  2.59k|        case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (133:9): [True: 2.59k, False: 5.42k]
  |  Branch (133:23): [True: 22, False: 2.57k]
  ------------------
  134|  8.02k|      }
  135|  8.02k|    }
  136|       |
  137|  7.97k|    switch (*value) {
  138|  2.84k|      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.84k, False: 5.13k]
  |  Branch (138:21): [True: 1, False: 2.84k]
  ------------------
  139|  2.84k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|      1|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (139:7): [True: 2.57k, False: 5.40k]
  |  Branch (139:21): [True: 1, False: 2.57k]
  ------------------
  140|  2.57k|      default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break;
  ------------------
  |  |  279|  2.55k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 998, False: 1.55k]
  |  |  ------------------
  ------------------
  |  Branch (140:7): [True: 2.55k, False: 5.42k]
  ------------------
  141|  7.97k|    }
  142|  7.97k|  }
  143|  1.56k|  goto document_end;
  144|       |
  145|       |//
  146|       |// Object parser states
  147|       |//
  148|  3.97k|object_begin:
  149|  3.97k|  log_start_value("object");
  150|  3.97k|  depth++;
  151|  3.97k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (151:7): [True: 1, False: 3.97k]
  ------------------
  152|  3.97k|  dom_parser.is_array[depth] = false;
  153|  3.97k|  SIMDJSON_TRY( visitor.visit_object_start(*this) );
  ------------------
  |  |  279|  3.97k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 3.97k]
  |  |  ------------------
  ------------------
  154|       |
  155|  3.97k|  {
  156|  3.97k|    auto key = advance();
  157|  3.97k|    if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; }
  ------------------
  |  Branch (157:9): [True: 70, False: 3.90k]
  ------------------
  158|  3.90k|    SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  3.90k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 3.90k]
  |  |  ------------------
  ------------------
  159|  3.90k|    SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  279|  3.90k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 85, False: 3.82k]
  |  |  ------------------
  ------------------
  160|  3.82k|  }
  161|       |
  162|  80.2k|object_field:
  163|  80.2k|  if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; }
  ------------------
  |  |  120|  80.2k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 413, False: 79.8k]
  |  |  ------------------
  ------------------
  164|  79.8k|  {
  165|  79.8k|    auto value = advance();
  166|  79.8k|    switch (*value) {
  167|    835|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|    196|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 196]
  |  |  ------------------
  ------------------
  |  Branch (167:7): [True: 835, False: 79.0k]
  |  Branch (167:21): [True: 196, False: 639]
  ------------------
  168|    639|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|    195|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 195]
  |  |  ------------------
  ------------------
  |  Branch (168:7): [True: 596, False: 79.2k]
  |  Branch (168:21): [True: 195, False: 401]
  ------------------
  169|  78.4k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  279|  78.4k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 668, False: 77.7k]
  |  |  ------------------
  ------------------
  |  Branch (169:7): [True: 78.4k, False: 1.43k]
  ------------------
  170|  79.8k|    }
  171|  79.8k|  }
  172|       |
  173|  78.5k|object_continue:
  174|  78.5k|  switch (*advance()) {
  175|  76.5k|    case ',':
  ------------------
  |  Branch (175:5): [True: 76.5k, False: 1.97k]
  ------------------
  176|  76.5k|      SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  76.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 76.5k]
  |  |  ------------------
  ------------------
  177|  76.5k|      {
  178|  76.5k|        auto key = advance();
  179|  76.5k|        if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; }
  ------------------
  |  |  120|  76.5k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 17, False: 76.5k]
  |  |  ------------------
  ------------------
  180|  76.5k|        SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  279|  76.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 89, False: 76.4k]
  |  |  ------------------
  ------------------
  181|  76.4k|      }
  182|      0|      goto object_field;
  183|  1.88k|    case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end;
  ------------------
  |  |  279|  1.88k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.88k]
  |  |  ------------------
  ------------------
  |  Branch (183:5): [True: 1.88k, False: 76.6k]
  ------------------
  184|     90|    default: log_error("No comma between object fields"); return TAPE_ERROR;
  ------------------
  |  Branch (184:5): [True: 90, False: 78.4k]
  ------------------
  185|  78.5k|  }
  186|       |
  187|  4.00k|scope_end:
  188|  4.00k|  depth--;
  189|  4.00k|  if (depth == 0) { goto document_end; }
  ------------------
  |  Branch (189:7): [True: 3.07k, False: 925]
  ------------------
  190|    925|  if (dom_parser.is_array[depth]) { goto array_continue; }
  ------------------
  |  Branch (190:7): [True: 541, False: 384]
  ------------------
  191|    384|  goto object_continue;
  192|       |
  193|       |//
  194|       |// Array parser states
  195|       |//
  196|  15.7k|array_begin:
  197|  15.7k|  log_start_value("array");
  198|  15.7k|  depth++;
  199|  15.7k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (199:7): [True: 2, False: 15.7k]
  ------------------
  200|  15.7k|  dom_parser.is_array[depth] = true;
  201|  15.7k|  SIMDJSON_TRY( visitor.visit_array_start(*this) );
  ------------------
  |  |  279|  15.7k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 15.7k]
  |  |  ------------------
  ------------------
  202|  15.7k|  SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  15.7k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 15.7k]
  |  |  ------------------
  ------------------
  203|       |
  204|   555k|array_value:
  205|   555k|  {
  206|   555k|    auto value = advance();
  207|   555k|    switch (*value) {
  208|    711|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|    218|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 218]
  |  |  ------------------
  ------------------
  |  Branch (208:7): [True: 711, False: 554k]
  |  Branch (208:21): [True: 218, False: 493]
  ------------------
  209|  13.1k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|    294|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 294]
  |  |  ------------------
  ------------------
  |  Branch (209:7): [True: 13.1k, False: 542k]
  |  Branch (209:21): [True: 294, False: 12.8k]
  ------------------
  210|   541k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  279|   541k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 806, False: 540k]
  |  |  ------------------
  ------------------
  |  Branch (210:7): [True: 541k, False: 13.8k]
  ------------------
  211|   555k|    }
  212|   555k|  }
  213|       |
  214|   541k|array_continue:
  215|   541k|  switch (*advance()) {
  216|   539k|    case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value;
  ------------------
  |  |  279|   539k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 539k]
  |  |  ------------------
  ------------------
  |  Branch (216:5): [True: 539k, False: 2.21k]
  ------------------
  217|  2.11k|    case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end;
  ------------------
  |  |  279|  2.11k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 2.11k]
  |  |  ------------------
  ------------------
  |  Branch (217:5): [True: 2.11k, False: 539k]
  ------------------
  218|    104|    default: log_error("Missing comma between array values"); return TAPE_ERROR;
  ------------------
  |  Branch (218:5): [True: 104, False: 541k]
  ------------------
  219|   541k|  }
  220|       |
  221|  4.63k|document_end:
  222|  4.63k|  log_end_value("document");
  223|  4.63k|  SIMDJSON_TRY( visitor.visit_document_end(*this) );
  ------------------
  |  |  279|  4.63k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 4.63k]
  |  |  ------------------
  ------------------
  224|       |
  225|  4.63k|  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|  4.63k|  if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
  ------------------
  |  Branch (228:8): [Folded - Ignored]
  |  Branch (228:22): [True: 106, False: 4.52k]
  ------------------
  229|    106|    log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
  230|    106|    return TAPE_ERROR;
  231|    106|  }
  232|       |
  233|  4.52k|  return SUCCESS;
  234|       |
  235|  4.63k|} // walk_document()
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator6at_eofEv:
  253|  8.02k|simdjson_inline bool json_iterator::at_eof() const noexcept {
  254|  8.02k|  return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes];
  255|  8.02k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15log_start_valueEPKc:
  267|  27.7k|simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept {
  268|  27.7k|  logger::log_line(*this, "+", type, "");
  269|  27.7k|  if (logger::LOG_ENABLED) { logger::log_depth++; }
  ------------------
  |  Branch (269:7): [Folded - Ignored]
  ------------------
  270|  27.7k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator7advanceEv:
  246|  1.42M|simdjson_inline const uint8_t *json_iterator::advance() noexcept {
  247|  1.42M|  return &buf[*(next_structural++)];
  248|  1.42M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15last_structuralEv:
  259|  5.46k|simdjson_inline uint8_t json_iterator::last_structural() const noexcept {
  260|  5.46k|  return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]];
  261|  5.46k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_valueEPKc:
  263|   703k|simdjson_inline void json_iterator::log_value(const char *type) const noexcept {
  264|   703k|  logger::log_line(*this, "", type, "");
  265|   703k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator4peekEv:
  243|  20.6k|simdjson_inline const uint8_t *json_iterator::peek() const noexcept {
  244|  20.6k|  return &buf[*(next_structural)];
  245|  20.6k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator20visit_root_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  282|  2.55k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept {
  283|  2.55k|  switch (*value) {
  284|    358|    case '"': return visitor.visit_root_string(*this, value);
  ------------------
  |  Branch (284:5): [True: 358, False: 2.19k]
  ------------------
  285|     56|    case 't': return visitor.visit_root_true_atom(*this, value);
  ------------------
  |  Branch (285:5): [True: 56, False: 2.50k]
  ------------------
  286|    107|    case 'f': return visitor.visit_root_false_atom(*this, value);
  ------------------
  |  Branch (286:5): [True: 107, False: 2.44k]
  ------------------
  287|     53|    case 'n': return visitor.visit_root_null_atom(*this, value);
  ------------------
  |  Branch (287:5): [True: 53, False: 2.50k]
  ------------------
  288|     99|    case '-':
  ------------------
  |  Branch (288:5): [True: 99, False: 2.45k]
  ------------------
  289|  1.00k|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (289:5): [True: 190, False: 2.36k]
  |  Branch (289:15): [True: 290, False: 2.26k]
  |  Branch (289:25): [True: 183, False: 2.37k]
  |  Branch (289:35): [True: 109, False: 2.44k]
  |  Branch (289:45): [True: 132, False: 2.42k]
  ------------------
  290|  1.87k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (290:5): [True: 118, False: 2.43k]
  |  Branch (290:15): [True: 67, False: 2.48k]
  |  Branch (290:25): [True: 88, False: 2.46k]
  |  Branch (290:35): [True: 175, False: 2.38k]
  |  Branch (290:45): [True: 428, False: 2.12k]
  ------------------
  291|  1.87k|      return visitor.visit_root_number(*this, value);
  292|    103|    default:
  ------------------
  |  Branch (292:5): [True: 103, False: 2.45k]
  ------------------
  293|    103|      log_error("Document starts with a non-value character");
  294|    103|      return TAPE_ERROR;
  295|  2.55k|  }
  296|  2.55k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13remaining_lenEv:
  249|  5.85k|simdjson_inline size_t json_iterator::remaining_len() const noexcept {
  250|  5.85k|  return dom_parser.len - *(next_structural-1);
  251|  5.85k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_errorEPKc:
  277|  1.44k|simdjson_inline void json_iterator::log_error(const char *error) const noexcept {
  278|  1.44k|  logger::log_line(*this, "", "ERROR", error);
  279|  1.44k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15visit_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  298|   620k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept {
  299|   620k|  switch (*value) {
  300|  1.03k|    case '"': return visitor.visit_string(*this, value);
  ------------------
  |  Branch (300:5): [True: 1.03k, False: 619k]
  ------------------
  301|    473|    case 't': return visitor.visit_true_atom(*this, value);
  ------------------
  |  Branch (301:5): [True: 473, False: 619k]
  ------------------
  302|    485|    case 'f': return visitor.visit_false_atom(*this, value);
  ------------------
  |  Branch (302:5): [True: 485, False: 619k]
  ------------------
  303|    458|    case 'n': return visitor.visit_null_atom(*this, value);
  ------------------
  |  Branch (303:5): [True: 458, False: 619k]
  ------------------
  304|  4.23k|    case '-':
  ------------------
  |  Branch (304:5): [True: 4.23k, False: 615k]
  ------------------
  305|   311k|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (305:5): [True: 218k, False: 402k]
  |  Branch (305:15): [True: 28.5k, False: 591k]
  |  Branch (305:25): [True: 4.48k, False: 615k]
  |  Branch (305:35): [True: 49.2k, False: 570k]
  |  Branch (305:45): [True: 7.28k, False: 612k]
  ------------------
  306|   617k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (306:5): [True: 15.7k, False: 604k]
  |  Branch (306:15): [True: 142k, False: 477k]
  |  Branch (306:25): [True: 24.0k, False: 596k]
  |  Branch (306:35): [True: 21.3k, False: 598k]
  |  Branch (306:45): [True: 102k, False: 518k]
  ------------------
  307|   617k|      return visitor.visit_number(*this, value);
  308|     64|    default:
  ------------------
  |  Branch (308:5): [True: 64, False: 620k]
  ------------------
  309|     64|      log_error("Non-value found when value was expected!");
  310|     64|      return TAPE_ERROR;
  311|   620k|  }
  312|   620k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13log_end_valueEPKc:
  272|  8.63k|simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept {
  273|  8.63k|  if (logger::LOG_ENABLED) { logger::log_depth--; }
  ------------------
  |  Branch (273:7): [Folded - Ignored]
  ------------------
  274|  8.63k|  logger::log_line(*this, "-", type, "");
  275|  8.63k|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16logger9log_startEv:
   32|  8.02k|  static simdjson_inline void log_start() {
   33|  8.02k|    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|  8.02k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16logger8log_lineIKNS1_6stage213json_iteratorEEEvRT_PKcSA_SA_:
   49|   741k|  static simdjson_inline void log_line(S &structurals, const char *title_prefix, const char *title, const char *detail) {
   50|   741k|    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|   741k|  }

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder14parse_documentILb0EEENS_10error_codeERNS0_25dom_parser_implementationERNS_3dom8documentE:
   89|  8.02k|    dom::document &doc) noexcept {
   90|  8.02k|  dom_parser.doc = &doc;
   91|  8.02k|  json_iterator iter(dom_parser, STREAMING ? dom_parser.next_structural_index : 0);
  ------------------
  |  Branch (91:34): [Folded - Ignored]
  ------------------
   92|  8.02k|  tape_builder builder(doc);
   93|  8.02k|  return iter.walk_document<STREAMING>(builder);
   94|  8.02k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builderC2ERNS_3dom8documentE:
  143|  8.02k|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|  8.02k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_start(json_iterator &iter) noexcept {
  110|  8.02k|  start_container(iter);
  111|  8.02k|  return SUCCESS;
  112|  8.02k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15start_containerERNS2_13json_iteratorE:
  243|  27.7k|simdjson_inline void tape_builder::start_container(json_iterator &iter) noexcept {
  244|  27.7k|  iter.dom_parser.open_containers[iter.depth].tape_index = next_tape_index(iter);
  245|  27.7k|  iter.dom_parser.open_containers[iter.depth].count = 0;
  246|  27.7k|  tape.skip(); // We don't actually *write* the start element until the end.
  247|  27.7k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15next_tape_indexERNS2_13json_iteratorE:
  232|  37.3k|simdjson_inline uint32_t tape_builder::next_tape_index(json_iterator &iter) const noexcept {
  233|  37.3k|  return uint32_t(tape.next_tape_loc - iter.dom_parser.doc->tape.get());
  234|  37.3k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder18visit_empty_objectERNS2_13json_iteratorE:
  102|    415|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_object(json_iterator &iter) noexcept {
  103|    415|  return empty_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT);
  104|    415|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15empty_containerERNS2_13json_iteratorENS_8internal9tape_typeES7_:
  236|    905|simdjson_warn_unused simdjson_inline error_code tape_builder::empty_container(json_iterator &iter, internal::tape_type start, internal::tape_type end) noexcept {
  237|    905|  auto start_index = next_tape_index(iter);
  238|    905|  tape.append(start_index+2, start);
  239|    905|  tape.append(start_index, end);
  240|    905|  return SUCCESS;
  241|    905|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_empty_arrayERNS2_13json_iteratorE:
  105|    490|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_empty_array(json_iterator &iter) noexcept {
  106|    490|  return empty_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY);
  107|    490|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_root_primitiveERNS2_13json_iteratorEPKh:
   96|  2.55k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_primitive(json_iterator &iter, const uint8_t *value) noexcept {
   97|  2.55k|  return iter.visit_root_primitive(*this, value);
   98|  2.55k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_root_stringERNS2_13json_iteratorEPKh:
  157|    358|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_string(json_iterator &iter, const uint8_t *value) noexcept {
  158|    358|  return visit_string(iter, value);
  159|    358|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder12visit_stringERNS2_13json_iteratorEPKhb:
  145|  81.8k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_string(json_iterator &iter, const uint8_t *value, bool key) noexcept {
  146|  81.8k|  iter.log_value(key ? "key" : "string");
  ------------------
  |  Branch (146:18): [True: 80.4k, False: 1.39k]
  ------------------
  147|  81.8k|  uint8_t *dst = on_start_string(iter);
  148|  81.8k|  dst = stringparsing::parse_string(value+1, dst, false); // We do not allow replacement when the escape characters are invalid.
  149|  81.8k|  if (dst == nullptr) {
  ------------------
  |  Branch (149:7): [True: 475, False: 81.3k]
  ------------------
  150|    475|    iter.log_error("Invalid escape in string");
  151|    475|    return STRING_ERROR;
  152|    475|  }
  153|  81.3k|  on_end_string(dst);
  154|  81.3k|  return SUCCESS;
  155|  81.8k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15on_start_stringERNS2_13json_iteratorE:
  262|  81.8k|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|  81.8k|  tape.append(current_string_buf_loc - iter.dom_parser.doc->string_buf.get(), internal::tape_type::STRING);
  265|  81.8k|  return current_string_buf_loc + sizeof(uint32_t);
  266|  81.8k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder13on_end_stringEPh:
  268|  81.3k|simdjson_inline void tape_builder::on_end_string(uint8_t *dst) noexcept {
  269|  81.3k|  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|  81.3k|  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|  81.3k|  *dst = 0;
  277|  81.3k|  current_string_buf_loc = dst + 1;
  278|  81.3k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_root_true_atomERNS2_13json_iteratorEPKh:
  195|     56|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_true_atom(json_iterator &iter, const uint8_t *value) noexcept {
  196|     56|  iter.log_value("true");
  197|     56|  if (!atomparsing::is_valid_true_atom(value, iter.remaining_len())) { return T_ATOM_ERROR; }
  ------------------
  |  Branch (197:7): [True: 55, False: 1]
  ------------------
  198|      1|  tape.append(0, internal::tape_type::TRUE_VALUE);
  199|      1|  return SUCCESS;
  200|     56|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder21visit_root_false_atomERNS2_13json_iteratorEPKh:
  209|    107|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_false_atom(json_iterator &iter, const uint8_t *value) noexcept {
  210|    107|  iter.log_value("false");
  211|    107|  if (!atomparsing::is_valid_false_atom(value, iter.remaining_len())) { return F_ATOM_ERROR; }
  ------------------
  |  Branch (211:7): [True: 105, False: 2]
  ------------------
  212|      2|  tape.append(0, internal::tape_type::FALSE_VALUE);
  213|      2|  return SUCCESS;
  214|    107|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder20visit_root_null_atomERNS2_13json_iteratorEPKh:
  223|     53|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_root_null_atom(json_iterator &iter, const uint8_t *value) noexcept {
  224|     53|  iter.log_value("null");
  225|     53|  if (!atomparsing::is_valid_null_atom(value, iter.remaining_len())) { return N_ATOM_ERROR; }
  ------------------
  |  Branch (225:7): [True: 52, False: 1]
  ------------------
  226|      1|  tape.append(0, internal::tape_type::NULL_VALUE);
  227|      1|  return SUCCESS;
  228|     53|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_root_numberERNS2_13json_iteratorEPKh:
  166|  1.87k|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|  1.87k|  std::unique_ptr<uint8_t[]>copy(new (std::nothrow) uint8_t[iter.remaining_len() + SIMDJSON_PADDING]);
  181|  1.87k|  if (copy.get() == nullptr) { return MEMALLOC; }
  ------------------
  |  Branch (181:7): [True: 0, False: 1.87k]
  ------------------
  182|  1.87k|  std::memcpy(copy.get(), value, iter.remaining_len());
  183|  1.87k|  std::memset(copy.get() + iter.remaining_len(), ' ', SIMDJSON_PADDING);
  184|  1.87k|  error_code error = visit_number(iter, copy.get());
  185|  1.87k|  return error;
  186|  1.87k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder12visit_numberERNS2_13json_iteratorEPKh:
  161|   619k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_number(json_iterator &iter, const uint8_t *value) noexcept {
  162|   619k|  iter.log_value("number");
  163|   619k|  return numberparsing::parse_number(value, tape);
  164|   619k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder18visit_object_startERNS2_13json_iteratorE:
  113|  3.97k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_start(json_iterator &iter) noexcept {
  114|  3.97k|  start_container(iter);
  115|  3.97k|  return SUCCESS;
  116|  3.97k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15increment_countERNS2_13json_iteratorE:
  138|   636k|simdjson_warn_unused simdjson_inline error_code tape_builder::increment_count(json_iterator &iter) noexcept {
  139|   636k|  iter.dom_parser.open_containers[iter.depth].count++; // we have a key value pair in the object at parser.dom_parser.depth - 1
  140|   636k|  return SUCCESS;
  141|   636k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder9visit_keyERNS2_13json_iteratorEPKh:
  134|  80.4k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_key(json_iterator &iter, const uint8_t *key) noexcept {
  135|  80.4k|  return visit_string(iter, key, true);
  136|  80.4k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_primitiveERNS2_13json_iteratorEPKh:
   99|   620k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_primitive(json_iterator &iter, const uint8_t *value) noexcept {
  100|   620k|  return iter.visit_primitive(*this, value);
  101|   620k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_true_atomERNS2_13json_iteratorEPKh:
  188|    473|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_true_atom(json_iterator &iter, const uint8_t *value) noexcept {
  189|    473|  iter.log_value("true");
  190|    473|  if (!atomparsing::is_valid_true_atom(value)) { return T_ATOM_ERROR; }
  ------------------
  |  Branch (190:7): [True: 85, False: 388]
  ------------------
  191|    388|  tape.append(0, internal::tape_type::TRUE_VALUE);
  192|    388|  return SUCCESS;
  193|    473|}
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: 97, False: 388]
  ------------------
  205|    388|  tape.append(0, internal::tape_type::FALSE_VALUE);
  206|    388|  return SUCCESS;
  207|    485|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_null_atomERNS2_13json_iteratorEPKh:
  216|    458|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_null_atom(json_iterator &iter, const uint8_t *value) noexcept {
  217|    458|  iter.log_value("null");
  218|    458|  if (!atomparsing::is_valid_null_atom(value)) { return N_ATOM_ERROR; }
  ------------------
  |  Branch (218:7): [True: 70, False: 388]
  ------------------
  219|    388|  tape.append(0, internal::tape_type::NULL_VALUE);
  220|    388|  return SUCCESS;
  221|    458|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder16visit_object_endERNS2_13json_iteratorE:
  122|  1.88k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_object_end(json_iterator &iter) noexcept {
  123|  1.88k|  return end_container(iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT);
  124|  1.88k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder13end_containerERNS2_13json_iteratorENS_8internal9tape_typeES7_:
  249|  4.00k|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|  4.00k|  const uint32_t start_tape_index = iter.dom_parser.open_containers[iter.depth].tape_index;
  252|  4.00k|  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|  4.00k|  const uint32_t count = iter.dom_parser.open_containers[iter.depth].count;
  257|  4.00k|  const uint32_t cntsat = count > 0xFFFFFF ? 0xFFFFFF : count;
  ------------------
  |  Branch (257:27): [True: 0, False: 4.00k]
  ------------------
  258|  4.00k|  tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter) | (uint64_t(cntsat) << 32), start);
  259|  4.00k|  return SUCCESS;
  260|  4.00k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder17visit_array_startERNS2_13json_iteratorE:
  117|  15.7k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_start(json_iterator &iter) noexcept {
  118|  15.7k|  start_container(iter);
  119|  15.7k|  return SUCCESS;
  120|  15.7k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder15visit_array_endERNS2_13json_iteratorE:
  125|  2.11k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_array_end(json_iterator &iter) noexcept {
  126|  2.11k|  return end_container(iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY);
  127|  2.11k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage212tape_builder18visit_document_endERNS2_13json_iteratorE:
  128|  4.63k|simdjson_warn_unused simdjson_inline error_code tape_builder::visit_document_end(json_iterator &iter) noexcept {
  129|  4.63k|  constexpr uint32_t start_tape_index = 0;
  130|  4.63k|  tape.append(start_tape_index, internal::tape_type::ROOT);
  131|  4.63k|  tape_writer::write(iter.dom_parser.doc->tape[start_tape_index], next_tape_index(iter), internal::tape_type::ROOT);
  132|  4.63k|  return SUCCESS;
  133|  4.63k|}

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

_ZN8simdjson7haswell25dom_parser_implementation6stage1EPKhmNS_11stage1_modeE:
  138|  8.92k|simdjson_warn_unused error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, stage1_mode streaming) noexcept {
  139|  8.92k|  this->buf = _buf;
  140|  8.92k|  this->len = _len;
  141|  8.92k|  return haswell::stage1::json_structural_indexer::index<128>(_buf, _len, *this, streaming);
  142|  8.92k|}
_ZN8simdjson7haswell25dom_parser_implementation6stage2ERNS_3dom8documentE:
  148|  8.02k|simdjson_warn_unused error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
  149|  8.02k|  return stage2::tape_builder::parse_document<false>(*this, _doc);
  150|  8.02k|}
_ZN8simdjson7haswell25dom_parser_implementation5parseEPKhmRNS_3dom8documentE:
  164|  8.92k|simdjson_warn_unused error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {
  165|  8.92k|  auto error = stage1(_buf, _len, stage1_mode::regular);
  166|  8.92k|  if (error) { return error; }
  ------------------
  |  Branch (166:7): [True: 907, False: 8.02k]
  ------------------
  167|  8.02k|  return stage2(_doc);
  168|  8.92k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   85|  1.10M|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   86|  1.10M|  return input.reduce_or().is_ascii();
   87|  1.10M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   97|   116k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   98|   116k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   99|   116k|  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|   116k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  102|   116k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner12find_escapedEm:
  126|  1.10M|simdjson_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
  127|  1.10M|  if (!backslash) { uint64_t escaped = prev_escaped; prev_escaped = 0; return escaped; }
  ------------------
  |  Branch (127:7): [True: 1.09M, False: 4.95k]
  ------------------
  128|  4.95k|  return find_escaped_branchless(backslash);
  129|  1.10M|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_120json_character_block8classifyERKNS1_4simd8simd8x64IhEE:
   32|  1.10M|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.10M|  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.10M|  const auto op_table = simd8<uint8_t>::repeat_16(
   57|  1.10M|    0, 0, 0, 0,
   58|  1.10M|    0, 0, 0, 0,
   59|  1.10M|    0, 0, ':', '{', // : = 3A, [ = 5B, { = 7B
   60|  1.10M|    ',', '}', 0, 0  // , = 2C, ] = 5D, } = 7D
   61|  1.10M|  );
   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.10M|  const uint64_t whitespace = in.eq({
   69|  1.10M|    _mm256_shuffle_epi8(whitespace_table, in.chunks[0]),
   70|  1.10M|    _mm256_shuffle_epi8(whitespace_table, in.chunks[1])
   71|  1.10M|  });
   72|       |  // Turn [ and ] into { and }
   73|  1.10M|  const simd8x64<uint8_t> curlified{
   74|  1.10M|    in.chunks[0] | 0x20,
   75|  1.10M|    in.chunks[1] | 0x20
   76|  1.10M|  };
   77|  1.10M|  const uint64_t op = curlified.eq({
   78|  1.10M|    _mm256_shuffle_epi8(op_table, in.chunks[0]),
   79|  1.10M|    _mm256_shuffle_epi8(op_table, in.chunks[1])
   80|  1.10M|  });
   81|       |
   82|  1.10M|  return { whitespace, op };
   83|  1.10M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block6scalarEv:
   28|  2.20M|simdjson_inline uint64_t json_character_block::scalar() const noexcept { return ~(op() | whitespace()); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block2opEv:
   27|  3.31M|simdjson_inline uint64_t json_character_block::op() const noexcept { return _op; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_120json_character_block10whitespaceEv:
   26|  2.20M|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|  8.93k|) const noexcept {
   11|  8.93k|  dst.reset( new (std::nothrow) dom_parser_implementation() );
   12|  8.93k|  if (!dst) { return MEMALLOC; }
  ------------------
  |  Branch (12:7): [True: 0, False: 8.93k]
  ------------------
   13|  8.93k|  if (auto err = dst->set_capacity(capacity))
  ------------------
  |  Branch (13:12): [True: 0, False: 8.93k]
  ------------------
   14|      0|    return err;
   15|  8.93k|  if (auto err = dst->set_max_depth(max_depth))
  ------------------
  |  Branch (15:12): [True: 0, False: 8.93k]
  ------------------
   16|      0|    return err;
   17|  8.93k|  return SUCCESS;
   18|  8.93k|}

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

