_ZN8FuzzDataC2EPKhm:
   50|  9.76k|           size_t size) : Data(data),Size(size){}
_ZN8FuzzData16splitIntoStringsEv:
  117|  9.76k|  std::vector<std::string_view> splitIntoStrings() {
  118|  9.76k|    std::vector<std::string_view> ret;
  119|  9.76k|    if(Size>0) {
  ------------------
  |  Branch (119:8): [True: 9.76k, False: 0]
  ------------------
  120|  9.76k|      ret=split(chardata(),Size);
  121|       |      // all data consumed.
  122|  9.76k|      Data+=Size;
  123|  9.76k|      Size=0;
  124|  9.76k|    }
  125|  9.76k|    return ret;
  126|  9.76k|  }
_Z5splitPKcm:
   26|  9.76k|inline std::vector<std::string_view> split(const char* Data, size_t Size) {
   27|       |
   28|  9.76k|  std::vector<std::string_view> ret;
   29|       |
   30|  9.76k|    using namespace std::literals;
   31|  9.76k|    constexpr auto sep="\n~~\n"sv;
   32|       |
   33|  9.76k|    std::string_view all(Data,Size);
   34|  9.76k|    auto pos=all.find(sep);
   35|   820k|    while(pos!=std::string_view::npos) {
  ------------------
  |  Branch (35:11): [True: 810k, False: 9.76k]
  ------------------
   36|   810k|      ret.push_back(all.substr(0,pos));
   37|   810k|      all=all.substr(pos+sep.size());
   38|   810k|      pos=all.find(sep);
   39|   810k|    }
   40|  9.76k|    ret.push_back(all);
   41|  9.76k|    return ret;
   42|  9.76k|}
_ZNK8FuzzData8chardataEv:
  158|  9.76k|  const char* chardata() const {return static_cast<const char*>(static_cast<const void*>(Data));}

LLVMFuzzerTestOneInput:
    8|  9.76k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
    9|       |
   10|       |  // Split data into two strings, json pointer and the document string.
   11|       |  // Might end up with none, either or both being empty, important for
   12|       |  // covering edge cases such as
   13|       |  // https://github.com/simdjson/simdjson/issues/1142 Inputs missing the
   14|       |  // separator line will get an empty json pointer but the all the input put in
   15|       |  // the document string. This means test data from other fuzzers that take json
   16|       |  // input works for this fuzzer as well.
   17|  9.76k|  FuzzData fd(Data, Size);
   18|  9.76k|  auto strings = fd.splitIntoStrings();
   19|  18.4k|  while (strings.size() < 2) {
  ------------------
  |  Branch (19:10): [True: 8.70k, False: 9.76k]
  ------------------
   20|  8.70k|    strings.emplace_back();
   21|  8.70k|  }
   22|  9.76k|  assert(strings.size() >= 2);
   23|       |
   24|      0|  simdjson::dom::parser parser;
   25|       |
   26|       |  // parse without exceptions, for speed
   27|  9.76k|  auto res = parser.parse(strings[0]);
   28|  9.76k|  if (res.error())
  ------------------
  |  Branch (28:7): [True: 4.55k, False: 5.21k]
  ------------------
   29|  4.55k|    return 0;
   30|       |
   31|  5.21k|  simdjson::dom::element root;
   32|  5.21k|  if (res.get(root))
  ------------------
  |  Branch (32:7): [True: 0, False: 5.21k]
  ------------------
   33|      0|    return 0;
   34|       |
   35|  5.21k|  auto maybe_leaf = root.at_pointer(strings[1]);
   36|  5.21k|  if (maybe_leaf.error())
  ------------------
  |  Branch (36:7): [True: 883, False: 4.33k]
  ------------------
   37|    883|    return 0;
   38|       |
   39|  4.33k|  simdjson::dom::element leaf;
   40|  4.33k|  if (maybe_leaf.get(leaf))
  ------------------
  |  Branch (40:7): [True: 0, False: 4.33k]
  ------------------
   41|      0|    return 0;
   42|       |
   43|  4.33k|  std::string_view sv;
   44|  4.33k|  if (leaf.get_string().get(sv))
  ------------------
  |  Branch (44:7): [True: 4.16k, False: 169]
  ------------------
   45|  4.16k|    return 0;
   46|    169|  return 0;
   47|  4.33k|}

_ZN8simdjson3dom5arrayC2ERKNS_8internal8tape_refE:
   54|  17.6k|simdjson_inline array::array(const internal::tape_ref &_tape) noexcept : tape{_tape} {}
_ZNK8simdjson3dom5array10at_pointerENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   71|  9.63k|inline simdjson_result<element> array::at_pointer(std::string_view json_pointer) const noexcept {
   72|  9.63k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  9.63k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   73|  9.63k|  if(json_pointer.empty()) { // an empty string means that we return the current node
  ------------------
  |  Branch (73:6): [True: 1.52k, False: 8.10k]
  ------------------
   74|  1.52k|      return element(this->tape); // copy the current node
   75|  8.10k|  } else if(json_pointer[0] != '/') { // otherwise there is an error
  ------------------
  |  Branch (75:13): [True: 13, False: 8.09k]
  ------------------
   76|     13|      return INVALID_JSON_POINTER;
   77|     13|  }
   78|  8.09k|  json_pointer = json_pointer.substr(1);
   79|       |  // - means "the append position" or "the element after the end of the array"
   80|       |  // We don't support this, because we're returning a real element, not a position.
   81|  8.09k|  if (json_pointer == "-") { return INDEX_OUT_OF_BOUNDS; }
  ------------------
  |  Branch (81:7): [True: 1, False: 8.09k]
  ------------------
   82|       |
   83|       |  // Read the array index
   84|  8.09k|  size_t array_index = 0;
   85|  8.09k|  size_t i;
   86|  2.50M|  for (i = 0; i < json_pointer.length() && json_pointer[i] != '/'; i++) {
  ------------------
  |  Branch (86:15): [True: 2.50M, False: 306]
  |  Branch (86:44): [True: 2.49M, False: 7.75k]
  ------------------
   87|  2.49M|    uint8_t digit = uint8_t(json_pointer[i] - '0');
   88|       |    // Check for non-digit in array index. If it's there, we're trying to get a field in an object
   89|  2.49M|    if (digit > 9) { return INCORRECT_TYPE; }
  ------------------
  |  Branch (89:9): [True: 33, False: 2.49M]
  ------------------
   90|  2.49M|    array_index = array_index*10 + digit;
   91|  2.49M|  }
   92|       |
   93|       |  // 0 followed by other digits is invalid
   94|  8.06k|  if (i > 1 && json_pointer[0] == '0') { return INVALID_JSON_POINTER; } // "JSON pointer array index has other characters after 0"
  ------------------
  |  Branch (94:7): [True: 391, False: 7.67k]
  |  Branch (94:16): [True: 7, False: 384]
  ------------------
   95|       |
   96|       |  // Empty string is invalid; so is a "/" with no digits before it
   97|  8.05k|  if (i == 0) { return INVALID_JSON_POINTER; } // "Empty string in JSON pointer array index"
  ------------------
  |  Branch (97:7): [True: 59, False: 7.99k]
  ------------------
   98|       |
   99|       |  // Get the child
  100|  7.99k|  auto child = array(tape).at(array_index);
  101|       |  // If there is an error, it ends here
  102|  7.99k|  if(child.error()) {
  ------------------
  |  Branch (102:6): [True: 235, False: 7.76k]
  ------------------
  103|    235|    return child;
  104|    235|  }
  105|       |  // If there is a /, we're not done yet, call recursively.
  106|  7.76k|  if (i < json_pointer.length()) {
  ------------------
  |  Branch (106:7): [True: 7.75k, False: 9]
  ------------------
  107|  7.75k|    child = child.at_pointer(json_pointer.substr(i));
  108|  7.75k|  }
  109|  7.76k|  return child;
  110|  7.99k|}
_ZNK8simdjson3dom5array2atEm:
  112|  7.99k|inline simdjson_result<element> array::at(size_t index) const noexcept {
  113|  7.99k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  7.99k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  114|  7.99k|  size_t i=0;
  115|   683k|  for (auto element : *this) {
  ------------------
  |  Branch (115:21): [True: 683k, False: 235]
  ------------------
  116|   683k|    if (i == index) { return element; }
  ------------------
  |  Branch (116:9): [True: 7.76k, False: 676k]
  ------------------
  117|   676k|    i++;
  118|   676k|  }
  119|    235|  return INDEX_OUT_OF_BOUNDS;
  120|  7.99k|}
_ZNK8simdjson3dom5array5beginEv:
   55|  7.99k|inline array::iterator array::begin() const noexcept {
   56|  7.99k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  7.99k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   57|  7.99k|  return internal::tape_ref(tape.doc, tape.json_index + 1);
   58|  7.99k|}
_ZN8simdjson3dom5array8iteratorC2ERKNS_8internal8tape_refE:
  125|  15.9k|simdjson_inline array::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom5array3endEv:
   59|  7.99k|inline array::iterator array::end() const noexcept {
   60|  7.99k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  7.99k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   61|  7.99k|  return internal::tape_ref(tape.doc, tape.after_element() - 1);
   62|  7.99k|}
_ZNK8simdjson3dom5array8iteratorneERKS2_:
  138|   684k|inline bool array::iterator::operator!=(const array::iterator& other) const noexcept {
  139|   684k|  return tape.json_index != other.tape.json_index;
  140|   684k|}
_ZNK8simdjson3dom5array8iteratordeEv:
  126|   683k|inline element array::iterator::operator*() const noexcept {
  127|   683k|  return element(tape);
  128|   683k|}
_ZN8simdjson3dom5array8iteratorppEv:
  129|   676k|inline array::iterator& array::iterator::operator++() noexcept {
  130|   676k|  tape.json_index = tape.after_element();
  131|   676k|  return *this;
  132|   676k|}

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

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

_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2ENS_10error_codeE:
   20|  5.43k|    : internal::simdjson_result_base<dom::element>(error) {}
_ZN8simdjson3dom7elementC2ERKNS_8internal8tape_refE:
  186|   701k|simdjson_inline element::element(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2EOS2_:
   18|  17.4k|    : internal::simdjson_result_base<dom::element>(std::forward<dom::element>(value)) {}
_ZN8simdjson3dom7elementC2Ev:
  185|  15.6k|simdjson_inline element::element() noexcept : tape{} {}
_ZNK8simdjson3dom7element10at_pointerENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  372|  13.1k|inline simdjson_result<element> element::at_pointer(std::string_view json_pointer) const noexcept {
  373|  13.1k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  13.1k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  374|  13.1k|  switch (tape.tape_ref_type()) {
  375|  2.03k|    case internal::tape_type::START_OBJECT:
  ------------------
  |  Branch (375:5): [True: 2.03k, False: 11.1k]
  ------------------
  376|  2.03k|      return object(tape).at_pointer(json_pointer);
  377|  9.63k|    case internal::tape_type::START_ARRAY:
  ------------------
  |  Branch (377:5): [True: 9.63k, False: 3.52k]
  ------------------
  378|  9.63k|      return array(tape).at_pointer(json_pointer);
  379|  1.48k|    default: {
  ------------------
  |  Branch (379:5): [True: 1.48k, False: 11.6k]
  ------------------
  380|  1.48k|      if(!json_pointer.empty()) { // a non-empty string is invalid on an atom
  ------------------
  |  Branch (380:10): [True: 75, False: 1.41k]
  ------------------
  381|     75|        return INVALID_JSON_POINTER;
  382|     75|      }
  383|       |      // an empty string means that we return the current node
  384|  1.41k|      dom::element copy(*this);
  385|  1.41k|      return simdjson_result<element>(std::move(copy));
  386|  1.48k|    }
  387|  13.1k|  }
  388|  13.1k|}
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2Ev:
   16|    653|    : internal::simdjson_result_base<dom::element>() {}
_ZNK8simdjson15simdjson_resultINS_3dom7elementEE10at_pointerENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
  115|  7.94k|simdjson_inline simdjson_result<dom::element> simdjson_result<dom::element>::at_pointer(const std::string_view json_pointer) const noexcept {
  116|  7.94k|  if (error()) { return error(); }
  ------------------
  |  Branch (116:7): [True: 0, False: 7.94k]
  ------------------
  117|  7.94k|  return first.at_pointer(json_pointer);
  118|  7.94k|}
_ZNK8simdjson3dom7element10get_stringEv:
  223|  4.33k|inline simdjson_result<std::string_view> element::get_string() const noexcept {
  224|  4.33k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  4.33k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  225|  4.33k|  switch (tape.tape_ref_type()) {
  226|    169|    case internal::tape_type::STRING:
  ------------------
  |  Branch (226:5): [True: 169, False: 4.16k]
  ------------------
  227|    169|      return tape.get_string_view();
  228|  4.16k|    default:
  ------------------
  |  Branch (228:5): [True: 4.16k, False: 169]
  ------------------
  229|  4.16k|      return INCORRECT_TYPE;
  230|  4.33k|  }
  231|  4.33k|}
_ZNK8simdjson15simdjson_resultINS_3dom7elementEE3getIS2_EENS_10error_codeERT_:
   36|  9.54k|simdjson_warn_unused simdjson_inline error_code simdjson_result<dom::element>::get(T &value) const noexcept {
   37|  9.54k|  if (error()) { return error(); }
  ------------------
  |  Branch (37:7): [True: 0, False: 9.54k]
  ------------------
   38|  9.54k|  return first.get<T>(value);
   39|  9.54k|}
_ZNK8simdjson3dom7element3getIS1_EENS_10error_codeERT_:
  308|  9.54k|simdjson_warn_unused simdjson_inline error_code element::get<element>(element &value) const noexcept {
  309|  9.54k|  value = element(tape);
  310|  9.54k|  return SUCCESS;
  311|  9.54k|}

_ZN8simdjson3dom6objectC2ERKNS_8internal8tape_refE:
   66|  2.03k|simdjson_inline object::object(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom6object10at_pointerENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   86|  2.03k|inline simdjson_result<element> object::at_pointer(std::string_view json_pointer) const noexcept {
   87|  2.03k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|  2.03k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   88|  2.03k|  if(json_pointer.empty()) { // an empty string means that we return the current node
  ------------------
  |  Branch (88:6): [True: 1.36k, False: 667]
  ------------------
   89|  1.36k|      return element(this->tape); // copy the current node
   90|  1.36k|  } else if(json_pointer[0] != '/') { // otherwise there is an error
  ------------------
  |  Branch (90:13): [True: 14, False: 653]
  ------------------
   91|     14|      return INVALID_JSON_POINTER;
   92|     14|  }
   93|    653|  json_pointer = json_pointer.substr(1);
   94|    653|  size_t slash = json_pointer.find('/');
   95|    653|  std::string_view key = json_pointer.substr(0, slash);
   96|       |  // Grab the child with the given key
   97|    653|  simdjson_result<element> child;
   98|       |
   99|       |  // If there is an escape character in the key, unescape it and then get the child.
  100|    653|  size_t escape = key.find('~');
  101|    653|  if (escape != std::string_view::npos) {
  ------------------
  |  Branch (101:7): [True: 264, False: 389]
  ------------------
  102|       |    // Unescape the key
  103|    264|    std::string unescaped(key);
  104|  1.24k|    do {
  105|  1.24k|      switch (unescaped[escape+1]) {
  106|    702|        case '0':
  ------------------
  |  Branch (106:9): [True: 702, False: 538]
  ------------------
  107|    702|          unescaped.replace(escape, 2, "~");
  108|    702|          break;
  109|    483|        case '1':
  ------------------
  |  Branch (109:9): [True: 483, False: 757]
  ------------------
  110|    483|          unescaped.replace(escape, 2, "/");
  111|    483|          break;
  112|     55|        default:
  ------------------
  |  Branch (112:9): [True: 55, False: 1.18k]
  ------------------
  113|     55|          return INVALID_JSON_POINTER; // "Unexpected ~ escape character in JSON pointer");
  114|  1.24k|      }
  115|  1.18k|      escape = unescaped.find('~', escape+1);
  116|  1.18k|    } while (escape != std::string::npos);
  ------------------
  |  Branch (116:14): [True: 976, False: 209]
  ------------------
  117|    209|    child = at_key(unescaped);
  118|    389|  } else {
  119|    389|    child = at_key(key);
  120|    389|  }
  121|    598|  if(child.error()) {
  ------------------
  |  Branch (121:6): [True: 391, False: 207]
  ------------------
  122|    391|    return child; // we do not continue if there was an error
  123|    391|  }
  124|       |  // If there is a /, we have to recurse and look up more of the path
  125|    207|  if (slash != std::string_view::npos) {
  ------------------
  |  Branch (125:7): [True: 195, False: 12]
  ------------------
  126|    195|    child = child.at_pointer(json_pointer.substr(slash));
  127|    195|  }
  128|    207|  return child;
  129|    598|}
_ZNK8simdjson3dom6object6at_keyENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  131|    598|inline simdjson_result<element> object::at_key(std::string_view key) const noexcept {
  132|    598|  iterator end_field = end();
  133|  1.22M|  for (iterator field = begin(); field != end_field; ++field) {
  ------------------
  |  Branch (133:34): [True: 1.22M, False: 391]
  ------------------
  134|  1.22M|    if (field.key_equals(key)) {
  ------------------
  |  Branch (134:9): [True: 207, False: 1.22M]
  ------------------
  135|    207|      return field.value();
  136|    207|    }
  137|  1.22M|  }
  138|    391|  return NO_SUCH_FIELD;
  139|    598|}
_ZNK8simdjson3dom6object3endEv:
   71|    598|inline object::iterator object::end() const noexcept {
   72|    598|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|    598|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   73|    598|  return internal::tape_ref(tape.doc, tape.after_element() - 1);
   74|    598|}
_ZN8simdjson3dom6object8iteratorC2ERKNS_8internal8tape_refE:
  156|  1.19k|simdjson_inline object::iterator::iterator(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZNK8simdjson3dom6object5beginEv:
   67|    598|inline object::iterator object::begin() const noexcept {
   68|    598|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  329|    598|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (329:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
   69|    598|  return internal::tape_ref(tape.doc, tape.json_index + 1);
   70|    598|}
_ZNK8simdjson3dom6object8iteratorneERKS2_:
  160|  1.22M|inline bool object::iterator::operator!=(const object::iterator& other) const noexcept {
  161|  1.22M|  return tape.json_index != other.tape.json_index;
  162|  1.22M|}
_ZNK8simdjson3dom6object8iterator10key_equalsENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  214|  1.22M|inline bool object::iterator::key_equals(std::string_view o) const noexcept {
  215|       |  // We use the fact that the key length can be computed quickly
  216|       |  // without access to the string buffer.
  217|  1.22M|  const uint32_t len = key_length();
  218|  1.22M|  if(o.size() == len) {
  ------------------
  |  Branch (218:6): [True: 1.27k, False: 1.21M]
  ------------------
  219|       |    // We avoid construction of a temporary string_view instance.
  220|  1.27k|    return (memcmp(o.data(), key_c_str(), len) == 0);
  221|  1.27k|  }
  222|  1.21M|  return false;
  223|  1.22M|}
_ZNK8simdjson3dom6object8iterator10key_lengthEv:
  191|  1.22M|inline uint32_t object::iterator::key_length() const noexcept {
  192|  1.22M|  return tape.get_string_length();
  193|  1.22M|}
_ZNK8simdjson3dom6object8iterator9key_c_strEv:
  194|  1.27k|inline const char* object::iterator::key_c_str() const noexcept {
  195|  1.27k|  return reinterpret_cast<const char *>(&tape.doc->string_buf[size_t(tape.tape_value()) + sizeof(uint32_t)]);
  196|  1.27k|}
_ZNK8simdjson3dom6object8iterator5valueEv:
  197|    207|inline element object::iterator::value() const noexcept {
  198|    207|  return element(internal::tape_ref(tape.doc, tape.json_index + 1));
  199|    207|}
_ZN8simdjson3dom6object8iteratorppEv:
  178|  1.22M|inline object::iterator& object::iterator::operator++() noexcept {
  179|  1.22M|  tape.json_index++;
  180|  1.22M|  tape.json_index = tape.after_element();
  181|  1.22M|  return *this;
  182|  1.22M|}

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

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

_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2ENS_10error_codeE:
  107|  5.43k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_NS_10error_codeE:
  104|  23.5k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_:
  110|  17.4k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2Ev:
  113|    653|    : simdjson_result_base(T{}, UNINITIALIZED) {}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2EOS5_:
  178|    169|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_:
  110|    169|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2EOS6_NS_10error_codeE:
  104|  4.33k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2ENS_10error_codeE:
  175|  4.16k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEC2ENS_10error_codeE:
  107|  4.16k|    : simdjson_result_base(T{}, error) {}
_ZNK8simdjson8internal20simdjson_result_baseINS_3dom7elementEE5errorEv:
   62|  41.0k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   63|  41.0k|  return this->second;
   64|  41.0k|}
_ZNO8simdjson15simdjson_resultINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEE3getERS5_:
  127|  4.33k|simdjson_warn_unused simdjson_inline error_code simdjson_result<T>::get(T &value) && noexcept {
  128|  4.33k|  return std::forward<internal::simdjson_result_base<T>>(*this).get(value);
  129|  4.33k|}
_ZNO8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEE3getERS6_:
   55|  4.33k|simdjson_warn_unused simdjson_inline error_code simdjson_result_base<T>::get(T &value) && noexcept {
   56|  4.33k|  error_code error;
   57|  4.33k|  std::forward<simdjson_result_base<T>>(*this).tie(value, error);
   58|  4.33k|  return error;
   59|  4.33k|}
_ZNO8simdjson8internal20simdjson_result_baseINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEE3tieERS6_RNS_10error_codeE:
   47|  4.33k|simdjson_inline void simdjson_result_base<T>::tie(T &value, error_code &error) && noexcept {
   48|  4.33k|  error = this->second;
   49|  4.33k|  if (!error) {
  ------------------
  |  Branch (49:7): [True: 169, False: 4.16k]
  ------------------
   50|    169|    value = std::forward<simdjson_result_base<T>>(*this).first;
   51|    169|  }
   52|  4.33k|}

_ZN8simdjson8fallback14implementationC2Ev:
   23|      1|  ) {}

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

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

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

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

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

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

_ZN8simdjson7haswell14implementationC2Ev:
   21|      1|  ) {}

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

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

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

_ZN8simdjson7icelake14implementationC2Ev:
   21|      1|  ) {}

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

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

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

_ZN8simdjson8internal8tape_refC2EPKNS_3dom8documentEm:
   14|  22.6k|simdjson_inline tape_ref::tape_ref(const dom::document *_doc, size_t _json_index) noexcept : doc{_doc}, json_index{_json_index} {}
_ZN8simdjson8internal8tape_refC2Ev:
   13|  15.6k|simdjson_inline tape_ref::tape_ref() noexcept : doc{nullptr}, json_index{0} {}
_ZNK8simdjson8internal8tape_ref13tape_ref_typeEv:
   65|  1.92M|simdjson_inline tape_type tape_ref::tape_ref_type() const noexcept {
   66|  1.92M|  return static_cast<tape_type>(doc->tape[json_index] >> 56);
   67|  1.92M|}
_ZNK8simdjson8internal8tape_ref13after_elementEv:
   52|  1.90M|inline size_t tape_ref::after_element() const noexcept {
   53|  1.90M|  switch (tape_ref_type()) {
   54|  11.3k|    case tape_type::START_ARRAY:
  ------------------
  |  Branch (54:5): [True: 11.3k, False: 1.89M]
  ------------------
   55|  12.7k|    case tape_type::START_OBJECT:
  ------------------
  |  Branch (55:5): [True: 1.41k, False: 1.90M]
  ------------------
   56|  12.7k|      return matching_brace_index();
   57|    582|    case tape_type::UINT64:
  ------------------
  |  Branch (57:5): [True: 582, False: 1.90M]
  ------------------
   58|  1.87M|    case tape_type::INT64:
  ------------------
  |  Branch (58:5): [True: 1.87M, False: 34.4k]
  ------------------
   59|  1.88M|    case tape_type::DOUBLE:
  ------------------
  |  Branch (59:5): [True: 12.0k, False: 1.89M]
  ------------------
   60|  1.88M|      return json_index + 2;
   61|  9.00k|    default:
  ------------------
  |  Branch (61:5): [True: 9.00k, False: 1.89M]
  ------------------
   62|  9.00k|      return json_index + 1;
   63|  1.90M|  }
   64|  1.90M|}
_ZNK8simdjson8internal8tape_ref20matching_brace_indexEv:
   71|  12.7k|simdjson_inline uint32_t internal::tape_ref::matching_brace_index() const noexcept {
   72|  12.7k|  return uint32_t(doc->tape[json_index]);
   73|  12.7k|}
_ZNK8simdjson8internal8tape_ref17get_string_lengthEv:
   90|  1.22M|simdjson_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
   91|  1.22M|  size_t string_buf_index = size_t(tape_value());
   92|  1.22M|  uint32_t len;
   93|  1.22M|  std::memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len));
   94|  1.22M|  return len;
   95|  1.22M|}
_ZNK8simdjson8internal8tape_ref10tape_valueEv:
   68|  1.22M|simdjson_inline uint64_t internal::tape_ref::tape_value() const noexcept {
   69|  1.22M|  return doc->tape[json_index] & internal::JSON_VALUE_MASK;
   70|  1.22M|}
_ZNK8simdjson8internal8tape_ref15get_string_viewEv:
  102|    169|inline std::string_view internal::tape_ref::get_string_view() const noexcept {
  103|    169|  return std::string_view(
  104|    169|      get_c_str(),
  105|    169|      get_string_length()
  106|    169|  );
  107|    169|}
_ZNK8simdjson8internal8tape_ref9get_c_strEv:
   97|    169|simdjson_inline const char * internal::tape_ref::get_c_str() const noexcept {
   98|    169|  size_t string_buf_index = size_t(tape_value());
   99|    169|  return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
  100|    169|}

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

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

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

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

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

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iteratorC2ERNS0_25dom_parser_implementationEm:
  240|  8.68k|    dom_parser{_dom_parser} {
  241|  8.68k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13walk_documentILb0ENS2_12tape_builderEEENS_10error_codeERT0_:
  112|  8.68k|simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
  113|  8.68k|  logger::log_start();
  114|       |
  115|       |  //
  116|       |  // Start the document
  117|       |  //
  118|  8.68k|  if (at_eof()) { return EMPTY; }
  ------------------
  |  Branch (118:7): [True: 0, False: 8.68k]
  ------------------
  119|  8.68k|  log_start_value("document");
  120|  8.68k|  SIMDJSON_TRY( visitor.visit_document_start(*this) );
  ------------------
  |  |  279|  8.68k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 8.68k]
  |  |  ------------------
  ------------------
  121|       |
  122|       |  //
  123|       |  // Read first value
  124|       |  //
  125|  8.68k|  {
  126|  8.68k|    auto value = advance();
  127|       |
  128|       |    // Make sure the outer object or array is closed before continuing; otherwise, there are ways we
  129|       |    // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906
  130|  8.68k|    if (!STREAMING) {
  ------------------
  |  Branch (130:9): [Folded - Ignored]
  ------------------
  131|  8.68k|      switch (*value) {
  ------------------
  |  Branch (131:15): [True: 2.48k, False: 6.19k]
  ------------------
  132|  3.32k|        case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (132:9): [True: 3.32k, False: 5.35k]
  |  Branch (132:23): [True: 23, False: 3.29k]
  ------------------
  133|  2.87k|        case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (133:9): [True: 2.87k, False: 5.80k]
  |  Branch (133:23): [True: 27, False: 2.84k]
  ------------------
  134|  8.68k|      }
  135|  8.68k|    }
  136|       |
  137|  8.63k|    switch (*value) {
  138|  3.29k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|    106|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 106]
  |  |  ------------------
  ------------------
  |  Branch (138:7): [True: 3.29k, False: 5.33k]
  |  Branch (138:21): [True: 106, False: 3.19k]
  ------------------
  139|  3.19k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|     76|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 76]
  |  |  ------------------
  ------------------
  |  Branch (139:7): [True: 2.84k, False: 5.78k]
  |  Branch (139:21): [True: 76, False: 2.76k]
  ------------------
  140|  2.76k|      default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break;
  ------------------
  |  |  279|  2.48k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 961, False: 1.52k]
  |  |  ------------------
  ------------------
  |  Branch (140:7): [True: 2.48k, False: 6.14k]
  ------------------
  141|  8.63k|    }
  142|  8.63k|  }
  143|  1.70k|  goto document_end;
  144|       |
  145|       |//
  146|       |// Object parser states
  147|       |//
  148|  4.68k|object_begin:
  149|  4.68k|  log_start_value("object");
  150|  4.68k|  depth++;
  151|  4.68k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (151:7): [True: 1, False: 4.67k]
  ------------------
  152|  4.67k|  dom_parser.is_array[depth] = false;
  153|  4.67k|  SIMDJSON_TRY( visitor.visit_object_start(*this) );
  ------------------
  |  |  279|  4.67k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 4.67k]
  |  |  ------------------
  ------------------
  154|       |
  155|  4.67k|  {
  156|  4.67k|    auto key = advance();
  157|  4.67k|    if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; }
  ------------------
  |  Branch (157:9): [True: 69, False: 4.61k]
  ------------------
  158|  4.61k|    SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  4.61k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 4.61k]
  |  |  ------------------
  ------------------
  159|  4.61k|    SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  279|  4.61k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 88, False: 4.52k]
  |  |  ------------------
  ------------------
  160|  4.52k|  }
  161|       |
  162|  1.23M|object_field:
  163|  1.23M|  if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; }
  ------------------
  |  |  120|  1.23M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 392, False: 1.23M]
  |  |  ------------------
  ------------------
  164|  1.23M|  {
  165|  1.23M|    auto value = advance();
  166|  1.23M|    switch (*value) {
  167|  1.42k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|    626|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 626]
  |  |  ------------------
  ------------------
  |  Branch (167:7): [True: 1.42k, False: 1.23M]
  |  Branch (167:21): [True: 626, False: 802]
  ------------------
  168|  3.65k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|  1.10k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.10k]
  |  |  ------------------
  ------------------
  |  Branch (168:7): [True: 3.65k, False: 1.23M]
  |  Branch (168:21): [True: 1.10k, False: 2.54k]
  ------------------
  169|  1.23M|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  279|  1.23M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 694, False: 1.23M]
  |  |  ------------------
  ------------------
  |  Branch (169:7): [True: 1.23M, False: 5.08k]
  ------------------
  170|  1.23M|    }
  171|  1.23M|  }
  172|       |
  173|  1.23M|object_continue:
  174|  1.23M|  switch (*advance()) {
  175|  1.23M|    case ',':
  ------------------
  |  Branch (175:5): [True: 1.23M, False: 2.75k]
  ------------------
  176|  1.23M|      SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  1.23M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.23M]
  |  |  ------------------
  ------------------
  177|  1.23M|      {
  178|  1.23M|        auto key = advance();
  179|  1.23M|        if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; }
  ------------------
  |  |  120|  1.23M|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (120:32): [True: 18, False: 1.23M]
  |  |  ------------------
  ------------------
  180|  1.23M|        SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  279|  1.23M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 90, False: 1.23M]
  |  |  ------------------
  ------------------
  181|  1.23M|      }
  182|      0|      goto object_field;
  183|  2.66k|    case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end;
  ------------------
  |  |  279|  2.66k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 2.66k]
  |  |  ------------------
  ------------------
  |  Branch (183:5): [True: 2.66k, False: 1.23M]
  ------------------
  184|     95|    default: log_error("No comma between object fields"); return TAPE_ERROR;
  ------------------
  |  Branch (184:5): [True: 95, False: 1.23M]
  ------------------
  185|  1.23M|  }
  186|       |
  187|  15.3k|scope_end:
  188|  15.3k|  depth--;
  189|  15.3k|  if (depth == 0) { goto document_end; }
  ------------------
  |  Branch (189:7): [True: 3.61k, False: 11.7k]
  ------------------
  190|  11.7k|  if (dom_parser.is_array[depth]) { goto array_continue; }
  ------------------
  |  Branch (190:7): [True: 8.99k, False: 2.77k]
  ------------------
  191|  2.77k|  goto object_continue;
  192|       |
  193|       |//
  194|       |// Array parser states
  195|       |//
  196|  24.8k|array_begin:
  197|  24.8k|  log_start_value("array");
  198|  24.8k|  depth++;
  199|  24.8k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (199:7): [True: 1, False: 24.8k]
  ------------------
  200|  24.8k|  dom_parser.is_array[depth] = true;
  201|  24.8k|  SIMDJSON_TRY( visitor.visit_array_start(*this) );
  ------------------
  |  |  279|  24.8k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
  202|  24.8k|  SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  279|  24.8k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
  203|       |
  204|  1.10M|array_value:
  205|  1.10M|  {
  206|  1.10M|    auto value = advance();
  207|  1.10M|    switch (*value) {
  208|  1.14k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  279|    461|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 461]
  |  |  ------------------
  ------------------
  |  Branch (208:7): [True: 1.14k, False: 1.10M]
  |  Branch (208:21): [True: 461, False: 685]
  ------------------
  209|  20.1k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  279|    609|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 609]
  |  |  ------------------
  ------------------
  |  Branch (209:7): [True: 20.1k, False: 1.08M]
  |  Branch (209:21): [True: 609, False: 19.5k]
  ------------------
  210|  1.08M|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  279|  1.08M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 801, False: 1.08M]
  |  |  ------------------
  ------------------
  |  Branch (210:7): [True: 1.08M, False: 21.2k]
  ------------------
  211|  1.10M|    }
  212|  1.10M|  }
  213|       |
  214|  1.09M|array_continue:
  215|  1.09M|  switch (*advance()) {
  216|  1.08M|    case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value;
  ------------------
  |  |  279|  1.08M|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 1.08M]
  |  |  ------------------
  ------------------
  |  Branch (216:5): [True: 1.08M, False: 12.8k]
  ------------------
  217|  12.7k|    case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end;
  ------------------
  |  |  279|  12.7k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 12.7k]
  |  |  ------------------
  ------------------
  |  Branch (217:5): [True: 12.7k, False: 1.08M]
  ------------------
  218|     97|    default: log_error("Missing comma between array values"); return TAPE_ERROR;
  ------------------
  |  Branch (218:5): [True: 97, False: 1.09M]
  ------------------
  219|  1.09M|  }
  220|       |
  221|  5.32k|document_end:
  222|  5.32k|  log_end_value("document");
  223|  5.32k|  SIMDJSON_TRY( visitor.visit_document_end(*this) );
  ------------------
  |  |  279|  5.32k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (279:54): [True: 0, False: 5.32k]
  |  |  ------------------
  ------------------
  224|       |
  225|  5.32k|  dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]);
  226|       |
  227|       |  // If we didn't make it to the end, it's an error
  228|  5.32k|  if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
  ------------------
  |  Branch (228:8): [Folded - Ignored]
  |  Branch (228:22): [True: 108, False: 5.21k]
  ------------------
  229|    108|    log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
  230|    108|    return TAPE_ERROR;
  231|    108|  }
  232|       |
  233|  5.21k|  return SUCCESS;
  234|       |
  235|  5.32k|} // walk_document()
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator6at_eofEv:
  253|  8.68k|simdjson_inline bool json_iterator::at_eof() const noexcept {
  254|  8.68k|  return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes];
  255|  8.68k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15log_start_valueEPKc:
  267|  38.2k|simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept {
  268|  38.2k|  logger::log_line(*this, "+", type, "");
  269|  38.2k|  if (logger::LOG_ENABLED) { logger::log_depth++; }
  ------------------
  |  Branch (269:7): [Folded - Ignored]
  ------------------
  270|  38.2k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator7advanceEv:
  246|  7.15M|simdjson_inline const uint8_t *json_iterator::advance() noexcept {
  247|  7.15M|  return &buf[*(next_structural++)];
  248|  7.15M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15last_structuralEv:
  259|  6.19k|simdjson_inline uint8_t json_iterator::last_structural() const noexcept {
  260|  6.19k|  return buf[dom_parser.structural_indexes[dom_parser.n_structural_indexes - 1]];
  261|  6.19k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_valueEPKc:
  263|  3.55M|simdjson_inline void json_iterator::log_value(const char *type) const noexcept {
  264|  3.55M|  logger::log_line(*this, "", type, "");
  265|  3.55M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator4peekEv:
  243|  32.5k|simdjson_inline const uint8_t *json_iterator::peek() const noexcept {
  244|  32.5k|  return &buf[*(next_structural)];
  245|  32.5k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator20visit_root_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  282|  2.48k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept {
  283|  2.48k|  switch (*value) {
  284|    338|    case '"': return visitor.visit_root_string(*this, value);
  ------------------
  |  Branch (284:5): [True: 338, False: 2.14k]
  ------------------
  285|     59|    case 't': return visitor.visit_root_true_atom(*this, value);
  ------------------
  |  Branch (285:5): [True: 59, False: 2.42k]
  ------------------
  286|    105|    case 'f': return visitor.visit_root_false_atom(*this, value);
  ------------------
  |  Branch (286:5): [True: 105, False: 2.38k]
  ------------------
  287|     57|    case 'n': return visitor.visit_root_null_atom(*this, value);
  ------------------
  |  Branch (287:5): [True: 57, False: 2.42k]
  ------------------
  288|    116|    case '-':
  ------------------
  |  Branch (288:5): [True: 116, False: 2.37k]
  ------------------
  289|    972|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (289:5): [True: 169, False: 2.31k]
  |  Branch (289:15): [True: 285, False: 2.20k]
  |  Branch (289:25): [True: 199, False: 2.28k]
  |  Branch (289:35): [True: 72, False: 2.41k]
  |  Branch (289:45): [True: 131, False: 2.35k]
  ------------------
  290|  1.82k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (290:5): [True: 88, False: 2.39k]
  |  Branch (290:15): [True: 87, False: 2.39k]
  |  Branch (290:25): [True: 86, False: 2.40k]
  |  Branch (290:35): [True: 158, False: 2.32k]
  |  Branch (290:45): [True: 436, False: 2.05k]
  ------------------
  291|  1.82k|      return visitor.visit_root_number(*this, value);
  292|    100|    default:
  ------------------
  |  Branch (292:5): [True: 100, False: 2.38k]
  ------------------
  293|    100|      log_error("Document starts with a non-value character");
  294|    100|      return TAPE_ERROR;
  295|  2.48k|  }
  296|  2.48k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13remaining_lenEv:
  249|  5.70k|simdjson_inline size_t json_iterator::remaining_len() const noexcept {
  250|  5.70k|  return dom_parser.len - *(next_structural-1);
  251|  5.70k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_errorEPKc:
  277|  1.44k|simdjson_inline void json_iterator::log_error(const char *error) const noexcept {
  278|  1.44k|  logger::log_line(*this, "", "ERROR", error);
  279|  1.44k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15visit_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  298|  2.31M|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept {
  299|  2.31M|  switch (*value) {
  300|  10.0k|    case '"': return visitor.visit_string(*this, value);
  ------------------
  |  Branch (300:5): [True: 10.0k, False: 2.30M]
  ------------------
  301|    477|    case 't': return visitor.visit_true_atom(*this, value);
  ------------------
  |  Branch (301:5): [True: 477, False: 2.31M]
  ------------------
  302|    480|    case 'f': return visitor.visit_false_atom(*this, value);
  ------------------
  |  Branch (302:5): [True: 480, False: 2.31M]
  ------------------
  303|    466|    case 'n': return visitor.visit_null_atom(*this, value);
  ------------------
  |  Branch (303:5): [True: 466, False: 2.31M]
  ------------------
  304|  2.29k|    case '-':
  ------------------
  |  Branch (304:5): [True: 2.29k, False: 2.31M]
  ------------------
  305|  1.92M|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (305:5): [True: 64.5k, False: 2.25M]
  |  Branch (305:15): [True: 813k, False: 1.50M]
  |  Branch (305:25): [True: 115k, False: 2.20M]
  |  Branch (305:35): [True: 5.26k, False: 2.31M]
  |  Branch (305:45): [True: 920k, False: 1.39M]
  ------------------
  306|  2.30M|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (306:5): [True: 106k, False: 2.20M]
  |  Branch (306:15): [True: 2.01k, False: 2.31M]
  |  Branch (306:25): [True: 73.6k, False: 2.24M]
  |  Branch (306:35): [True: 33.2k, False: 2.28M]
  |  Branch (306:45): [True: 167k, False: 2.14M]
  ------------------
  307|  2.30M|      return visitor.visit_number(*this, value);
  308|     67|    default:
  ------------------
  |  Branch (308:5): [True: 67, False: 2.31M]
  ------------------
  309|     67|      log_error("Non-value found when value was expected!");
  310|     67|      return TAPE_ERROR;
  311|  2.31M|  }
  312|  2.31M|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13log_end_valueEPKc:
  272|  20.7k|simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept {
  273|  20.7k|  if (logger::LOG_ENABLED) { logger::log_depth--; }
  ------------------
  |  Branch (273:7): [Folded - Ignored]
  ------------------
  274|  20.7k|  logger::log_line(*this, "-", type, "");
  275|  20.7k|}

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

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

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

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

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

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

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

