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

LLVMFuzzerTestOneInput:
    9|  8.74k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   10|  8.74k|    simdjson::dom::parser parser;
   11|  8.74k|    simdjson::dom::element elem;
   12|  8.74k|    auto error = parser.parse(Data, Size).get(elem);
   13|  8.74k|    if (error) { return 0; }
  ------------------
  |  Branch (13:9): [True: 4.33k, False: 4.40k]
  ------------------
   14|       |
   15|  4.40k|    NulOStream os;
   16|  4.40k|    simdjson_unused auto dumpstatus = elem.dump_raw_tape(os);
  ------------------
  |  |   99|  4.40k|  #define simdjson_unused __attribute__((unused))
  ------------------
   17|  4.40k|    return 0;
   18|  8.74k|}

_ZNK8simdjson3dom8document8capacityEv:
   24|  8.74k|inline size_t document::capacity() const noexcept {
   25|  8.74k|  return allocated_capacity;
   26|  8.74k|}
_ZN8simdjson3dom8document8allocateEm:
   29|  8.74k|inline error_code document::allocate(size_t capacity) noexcept {
   30|  8.74k|  if (capacity == 0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 8.74k]
  ------------------
   31|      0|    string_buf.reset();
   32|      0|    tape.reset();
   33|      0|    allocated_capacity = 0;
   34|      0|    return SUCCESS;
   35|      0|  }
   36|       |
   37|       |  // a pathological input like "[[[[..." would generate capacity tape elements, so
   38|       |  // need a capacity of at least capacity + 1, but it is also possible to do
   39|       |  // worse with "[7,7,7,7,6,7,7,7,6,7,7,6,[7,7,7,7,6,7,7,7,6,7,7,6,7,7,7,7,7,7,6"
   40|       |  //where capacity + 1 tape elements are
   41|       |  // generated, see issue https://github.com/simdjson/simdjson/issues/345
   42|  8.74k|  size_t tape_capacity = SIMDJSON_ROUNDUP_N(capacity + 3, 64);
  ------------------
  |  |   47|  8.74k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   43|       |  // a document with only zero-length strings... could have capacity/3 string
   44|       |  // and we would need capacity/3 * 5 bytes on the string buffer
   45|  8.74k|  size_t string_capacity = SIMDJSON_ROUNDUP_N(5 * capacity / 3 + SIMDJSON_PADDING, 64);
  ------------------
  |  |   47|  8.74k|#define SIMDJSON_ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
  ------------------
   46|  8.74k|  string_buf.reset( new (std::nothrow) uint8_t[string_capacity]);
   47|  8.74k|  tape.reset(new (std::nothrow) uint64_t[tape_capacity]);
   48|  8.74k|  if(!(string_buf && tape)) {
  ------------------
  |  Branch (48:8): [True: 8.74k, False: 0]
  |  Branch (48:22): [True: 8.74k, False: 0]
  ------------------
   49|      0|    allocated_capacity = 0;
   50|      0|    string_buf.reset();
   51|      0|    tape.reset();
   52|      0|    return MEMALLOC;
   53|      0|  }
   54|       |  // Technically the allocated_capacity might be larger than capacity
   55|       |  // so the next line is pessimistic.
   56|  8.74k|  allocated_capacity = capacity;
   57|  8.74k|  return SUCCESS;
   58|  8.74k|}
_ZNK8simdjson3dom8document4rootEv:
   20|  4.40k|inline element document::root() const noexcept {
   21|  4.40k|  return element(internal::tape_ref(this, 1));
   22|  4.40k|}
_ZNK8simdjson3dom8document13dump_raw_tapeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
   60|  4.40k|inline bool document::dump_raw_tape(std::ostream &os) const noexcept {
   61|  4.40k|  uint32_t string_length;
   62|  4.40k|  size_t tape_idx = 0;
   63|  4.40k|  uint64_t tape_val = tape[tape_idx];
   64|  4.40k|  uint8_t type = uint8_t(tape_val >> 56);
   65|  4.40k|  os << tape_idx << " : " << type;
   66|  4.40k|  tape_idx++;
   67|  4.40k|  size_t how_many = 0;
   68|  4.40k|  if (type == 'r') {
  ------------------
  |  Branch (68:7): [True: 4.40k, False: 0]
  ------------------
   69|  4.40k|    how_many = size_t(tape_val & internal::JSON_VALUE_MASK);
   70|  4.40k|  } else {
   71|       |    // Error: no starting root node?
   72|      0|    return false;
   73|      0|  }
   74|  4.40k|  os << "\t// pointing to " << how_many << " (right after last node)\n";
   75|  4.40k|  uint64_t payload;
   76|  2.39M|  for (; tape_idx < how_many; tape_idx++) {
  ------------------
  |  Branch (76:10): [True: 2.39M, False: 0]
  ------------------
   77|  2.39M|    os << tape_idx << " : ";
   78|  2.39M|    tape_val = tape[tape_idx];
   79|  2.39M|    payload = tape_val & internal::JSON_VALUE_MASK;
   80|  2.39M|    type = uint8_t(tape_val >> 56);
   81|  2.39M|    switch (type) {
   82|   336k|    case '"': // we have a string
  ------------------
  |  Branch (82:5): [True: 336k, False: 2.05M]
  ------------------
   83|   336k|      os << "string \"";
   84|   336k|      std::memcpy(&string_length, string_buf.get() + payload, sizeof(uint32_t));
   85|   336k|      os << internal::escape_json_string(std::string_view(
   86|   336k|        reinterpret_cast<const char *>(string_buf.get() + payload + sizeof(uint32_t)),
   87|   336k|        string_length
   88|   336k|      ));
   89|   336k|      os << '"';
   90|   336k|      os << '\n';
   91|   336k|      break;
   92|  2.01M|    case 'l': // we have a long int
  ------------------
  |  Branch (92:5): [True: 2.01M, False: 380k]
  ------------------
   93|  2.01M|      if (tape_idx + 1 >= how_many) {
  ------------------
  |  Branch (93:11): [True: 0, False: 2.01M]
  ------------------
   94|      0|        return false;
   95|      0|      }
   96|  2.01M|      os << "integer " << static_cast<int64_t>(tape[++tape_idx]) << "\n";
   97|  2.01M|      break;
   98|  10.3k|    case 'u': // we have a long uint
  ------------------
  |  Branch (98:5): [True: 10.3k, False: 2.38M]
  ------------------
   99|  10.3k|      if (tape_idx + 1 >= how_many) {
  ------------------
  |  Branch (99:11): [True: 0, False: 10.3k]
  ------------------
  100|      0|        return false;
  101|      0|      }
  102|  10.3k|      os << "unsigned integer " << tape[++tape_idx] << "\n";
  103|  10.3k|      break;
  104|  19.9k|    case 'd': // we have a double
  ------------------
  |  Branch (104:5): [True: 19.9k, False: 2.37M]
  ------------------
  105|  19.9k|      os << "float ";
  106|  19.9k|      if (tape_idx + 1 >= how_many) {
  ------------------
  |  Branch (106:11): [True: 0, False: 19.9k]
  ------------------
  107|      0|        return false;
  108|      0|      }
  109|  19.9k|      double answer;
  110|  19.9k|      std::memcpy(&answer, &tape[++tape_idx], sizeof(answer));
  111|  19.9k|      os << answer << '\n';
  112|  19.9k|      break;
  113|    390|    case 'n': // we have a null
  ------------------
  |  Branch (113:5): [True: 390, False: 2.39M]
  ------------------
  114|    390|      os << "null\n";
  115|    390|      break;
  116|    389|    case 't': // we have a true
  ------------------
  |  Branch (116:5): [True: 389, False: 2.39M]
  ------------------
  117|    389|      os << "true\n";
  118|    389|      break;
  119|    261|    case 'f': // we have a false
  ------------------
  |  Branch (119:5): [True: 261, False: 2.39M]
  ------------------
  120|    261|      os << "false\n";
  121|    261|      break;
  122|  1.80k|    case '{': // we have an object
  ------------------
  |  Branch (122:5): [True: 1.80k, False: 2.39M]
  ------------------
  123|  1.80k|      os << "{\t// pointing to next tape location " << uint32_t(payload)
  124|  1.80k|         << " (first node after the scope), "
  125|  1.80k|         << " saturated count "
  126|  1.80k|         << ((payload >> 32) & internal::JSON_COUNT_MASK)<< "\n";
  127|  1.80k|      break;    case '}': // we end an object
  ------------------
  |  Branch (127:17): [True: 1.80k, False: 2.39M]
  ------------------
  128|  1.80k|      os << "}\t// pointing to previous tape location " << uint32_t(payload)
  129|  1.80k|         << " (start of the scope)\n";
  130|  1.80k|      break;
  131|  2.52k|    case '[': // we start an array
  ------------------
  |  Branch (131:5): [True: 2.52k, False: 2.39M]
  ------------------
  132|  2.52k|      os << "[\t// pointing to next tape location " << uint32_t(payload)
  133|  2.52k|         << " (first node after the scope), "
  134|  2.52k|         << " saturated count "
  135|  2.52k|         << ((payload >> 32) & internal::JSON_COUNT_MASK)<< "\n";
  136|  2.52k|      break;
  137|  2.52k|    case ']': // we end an array
  ------------------
  |  Branch (137:5): [True: 2.52k, False: 2.39M]
  ------------------
  138|  2.52k|      os << "]\t// pointing to previous tape location " << uint32_t(payload)
  139|  2.52k|         << " (start of the scope)\n";
  140|  2.52k|      break;
  141|  4.40k|    case 'r': // we start and end with the root node
  ------------------
  |  Branch (141:5): [True: 4.40k, False: 2.38M]
  ------------------
  142|       |      // should we be hitting the root node?
  143|  4.40k|      return false;
  144|      0|    default:
  ------------------
  |  Branch (144:5): [True: 0, False: 2.39M]
  ------------------
  145|      0|      return false;
  146|  2.39M|    }
  147|  2.39M|  }
  148|      0|  tape_val = tape[tape_idx];
  149|      0|  payload = tape_val & internal::JSON_VALUE_MASK;
  150|      0|  type = uint8_t(tape_val >> 56);
  151|      0|  os << tape_idx << " : " << type << "\t// pointing to " << payload
  152|      0|     << " (start root)\n";
  153|      0|  return true;
  154|  4.40k|}

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

_ZN8simdjson3dom7elementC2Ev:
  197|  13.0k|simdjson_inline element::element() noexcept : tape{} {}
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2ENS_10error_codeE:
   27|  4.33k|    : internal::simdjson_result_base<dom::element>(error) {}
_ZN8simdjson3dom7elementC2ERKNS_8internal8tape_refE:
  198|  8.81k|simdjson_inline element::element(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2EOS2_:
   25|  4.40k|    : internal::simdjson_result_base<dom::element>(std::forward<dom::element>(value)) {}
_ZNK8simdjson3dom7element13dump_raw_tapeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
  451|  4.40k|inline bool element::dump_raw_tape(std::ostream &out) const noexcept {
  452|  4.40k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  4.40k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  453|  4.40k|  return tape.doc->dump_raw_tape(out);
  454|  4.40k|}
_ZNK8simdjson15simdjson_resultINS_3dom7elementEE3getIS2_EENS_10error_codeERT_:
   43|  8.74k|simdjson_warn_unused simdjson_inline error_code simdjson_result<dom::element>::get(T &value) const noexcept {
   44|  8.74k|  if (error()) { return error(); }
  ------------------
  |  Branch (44:7): [True: 4.33k, False: 4.40k]
  ------------------
   45|  4.40k|  return first.get<T>(value);
   46|  8.74k|}
_ZNK8simdjson3dom7element3getIS1_EENS_10error_codeERT_:
  320|  4.40k|simdjson_warn_unused simdjson_inline error_code element::get<element>(element &value) const noexcept {
  321|  4.40k|  value = element(tape);
  322|  4.40k|  return SUCCESS;
  323|  4.40k|}

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

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

_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2ENS_10error_codeE:
  111|  4.33k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_NS_10error_codeE:
  108|  8.74k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_:
  114|  4.40k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8internal20simdjson_result_baseINS_3dom7elementEE5errorEv:
   66|  13.0k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   67|  13.0k|  return this->second;
   68|  13.0k|}

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

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

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

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

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

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

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ev:
  231|  26.2k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   98|  26.2k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   50|  26.2k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   22|  26.2k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  309|   984k|    simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8<T>::load(ptr), simd8<T>::load(ptr+32)} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE4loadEPKh:
   82|  2.42M|    static simdjson_inline simd8<T> load(const T values[32]) {
   83|  2.42M|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   84|  2.42M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  232|  21.5M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   99|  21.5M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   51|  21.5M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   25|  21.5M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  330|   984k|    simdjson_inline simd8<T> reduce_or() const {
  331|   984k|      return this->chunks[0] | this->chunks[1];
  332|   984k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   32|  4.02M|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   28|  44.4M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  283|   984k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   36|  1.01M|    simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast<Child*>(this); *this_cast = *this_cast | other; return *this_cast; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi1EEENS4_IhEES8_:
   58|  53.0k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|  53.0k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|  53.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  289|   106k|    simdjson_inline simd8<uint8_t> shr() const { return simd8<uint8_t>(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_:
  177|   159k|        L replace12, L replace13, L replace14, L replace15) const {
  178|   159k|      return lookup_16(simd8<L>::repeat_16(
  179|   159k|        replace0,  replace1,  replace2,  replace3,
  180|   159k|        replace4,  replace5,  replace6,  replace7,
  181|   159k|        replace8,  replace9,  replace10, replace11,
  182|   159k|        replace12, replace13, replace14, replace15
  183|   159k|      ));
  184|   159k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  115|   159k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  116|   159k|      return _mm256_shuffle_epi8(lookup_table, *this);
  117|   159k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   29|   159k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  253|  2.12M|    ) {
  254|  2.12M|      return simd8<uint8_t>(
  255|  2.12M|        v0, v1, v2, v3, v4, v5, v6, v7,
  256|  2.12M|        v8, v9, v10,v11,v12,v13,v14,v15,
  257|  2.12M|        v0, v1, v2, v3, v4, v5, v6, v7,
  258|  2.12M|        v8, v9, v10,v11,v12,v13,v14,v15
  259|  2.12M|      );
  260|  2.12M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|  2.12M|    ) : simd8(_mm256_setr_epi8(
  244|  2.12M|      v0, v1, v2, v3, v4, v5, v6, v7,
  245|  2.12M|      v8, v9, v10,v11,v12,v13,v14,v15,
  246|  2.12M|      v16,v17,v18,v19,v20,v21,v22,v23,
  247|  2.12M|      v24,v25,v26,v27,v28,v29,v30,v31
  248|  2.12M|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   33|   318k|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  234|  3.14M|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   80|  6.09M|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   58|  53.0k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|  53.0k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|  53.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   58|  53.0k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|  53.0k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|  53.0k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  264|   132k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm256_subs_epu8(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   34|  53.0k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  236|   454k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  270|  26.5k|    simdjson_inline simd8<uint8_t> gt_bits(const simd8<uint8_t> other) const { return this->saturating_sub(other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21any_bits_set_anywhereEv:
  285|  8.38k|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  284|  8.38k|    simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5storeEPh:
  102|   427k|    simdjson_inline void store(T dst[32]) const { return _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), *this); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simdeqENS2_5simd8IhEES4_:
   53|  10.6M|    friend simdjson_really_inline Mask operator==(const simd8<T> lhs, const simd8<T> rhs) { return _mm256_cmpeq_epi8(lhs, rhs); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IbEC2EDv4_x:
   69|  10.6M|    simdjson_inline simd8(const __m256i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv4_x:
   51|  10.6M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv4_x:
   25|  10.6M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IbE10to_bitmaskEv:
   73|  10.6M|    simdjson_inline int to_bitmask() const { return _mm256_movemask_epi8(*this); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRKDv4_xEv:
   28|  10.6M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqEh:
  342|  1.96M|    simdjson_inline uint64_t eq(const T m) const {
  343|  1.96M|      const simd8<T> mask = simd8<T>::splat(m);
  344|  1.96M|      return  simd8x64<bool>(
  345|  1.96M|        this->chunks[0] == mask,
  346|  1.96M|        this->chunks[1] == mask
  347|  1.96M|      ).to_bitmask();
  348|  1.96M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbEC2ENS2_5simd8IbEES6_:
  308|  4.92M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IbE10to_bitmaskEv:
  324|  4.92M|    simdjson_inline uint64_t to_bitmask() const {
  325|  4.92M|      uint64_t r_lo = uint32_t(this->chunks[0].to_bitmask());
  326|  4.92M|      uint64_t r_hi =                       this->chunks[1].to_bitmask();
  327|  4.92M|      return r_lo | (r_hi << 32);
  328|  4.92M|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE2eqERKS4_:
  350|  1.96M|    simdjson_inline uint64_t eq(const simd8x64<uint8_t> &other) const {
  351|  1.96M|      return  simd8x64<bool>(
  352|  1.96M|        this->chunks[0] == other.chunks[0],
  353|  1.96M|        this->chunks[1] == other.chunks[1]
  354|  1.96M|      ).to_bitmask();
  355|  1.96M|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2ENS2_5simd8IhEES6_:
  308|  2.95M|    simdjson_inline simd8x64(const simd8<T> chunk0, const simd8<T> chunk1) : chunks{chunk0, chunk1} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE4lteqEh:
  357|   984k|    simdjson_inline uint64_t lteq(const T m) const {
  358|   984k|      const simd8<T> mask = simd8<T>::splat(m);
  359|   984k|      return  simd8x64<bool>(
  360|   984k|        this->chunks[0] <= mask,
  361|   984k|        this->chunks[1] <= mask
  362|   984k|      ).to_bitmask();
  363|   984k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEleES4_:
  273|  1.96M|    simdjson_inline simd8<bool> operator<=(const simd8<uint8_t> other) const { return other.max_val(*this) == other; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7max_valES4_:
  267|  1.96M|    simdjson_inline simd8<uint8_t> max_val(const simd8<uint8_t> other) const { return _mm256_max_epu8(*this, other); }

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

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

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

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

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

_ZN8simdjson8internallsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_18escape_json_stringE:
   23|   336k|inline std::ostream& operator<<(std::ostream& out, const escape_json_string &unescaped) {
   24|  2.72M|  for (size_t i=0; i<unescaped.str.length(); i++) {
  ------------------
  |  Branch (24:20): [True: 2.38M, False: 336k]
  ------------------
   25|  2.38M|    switch (unescaped.str[i]) {
   26|    210|    case '\b':
  ------------------
  |  Branch (26:5): [True: 210, False: 2.38M]
  ------------------
   27|    210|      out << "\\b";
   28|    210|      break;
   29|    284|    case '\f':
  ------------------
  |  Branch (29:5): [True: 284, False: 2.38M]
  ------------------
   30|    284|      out << "\\f";
   31|    284|      break;
   32|    642|    case '\n':
  ------------------
  |  Branch (32:5): [True: 642, False: 2.38M]
  ------------------
   33|    642|      out << "\\n";
   34|    642|      break;
   35|  1.11k|    case '\r':
  ------------------
  |  Branch (35:5): [True: 1.11k, False: 2.38M]
  ------------------
   36|  1.11k|      out << "\\r";
   37|  1.11k|      break;
   38|    235|    case '\"':
  ------------------
  |  Branch (38:5): [True: 235, False: 2.38M]
  ------------------
   39|    235|      out << "\\\"";
   40|    235|      break;
   41|    495|    case '\t':
  ------------------
  |  Branch (41:5): [True: 495, False: 2.38M]
  ------------------
   42|    495|      out << "\\t";
   43|    495|      break;
   44|  1.32k|    case '\\':
  ------------------
  |  Branch (44:5): [True: 1.32k, False: 2.38M]
  ------------------
   45|  1.32k|      out << "\\\\";
   46|  1.32k|      break;
   47|  2.38M|    default:
  ------------------
  |  Branch (47:5): [True: 2.38M, False: 4.30k]
  ------------------
   48|  2.38M|      if (static_cast<unsigned char>(unescaped.str[i]) <= 0x1F) {
  ------------------
  |  Branch (48:11): [True: 610, False: 2.38M]
  ------------------
   49|       |        // TODO can this be done once at the beginning, or will it mess up << char?
   50|    610|        std::ios::fmtflags f(out.flags());
   51|    610|        out << "\\u" << std::hex << std::setw(4) << std::setfill('0') << int(unescaped.str[i]);
   52|    610|        out.flags(f);
   53|  2.38M|      } else {
   54|  2.38M|        out << unescaped.str[i];
   55|  2.38M|      }
   56|  2.38M|    }
   57|  2.38M|  }
   58|   336k|  return out;
   59|   336k|}
_ZN8simdjson8internal18escape_json_stringC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   16|   336k|  escape_json_string(std::string_view _str) noexcept : str{_str} {}

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

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

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

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

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner4nextERKNS1_4simd8simd8x64IhEE:
   62|   984k|simdjson_really_inline json_string_block json_string_scanner::next(const simd::simd8x64<uint8_t>& in) {
   63|   984k|  const uint64_t backslash = in.eq('\\');
   64|   984k|  const uint64_t escaped = escape_scanner.next(backslash).escaped;
   65|   984k|  const uint64_t quote = in.eq('"') & ~escaped;
   66|       |
   67|       |  //
   68|       |  // prefix_xor flips on bits inside the string (and flips off the end quote).
   69|       |  //
   70|       |  // Then we xor with prev_in_string: if we were in a string already, its effect is flipped
   71|       |  // (characters inside strings are outside, and characters outside strings are inside).
   72|       |  //
   73|   984k|  const uint64_t in_string = prefix_xor(quote) ^ prev_in_string;
   74|       |
   75|       |  //
   76|       |  // Check if we're still in a string at the end of the box so the next block will know
   77|       |  //
   78|   984k|  prev_in_string = uint64_t(static_cast<int64_t>(in_string) >> 63);
   79|       |
   80|       |  // Use ^ to turn the beginning quote off, and the end quote on.
   81|       |
   82|       |  // We are returning a function-local object so either we get a move constructor
   83|       |  // or we get copy elision.
   84|   984k|  return json_string_block(escaped, quote, in_string);
   85|   984k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage117json_string_blockC2Emmm:
   17|   984k|  _escaped(escaped), _quote(quote), _in_string(in_string) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block5quoteEv:
   22|   984k|  simdjson_really_inline uint64_t quote() const { return _quote; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage119json_string_scanner6finishEv:
   87|  8.73k|simdjson_really_inline error_code json_string_scanner::finish() {
   88|  8.73k|  if (prev_in_string) {
  ------------------
  |  Branch (88:7): [True: 169, False: 8.56k]
  ------------------
   89|    169|    return UNCLOSED_STRING;
   90|    169|  }
   91|  8.56k|  return SUCCESS;
   92|  8.73k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block11string_tailEv:
   30|   984k|  simdjson_really_inline uint64_t string_tail() const { return _in_string ^ _quote; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage117json_string_block23non_quote_inside_stringEm:
   26|   984k|  simdjson_really_inline uint64_t non_quote_inside_string(uint64_t mask) const { return mask & _in_string; }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer5indexILm128EEENS_10error_codeEPKhmRNS0_25dom_parser_implementationENS_11stage1_modeE:
  194|  8.73k|error_code json_structural_indexer::index(const uint8_t *buf, size_t len, dom_parser_implementation &parser, stage1_mode partial) noexcept {
  195|  8.73k|  if (simdjson_unlikely(len > parser.capacity())) { return CAPACITY; }
  ------------------
  |  |  106|  8.73k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 8.73k]
  |  |  ------------------
  ------------------
  196|       |  // We guard the rest of the code so that we can assume that len > 0 throughout.
  197|  8.73k|  if (len == 0) { return EMPTY; }
  ------------------
  |  Branch (197:7): [True: 1, False: 8.73k]
  ------------------
  198|  8.73k|  if (is_streaming(partial)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 8.73k]
  ------------------
  199|      0|    len = trim_partial_utf8(buf, len);
  200|       |    // If you end up with an empty window after trimming
  201|       |    // the partial UTF-8 bytes, then chances are good that you
  202|       |    // have an UTF-8 formatting error.
  203|      0|    if(len == 0) { return UTF8_ERROR; }
  ------------------
  |  Branch (203:8): [True: 0, False: 0]
  ------------------
  204|      0|  }
  205|  8.73k|  buf_block_reader<STEP_SIZE> reader(buf, len);
  206|  8.73k|  json_structural_indexer indexer(parser.structural_indexes.get());
  207|       |
  208|       |  // Read all but the last block
  209|   492k|  while (reader.has_full_block()) {
  ------------------
  |  Branch (209:10): [True: 483k, False: 8.73k]
  ------------------
  210|   483k|    indexer.step<STEP_SIZE>(reader.full_block(), reader);
  211|   483k|  }
  212|       |  // Take care of the last block (will always be there unless file is empty which is
  213|       |  // not supposed to happen.)
  214|  8.73k|  uint8_t block[STEP_SIZE];
  215|  8.73k|  if (simdjson_unlikely(reader.get_remainder(block) == 0)) { return UNEXPECTED_ERROR; }
  ------------------
  |  |  106|  8.73k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 8.73k]
  |  |  ------------------
  ------------------
  216|  8.73k|  indexer.step<STEP_SIZE>(block, reader);
  217|  8.73k|  return indexer.finish(parser, reader.block_index(), len, partial);
  218|  8.73k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexerC2EPj:
  153|  8.73k|simdjson_inline json_structural_indexer::json_structural_indexer(uint32_t *structural_indexes) : indexer{structural_indexes} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexerC2EPj:
   28|  8.73k|  simdjson_inline bit_indexer(uint32_t *index_buf) : tail(index_buf) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4stepILm128EEEvPKhRNS2_16buf_block_readerIXT_EEE:
  221|   492k|simdjson_inline void json_structural_indexer::step<128>(const uint8_t *block, buf_block_reader<128> &reader) noexcept {
  222|   492k|  simd::simd8x64<uint8_t> in_1(block);
  223|   492k|  simd::simd8x64<uint8_t> in_2(block+64);
  224|   492k|  json_block block_1 = scanner.next(in_1);
  225|   492k|  json_block block_2 = scanner.next(in_2);
  226|   492k|  this->next(in_1, block_1, reader.block_index());
  227|   492k|  this->next(in_2, block_2, reader.block_index()+64);
  228|   492k|  reader.advance();
  229|   492k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer4nextERKNS1_4simd8simd8x64IhEERKNS2_10json_blockEm:
  239|   984k|simdjson_inline void json_structural_indexer::next(const simd::simd8x64<uint8_t>& in, const json_block& block, size_t idx) {
  240|   984k|  uint64_t unescaped = in.lteq(0x1F);
  241|   984k|#if SIMDJSON_UTF8VALIDATION
  242|   984k|  checker.check_next_input(in);
  243|   984k|#endif
  244|   984k|  indexer.write(uint32_t(idx-64), prev_structurals); // Output *last* iteration's structurals to the parser
  245|   984k|  prev_structurals = block.structural_start();
  246|   984k|  unescaped_chars_error |= block.non_quote_inside_string(unescaped);
  247|   984k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer5writeEjm:
   93|   992k|  simdjson_inline void write(uint32_t idx, uint64_t bits) {
   94|       |    // In some instances, the next branch is expensive because it is mispredicted.
   95|       |    // Unfortunately, in other cases,
   96|       |    // it helps tremendously.
   97|   992k|    if (bits == 0)
  ------------------
  |  Branch (97:9): [True: 836k, False: 156k]
  ------------------
   98|   836k|        return;
   99|       |
  100|   156k|    int cnt = static_cast<int>(count_ones(bits));
  101|       |
  102|       |#if SIMDJSON_PREFER_REVERSE_BITS
  103|       |    bits = reverse_bits(bits);
  104|       |#endif
  105|       |#ifdef SIMDJSON_STRUCTURAL_INDEXER_STEP
  106|       |    static constexpr const int STEP = SIMDJSON_STRUCTURAL_INDEXER_STEP;
  107|       |#else
  108|   156k|    static constexpr const int STEP = 4;
  109|   156k|#endif
  110|   156k|    static constexpr const int STEP_UNTIL = 24;
  111|       |
  112|   156k|    write_indexes_stepped<0, STEP_UNTIL, STEP>(idx, bits, cnt);
  113|   156k|    SIMDJSON_IF_CONSTEXPR (STEP_UNTIL < 64) {
  ------------------
  |  |   47|   156k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  114|   156k|      if (simdjson_unlikely(STEP_UNTIL < cnt)) {
  ------------------
  |  |  106|   156k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 116k, False: 39.9k]
  |  |  ------------------
  ------------------
  115|  3.84M|        for (int i=STEP_UNTIL; i<cnt; i++) {
  ------------------
  |  Branch (115:32): [True: 3.73M, False: 116k]
  ------------------
  116|  3.73M|          write_index(idx, bits, i);
  117|  3.73M|        }
  118|   116k|      }
  119|   156k|    }
  120|       |
  121|   156k|    this->tail += cnt;
  122|   156k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi0ELi24ELi4EEEijRmi:
   72|   156k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   156k|    write_indexes<START, STEP>(idx, bits);
   74|   156k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   156k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   156k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   156k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 131k, False: 25.4k]
  |  |  ------------------
  ------------------
   76|   131k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   131k|      }
   78|   156k|    }
   79|   156k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   156k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi0ELi4EEEijRm:
   63|   156k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   156k|    write_index(idx, bits, START);
   65|   156k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   156k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   156k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   156k|    }
   68|   156k|    return START+N;
   69|   156k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi1ELi3EEEijRm:
   63|   156k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   156k|    write_index(idx, bits, START);
   65|   156k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   156k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   156k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   156k|    }
   68|   156k|    return START+N;
   69|   156k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi2ELi2EEEijRm:
   63|   156k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   156k|    write_index(idx, bits, START);
   65|   156k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   156k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   156k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   156k|    }
   68|   156k|    return START+N;
   69|   156k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi3ELi1EEEijRm:
   63|   156k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   156k|    write_index(idx, bits, START);
   65|   156k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   156k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   156k|    return START+N;
   69|   156k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi4ELi24ELi4EEEijRmi:
   72|   131k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   131k|    write_indexes<START, STEP>(idx, bits);
   74|   131k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   131k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   131k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   131k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 125k, False: 6.22k]
  |  |  ------------------
  ------------------
   76|   125k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   125k|      }
   78|   131k|    }
   79|   131k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   131k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi4ELi4EEEijRm:
   63|   131k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   131k|    write_index(idx, bits, START);
   65|   131k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   131k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   131k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   131k|    }
   68|   131k|    return START+N;
   69|   131k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi5ELi3EEEijRm:
   63|   131k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   131k|    write_index(idx, bits, START);
   65|   131k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   131k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   131k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   131k|    }
   68|   131k|    return START+N;
   69|   131k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi6ELi2EEEijRm:
   63|   131k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   131k|    write_index(idx, bits, START);
   65|   131k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   131k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   131k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   131k|    }
   68|   131k|    return START+N;
   69|   131k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi7ELi1EEEijRm:
   63|   131k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   131k|    write_index(idx, bits, START);
   65|   131k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   131k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   131k|    return START+N;
   69|   131k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi8ELi24ELi4EEEijRmi:
   72|   125k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   125k|    write_indexes<START, STEP>(idx, bits);
   74|   125k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   125k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   125k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   125k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 123k, False: 1.97k]
  |  |  ------------------
  ------------------
   76|   123k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   123k|      }
   78|   125k|    }
   79|   125k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   125k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi8ELi4EEEijRm:
   63|   125k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   125k|    write_index(idx, bits, START);
   65|   125k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   125k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   125k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   125k|    }
   68|   125k|    return START+N;
   69|   125k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi9ELi3EEEijRm:
   63|   125k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   125k|    write_index(idx, bits, START);
   65|   125k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   125k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   125k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   125k|    }
   68|   125k|    return START+N;
   69|   125k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi10ELi2EEEijRm:
   63|   125k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   125k|    write_index(idx, bits, START);
   65|   125k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   125k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   125k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   125k|    }
   68|   125k|    return START+N;
   69|   125k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi11ELi1EEEijRm:
   63|   125k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   125k|    write_index(idx, bits, START);
   65|   125k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   125k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   125k|    return START+N;
   69|   125k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi12ELi24ELi4EEEijRmi:
   72|   123k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   123k|    write_indexes<START, STEP>(idx, bits);
   74|   123k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   123k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   123k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 121k, False: 1.62k]
  |  |  ------------------
  ------------------
   76|   121k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   121k|      }
   78|   123k|    }
   79|   123k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi12ELi4EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   123k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   123k|    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi13ELi3EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   123k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   123k|    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi14ELi2EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   123k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   123k|    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi15ELi1EEEijRm:
   63|   123k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   123k|    write_index(idx, bits, START);
   65|   123k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   123k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   123k|    return START+N;
   69|   123k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi16ELi24ELi4EEEijRmi:
   72|   121k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   121k|    write_indexes<START, STEP>(idx, bits);
   74|   121k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   121k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|   121k|      if (simdjson_unlikely((START+STEP) < cnt)) {
  ------------------
  |  |  106|   121k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 117k, False: 3.71k]
  |  |  ------------------
  ------------------
   76|   117k|        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|   117k|      }
   78|   121k|    }
   79|   121k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   121k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi16ELi4EEEijRm:
   63|   121k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   121k|    write_index(idx, bits, START);
   65|   121k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   121k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   121k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   121k|    }
   68|   121k|    return START+N;
   69|   121k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi17ELi3EEEijRm:
   63|   121k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   121k|    write_index(idx, bits, START);
   65|   121k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   121k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   121k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   121k|    }
   68|   121k|    return START+N;
   69|   121k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi18ELi2EEEijRm:
   63|   121k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   121k|    write_index(idx, bits, START);
   65|   121k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   121k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   121k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   121k|    }
   68|   121k|    return START+N;
   69|   121k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi19ELi1EEEijRm:
   63|   121k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   121k|    write_index(idx, bits, START);
   65|   121k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   121k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   121k|    return START+N;
   69|   121k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer21write_indexes_steppedILi20ELi24ELi4EEEijRmi:
   72|   117k|  simdjson_inline int write_indexes_stepped(uint32_t idx, uint64_t& bits, int cnt) {
   73|   117k|    write_indexes<START, STEP>(idx, bits);
   74|   117k|    SIMDJSON_IF_CONSTEXPR ((START+STEP)  < END) {
  ------------------
  |  |   47|   117k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   75|       |      if (simdjson_unlikely((START+STEP) < cnt)) {
   76|       |        write_indexes_stepped<(START+STEP<END?START+STEP:END), END, STEP>(idx, bits, cnt);
   77|       |      }
   78|       |    }
   79|   117k|    return ((END-START) % STEP) == 0 ? END : (END-START) - ((END-START) % STEP) + STEP;
  ------------------
  |  Branch (79:12): [Folded - Ignored]
  ------------------
   80|   117k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi20ELi4EEEijRm:
   63|   117k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   117k|    write_index(idx, bits, START);
   65|   117k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   117k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   117k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   117k|    }
   68|   117k|    return START+N;
   69|   117k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi21ELi3EEEijRm:
   63|   117k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   117k|    write_index(idx, bits, START);
   65|   117k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   117k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   117k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   117k|    }
   68|   117k|    return START+N;
   69|   117k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi22ELi2EEEijRm:
   63|   117k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   117k|    write_index(idx, bits, START);
   65|   117k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   117k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|   117k|      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|   117k|    }
   68|   117k|    return START+N;
   69|   117k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer13write_indexesILi23ELi1EEEijRm:
   63|   117k|  simdjson_inline int write_indexes(uint32_t idx, uint64_t& bits) {
   64|   117k|    write_index(idx, bits, START);
   65|   117k|    SIMDJSON_IF_CONSTEXPR (N > 1) {
  ------------------
  |  |   47|   117k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
   66|       |      write_indexes<(N-1>0?START+1:START), (N-1>=0?N-1:1)>(idx, bits);
   67|       |    }
   68|   117k|    return START+N;
   69|   117k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage111bit_indexer11write_indexEjRmi:
   56|  6.83M|  simdjson_inline void write_index(uint32_t idx, uint64_t& bits, int i) {
   57|  6.83M|    this->tail[i] = idx + trailing_zeroes(bits);
   58|  6.83M|    bits = clear_lowest_bit(bits);
   59|  6.83M|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage123json_structural_indexer6finishERNS0_25dom_parser_implementationEmmNS_11stage1_modeE:
  249|  8.73k|simdjson_inline error_code json_structural_indexer::finish(dom_parser_implementation &parser, size_t idx, size_t len, stage1_mode partial) {
  250|       |  // Write out the final iteration's structurals
  251|  8.73k|  indexer.write(uint32_t(idx-64), prev_structurals);
  252|  8.73k|  error_code error = scanner.finish();
  253|       |  // We deliberately break down the next expression so that it is
  254|       |  // human readable.
  255|  8.73k|  const bool should_we_exit = is_streaming(partial) ?
  ------------------
  |  Branch (255:31): [True: 0, False: 8.73k]
  ------------------
  256|      0|    ((error != SUCCESS) && (error != UNCLOSED_STRING)) // when partial we tolerate UNCLOSED_STRING
  ------------------
  |  Branch (256:6): [True: 0, False: 0]
  |  Branch (256:28): [True: 0, False: 0]
  ------------------
  257|  8.73k|    : (error != SUCCESS); // if partial is false, we must have SUCCESS
  258|  8.73k|  const bool have_unclosed_string = (error == UNCLOSED_STRING);
  259|  8.73k|  if (simdjson_unlikely(should_we_exit)) { return error; }
  ------------------
  |  |  106|  8.73k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 169, False: 8.56k]
  |  |  ------------------
  ------------------
  260|       |
  261|  8.56k|  if (unescaped_chars_error) {
  ------------------
  |  Branch (261:7): [True: 178, False: 8.39k]
  ------------------
  262|    178|    return UNESCAPED_CHARS;
  263|    178|  }
  264|  8.39k|  parser.n_structural_indexes = uint32_t(indexer.tail - parser.structural_indexes.get());
  265|       |  /***
  266|       |   * The On-Demand API requires special padding.
  267|       |   *
  268|       |   * This is related to https://github.com/simdjson/simdjson/issues/906
  269|       |   * Basically, we want to make sure that if the parsing continues beyond the last (valid)
  270|       |   * structural character, it quickly stops.
  271|       |   * Only three structural characters can be repeated without triggering an error in JSON:  [,] and }.
  272|       |   * We repeat the padding character (at 'len'). We don't know what it is, but if the parsing
  273|       |   * continues, then it must be [,] or }.
  274|       |   * Suppose it is ] or }. We backtrack to the first character, what could it be that would
  275|       |   * not trigger an error? It could be ] or } but no, because you can't start a document that way.
  276|       |   * It can't be a comma, a colon or any simple value. So the only way we could continue is
  277|       |   * if the repeated character is [. But if so, the document must start with [. But if the document
  278|       |   * starts with [, it should end with ]. If we enforce that rule, then we would get
  279|       |   * ][[ which is invalid.
  280|       |   *
  281|       |   * This is illustrated with the test array_iterate_unclosed_error() on the following input:
  282|       |   * R"({ "a": [,,)"
  283|       |   **/
  284|  8.39k|  parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len); // used later in partial == stage1_mode::streaming_final
  285|  8.39k|  parser.structural_indexes[parser.n_structural_indexes + 1] = uint32_t(len);
  286|  8.39k|  parser.structural_indexes[parser.n_structural_indexes + 2] = 0;
  287|  8.39k|  parser.next_structural_index = 0;
  288|       |  // a valid JSON file cannot have zero structural indexes - we should have found something
  289|  8.39k|  if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  106|  8.39k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 1, False: 8.38k]
  |  |  ------------------
  ------------------
  290|      1|    return EMPTY;
  291|      1|  }
  292|  8.38k|  if (simdjson_unlikely(parser.structural_indexes[parser.n_structural_indexes - 1] > len)) {
  ------------------
  |  |  106|  8.38k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 8.38k]
  |  |  ------------------
  ------------------
  293|      0|    return UNEXPECTED_ERROR;
  294|      0|  }
  295|  8.38k|  if (partial == stage1_mode::streaming_partial) {
  ------------------
  |  Branch (295:7): [True: 0, False: 8.38k]
  ------------------
  296|       |    // If we have an unclosed string, then the last structural
  297|       |    // will be the quote and we want to make sure to omit it.
  298|      0|    if(have_unclosed_string) {
  ------------------
  |  Branch (298:8): [True: 0, False: 0]
  ------------------
  299|      0|      parser.n_structural_indexes--;
  300|       |      // a valid JSON file cannot have zero structural indexes - we should have found something
  301|      0|      if (simdjson_unlikely(parser.n_structural_indexes == 0u)) { return CAPACITY; }
  ------------------
  |  |  106|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  302|      0|    }
  303|       |    // We truncate the input to the end of the last complete document (or zero).
  304|      0|    auto new_structural_indexes = find_next_document_index(parser);
  305|      0|    if (new_structural_indexes == 0 && parser.n_structural_indexes > 0) {
  ------------------
  |  Branch (305:9): [True: 0, False: 0]
  |  Branch (305:40): [True: 0, False: 0]
  ------------------
  306|      0|      if(parser.structural_indexes[0] == 0) {
  ------------------
  |  Branch (306:10): [True: 0, False: 0]
  ------------------
  307|       |        // If the buffer is partial and we started at index 0 but the document is
  308|       |        // incomplete, it's too big to parse.
  309|      0|        return CAPACITY;
  310|      0|      } else {
  311|       |        // It is possible that the document could be parsed, we just had a lot
  312|       |        // of white space.
  313|      0|        parser.n_structural_indexes = 0;
  314|      0|        return EMPTY;
  315|      0|      }
  316|      0|    }
  317|       |
  318|      0|    parser.n_structural_indexes = new_structural_indexes;
  319|  8.38k|  } else if (partial == stage1_mode::streaming_final) {
  ------------------
  |  Branch (319:14): [True: 0, False: 8.38k]
  ------------------
  320|      0|    if(have_unclosed_string) { parser.n_structural_indexes--; }
  ------------------
  |  Branch (320:8): [True: 0, False: 0]
  ------------------
  321|       |    // We truncate the input to the end of the last complete document (or zero).
  322|       |    // Because partial == stage1_mode::streaming_final, it means that we may
  323|       |    // silently ignore trailing garbage. Though it sounds bad, we do it
  324|       |    // deliberately because many people who have streams of JSON documents
  325|       |    // will truncate them for processing. E.g., imagine that you are uncompressing
  326|       |    // the data from a size file or receiving it in chunks from the network. You
  327|       |    // may not know where exactly the last document will be. Meanwhile the
  328|       |    // document_stream instances allow people to know the JSON documents they are
  329|       |    // parsing (see the iterator.source() method).
  330|      0|    parser.n_structural_indexes = find_next_document_index(parser);
  331|       |    // We store the initial n_structural_indexes so that the client can see
  332|       |    // whether we used truncation. If initial_n_structural_indexes == parser.n_structural_indexes,
  333|       |    // then this will query parser.structural_indexes[parser.n_structural_indexes] which is len,
  334|       |    // otherwise, it will copy some prior index.
  335|      0|    parser.structural_indexes[parser.n_structural_indexes + 1] = parser.structural_indexes[parser.n_structural_indexes];
  336|       |    // This next line is critical, do not change it unless you understand what you are
  337|       |    // doing.
  338|      0|    parser.structural_indexes[parser.n_structural_indexes] = uint32_t(len);
  339|      0|    if (simdjson_unlikely(parser.n_structural_indexes == 0u)) {
  ------------------
  |  |  106|      0|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  340|       |        // We tolerate an unclosed string at the very end of the stream. Indeed, users
  341|       |        // often load their data in bulk without being careful and they want us to ignore
  342|       |        // the trailing garbage.
  343|      0|        return EMPTY;
  344|      0|    }
  345|      0|  }
  346|  8.38k|  checker.check_eof();
  347|  8.38k|  return checker.errors();
  348|  8.38k|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iteratorC2ERNS0_25dom_parser_implementationEm:
  245|  7.81k|  : buf{_dom_parser.buf},
  246|  7.81k|    next_structural{&_dom_parser.structural_indexes[start_structural_index]},
  247|  7.81k|    dom_parser{_dom_parser} {
  248|  7.81k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13walk_documentILb0ENS2_12tape_builderEEENS_10error_codeERT0_:
  119|  7.81k|simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
  120|  7.81k|  logger::log_start();
  121|       |
  122|       |  //
  123|       |  // Start the document
  124|       |  //
  125|  7.81k|  if (at_eof()) { return EMPTY; }
  ------------------
  |  Branch (125:7): [True: 0, False: 7.81k]
  ------------------
  126|  7.81k|  log_start_value("document");
  127|  7.81k|  SIMDJSON_TRY( visitor.visit_document_start(*this) );
  ------------------
  |  |  273|  7.81k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 7.81k]
  |  |  ------------------
  ------------------
  128|       |
  129|       |  //
  130|       |  // Read first value
  131|       |  //
  132|  7.81k|  {
  133|  7.81k|    auto value = advance();
  134|       |
  135|       |    // Make sure the outer object or array is closed before continuing; otherwise, there are ways we
  136|       |    // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906
  137|  7.81k|    if (!STREAMING) {
  ------------------
  |  Branch (137:9): [Folded - Ignored]
  ------------------
  138|  7.81k|      switch (*value) {
  ------------------
  |  Branch (138:15): [True: 2.50k, False: 5.30k]
  ------------------
  139|  2.76k|        case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (139:9): [True: 2.76k, False: 5.05k]
  |  Branch (139:23): [True: 17, False: 2.74k]
  ------------------
  140|  2.54k|        case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (140:9): [True: 2.54k, False: 5.26k]
  |  Branch (140:23): [True: 27, False: 2.51k]
  ------------------
  141|  7.81k|      }
  142|  7.81k|    }
  143|       |
  144|  7.76k|    switch (*value) {
  145|  2.74k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|      2|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (145:7): [True: 2.74k, False: 5.02k]
  |  Branch (145:21): [True: 2, False: 2.74k]
  ------------------
  146|  2.74k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|      2|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (146:7): [True: 2.51k, False: 5.25k]
  |  Branch (146:21): [True: 2, False: 2.51k]
  ------------------
  147|  2.51k|      default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break;
  ------------------
  |  |  273|  2.50k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 979, False: 1.52k]
  |  |  ------------------
  ------------------
  |  Branch (147:7): [True: 2.50k, False: 5.26k]
  ------------------
  148|  7.76k|    }
  149|  7.76k|  }
  150|  1.53k|  goto document_end;
  151|       |
  152|       |//
  153|       |// Object parser states
  154|       |//
  155|  4.15k|object_begin:
  156|  4.15k|  log_start_value("object");
  157|  4.15k|  depth++;
  158|  4.15k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (158:7): [True: 1, False: 4.15k]
  ------------------
  159|  4.15k|  dom_parser.is_array[depth] = false;
  160|  4.15k|  SIMDJSON_TRY( visitor.visit_object_start(*this) );
  ------------------
  |  |  273|  4.15k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 4.15k]
  |  |  ------------------
  ------------------
  161|       |
  162|  4.15k|  {
  163|  4.15k|    auto key = advance();
  164|  4.15k|    if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; }
  ------------------
  |  Branch (164:9): [True: 79, False: 4.07k]
  ------------------
  165|  4.07k|    SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  4.07k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 4.07k]
  |  |  ------------------
  ------------------
  166|  4.07k|    SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  273|  4.07k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 96, False: 3.98k]
  |  |  ------------------
  ------------------
  167|  3.98k|  }
  168|       |
  169|   339k|object_field:
  170|   339k|  if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; }
  ------------------
  |  |  106|   339k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 430, False: 338k]
  |  |  ------------------
  ------------------
  171|   338k|  {
  172|   338k|    auto value = advance();
  173|   338k|    switch (*value) {
  174|  1.05k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    224|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 224]
  |  |  ------------------
  ------------------
  |  Branch (174:7): [True: 1.05k, False: 337k]
  |  Branch (174:21): [True: 224, False: 831]
  ------------------
  175|    831|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|    194|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 194]
  |  |  ------------------
  ------------------
  |  Branch (175:7): [True: 617, False: 338k]
  |  Branch (175:21): [True: 194, False: 423]
  ------------------
  176|   337k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  273|   337k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 616, False: 336k]
  |  |  ------------------
  ------------------
  |  Branch (176:7): [True: 337k, False: 1.67k]
  ------------------
  177|   338k|    }
  178|   338k|  }
  179|       |
  180|   337k|object_continue:
  181|   337k|  switch (*advance()) {
  182|   335k|    case ',':
  ------------------
  |  Branch (182:5): [True: 335k, False: 1.97k]
  ------------------
  183|   335k|      SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|   335k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 335k]
  |  |  ------------------
  ------------------
  184|   335k|      {
  185|   335k|        auto key = advance();
  186|   335k|        if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; }
  ------------------
  |  |  106|   335k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 15, False: 335k]
  |  |  ------------------
  ------------------
  187|   335k|        SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  273|   335k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 103, False: 335k]
  |  |  ------------------
  ------------------
  188|   335k|      }
  189|      0|      goto object_field;
  190|  1.87k|    case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end;
  ------------------
  |  |  273|  1.87k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 1.87k]
  |  |  ------------------
  ------------------
  |  Branch (190:5): [True: 1.87k, False: 335k]
  ------------------
  191|    100|    default: log_error("No comma between object fields"); return TAPE_ERROR;
  ------------------
  |  Branch (191:5): [True: 100, False: 337k]
  ------------------
  192|   337k|  }
  193|       |
  194|  4.69k|scope_end:
  195|  4.69k|  depth--;
  196|  4.69k|  if (depth == 0) { goto document_end; }
  ------------------
  |  Branch (196:7): [True: 2.92k, False: 1.76k]
  ------------------
  197|  1.76k|  if (dom_parser.is_array[depth]) { goto array_continue; }
  ------------------
  |  Branch (197:7): [True: 1.35k, False: 406]
  ------------------
  198|    406|  goto object_continue;
  199|       |
  200|       |//
  201|       |// Array parser states
  202|       |//
  203|  23.9k|array_begin:
  204|  23.9k|  log_start_value("array");
  205|  23.9k|  depth++;
  206|  23.9k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (206:7): [True: 2, False: 23.9k]
  ------------------
  207|  23.9k|  dom_parser.is_array[depth] = true;
  208|  23.9k|  SIMDJSON_TRY( visitor.visit_array_start(*this) );
  ------------------
  |  |  273|  23.9k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 23.9k]
  |  |  ------------------
  ------------------
  209|  23.9k|  SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  23.9k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 23.9k]
  |  |  ------------------
  ------------------
  210|       |
  211|  1.74M|array_value:
  212|  1.74M|  {
  213|  1.74M|    auto value = advance();
  214|  1.74M|    switch (*value) {
  215|    930|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    344|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 344]
  |  |  ------------------
  ------------------
  |  Branch (215:7): [True: 930, False: 1.74M]
  |  Branch (215:21): [True: 344, False: 586]
  ------------------
  216|  21.5k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|    534|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 534]
  |  |  ------------------
  ------------------
  |  Branch (216:7): [True: 21.5k, False: 1.72M]
  |  Branch (216:21): [True: 534, False: 21.0k]
  ------------------
  217|  1.72M|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  273|  1.72M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 793, False: 1.72M]
  |  |  ------------------
  ------------------
  |  Branch (217:7): [True: 1.72M, False: 22.5k]
  ------------------
  218|  1.74M|    }
  219|  1.74M|  }
  220|       |
  221|  1.72M|array_continue:
  222|  1.72M|  switch (*advance()) {
  223|  1.72M|    case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value;
  ------------------
  |  |  273|  1.72M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 1.72M]
  |  |  ------------------
  ------------------
  |  Branch (223:5): [True: 1.72M, False: 2.91k]
  ------------------
  224|  2.82k|    case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end;
  ------------------
  |  |  273|  2.82k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 2.82k]
  |  |  ------------------
  ------------------
  |  Branch (224:5): [True: 2.82k, False: 1.72M]
  ------------------
  225|     96|    default: log_error("Missing comma between array values"); return TAPE_ERROR;
  ------------------
  |  Branch (225:5): [True: 96, False: 1.72M]
  ------------------
  226|  1.72M|  }
  227|       |
  228|  4.45k|document_end:
  229|  4.45k|  log_end_value("document");
  230|  4.45k|  SIMDJSON_TRY( visitor.visit_document_end(*this) );
  ------------------
  |  |  273|  4.45k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 4.45k]
  |  |  ------------------
  ------------------
  231|       |
  232|  4.45k|  dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]);
  233|       |
  234|       |  // If we didn't make it to the end, it's an error
  235|  4.45k|  if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
  ------------------
  |  Branch (235:8): [Folded - Ignored]
  |  Branch (235:22): [True: 51, False: 4.40k]
  ------------------
  236|     51|    log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
  237|     51|    return TAPE_ERROR;
  238|     51|  }
  239|       |
  240|  4.40k|  return SUCCESS;
  241|       |
  242|  4.45k|} // walk_document()
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator6at_eofEv:
  260|  7.81k|simdjson_inline bool json_iterator::at_eof() const noexcept {
  261|  7.81k|  return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes];
  262|  7.81k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15log_start_valueEPKc:
  274|  35.9k|simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept {
  275|  35.9k|  logger::log_line(*this, "+", type, "");
  276|  35.9k|  if (logger::LOG_ENABLED) { logger::log_depth++; }
  ------------------
  |  Branch (276:7): [Folded - Ignored]
  ------------------
  277|  35.9k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator7advanceEv:
  253|  4.84M|simdjson_inline const uint8_t *json_iterator::advance() noexcept {
  254|  4.84M|  return &buf[*(next_structural++)];
  255|  4.84M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15last_structuralEv:
  266|  5.30k|simdjson_inline uint8_t json_iterator::last_structural() const noexcept {
  267|  5.30k|  return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]];
  268|  5.30k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_valueEPKc:
  270|  2.40M|simdjson_inline void json_iterator::log_value(const char *type) const noexcept {
  271|  2.40M|  logger::log_line(*this, "", type, "");
  272|  2.40M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator4peekEv:
  250|  29.4k|simdjson_inline const uint8_t *json_iterator::peek() const noexcept {
  251|  29.4k|  return &buf[*(next_structural)];
  252|  29.4k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator20visit_root_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  289|  2.50k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept {
  290|  2.50k|  switch (*value) {
  291|    352|    case '"': return visitor.visit_root_string(*this, value);
  ------------------
  |  Branch (291:5): [True: 352, False: 2.15k]
  ------------------
  292|     57|    case 't': return visitor.visit_root_true_atom(*this, value);
  ------------------
  |  Branch (292:5): [True: 57, False: 2.45k]
  ------------------
  293|     96|    case 'f': return visitor.visit_root_false_atom(*this, value);
  ------------------
  |  Branch (293:5): [True: 96, False: 2.41k]
  ------------------
  294|     46|    case 'n': return visitor.visit_root_null_atom(*this, value);
  ------------------
  |  Branch (294:5): [True: 46, False: 2.46k]
  ------------------
  295|    102|    case '-':
  ------------------
  |  Branch (295:5): [True: 102, False: 2.40k]
  ------------------
  296|    949|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (296:5): [True: 138, False: 2.37k]
  |  Branch (296:15): [True: 280, False: 2.22k]
  |  Branch (296:25): [True: 239, False: 2.26k]
  |  Branch (296:35): [True: 96, False: 2.41k]
  |  Branch (296:45): [True: 94, False: 2.41k]
  ------------------
  297|  1.85k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (297:5): [True: 108, False: 2.40k]
  |  Branch (297:15): [True: 82, False: 2.42k]
  |  Branch (297:25): [True: 89, False: 2.41k]
  |  Branch (297:35): [True: 220, False: 2.28k]
  |  Branch (297:45): [True: 409, False: 2.09k]
  ------------------
  298|  1.85k|      return visitor.visit_root_number(*this, value);
  299|    100|    default:
  ------------------
  |  Branch (299:5): [True: 100, False: 2.40k]
  ------------------
  300|    100|      log_error("Document starts with a non-value character");
  301|    100|      return TAPE_ERROR;
  302|  2.50k|  }
  303|  2.50k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13remaining_lenEv:
  256|  5.77k|simdjson_inline size_t json_iterator::remaining_len() const noexcept {
  257|  5.77k|  return dom_parser.len - *(next_structural-1);
  258|  5.77k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_errorEPKc:
  284|  1.42k|simdjson_inline void json_iterator::log_error(const char *error) const noexcept {
  285|  1.42k|  logger::log_line(*this, "", "ERROR", error);
  286|  1.42k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15visit_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  305|  2.06M|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept {
  306|       |  // Use the fact that most scalars are going to be either strings or numbers.
  307|  2.06M|  if(*value == '"') {
  ------------------
  |  Branch (307:6): [True: 1.29k, False: 2.06M]
  ------------------
  308|  1.29k|    return visitor.visit_string(*this, value);
  309|  2.06M|  } else if (((*value - '0')  < 10) || (*value == '-')) {
  ------------------
  |  Branch (309:14): [True: 2.06M, False: 1.51k]
  |  Branch (309:40): [True: 0, False: 1.51k]
  ------------------
  310|  2.06M|    return visitor.visit_number(*this, value);
  311|  2.06M|  }
  312|       |  // true, false, null are uncommon.
  313|  1.51k|  switch (*value) {
  314|    468|    case 't': return visitor.visit_true_atom(*this, value);
  ------------------
  |  Branch (314:5): [True: 468, False: 1.04k]
  ------------------
  315|    485|    case 'f': return visitor.visit_false_atom(*this, value);
  ------------------
  |  Branch (315:5): [True: 485, False: 1.03k]
  ------------------
  316|    499|    case 'n': return visitor.visit_null_atom(*this, value);
  ------------------
  |  Branch (316:5): [True: 499, False: 1.01k]
  ------------------
  317|     65|    default:
  ------------------
  |  Branch (317:5): [True: 65, False: 1.45k]
  ------------------
  318|     65|      log_error("Non-value found when value was expected!");
  319|     65|      return TAPE_ERROR;
  320|  1.51k|  }
  321|  1.51k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13log_end_valueEPKc:
  279|  9.14k|simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept {
  280|  9.14k|  if (logger::LOG_ENABLED) { logger::log_depth--; }
  ------------------
  |  Branch (280:7): [Folded - Ignored]
  ------------------
  281|  9.14k|  logger::log_line(*this, "-", type, "");
  282|  9.14k|}

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

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

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

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

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

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

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

