_ZN8FuzzDataC2EPKhm:
   50|  8.87k|           size_t size) : Data(data),Size(size){}
_ZN8FuzzData23remainder_as_stringviewEv:
  109|  8.87k|  std::string_view remainder_as_stringview() {
  110|  8.87k|    std::string_view ret{chardata(),Size};
  111|  8.87k|    Data+=Size;
  112|  8.87k|    Size=0;
  113|  8.87k|    return ret;
  114|  8.87k|  }
_ZNK8FuzzData8chardataEv:
  158|  8.87k|  const char* chardata() const {return static_cast<const char*>(static_cast<const void*>(Data));}
_ZN8FuzzData6getIntILi0ELi1000EEEiv:
   54|  8.87k|  int getInt() {
   55|  8.87k|    static_assert (Min<Max,"min must be <max");
   56|       |
   57|       |    // make this constexpr, can't overflow because that is UB and is forbidden
   58|       |    // in constexpr evaluation
   59|  8.87k|    constexpr int range=(Max-Min)+1;
   60|  8.87k|    constexpr unsigned int urange=range;
   61|       |
   62|       |    // don't use std::uniform_int_distribution, we don't want to pay for
   63|       |    // over consumption of random data. Accept the slightly non-uniform distribution.
   64|  8.87k|    if(range<256)
  ------------------
  |  Branch (64:8): [Folded - Ignored]
  ------------------
   65|      0|      return Min+static_cast<int>(get<uint8_t>()%urange);
   66|  8.87k|    if(range<65536)
  ------------------
  |  Branch (66:8): [Folded - Ignored]
  ------------------
   67|  8.87k|      return Min+static_cast<int>(get<uint16_t>()%urange);
   68|       |
   69|      0|    return Min+static_cast<int>(get<uint32_t>()%urange);
   70|  8.87k|  }
_ZN8FuzzData3getItEET_v:
   73|  8.87k|  T get() {
   74|  8.87k|    const auto Nbytes=sizeof(T);
   75|  8.87k|    T ret{};
   76|  8.87k|    if(Size<Nbytes) {
  ------------------
  |  Branch (76:8): [True: 2, False: 8.87k]
  ------------------
   77|       |      //don't throw, signal with null instead.
   78|      2|      Data=nullptr;
   79|      2|      Size=0;
   80|      2|      return ret;
   81|      2|    }
   82|  8.87k|    std::memcpy(&ret,Data,Nbytes);
   83|  8.87k|    Data+=Nbytes;
   84|  8.87k|    Size-=Nbytes;
   85|  8.87k|    return ret;
   86|  8.87k|  }

LLVMFuzzerTestOneInput:
    9|  8.87k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   10|  8.87k|  FuzzData fd(Data, Size);
   11|  8.87k|  const auto batch_size = static_cast<size_t>(fd.getInt<0,1000>());
   12|  8.87k|  const auto json = simdjson::padded_string{fd.remainder_as_stringview()};
   13|  8.87k|  simdjson::dom::parser parser;
   14|  8.87k|  simdjson::dom::document_stream docs;
   15|  8.87k|  if(parser.parse_many(json,batch_size).get(docs)) { return 0; }
  ------------------
  |  Branch (15:6): [True: 0, False: 8.87k]
  ------------------
   16|  8.87k|  size_t bool_count1 = 0;
   17|  8.87k|  size_t total_count1 = 0;
   18|  50.6k|  for (auto doc : docs) {
  ------------------
  |  Branch (18:17): [True: 50.6k, False: 8.87k]
  ------------------
   19|  50.6k|    total_count1++;
   20|  50.6k|    bool_count1 += doc.is_bool();
   21|  50.6k|  }
   22|       |  // Restart, if we made it this far, the document *must* be accessible.
   23|  8.87k|  if(parser.parse_many(json,batch_size).get(docs)) { return EXIT_FAILURE; }
  ------------------
  |  Branch (23:6): [True: 0, False: 8.87k]
  ------------------
   24|  8.87k|  size_t bool_count2 = 0;
   25|  8.87k|  size_t total_count2 = 0;
   26|  50.6k|  for (auto doc : docs) {
  ------------------
  |  Branch (26:17): [True: 50.6k, False: 8.87k]
  ------------------
   27|  50.6k|    total_count2++;
   28|  50.6k|    bool_count2 += doc.is_bool();
   29|  50.6k|  }
   30|       |  // They should agree!!!
   31|  8.87k|  if((total_count2 != total_count1) || (bool_count2 != bool_count1)) { return EXIT_FAILURE; }
  ------------------
  |  Branch (31:6): [True: 0, False: 8.87k]
  |  Branch (31:40): [True: 0, False: 8.87k]
  ------------------
   32|  8.87k|  return 0;
   33|  8.87k|}

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

_ZN8simdjson3dom8documentC2Ev:
   23|  35.4k|  document() noexcept = default;
_ZN8simdjson3dom8documentC2EOS1_:
   31|   173k|  document(document &&other) noexcept = default;
_ZN8simdjson3dom8documentaSEOS1_:
   39|   329k|  document &operator=(document &&other) noexcept = default;
_ZN8simdjson3dom8documentD2Ev:
   24|   208k|  ~document() noexcept = default;

_ZN8simdjson3dom15document_streamC2Ev:
  111|  8.87k|  : parser{nullptr},
  112|  8.87k|    buf{nullptr},
  113|  8.87k|    len{0},
  114|  8.87k|    batch_size{0},
  115|  8.87k|    error{UNINITIALIZED}
  116|       |#ifdef SIMDJSON_THREADS_ENABLED
  117|  8.87k|    , use_thread(false)
  118|       |#endif
  119|  8.87k|{
  120|  8.87k|}
_ZN8simdjson3dom15document_streamC2ERNS0_6parserEPKhmm:
   94|  17.7k|  : parser{&_parser},
   95|  17.7k|    buf{_buf},
   96|  17.7k|    len{_len},
   97|  17.7k|    batch_size{_batch_size <= MINIMAL_BATCH_SIZE ? MINIMAL_BATCH_SIZE : _batch_size},
  ------------------
  |  Branch (97:16): [True: 1.31k, False: 16.4k]
  ------------------
   98|  17.7k|    error{SUCCESS}
   99|       |#ifdef SIMDJSON_THREADS_ENABLED
  100|  17.7k|    , use_thread(_parser.threaded) // we need to make a copy because _parser.threaded can change
  101|       |#endif
  102|  17.7k|{
  103|  17.7k|#ifdef SIMDJSON_THREADS_ENABLED
  104|  17.7k|  if(worker.get() == nullptr) {
  ------------------
  |  Branch (104:6): [True: 0, False: 17.7k]
  ------------------
  105|      0|    error = MEMALLOC;
  106|      0|  }
  107|  17.7k|#endif
  108|  17.7k|}
_ZN8simdjson15simdjson_resultINS_3dom15document_streamEEC2EOS2_:
  322|  17.7k|  : simdjson_result_base(std::forward<dom::document_stream>(value)) {
  323|  17.7k|}
_ZN8simdjson3dom15document_stream5beginEv:
  132|  17.7k|simdjson_inline document_stream::iterator document_stream::begin() noexcept {
  133|  17.7k|  start();
  134|       |  // If there are no documents, we're finished.
  135|  17.7k|  return iterator(this, error == EMPTY);
  136|  17.7k|}
_ZN8simdjson3dom15document_stream5startEv:
  187|  17.7k|inline void document_stream::start() noexcept {
  188|  17.7k|  if (error) { return; }
  ------------------
  |  Branch (188:7): [True: 0, False: 17.7k]
  ------------------
  189|  17.7k|  error = parser->ensure_capacity(batch_size);
  190|  17.7k|  if (error) { return; }
  ------------------
  |  Branch (190:7): [True: 0, False: 17.7k]
  ------------------
  191|       |  // Always run the first stage 1 parse immediately
  192|  17.7k|  batch_start = 0;
  193|  17.7k|  error = run_stage1(*parser, batch_start);
  194|  83.8k|  while(error == EMPTY) {
  ------------------
  |  Branch (194:9): [True: 66.5k, False: 17.3k]
  ------------------
  195|       |    // In exceptional cases, we may start with an empty block
  196|  66.5k|    batch_start = next_batch_start();
  197|  66.5k|    if (batch_start >= len) { return; }
  ------------------
  |  Branch (197:9): [True: 390, False: 66.1k]
  ------------------
  198|  66.1k|    error = run_stage1(*parser, batch_start);
  199|  66.1k|  }
  200|  17.3k|  if (error) { return; }
  ------------------
  |  Branch (200:7): [True: 2.03k, False: 15.3k]
  ------------------
  201|  15.3k|#ifdef SIMDJSON_THREADS_ENABLED
  202|  15.3k|  if (use_thread && next_batch_start() < len) {
  ------------------
  |  Branch (202:7): [True: 15.3k, False: 0]
  |  Branch (202:21): [True: 1.47k, False: 13.8k]
  ------------------
  203|       |    // Kick off the first thread if needed
  204|  1.47k|    error = stage1_thread_parser.ensure_capacity(batch_size);
  205|  1.47k|    if (error) { return; }
  ------------------
  |  Branch (205:9): [True: 0, False: 1.47k]
  ------------------
  206|  1.47k|    worker->start_thread();
  207|  1.47k|    start_stage1_thread();
  208|  1.47k|    if (error) { return; }
  ------------------
  |  Branch (208:9): [True: 0, False: 1.47k]
  ------------------
  209|  1.47k|  }
  210|  15.3k|#endif // SIMDJSON_THREADS_ENABLED
  211|  15.3k|  next();
  212|  15.3k|}
_ZN8simdjson3dom15document_stream10run_stage1ERNS0_6parserEm:
  275|   102k|inline error_code document_stream::run_stage1(dom::parser &p, size_t _batch_start) noexcept {
  276|   102k|  size_t remaining = len - _batch_start;
  277|   102k|  if (remaining <= batch_size) {
  ------------------
  |  Branch (277:7): [True: 17.0k, False: 85.7k]
  ------------------
  278|  17.0k|    return p.implementation->stage1(&buf[_batch_start], remaining, stage1_mode::streaming_final);
  279|  85.7k|  } else {
  280|  85.7k|    return p.implementation->stage1(&buf[_batch_start], batch_size, stage1_mode::streaming_partial);
  281|  85.7k|  }
  282|   102k|}
_ZNK8simdjson3dom15document_stream16next_batch_startEv:
  271|   280k|inline size_t document_stream::next_batch_start() const noexcept {
  272|   280k|  return batch_start + parser->implementation->structural_indexes[parser->implementation->n_structural_indexes];
  273|   280k|}
_ZN8simdjson3dom13stage1_worker12start_threadEv:
   32|  1.47k|inline void stage1_worker::start_thread() {
   33|  1.47k|  std::unique_lock<std::mutex> lock(locking_mutex);
   34|  1.47k|  if(thread.joinable()) {
  ------------------
  |  Branch (34:6): [True: 0, False: 1.47k]
  ------------------
   35|      0|    return; // This should never happen but we never want to create more than one thread.
   36|      0|  }
   37|  1.47k|  thread = std::thread([this]{
   38|  1.47k|      while(true) {
   39|  1.47k|        std::unique_lock<std::mutex> thread_lock(locking_mutex);
   40|       |        // We wait for either "run" or "stop_thread" to be called.
   41|  1.47k|        cond_var.wait(thread_lock, [this]{return has_work || !can_work;});
   42|       |        // If, for some reason, the stop_thread() method was called (i.e., the
   43|       |        // destructor of stage1_worker is called, then we want to immediately destroy
   44|       |        // the thread (and not do any more processing).
   45|  1.47k|        if(!can_work) {
   46|  1.47k|          break;
   47|  1.47k|        }
   48|  1.47k|        this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser,
   49|  1.47k|              this->_next_batch_start);
   50|  1.47k|        this->has_work = false;
   51|       |        // The condition variable call should be moved after thread_lock.unlock() for performance
   52|       |        // reasons but thread sanitizers may report it as a data race if we do.
   53|       |        // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock
   54|  1.47k|        cond_var.notify_one(); // will notify "finish"
   55|  1.47k|        thread_lock.unlock();
   56|  1.47k|      }
   57|  1.47k|    }
   58|  1.47k|  );
   59|  1.47k|}
_ZZN8simdjson3dom13stage1_worker12start_threadEvENKUlvE_clEv:
   37|  1.47k|  thread = std::thread([this]{
   38|  20.3k|      while(true) {
  ------------------
  |  Branch (38:13): [Folded - Ignored]
  ------------------
   39|  20.3k|        std::unique_lock<std::mutex> thread_lock(locking_mutex);
   40|       |        // We wait for either "run" or "stop_thread" to be called.
   41|  20.3k|        cond_var.wait(thread_lock, [this]{return has_work || !can_work;});
   42|       |        // If, for some reason, the stop_thread() method was called (i.e., the
   43|       |        // destructor of stage1_worker is called, then we want to immediately destroy
   44|       |        // the thread (and not do any more processing).
   45|  20.3k|        if(!can_work) {
  ------------------
  |  Branch (45:12): [True: 1.47k, False: 18.9k]
  ------------------
   46|  1.47k|          break;
   47|  1.47k|        }
   48|  18.9k|        this->owner->stage1_thread_error = this->owner->run_stage1(*this->stage1_thread_parser,
   49|  18.9k|              this->_next_batch_start);
   50|  18.9k|        this->has_work = false;
   51|       |        // The condition variable call should be moved after thread_lock.unlock() for performance
   52|       |        // reasons but thread sanitizers may report it as a data race if we do.
   53|       |        // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock
   54|  18.9k|        cond_var.notify_one(); // will notify "finish"
   55|  18.9k|        thread_lock.unlock();
   56|  18.9k|      }
   57|  1.47k|    }
_ZZZN8simdjson3dom13stage1_worker12start_threadEvENKUlvE_clEvENKUlvE_clEv:
   41|  39.2k|        cond_var.wait(thread_lock, [this]{return has_work || !can_work;});
  ------------------
  |  Branch (41:50): [True: 18.9k, False: 20.3k]
  |  Branch (41:62): [True: 1.47k, False: 18.8k]
  ------------------
_ZN8simdjson3dom15document_stream19start_stage1_threadEv:
  300|  19.5k|inline void document_stream::start_stage1_thread() noexcept {
  301|       |  // we call the thread on a lambda that will update
  302|       |  // this->stage1_thread_error
  303|       |  // there is only one thread that may write to this value
  304|       |  // TODO this is NOT exception-safe.
  305|  19.5k|  this->stage1_thread_error = UNINITIALIZED; // In case something goes wrong, make sure it's an error
  306|  19.5k|  size_t _next_batch_start = this->next_batch_start();
  307|       |
  308|  19.5k|  worker->run(this, & this->stage1_thread_parser, _next_batch_start);
  309|  19.5k|}
_ZN8simdjson3dom13stage1_worker3runEPNS0_15document_streamEPNS0_6parserEm:
   74|  19.5k|inline void stage1_worker::run(document_stream * ds, dom::parser * stage1, size_t next_batch_start) {
   75|  19.5k|  std::unique_lock<std::mutex> lock(locking_mutex);
   76|  19.5k|  owner = ds;
   77|  19.5k|  _next_batch_start = next_batch_start;
   78|  19.5k|  stage1_thread_parser = stage1;
   79|  19.5k|  has_work = true;
   80|       |  // The condition variable call should be moved after thread_lock.unlock() for performance
   81|       |  // reasons but thread sanitizers may report it as a data race if we do.
   82|       |  // See https://stackoverflow.com/questions/35775501/c-should-condition-variable-be-notified-under-lock
   83|  19.5k|  cond_var.notify_one(); // will notify the thread lock that we have work
   84|  19.5k|  lock.unlock();
   85|  19.5k|}
_ZN8simdjson3dom15document_stream4nextEv:
  235|   116k|inline void document_stream::next() noexcept {
  236|       |  // We always exit at once, once in an error condition.
  237|   116k|  if (error) { return; }
  ------------------
  |  Branch (237:7): [True: 12.5k, False: 104k]
  ------------------
  238|       |
  239|       |  // Load the next document from the batch
  240|   104k|  doc_index = batch_start + parser->implementation->structural_indexes[parser->implementation->next_structural_index];
  241|   104k|  error = parser->implementation->stage2_next(parser->doc);
  242|       |  // If that was the last document in the batch, load another batch (if available)
  243|   259k|  while (error == EMPTY) {
  ------------------
  |  Branch (243:10): [True: 160k, False: 99.3k]
  ------------------
  244|   160k|    batch_start = next_batch_start();
  245|   160k|    if (batch_start >= len) { break; }
  ------------------
  |  Branch (245:9): [True: 4.84k, False: 155k]
  ------------------
  246|       |
  247|   155k|#ifdef SIMDJSON_THREADS_ENABLED
  248|   155k|    if(use_thread) {
  ------------------
  |  Branch (248:8): [True: 155k, False: 0]
  ------------------
  249|   155k|      load_from_stage1_thread();
  250|   155k|    } else {
  251|      0|      error = run_stage1(*parser, batch_start);
  252|      0|    }
  253|       |#else
  254|       |    error = run_stage1(*parser, batch_start);
  255|       |#endif
  256|   155k|    if (error) { continue; } // If the error was EMPTY, we may want to load another batch.
  ------------------
  |  Branch (256:9): [True: 137k, False: 18.4k]
  ------------------
  257|       |    // Run stage 2 on the first document in the batch
  258|  18.4k|    doc_index = batch_start + parser->implementation->structural_indexes[parser->implementation->next_structural_index];
  259|  18.4k|    error = parser->implementation->stage2_next(parser->doc);
  260|  18.4k|  }
  261|   104k|}
_ZN8simdjson3dom15document_stream23load_from_stage1_threadEv:
  286|   155k|inline void document_stream::load_from_stage1_thread() noexcept {
  287|   155k|  worker->finish();
  288|       |  // Swap to the parser that was loaded up in the thread. Make sure the parser has
  289|       |  // enough memory to swap to, as well.
  290|   155k|  std::swap(*parser, stage1_thread_parser);
  291|   155k|  error = stage1_thread_error;
  292|   155k|  if (error) { return; }
  ------------------
  |  Branch (292:7): [True: 137k, False: 18.4k]
  ------------------
  293|       |
  294|       |  // If there's anything left, start the stage 1 thread!
  295|  18.4k|  if (next_batch_start() < len) {
  ------------------
  |  Branch (295:7): [True: 18.0k, False: 386]
  ------------------
  296|  18.0k|    start_stage1_thread();
  297|  18.0k|  }
  298|  18.4k|}
_ZN8simdjson3dom13stage1_worker6finishEv:
   16|   155k|inline void stage1_worker::finish() {
   17|       |  // After calling "run" someone would call finish() to wait
   18|       |  // for the end of the processing.
   19|       |  // This function will wait until either the thread has done
   20|       |  // the processing or, else, the destructor has been called.
   21|   155k|  std::unique_lock<std::mutex> lock(locking_mutex);
   22|   155k|  cond_var.wait(lock, [this]{return has_work == false;});
   23|   155k|}
_ZZN8simdjson3dom13stage1_worker6finishEvENKUlvE_clEv:
   22|   171k|  cond_var.wait(lock, [this]{return has_work == false;});
_ZN8simdjson3dom15document_stream8iteratorC2EPS1_b:
  143|  35.4k|  : stream{_stream}, finished{is_end} {
  144|  35.4k|}
_ZN8simdjson3dom15document_stream3endEv:
  138|  17.7k|simdjson_inline document_stream::iterator document_stream::end() noexcept {
  139|  17.7k|  return iterator(this, true);
  140|  17.7k|}
_ZNK8simdjson3dom15document_stream8iteratorneERKS2_:
  183|   119k|simdjson_inline bool document_stream::iterator::operator!=(const document_stream::iterator &other) const noexcept {
  184|   119k|  return finished != other.finished;
  185|   119k|}
_ZN8simdjson3dom15document_stream8iteratordeEv:
  146|   101k|simdjson_inline document_stream::iterator::reference document_stream::iterator::operator*() noexcept {
  147|       |  // Note that in case of error, we do not yet mark
  148|       |  // the iterator as "finished": this detection is done
  149|       |  // in the operator++ function since it is possible
  150|       |  // to call operator++ repeatedly while omitting
  151|       |  // calls to operator*.
  152|   101k|  if (stream->error) { return stream->error; }
  ------------------
  |  Branch (152:7): [True: 12.5k, False: 88.8k]
  ------------------
  153|  88.8k|  return stream->parser->doc.root();
  154|   101k|}
_ZN8simdjson3dom15document_stream8iteratorppEv:
  156|   101k|simdjson_inline document_stream::iterator& document_stream::iterator::operator++() noexcept {
  157|       |  // If there is an error, then we want the iterator
  158|       |  // to be finished, no matter what. (E.g., we do not
  159|       |  // keep generating documents with errors, or go beyond
  160|       |  // a document with errors.)
  161|       |  //
  162|       |  // Users do not have to call "operator*()" when they use operator++,
  163|       |  // so we need to end the stream in the operator++ function.
  164|       |  //
  165|       |  // Note that setting finished = true is essential otherwise
  166|       |  // we would enter an infinite loop.
  167|   101k|  if (stream->error) { finished = true; }
  ------------------
  |  Branch (167:7): [True: 12.5k, False: 88.8k]
  ------------------
  168|       |  // Note that stream->error() is guarded against error conditions
  169|       |  // (it will immediately return if stream->error casts to false).
  170|       |  // In effect, this next function does nothing when (stream->error)
  171|       |  // is true (hence the risk of an infinite loop).
  172|   101k|  stream->next();
  173|       |  // If that was the last document, we're finished.
  174|       |  // It is the only type of error we do not want to appear
  175|       |  // in operator*.
  176|   101k|  if (stream->error == EMPTY) { finished = true; }
  ------------------
  |  Branch (176:7): [True: 4.84k, False: 96.5k]
  ------------------
  177|       |  // If we had any other kind of error (not EMPTY) then we want
  178|       |  // to pass it along to the operator* and we cannot mark the result
  179|       |  // as "finished" just yet.
  180|   101k|  return *this;
  181|   101k|}
_ZN8simdjson3dom15document_streamD2Ev:
  122|  44.3k|simdjson_inline document_stream::~document_stream() noexcept {
  123|  44.3k|#ifdef SIMDJSON_THREADS_ENABLED
  124|  44.3k|  worker.reset();
  125|  44.3k|#endif
  126|  44.3k|}
_ZN8simdjson3dom13stage1_workerD2Ev:
   25|  26.6k|inline stage1_worker::~stage1_worker() {
   26|       |  // The thread may never outlive the stage1_worker instance
   27|       |  // and will always be stopped/joined before the stage1_worker
   28|       |  // instance is gone.
   29|  26.6k|  stop_thread();
   30|  26.6k|}
_ZN8simdjson3dom13stage1_worker11stop_threadEv:
   62|  26.6k|inline void stage1_worker::stop_thread() {
   63|  26.6k|  std::unique_lock<std::mutex> lock(locking_mutex);
   64|       |  // We have to make sure that all locks can be released.
   65|  26.6k|  can_work = false;
   66|  26.6k|  has_work = false;
   67|  26.6k|  cond_var.notify_all();
   68|  26.6k|  lock.unlock();
   69|  26.6k|  if(thread.joinable()) {
  ------------------
  |  Branch (69:6): [True: 1.47k, False: 25.1k]
  ------------------
   70|  1.47k|    thread.join();
   71|  1.47k|  }
   72|  26.6k|}

_ZN8simdjson3dom13stage1_workerC2Ev:
   19|  26.6k|  stage1_worker() noexcept = default;
_ZN8simdjson3dom15document_streamC2EOS1_:
   84|  17.7k|  simdjson_inline document_stream(document_stream &&other) noexcept = default;
_ZN8simdjson3dom15document_streamaSEOS1_:
   86|  17.7k|  simdjson_inline document_stream &operator=(document_stream &&other) noexcept = default;

_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2ENS_10error_codeE:
   27|  12.5k|    : internal::simdjson_result_base<dom::element>(error) {}
_ZN8simdjson3dom7elementC2Ev:
  197|  12.5k|simdjson_inline element::element() noexcept : tape{} {}
_ZN8simdjson3dom7elementC2ERKNS_8internal8tape_refE:
  198|  88.8k|simdjson_inline element::element(const internal::tape_ref &_tape) noexcept : tape{_tape} { }
_ZN8simdjson15simdjson_resultINS_3dom7elementEEC2EOS2_:
   25|  88.8k|    : internal::simdjson_result_base<dom::element>(std::forward<dom::element>(value)) {}
_ZNK8simdjson15simdjson_resultINS_3dom7elementEE7is_boolEv:
  106|   101k|simdjson_inline bool simdjson_result<dom::element>::is_bool() const noexcept {
  107|   101k|  return !error() && first.is_bool();
  ------------------
  |  Branch (107:10): [True: 88.8k, False: 12.5k]
  |  Branch (107:22): [True: 3.22k, False: 85.6k]
  ------------------
  108|   101k|}
_ZNK8simdjson3dom7element7is_boolEv:
  350|  88.8k|inline bool element::is_bool() const noexcept { return is<bool>(); }
_ZNK8simdjson3dom7element2isIbEEbv:
  330|  88.8k|simdjson_inline bool element::is() const noexcept {
  331|  88.8k|  auto result = get<T>();
  332|  88.8k|  return !result.error();
  333|  88.8k|}
_ZNK8simdjson3dom7element3getIbEENS_15simdjson_resultIT_EEv:
  342|  88.8k|template<> inline simdjson_result<bool> element::get<bool>() const noexcept { return get_bool(); }
_ZNK8simdjson3dom7element8get_boolEv:
  206|  88.8k|inline simdjson_result<bool> element::get_bool() const noexcept {
  207|  88.8k|  SIMDJSON_DEVELOPMENT_ASSERT(tape.usable()); // https://github.com/simdjson/simdjson/issues/1914
  ------------------
  |  |  322|  88.8k|#define SIMDJSON_DEVELOPMENT_ASSERT(expr) do { } while (0)
  |  |  ------------------
  |  |  |  Branch (322:57): [Folded - Ignored]
  |  |  ------------------
  ------------------
  208|  88.8k|  if(tape.is_true()) {
  ------------------
  |  Branch (208:6): [True: 2.02k, False: 86.8k]
  ------------------
  209|  2.02k|    return true;
  210|  86.8k|  } else if(tape.is_false()) {
  ------------------
  |  Branch (210:13): [True: 1.19k, False: 85.6k]
  ------------------
  211|  1.19k|    return false;
  212|  1.19k|  }
  213|  85.6k|  return INCORRECT_TYPE;
  214|  88.8k|}

_ZN8simdjson3dom6parserC2Em:
   24|  35.4k|  : _max_capacity{max_capacity},
   25|  35.4k|    loaded_bytes(nullptr) {
   26|  35.4k|}
_ZN8simdjson3dom6parser10parse_manyERKNS_13padded_stringEm:
  184|  17.7k|inline simdjson_result<document_stream> parser::parse_many(const padded_string &s, size_t batch_size) noexcept {
  185|  17.7k|  return parse_many(s.data(), s.length(), batch_size);
  186|  17.7k|}
_ZN8simdjson3dom6parser10parse_manyEPKcmm:
  178|  17.7k|inline simdjson_result<document_stream> parser::parse_many(const char *buf, size_t len, size_t batch_size) noexcept {
  179|  17.7k|  return parse_many(reinterpret_cast<const uint8_t *>(buf), len, batch_size);
  180|  17.7k|}
_ZN8simdjson3dom6parser10parse_manyEPKhmm:
  170|  17.7k|inline simdjson_result<document_stream> parser::parse_many(const uint8_t *buf, size_t len, size_t batch_size) noexcept {
  171|  17.7k|  if(batch_size < MINIMAL_BATCH_SIZE) { batch_size = MINIMAL_BATCH_SIZE; }
  ------------------
  |  Branch (171:6): [True: 1.25k, False: 16.4k]
  ------------------
  172|  17.7k|  if((len >= 3) && (std::memcmp(buf, "\xEF\xBB\xBF", 3) == 0)) {
  ------------------
  |  Branch (172:6): [True: 17.4k, False: 272]
  |  Branch (172:20): [True: 14, False: 17.4k]
  ------------------
  173|     14|    buf += 3;
  174|     14|    len -= 3;
  175|     14|  }
  176|  17.7k|  return document_stream(*this, buf, len, batch_size);
  177|  17.7k|}
_ZN8simdjson3dom6parserC2EOS1_:
   27|   173k|simdjson_inline parser::parser(parser &&other) noexcept = default;
_ZN8simdjson3dom6parser15ensure_capacityEm:
  220|  19.2k|inline error_code parser::ensure_capacity(size_t desired_capacity) noexcept {
  221|  19.2k|  return ensure_capacity(doc, desired_capacity);
  222|  19.2k|}
_ZN8simdjson3dom6parser15ensure_capacityERNS0_8documentEm:
  225|  19.2k|inline error_code parser::ensure_capacity(document& target_document, size_t desired_capacity) noexcept {
  226|       |  // 1. It is wasteful to allocate a document and a parser for documents spanning less than MINIMAL_DOCUMENT_CAPACITY bytes.
  227|       |  // 2. If we allow desired_capacity = 0 then it is possible to exit this function with implementation == nullptr.
  228|  19.2k|  if(desired_capacity < MINIMAL_DOCUMENT_CAPACITY) { desired_capacity = MINIMAL_DOCUMENT_CAPACITY; }
  ------------------
  |  Branch (228:6): [True: 0, False: 19.2k]
  ------------------
  229|       |  // If we don't have enough capacity, (try to) automatically bump it.
  230|       |  // If the document needs allocation, do it too.
  231|       |  // Both in one if statement to minimize unlikely branching.
  232|       |  //
  233|       |  // Note: we must make sure that this function is called if capacity() == 0. We do so because we
  234|       |  // ensure that desired_capacity > 0.
  235|  19.2k|  if (simdjson_unlikely(capacity() < desired_capacity || target_document.capacity() < desired_capacity)) {
  ------------------
  |  |  106|  28.1k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 10.3k, False: 8.87k]
  |  |  |  Branch (106:52): [True: 10.3k, False: 8.87k]
  |  |  |  Branch (106:52): [True: 0, False: 8.87k]
  |  |  ------------------
  ------------------
  236|  10.3k|    if (desired_capacity > max_capacity()) {
  ------------------
  |  Branch (236:9): [True: 0, False: 10.3k]
  ------------------
  237|      0|      return error = CAPACITY;
  238|      0|    }
  239|  10.3k|    error_code err1 = target_document.capacity() < desired_capacity ? target_document.allocate(desired_capacity) : SUCCESS;
  ------------------
  |  Branch (239:23): [True: 10.3k, False: 0]
  ------------------
  240|  10.3k|    error_code err2 = capacity() < desired_capacity ? allocate(desired_capacity, max_depth()) : SUCCESS;
  ------------------
  |  Branch (240:23): [True: 10.3k, False: 0]
  ------------------
  241|  10.3k|    if(err1 != SUCCESS) { return error = err1; }
  ------------------
  |  Branch (241:8): [True: 0, False: 10.3k]
  ------------------
  242|  10.3k|    if(err2 != SUCCESS) { return error = err2; }
  ------------------
  |  Branch (242:8): [True: 0, False: 10.3k]
  ------------------
  243|  10.3k|  }
  244|  19.2k|  return SUCCESS;
  245|  19.2k|}
_ZNK8simdjson3dom6parser8capacityEv:
  188|  29.5k|simdjson_inline size_t parser::capacity() const noexcept {
  189|  29.5k|  return implementation ? implementation->capacity() : 0;
  ------------------
  |  Branch (189:10): [True: 8.87k, False: 20.7k]
  ------------------
  190|  29.5k|}
_ZNK8simdjson3dom6parser12max_capacityEv:
  191|  10.3k|simdjson_inline size_t parser::max_capacity() const noexcept {
  192|  10.3k|  return _max_capacity;
  193|  10.3k|}
_ZN8simdjson3dom6parser8allocateEmm:
  199|  10.3k|inline error_code parser::allocate(size_t capacity, size_t max_depth) noexcept {
  200|       |  //
  201|       |  // Reallocate implementation if needed
  202|       |  //
  203|  10.3k|  error_code err;
  204|  10.3k|  if (implementation) {
  ------------------
  |  Branch (204:7): [True: 0, False: 10.3k]
  ------------------
  205|      0|    err = implementation->allocate(capacity, max_depth);
  206|  10.3k|  } else {
  207|  10.3k|    err = simdjson::get_active_implementation()->create_dom_parser_implementation(capacity, max_depth, implementation);
  208|  10.3k|  }
  209|  10.3k|  if (err) { return err; }
  ------------------
  |  Branch (209:7): [True: 0, False: 10.3k]
  ------------------
  210|  10.3k|  return SUCCESS;
  211|  10.3k|}
_ZNK8simdjson3dom6parser9max_depthEv:
  194|  10.3k|simdjson_pure simdjson_inline size_t parser::max_depth() const noexcept {
  195|  10.3k|  return implementation ? implementation->max_depth() : DEFAULT_MAX_DEPTH;
  ------------------
  |  Branch (195:10): [True: 0, False: 10.3k]
  ------------------
  196|  10.3k|}
_ZN8simdjson3dom6parseraSEOS1_:
   28|   329k|simdjson_inline parser &parser::operator=(parser &&other) noexcept = default;

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

_ZN8simdjson8internal20simdjson_result_baseINS_3dom15document_streamEEC2EOS3_:
  114|  17.7k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom15document_streamEEC2EOS3_NS_10error_codeE:
  108|  17.7k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2ENS_10error_codeE:
  111|  12.5k|    : simdjson_result_base(T{}, error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_NS_10error_codeE:
  108|   101k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson8internal20simdjson_result_baseINS_3dom7elementEEC2EOS3_:
  114|  88.8k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZNK8simdjson8internal20simdjson_result_baseINS_3dom7elementEE5errorEv:
   66|   101k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   67|   101k|  return this->second;
   68|   101k|}
_ZN8simdjson15simdjson_resultIbEC2EOb:
  199|  3.22k|    : internal::simdjson_result_base<T>(std::forward<T>(value)) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EOb:
  114|  3.22k|    : simdjson_result_base(std::forward<T>(value), SUCCESS) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2EObNS_10error_codeE:
  108|  88.8k|    : std::pair<T, error_code>(std::forward<T>(value), error) {}
_ZN8simdjson15simdjson_resultIbEC2ENS_10error_codeE:
  196|  85.6k|    : internal::simdjson_result_base<T>(error) {}
_ZN8simdjson8internal20simdjson_result_baseIbEC2ENS_10error_codeE:
  111|  85.6k|    : simdjson_result_base(T{}, error) {}
_ZNK8simdjson15simdjson_resultIbE5errorEv:
  153|  88.8k|simdjson_inline error_code simdjson_result<T>::error() const noexcept {
  154|  88.8k|  return internal::simdjson_result_base<T>::error();
  155|  88.8k|}
_ZNK8simdjson8internal20simdjson_result_baseIbE5errorEv:
   66|  88.8k|simdjson_inline error_code simdjson_result_base<T>::error() const noexcept {
   67|  88.8k|  return this->second;
   68|  88.8k|}
_ZNO8simdjson8internal20simdjson_result_baseINS_3dom15document_streamEE3getERS3_:
   59|  17.7k|simdjson_warn_unused simdjson_inline error_code simdjson_result_base<T>::get(T &value) && noexcept {
   60|  17.7k|  error_code error;
   61|  17.7k|  std::forward<simdjson_result_base<T>>(*this).tie(value, error);
   62|  17.7k|  return error;
   63|  17.7k|}
_ZNO8simdjson8internal20simdjson_result_baseINS_3dom15document_streamEE3tieERS3_RNS_10error_codeE:
   51|  17.7k|simdjson_inline void simdjson_result_base<T>::tie(T &value, error_code &error) && noexcept {
   52|  17.7k|  error = this->second;
   53|  17.7k|  if (!error) {
  ------------------
  |  Branch (53:7): [True: 17.7k, False: 0]
  ------------------
   54|  17.7k|    value = std::forward<simdjson_result_base<T>>(*this).first;
   55|  17.7k|  }
   56|  17.7k|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN8simdjson8internal8tape_refC2Ev:
   19|  12.5k|simdjson_inline tape_ref::tape_ref() noexcept : doc{nullptr}, json_index{0} {}
_ZN8simdjson8internal8tape_refC2EPKNS_3dom8documentEm:
   20|  88.8k|simdjson_inline tape_ref::tape_ref(const dom::document *_doc, size_t _json_index) noexcept : doc{_doc}, json_index{_json_index} {}
_ZNK8simdjson8internal8tape_ref7is_trueEv:
   49|  88.8k|simdjson_inline bool tape_ref::is_true() const noexcept {
   50|  88.8k|  constexpr uint64_t tape_true = uint64_t(tape_type::TRUE_VALUE)<<56;
   51|  88.8k|  return doc->tape[json_index] == tape_true;
   52|  88.8k|}
_ZNK8simdjson8internal8tape_ref8is_falseEv:
   45|  86.8k|simdjson_inline bool tape_ref::is_false() const noexcept {
   46|  86.8k|  constexpr uint64_t tape_false = uint64_t(tape_type::FALSE_VALUE)<<56;
   47|  86.8k|  return doc->tape[json_index] == tape_false;
   48|  86.8k|}

_ZN8simdjson13padded_stringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   82|  8.87k|    : viable_size(sv_.size()), data_ptr(internal::allocate_padded_buffer(sv_.size())) {
   83|  8.87k|  if(simdjson_unlikely(!data_ptr)) {
  ------------------
  |  |  106|  8.87k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 5, False: 8.86k]
  |  |  ------------------
  ------------------
   84|       |    //allocation failed or zero size
   85|      5|    viable_size = 0;
   86|      5|    return;
   87|      5|  }
   88|  8.86k|  if (sv_.size()) {
  ------------------
  |  Branch (88:7): [True: 8.84k, False: 24]
  ------------------
   89|  8.84k|    std::memcpy(data_ptr, sv_.data(), sv_.size());
   90|  8.84k|  }
   91|  8.86k|}
_ZN8simdjson8internal22allocate_padded_bufferEm:
   21|  8.87k|inline char *allocate_padded_buffer(size_t length) noexcept {
   22|  8.87k|  const size_t totalpaddedlength = length + SIMDJSON_PADDING;
   23|  8.87k|  if(totalpaddedlength<length) {
  ------------------
  |  Branch (23:6): [True: 0, False: 8.87k]
  ------------------
   24|       |    // overflow
   25|      0|    return nullptr;
   26|      0|  }
   27|  8.87k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   28|       |  // avoid getting out of memory
   29|  8.87k|  if (totalpaddedlength>(1UL<<20)) {
  ------------------
  |  Branch (29:7): [True: 5, False: 8.86k]
  ------------------
   30|      5|    return nullptr;
   31|      5|  }
   32|  8.86k|#endif
   33|       |
   34|  8.86k|  char *padded_buffer = new (std::nothrow) char[totalpaddedlength];
   35|  8.86k|  if (padded_buffer == nullptr) {
  ------------------
  |  Branch (35:7): [True: 0, False: 8.86k]
  ------------------
   36|      0|    return nullptr;
   37|      0|  }
   38|       |  // We write nulls in the padded region to avoid having uninitialized
   39|       |  // content which may trigger warning for some sanitizers
   40|  8.86k|  std::memset(padded_buffer + length, 0, totalpaddedlength - length);
   41|  8.86k|  return padded_buffer;
   42|  8.86k|} // allocate_padded_buffer()
_ZNK8simdjson13padded_string4dataEv:
  124|  17.7k|inline const char *padded_string::data() const noexcept { return data_ptr; }
_ZNK8simdjson13padded_string6lengthEv:
  122|  17.7k|inline size_t padded_string::length() const noexcept { return viable_size; }
_ZN8simdjson13padded_stringD2Ev:
  116|  8.87k|inline padded_string::~padded_string() noexcept {
  117|  8.87k|  delete[] data_ptr;
  118|  8.87k|}

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

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage124find_next_document_indexERNS0_25dom_parser_implementationE:
   39|  36.1k|simdjson_inline uint32_t find_next_document_index(dom_parser_implementation &parser) {
   40|       |  // Variant: do not count separately, just figure out depth
   41|  36.1k|  if(parser.n_structural_indexes == 0) { return 0; }
  ------------------
  |  Branch (41:6): [True: 84, False: 36.0k]
  ------------------
   42|  36.0k|  auto arr_cnt = 0;
   43|  36.0k|  auto obj_cnt = 0;
   44|   262k|  for (auto i = parser.n_structural_indexes - 1; i > 0; i--) {
  ------------------
  |  Branch (44:50): [True: 252k, False: 10.2k]
  ------------------
   45|   252k|    auto idxb = parser.structural_indexes[i];
   46|   252k|    switch (parser.buf[idxb]) {
  ------------------
  |  Branch (46:13): [True: 91.8k, False: 160k]
  ------------------
   47|  24.6k|    case ':':
  ------------------
  |  Branch (47:5): [True: 24.6k, False: 228k]
  ------------------
   48|  90.1k|    case ',':
  ------------------
  |  Branch (48:5): [True: 65.5k, False: 187k]
  ------------------
   49|  90.1k|      continue;
   50|  12.6k|    case '}':
  ------------------
  |  Branch (50:5): [True: 12.6k, False: 240k]
  ------------------
   51|  12.6k|      obj_cnt--;
   52|  12.6k|      continue;
   53|  16.5k|    case ']':
  ------------------
  |  Branch (53:5): [True: 16.5k, False: 236k]
  ------------------
   54|  16.5k|      arr_cnt--;
   55|  16.5k|      continue;
   56|  16.7k|    case '{':
  ------------------
  |  Branch (56:5): [True: 16.7k, False: 235k]
  ------------------
   57|  16.7k|      obj_cnt++;
   58|  16.7k|      break;
   59|  24.7k|    case '[':
  ------------------
  |  Branch (59:5): [True: 24.7k, False: 227k]
  ------------------
   60|  24.7k|      arr_cnt++;
   61|  24.7k|      break;
   62|   252k|    }
   63|   133k|    auto idxa = parser.structural_indexes[i - 1];
   64|   133k|    switch (parser.buf[idxa]) {
  ------------------
  |  Branch (64:13): [True: 25.8k, False: 107k]
  ------------------
   65|  15.6k|    case '{':
  ------------------
  |  Branch (65:5): [True: 15.6k, False: 117k]
  ------------------
   66|  34.6k|    case '[':
  ------------------
  |  Branch (66:5): [True: 18.9k, False: 114k]
  ------------------
   67|  50.8k|    case ':':
  ------------------
  |  Branch (67:5): [True: 16.2k, False: 117k]
  ------------------
   68|   107k|    case ',':
  ------------------
  |  Branch (68:5): [True: 56.5k, False: 76.7k]
  ------------------
   69|   107k|      continue;
   70|   133k|    }
   71|       |    // Last document is complete, so the next document will appear after!
   72|  25.8k|    if (!arr_cnt && !obj_cnt) {
  ------------------
  |  Branch (72:9): [True: 17.9k, False: 7.88k]
  |  Branch (72:21): [True: 9.98k, False: 7.99k]
  ------------------
   73|  9.98k|      return parser.n_structural_indexes;
   74|  9.98k|    }
   75|       |    // Last document is incomplete; mark the document at i + 1 as the next one
   76|  15.8k|    return i;
   77|  25.8k|  }
   78|       |  // If we made it to the end, we want to finish counting to see if we have a full document.
   79|  10.2k|  switch (parser.buf[parser.structural_indexes[0]]) {
  ------------------
  |  Branch (79:11): [True: 7.30k, False: 2.89k]
  ------------------
   80|     60|    case '}':
  ------------------
  |  Branch (80:5): [True: 60, False: 10.1k]
  ------------------
   81|     60|      obj_cnt--;
   82|     60|      break;
   83|     92|    case ']':
  ------------------
  |  Branch (83:5): [True: 92, False: 10.1k]
  ------------------
   84|     92|      arr_cnt--;
   85|     92|      break;
   86|  1.59k|    case '{':
  ------------------
  |  Branch (86:5): [True: 1.59k, False: 8.61k]
  ------------------
   87|  1.59k|      obj_cnt++;
   88|  1.59k|      break;
   89|  1.15k|    case '[':
  ------------------
  |  Branch (89:5): [True: 1.15k, False: 9.05k]
  ------------------
   90|  1.15k|      arr_cnt++;
   91|  1.15k|      break;
   92|  10.2k|  }
   93|  10.2k|  if (!arr_cnt && !obj_cnt) {
  ------------------
  |  Branch (93:7): [True: 9.67k, False: 532]
  |  Branch (93:19): [True: 9.35k, False: 321]
  ------------------
   94|       |    // We have a complete document.
   95|  9.35k|    return parser.n_structural_indexes;
   96|  9.35k|  }
   97|    853|  return 0;
   98|  10.2k|}

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

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

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

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

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iteratorC2ERNS0_25dom_parser_implementationEm:
  245|   122k|  : buf{_dom_parser.buf},
  246|   122k|    next_structural{&_dom_parser.structural_indexes[start_structural_index]},
  247|   122k|    dom_parser{_dom_parser} {
  248|   122k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator6at_eofEv:
  260|   122k|simdjson_inline bool json_iterator::at_eof() const noexcept {
  261|   122k|  return next_structural == &dom_parser.structural_indexes[dom_parser.n_structural_indexes];
  262|   122k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15log_start_valueEPKc:
  274|   151k|simdjson_inline void json_iterator::log_start_value(const char *type) const noexcept {
  275|   151k|  logger::log_line(*this, "+", type, "");
  276|   151k|  if (logger::LOG_ENABLED) { logger::log_depth++; }
  ------------------
  |  Branch (276:7): [Folded - Ignored]
  ------------------
  277|   151k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator7advanceEv:
  253|   430k|simdjson_inline const uint8_t *json_iterator::advance() noexcept {
  254|   430k|  return &buf[*(next_structural++)];
  255|   430k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_valueEPKc:
  270|   219k|simdjson_inline void json_iterator::log_value(const char *type) const noexcept {
  271|   219k|  logger::log_line(*this, "", type, "");
  272|   219k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator4peekEv:
  250|  58.5k|simdjson_inline const uint8_t *json_iterator::peek() const noexcept {
  251|  58.5k|  return &buf[*(next_structural)];
  252|  58.5k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator20visit_root_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  289|  64.1k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_root_primitive(V &visitor, const uint8_t *value) noexcept {
  290|  64.1k|  switch (*value) {
  291|  34.2k|    case '"': return visitor.visit_root_string(*this, value);
  ------------------
  |  Branch (291:5): [True: 34.2k, False: 29.8k]
  ------------------
  292|  2.11k|    case 't': return visitor.visit_root_true_atom(*this, value);
  ------------------
  |  Branch (292:5): [True: 2.11k, False: 62.0k]
  ------------------
  293|  1.33k|    case 'f': return visitor.visit_root_false_atom(*this, value);
  ------------------
  |  Branch (293:5): [True: 1.33k, False: 62.8k]
  ------------------
  294|  1.61k|    case 'n': return visitor.visit_root_null_atom(*this, value);
  ------------------
  |  Branch (294:5): [True: 1.61k, False: 62.5k]
  ------------------
  295|  1.53k|    case '-':
  ------------------
  |  Branch (295:5): [True: 1.53k, False: 62.6k]
  ------------------
  296|  14.4k|    case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (296:5): [True: 3.03k, False: 61.1k]
  |  Branch (296:15): [True: 3.76k, False: 60.3k]
  |  Branch (296:25): [True: 1.87k, False: 62.2k]
  |  Branch (296:35): [True: 2.82k, False: 61.3k]
  |  Branch (296:45): [True: 1.46k, False: 62.7k]
  ------------------
  297|  24.2k|    case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (297:5): [True: 1.65k, False: 62.5k]
  |  Branch (297:15): [True: 1.20k, False: 62.9k]
  |  Branch (297:25): [True: 1.53k, False: 62.6k]
  |  Branch (297:35): [True: 3.24k, False: 60.9k]
  |  Branch (297:45): [True: 2.16k, False: 62.0k]
  ------------------
  298|  24.2k|      return visitor.visit_root_number(*this, value);
  299|    532|    default:
  ------------------
  |  Branch (299:5): [True: 532, False: 63.6k]
  ------------------
  300|    532|      log_error("Document starts with a non-value character");
  301|    532|      return TAPE_ERROR;
  302|  64.1k|  }
  303|  64.1k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13remaining_lenEv:
  256|  77.9k|simdjson_inline size_t json_iterator::remaining_len() const noexcept {
  257|  77.9k|  return dom_parser.len - *(next_structural-1);
  258|  77.9k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator9log_errorEPKc:
  284|  6.34k|simdjson_inline void json_iterator::log_error(const char *error) const noexcept {
  285|  6.34k|  logger::log_line(*this, "", "ERROR", error);
  286|  6.34k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator15visit_primitiveINS2_12tape_builderEEENS_10error_codeERT_PKh:
  305|   107k|simdjson_warn_unused simdjson_inline error_code json_iterator::visit_primitive(V &visitor, const uint8_t *value) noexcept {
  306|       |  // Use the fact that most scalars are going to be either strings or numbers.
  307|   107k|  if(*value == '"') {
  ------------------
  |  Branch (307:6): [True: 2.57k, False: 104k]
  ------------------
  308|  2.57k|    return visitor.visit_string(*this, value);
  309|   104k|  } else if (((*value - '0')  < 10) || (*value == '-')) {
  ------------------
  |  Branch (309:14): [True: 103k, False: 1.79k]
  |  Branch (309:40): [True: 0, False: 1.79k]
  ------------------
  310|   103k|    return visitor.visit_number(*this, value);
  311|   103k|  }
  312|       |  // true, false, null are uncommon.
  313|  1.79k|  switch (*value) {
  314|    534|    case 't': return visitor.visit_true_atom(*this, value);
  ------------------
  |  Branch (314:5): [True: 534, False: 1.25k]
  ------------------
  315|    616|    case 'f': return visitor.visit_false_atom(*this, value);
  ------------------
  |  Branch (315:5): [True: 616, False: 1.17k]
  ------------------
  316|    546|    case 'n': return visitor.visit_null_atom(*this, value);
  ------------------
  |  Branch (316:5): [True: 546, False: 1.24k]
  ------------------
  317|     94|    default:
  ------------------
  |  Branch (317:5): [True: 94, False: 1.69k]
  ------------------
  318|     94|      log_error("Non-value found when value was expected!");
  319|     94|      return TAPE_ERROR;
  320|  1.79k|  }
  321|  1.79k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13log_end_valueEPKc:
  279|   114k|simdjson_inline void json_iterator::log_end_value(const char *type) const noexcept {
  280|   114k|  if (logger::LOG_ENABLED) { logger::log_depth--; }
  ------------------
  |  Branch (280:7): [Folded - Ignored]
  ------------------
  281|   114k|  logger::log_line(*this, "-", type, "");
  282|   114k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage213json_iterator13walk_documentILb1ENS2_12tape_builderEEENS_10error_codeERT0_:
  119|   122k|simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
  120|   122k|  logger::log_start();
  121|       |
  122|       |  //
  123|       |  // Start the document
  124|       |  //
  125|   122k|  if (at_eof()) { return EMPTY; }
  ------------------
  |  Branch (125:7): [True: 23.4k, False: 99.1k]
  ------------------
  126|  99.1k|  log_start_value("document");
  127|  99.1k|  SIMDJSON_TRY( visitor.visit_document_start(*this) );
  ------------------
  |  |  273|  99.1k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 99.1k]
  |  |  ------------------
  ------------------
  128|       |
  129|       |  //
  130|       |  // Read first value
  131|       |  //
  132|  99.1k|  {
  133|  99.1k|    auto value = advance();
  134|       |
  135|       |    // Make sure the outer object or array is closed before continuing; otherwise, there are ways we
  136|       |    // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906
  137|  99.1k|    if (!STREAMING) {
  ------------------
  |  Branch (137:9): [Folded - Ignored]
  ------------------
  138|      0|      switch (*value) {
  ------------------
  |  Branch (138:15): [True: 0, False: 0]
  ------------------
  139|      0|        case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (139:9): [True: 0, False: 0]
  |  Branch (139:23): [True: 0, False: 0]
  ------------------
  140|      0|        case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  |  Branch (140:23): [True: 0, False: 0]
  ------------------
  141|      0|      }
  142|      0|    }
  143|       |
  144|  99.1k|    switch (*value) {
  145|  20.7k|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    288|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 288]
  |  |  ------------------
  ------------------
  |  Branch (145:7): [True: 20.7k, False: 78.3k]
  |  Branch (145:21): [True: 288, False: 20.4k]
  ------------------
  146|  20.4k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|  2.22k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 2.22k]
  |  |  ------------------
  ------------------
  |  Branch (146:7): [True: 14.2k, False: 84.9k]
  |  Branch (146:21): [True: 2.22k, False: 12.0k]
  ------------------
  147|  64.1k|      default: SIMDJSON_TRY( visitor.visit_root_primitive(*this, value) ); break;
  ------------------
  |  |  273|  64.1k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 2.22k, False: 61.9k]
  |  |  ------------------
  ------------------
  |  Branch (147:7): [True: 64.1k, False: 35.0k]
  ------------------
  148|  99.1k|    }
  149|  99.1k|  }
  150|  64.4k|  goto document_end;
  151|       |
  152|       |//
  153|       |// Object parser states
  154|       |//
  155|  64.4k|object_begin:
  156|  21.4k|  log_start_value("object");
  157|  21.4k|  depth++;
  158|  21.4k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (158:7): [True: 0, False: 21.4k]
  ------------------
  159|  21.4k|  dom_parser.is_array[depth] = false;
  160|  21.4k|  SIMDJSON_TRY( visitor.visit_object_start(*this) );
  ------------------
  |  |  273|  21.4k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 21.4k]
  |  |  ------------------
  ------------------
  161|       |
  162|  21.4k|  {
  163|  21.4k|    auto key = advance();
  164|  21.4k|    if (*key != '"') { log_error("Object does not start with a key"); return TAPE_ERROR; }
  ------------------
  |  Branch (164:9): [True: 148, False: 21.2k]
  ------------------
  165|  21.2k|    SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  21.2k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 21.2k]
  |  |  ------------------
  ------------------
  166|  21.2k|    SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  273|  21.2k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 204, False: 21.0k]
  |  |  ------------------
  ------------------
  167|  21.0k|  }
  168|       |
  169|  41.8k|object_field:
  170|  41.8k|  if (simdjson_unlikely( *advance() != ':' )) { log_error("Missing colon after key in object"); return TAPE_ERROR; }
  ------------------
  |  |  106|  41.8k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 720, False: 41.0k]
  |  |  ------------------
  ------------------
  171|  41.0k|  {
  172|  41.0k|    auto value = advance();
  173|  41.0k|    switch (*value) {
  174|    692|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    194|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 194]
  |  |  ------------------
  ------------------
  |  Branch (174:7): [True: 692, False: 40.3k]
  |  Branch (174:21): [True: 194, False: 498]
  ------------------
  175|  3.76k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|  3.37k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 3.37k]
  |  |  ------------------
  ------------------
  |  Branch (175:7): [True: 3.76k, False: 37.3k]
  |  Branch (175:21): [True: 3.37k, False: 390]
  ------------------
  176|  36.6k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  273|  36.6k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 1.31k, False: 35.3k]
  |  |  ------------------
  ------------------
  |  Branch (176:7): [True: 36.6k, False: 4.45k]
  ------------------
  177|  41.0k|    }
  178|  41.0k|  }
  179|       |
  180|  39.1k|object_continue:
  181|  39.1k|  switch (*advance()) {
  182|  20.9k|    case ',':
  ------------------
  |  Branch (182:5): [True: 20.9k, False: 18.1k]
  ------------------
  183|  20.9k|      SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  20.9k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 20.9k]
  |  |  ------------------
  ------------------
  184|  20.9k|      {
  185|  20.9k|        auto key = advance();
  186|  20.9k|        if (simdjson_unlikely( *key != '"' )) { log_error("Key string missing at beginning of field in object"); return TAPE_ERROR; }
  ------------------
  |  |  106|  20.9k|  #define simdjson_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (106:32): [True: 40, False: 20.8k]
  |  |  ------------------
  ------------------
  187|  20.8k|        SIMDJSON_TRY( visitor.visit_key(*this, key) );
  ------------------
  |  |  273|  20.8k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 134, False: 20.7k]
  |  |  ------------------
  ------------------
  188|  20.7k|      }
  189|      0|      goto object_field;
  190|  16.4k|    case '}': log_end_value("object"); SIMDJSON_TRY( visitor.visit_object_end(*this) ); goto scope_end;
  ------------------
  |  |  273|  16.4k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 16.4k]
  |  |  ------------------
  ------------------
  |  Branch (190:5): [True: 16.4k, False: 22.7k]
  ------------------
  191|  1.77k|    default: log_error("No comma between object fields"); return TAPE_ERROR;
  ------------------
  |  Branch (191:5): [True: 1.77k, False: 37.3k]
  ------------------
  192|  39.1k|  }
  193|       |
  194|  25.1k|scope_end:
  195|  25.1k|  depth--;
  196|  25.1k|  if (depth == 0) { goto document_end; }
  ------------------
  |  Branch (196:7): [True: 24.4k, False: 750]
  ------------------
  197|    750|  if (dom_parser.is_array[depth]) { goto array_continue; }
  ------------------
  |  Branch (197:7): [True: 506, False: 244]
  ------------------
  198|    244|  goto object_continue;
  199|       |
  200|       |//
  201|       |// Array parser states
  202|       |//
  203|  30.5k|array_begin:
  204|  30.5k|  log_start_value("array");
  205|  30.5k|  depth++;
  206|  30.5k|  if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
  ------------------
  |  Branch (206:7): [True: 0, False: 30.5k]
  ------------------
  207|  30.5k|  dom_parser.is_array[depth] = true;
  208|  30.5k|  SIMDJSON_TRY( visitor.visit_array_start(*this) );
  ------------------
  |  |  273|  30.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 30.5k]
  |  |  ------------------
  ------------------
  209|  30.5k|  SIMDJSON_TRY( visitor.increment_count(*this) );
  ------------------
  |  |  273|  30.5k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 30.5k]
  |  |  ------------------
  ------------------
  210|       |
  211|  89.9k|array_value:
  212|  89.9k|  {
  213|  89.9k|    auto value = advance();
  214|  89.9k|    switch (*value) {
  215|    698|      case '{': if (*peek() == '}') { advance(); log_value("empty object"); SIMDJSON_TRY( visitor.visit_empty_object(*this) ); break; } goto object_begin;
  ------------------
  |  |  273|    280|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 280]
  |  |  ------------------
  ------------------
  |  Branch (215:7): [True: 698, False: 89.2k]
  |  Branch (215:21): [True: 280, False: 418]
  ------------------
  216|  18.4k|      case '[': if (*peek() == ']') { advance(); log_value("empty array"); SIMDJSON_TRY( visitor.visit_empty_array(*this) ); break; } goto array_begin;
  ------------------
  |  |  273|    224|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 224]
  |  |  ------------------
  ------------------
  |  Branch (216:7): [True: 18.4k, False: 71.5k]
  |  Branch (216:21): [True: 224, False: 18.1k]
  ------------------
  217|  70.8k|      default: SIMDJSON_TRY( visitor.visit_primitive(*this, value) ); break;
  ------------------
  |  |  273|  70.8k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 1.60k, False: 69.2k]
  |  |  ------------------
  ------------------
  |  Branch (217:7): [True: 70.8k, False: 19.1k]
  ------------------
  218|  89.9k|    }
  219|  89.9k|  }
  220|       |
  221|  70.2k|array_continue:
  222|  70.2k|  switch (*advance()) {
  223|  59.4k|    case ',': SIMDJSON_TRY( visitor.increment_count(*this) ); goto array_value;
  ------------------
  |  |  273|  59.4k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 59.4k]
  |  |  ------------------
  ------------------
  |  Branch (223:5): [True: 59.4k, False: 10.8k]
  ------------------
  224|  8.73k|    case ']': log_end_value("array"); SIMDJSON_TRY( visitor.visit_array_end(*this) ); goto scope_end;
  ------------------
  |  |  273|  8.73k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 8.73k]
  |  |  ------------------
  ------------------
  |  Branch (224:5): [True: 8.73k, False: 61.5k]
  ------------------
  225|  2.15k|    default: log_error("Missing comma between array values"); return TAPE_ERROR;
  ------------------
  |  Branch (225:5): [True: 2.15k, False: 68.1k]
  ------------------
  226|  70.2k|  }
  227|       |
  228|  88.8k|document_end:
  229|  88.8k|  log_end_value("document");
  230|  88.8k|  SIMDJSON_TRY( visitor.visit_document_end(*this) );
  ------------------
  |  |  273|  88.8k|#define SIMDJSON_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } }
  |  |  ------------------
  |  |  |  Branch (273:54): [True: 0, False: 88.8k]
  |  |  ------------------
  ------------------
  231|       |
  232|  88.8k|  dom_parser.next_structural_index = uint32_t(next_structural - &dom_parser.structural_indexes[0]);
  233|       |
  234|       |  // If we didn't make it to the end, it's an error
  235|  88.8k|  if ( !STREAMING && dom_parser.next_structural_index != dom_parser.n_structural_indexes ) {
  ------------------
  |  Branch (235:8): [Folded - Ignored]
  |  Branch (235:22): [True: 0, False: 0]
  ------------------
  236|      0|    log_error("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
  237|      0|    return TAPE_ERROR;
  238|      0|  }
  239|       |
  240|  88.8k|  return SUCCESS;
  241|       |
  242|  88.8k|} // walk_document()

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

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

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

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

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

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

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

