LLVMFuzzerTestOneInput:
   18|  17.0k|{
   19|       |   // use a vector with null termination instead of a std::string to avoid
   20|       |   // small string optimization to hide bounds problems
   21|  17.0k|   std::vector<char> buffer{Data, Data + Size};
   22|  17.0k|   buffer.push_back('\0');
   23|       |
   24|  17.0k|   [[maybe_unused]] auto s = glz::read_jsonc<my_struct>(std::string_view{buffer.data(), Size});
   25|  17.0k|   if (s) {
  ------------------
  |  Branch (25:8): [True: 404, False: 16.6k]
  ------------------
   26|       |      // hooray! valid json found
   27|    404|   }
   28|       |
   29|       |   // A valid document has to survive the formatters unchanged. Two independent comment scanners run
   30|       |   // here -- skip_comment on the read path and read_jsonc_comment in the writers -- and a
   31|       |   // disagreement between them is invisible to either side on its own: the reader accepted comment
   32|       |   // shapes the writer truncated, and the writer emitted shapes the reader could not read back.
   33|       |   //
   34|       |   // Gated on validate_jsonc rather than on the read, because a read stops at the first complete
   35|       |   // value and says nothing about what trails it. Nothing is promised about a document that does not
   36|       |   // validate: minifying is free to run tokens together that only whitespace separated, which is
   37|       |   // what dropping a line comment does to "8 // c" followed by "6".
   38|  17.0k|   {
   39|  17.0k|      std::vector<char> read_buffer{Data, Data + Size};
   40|  17.0k|      read_buffer.push_back('\0');
   41|  17.0k|      const std::string_view document{read_buffer.data(), Size};
   42|  17.0k|      glz::generic value{};
   43|  17.0k|      if (not glz::validate_jsonc(document) && not glz::read_jsonc(value, document)) {
  ------------------
  |  Branch (43:11): [True: 9.97k, False: 7.08k]
  |  Branch (43:11): [True: 8.90k, False: 8.16k]
  |  Branch (43:48): [True: 8.90k, False: 1.07k]
  ------------------
   44|  8.90k|         std::string original{};
   45|  8.90k|         if (not glz::write_json(value, original)) {
  ------------------
  |  Branch (45:14): [True: 8.90k, False: 0]
  ------------------
   46|  8.90k|            auto round_trips = [&](const std::string& formatted) {
   47|  8.90k|               glz::generic reparsed{};
   48|  8.90k|               if (glz::read_jsonc(reparsed, formatted)) {
   49|  8.90k|                  return false;
   50|  8.90k|               }
   51|  8.90k|               std::string rewritten{};
   52|  8.90k|               if (glz::write_json(reparsed, rewritten)) {
   53|  8.90k|                  return false;
   54|  8.90k|               }
   55|  8.90k|               return rewritten == original;
   56|  8.90k|            };
   57|       |
   58|       |            // A formatter that rejects a document the validator accepted is the same disagreement
   59|       |            // as one that mangles it, so an error here is a failure rather than a reason to skip
   60|       |            // the check. Gating on success would hide exactly the regression this guards against.
   61|  8.90k|            std::string minify_in{Data, Data + Size};
   62|  8.90k|            std::string minified{};
   63|  8.90k|            if (glz::minify_jsonc(minify_in, minified) || not round_trips(minified)) {
  ------------------
  |  Branch (63:17): [True: 0, False: 8.90k]
  |  Branch (63:17): [True: 0, False: 8.90k]
  |  Branch (63:59): [True: 0, False: 8.90k]
  ------------------
   64|      0|               std::abort(); // not assert: a fuzz target has to fire under NDEBUG too
   65|      0|            }
   66|       |
   67|  8.90k|            const std::string prettify_in{Data, Data + Size};
   68|  8.90k|            std::string prettified{};
   69|  8.90k|            if (glz::prettify_jsonc(prettify_in, prettified) || not round_trips(prettified)) {
  ------------------
  |  Branch (69:17): [True: 0, False: 8.90k]
  |  Branch (69:17): [True: 0, False: 8.90k]
  |  Branch (69:65): [True: 0, False: 8.90k]
  ------------------
   70|      0|               std::abort(); // not assert: a fuzz target has to fire under NDEBUG too
   71|      0|            }
   72|  8.90k|         }
   73|  8.90k|      }
   74|  17.0k|   }
   75|       |
   76|  17.0k|   return 0;
   77|  17.0k|}
json_with_comments.cpp:_ZZ22LLVMFuzzerTestOneInputENK3$_0clERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   46|  17.8k|            auto round_trips = [&](const std::string& formatted) {
   47|  17.8k|               glz::generic reparsed{};
   48|  17.8k|               if (glz::read_jsonc(reparsed, formatted)) {
  ------------------
  |  Branch (48:20): [True: 0, False: 17.8k]
  ------------------
   49|      0|                  return false;
   50|      0|               }
   51|  17.8k|               std::string rewritten{};
   52|  17.8k|               if (glz::write_json(reparsed, rewritten)) {
  ------------------
  |  Branch (52:20): [True: 0, False: 17.8k]
  ------------------
   53|      0|                  return false;
   54|      0|               }
   55|  17.8k|               return rewritten == original;
   56|  17.8k|            };

_ZN3glz11empty_rangeITkNS_5rangeERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEEEbOT_:
  304|   649k|   {
  305|   649k|#ifdef __cpp_lib_ranges
  306|   649k|      return std::ranges::empty(rng);
  307|       |#else
  308|       |      // in lieu of std::ranges::empty
  309|       |      if constexpr (requires() {
  310|       |                       { rng.empty() } -> std::convertible_to<bool>;
  311|       |                    }) {
  312|       |         return rng.empty();
  313|       |      }
  314|       |      else if constexpr (requires() {
  315|       |                            { rng.size() } -> std::same_as<std::size_t>;
  316|       |                         }) {
  317|       |         return rng.size() == std::size_t{0};
  318|       |      }
  319|       |      else {
  320|       |         return std::cbegin(rng) == std::cend(rng);
  321|       |      }
  322|       |#endif
  323|   649k|   }
_ZN3glz11empty_rangeITkNS_5rangeERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEEEbOT_:
  304|  4.88M|   {
  305|  4.88M|#ifdef __cpp_lib_ranges
  306|  4.88M|      return std::ranges::empty(rng);
  307|       |#else
  308|       |      // in lieu of std::ranges::empty
  309|       |      if constexpr (requires() {
  310|       |                       { rng.empty() } -> std::convertible_to<bool>;
  311|       |                    }) {
  312|       |         return rng.empty();
  313|       |      }
  314|       |      else if constexpr (requires() {
  315|       |                            { rng.size() } -> std::same_as<std::size_t>;
  316|       |                         }) {
  317|       |         return rng.size() == std::size_t{0};
  318|       |      }
  319|       |      else {
  320|       |         return std::cbegin(rng) == std::cend(rng);
  321|       |      }
  322|       |#endif
  323|  4.88M|   }

_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2Ev:
  566|  4.90M|      ordered_small_map() = default;
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9free_dataEv:
  266|  18.1M|      {
  267|  18.1M|         destroy_all();
  268|  18.1M|         ::operator delete(data_);
  269|  18.1M|         data_ = nullptr;
  270|  18.1M|         size_ = 0;
  271|  18.1M|         capacity_ = 0;
  272|  18.1M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11destroy_allEv:
  259|  18.4M|      {
  260|  23.1M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (260:31): [True: 4.71M, False: 18.4M]
  ------------------
  261|  4.71M|            std::destroy_at(data_ + i);
  262|  4.71M|         }
  263|  18.4M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10free_indexEv:
  308|  18.1M|      {
  309|  18.1M|         std::free(index_);
  310|  18.1M|         index_ = nullptr;
  311|  18.1M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2EOS4_:
  610|  13.2M|         : data_(other.data_), size_(other.size_), capacity_(other.capacity_), index_(other.index_)
  611|  13.2M|      {
  612|  13.2M|         other.data_ = nullptr;
  613|  13.2M|         other.size_ = 0;
  614|  13.2M|         other.capacity_ = 0;
  615|  13.2M|         other.index_ = nullptr;
  616|  13.2M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEED2Ev:
  569|  18.1M|      {
  570|  18.1M|         free_data();
  571|  18.1M|         free_index();
  572|  18.1M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEixERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
  932|  3.36M|      {
  933|  3.36M|         return subscript_or_insert(key, [&] { emplace_back_impl(key, mapped_type{}); });
  934|  3.36M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE19subscript_or_insertINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEZNS4_ixERKSC_EUlvE_EERS3_RKT_OT0_:
  491|  3.36M|      {
  492|  3.36M|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (492:14): [True: 507k, False: 2.85M]
  ------------------
  493|   507k|            auto it = linear_find(key);
  494|   507k|            if (it != end()) return it->second;
  ------------------
  |  Branch (494:17): [True: 68.7k, False: 438k]
  ------------------
  495|   438k|            append_fn();
  496|   438k|            return data_[size_ - 1].second;
  497|   507k|         }
  498|       |
  499|  2.85M|         const uint32_t h = hash_key(key);
  500|  2.85M|         if (try_bloom_insert(h, append_fn)) {
  ------------------
  |  Branch (500:14): [True: 1.39M, False: 1.45M]
  ------------------
  501|  1.39M|            return data_[size_ - 1].second;
  502|  1.39M|         }
  503|       |
  504|  1.45M|         auto [it, pos, _] = index_find_or_pos(key, h);
  505|  1.45M|         if (it != end()) return it->second;
  ------------------
  |  Branch (505:14): [True: 1.31M, False: 147k]
  ------------------
  506|       |
  507|   147k|         append_fn();
  508|   147k|         bloom_set(h);
  509|   147k|         if (index_size() > 0) {
  ------------------
  |  Branch (509:14): [True: 147k, False: 0]
  ------------------
  510|   147k|            const uint32_t n = index_->size;
  511|   147k|            ensure_index_capacity(static_cast<size_type>(n) + 1);
  512|   147k|            auto* entries = index_entries();
  513|   147k|            if (pos < n) {
  ------------------
  |  Branch (513:17): [True: 145k, False: 1.61k]
  ------------------
  514|   145k|               std::memmove(entries + pos + 1, entries + pos, (n - pos) * sizeof(hash_index_entry));
  515|   145k|            }
  516|   147k|            entries[pos] = {h, size_ - 1};
  517|   147k|            index_->size = size_;
  518|   147k|         }
  519|   147k|         return data_[size_ - 1].second;
  520|  1.45M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11linear_findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  421|   507k|      {
  422|  2.08M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (422:31): [True: 1.64M, False: 438k]
  ------------------
  423|  1.64M|            if (data_[i].first == key) return data_ + i;
  ------------------
  |  Branch (423:17): [True: 68.7k, False: 1.57M]
  ------------------
  424|  1.64M|         }
  425|   438k|         return data_ + size_;
  426|   507k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE3endEv:
  649|  2.05M|      iterator end() noexcept { return data_ + size_; }
_ZZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEixERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEENKUlvE_clEv:
  933|  1.97M|         return subscript_or_insert(key, [&] { emplace_back_impl(key, mapped_type{}); });
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17emplace_back_implIJRKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEES3_EEEvDpOT_:
  243|  1.97M|      {
  244|  1.97M|         grow_if_needed();
  245|  1.97M|         std::construct_at(data_ + size_, std::forward<Args>(args)...);
  246|  1.97M|         ++size_;
  247|  1.97M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14grow_if_neededEv:
  217|  1.97M|      {
  218|  1.97M|         if (size_ == capacity_) {
  ------------------
  |  Branch (218:14): [True: 241k, False: 1.73M]
  ------------------
  219|   241k|            if (size_ == max_u32) {
  ------------------
  |  Branch (219:17): [True: 0, False: 241k]
  ------------------
  220|      0|               throw_capacity_overflow();
  221|      0|            }
  222|   241k|            const uint32_t new_cap = next_data_capacity(capacity_);
  223|   241k|            reallocate_data(new_cap);
  224|   241k|         }
  225|  1.97M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE18next_data_capacityEj:
  120|   241k|      {
  121|   241k|         if (current == 0) return 4;
  ------------------
  |  Branch (121:14): [True: 96.4k, False: 145k]
  ------------------
  122|   145k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (122:14): [True: 0, False: 145k]
  ------------------
  123|   145k|         return current * 2;
  124|   145k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15reallocate_dataEj:
  205|   241k|      {
  206|   241k|         if (new_cap < size_) {
  ------------------
  |  Branch (206:14): [True: 0, False: 241k]
  ------------------
  207|      0|            throw_capacity_overflow();
  208|      0|         }
  209|   241k|         auto* new_data = allocate_and_relocate(new_cap);
  210|   241k|         destroy_all();
  211|   241k|         ::operator delete(data_);
  212|   241k|         data_ = new_data;
  213|   241k|         capacity_ = new_cap;
  214|   241k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21allocate_and_relocateEj:
  159|   241k|      {
  160|   241k|         auto* new_data = static_cast<value_type*>(::operator new(checked_data_allocation_bytes(new_cap)));
  161|   241k|#if __cpp_exceptions
  162|   241k|         uint32_t constructed = 0;
  163|   241k|         try {
  164|  2.98M|            for (; constructed < size_; ++constructed) {
  ------------------
  |  Branch (164:20): [True: 2.74M, False: 241k]
  ------------------
  165|  2.74M|               std::construct_at(new_data + constructed, std::move_if_noexcept(data_[constructed]));
  166|  2.74M|            }
  167|   241k|         }
  168|   241k|         catch (...) {
  169|      0|            destroy_range(new_data, constructed);
  170|      0|            ::operator delete(new_data);
  171|      0|            throw;
  172|      0|         }
  173|       |#else
  174|       |         for (uint32_t i = 0; i < size_; ++i) {
  175|       |            std::construct_at(new_data + i, std::move_if_noexcept(data_[i]));
  176|       |         }
  177|       |#endif
  178|   241k|         return new_data;
  179|   241k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE29checked_data_allocation_bytesEj:
  134|   241k|      {
  135|   241k|         if (count > ((std::numeric_limits<size_t>::max)() / sizeof(value_type))) {
  ------------------
  |  Branch (135:14): [True: 0, False: 241k]
  ------------------
  136|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  137|      0|         }
  138|   241k|         return static_cast<size_t>(count) * sizeof(value_type);
  139|   241k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE8hash_keyENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
   97|  6.85M|      static uint32_t hash_key(std::string_view key) noexcept { return sweethash::sweet32(key); }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE16try_bloom_insertIRZNS4_ixERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEUlvE_EEbjOT_:
  529|  2.85M|      {
  530|  2.85M|         if (index_ && size_ <= bloom_threshold && !bloom_maybe_contains(h)) {
  ------------------
  |  Branch (530:14): [True: 2.81M, False: 40.5k]
  |  Branch (530:24): [True: 2.62M, False: 182k]
  |  Branch (530:52): [True: 1.39M, False: 1.23M]
  ------------------
  531|       |            // Definitely not present — skip the search
  532|  1.39M|            append_fn();
  533|  1.39M|            bloom_set(h);
  534|       |            // Index is now stale (index_->size < size_), will rebuild on next lookup or false positive
  535|  1.39M|            return true;
  536|  1.39M|         }
  537|  1.45M|         return false;
  538|  2.85M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE20bloom_maybe_containsEj:
  285|  2.62M|      {
  286|  2.62M|         const uint32_t a = h & bloom_mask;
  287|  2.62M|         const uint32_t b = (h >> 10) & bloom_mask;
  288|  2.62M|         return (index_->bloom[a >> 3] & (uint8_t(1) << (a & 7))) && (index_->bloom[b >> 3] & (uint8_t(1) << (b & 7)));
  ------------------
  |  Branch (288:17): [True: 1.39M, False: 1.23M]
  |  Branch (288:70): [True: 1.23M, False: 158k]
  ------------------
  289|  2.62M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17index_find_or_posINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS4_17index_find_resultERKT_j:
  400|  1.45M|      {
  401|  1.45M|         ensure_index();
  402|       |
  403|  1.45M|         const auto* base = index_entries();
  404|  1.45M|         const auto* idx_end = base + index_->size;
  405|  1.45M|         const auto* p = branchless_lower_bound(base, index_->size, h);
  406|  1.45M|         const size_t pos = static_cast<size_t>(p - base);
  407|       |
  408|       |         // Scan adjacent entries with matching hash
  409|  1.46M|         for (auto* scan = p; scan != idx_end && scan->key_hash == h; ++scan) {
  ------------------
  |  Branch (409:31): [True: 1.45M, False: 1.61k]
  |  Branch (409:50): [True: 1.31M, False: 145k]
  ------------------
  410|  1.31M|            if (data_[scan->index].first == key) {
  ------------------
  |  Branch (410:17): [True: 1.31M, False: 1.04k]
  ------------------
  411|  1.31M|               return {data_ + scan->index, pos, h};
  412|  1.31M|            }
  413|  1.31M|         }
  414|       |
  415|   147k|         return {data_ + size_, pos, h};
  416|  1.45M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE12ensure_indexEv:
  360|  1.45M|      {
  361|  1.45M|         if (size_ <= linear_search_threshold) return;
  ------------------
  |  Branch (361:14): [True: 0, False: 1.45M]
  ------------------
  362|  1.45M|         const auto current = index_size();
  363|  1.45M|         if (current == size_) return; // fully current
  ------------------
  |  Branch (363:14): [True: 1.06M, False: 393k]
  ------------------
  364|       |
  365|   393k|         if (current == 0 || (size_ - current) > linear_search_threshold) {
  ------------------
  |  Branch (365:14): [True: 40.5k, False: 353k]
  |  Branch (365:30): [True: 55.1k, False: 297k]
  ------------------
  366|  95.7k|            rebuild_index(); // full rebuild
  367|  95.7k|            return;
  368|  95.7k|         }
  369|       |
  370|       |         // Incrementally insert-sort the few new entries
  371|   903k|         for (uint32_t i = current; i < size_; ++i) {
  ------------------
  |  Branch (371:37): [True: 605k, False: 297k]
  ------------------
  372|   605k|            const hash_index_entry entry{hash_key(data_[i].first), i};
  373|   605k|            const auto* base = index_entries();
  374|   605k|            const auto* p = branchless_lower_bound(base, index_->size, entry.key_hash);
  375|   605k|            auto pos = static_cast<size_t>(p - base);
  376|       |
  377|   605k|            const uint32_t m = index_->size;
  378|   605k|            ensure_index_capacity(static_cast<size_type>(m) + 1);
  379|   605k|            auto* entries = index_entries();
  380|   605k|            if (pos < m) {
  ------------------
  |  Branch (380:17): [True: 584k, False: 21.3k]
  ------------------
  381|   584k|               std::memmove(entries + pos + 1, entries + pos, (m - pos) * sizeof(hash_index_entry));
  382|   584k|            }
  383|   605k|            entries[pos] = entry;
  384|   605k|            index_->size = i + 1;
  385|   605k|         }
  386|   297k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEv:
  343|  95.7k|      {
  344|  95.7k|         ensure_index_capacity(static_cast<size_type>(size_));
  345|  95.7k|         bloom_clear();
  346|  95.7k|         auto* entries = index_entries();
  347|  3.49M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (347:31): [True: 3.39M, False: 95.7k]
  ------------------
  348|  3.39M|            const uint32_t h = hash_key(data_[i].first);
  349|  3.39M|            entries[i] = {h, i};
  350|  3.39M|            bloom_set(h);
  351|  3.39M|         }
  352|  95.7k|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
  353|  95.7k|         index_->size = size_;
  354|  95.7k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11bloom_clearEv:
  291|  95.7k|      void bloom_clear() const noexcept { std::memset(index_->bloom, 0, bloom_bytes); }
_ZZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEvENKUlRKT_RKT0_E_clINS4_16hash_index_entryESD_EEDaS7_SA_:
  352|  22.9M|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE22branchless_lower_boundEPKNS4_16hash_index_entryEmj:
  440|  2.06M|      {
  441|  14.3M|         while (len > 1) {
  ------------------
  |  Branch (441:17): [True: 12.3M, False: 2.06M]
  ------------------
  442|  12.3M|            size_t half = len / 2;
  443|  12.3M|            p += (p[half - 1].key_hash < target) * half;
  444|  12.3M|            len -= half;
  445|  12.3M|         }
  446|       |         // Final element check: advance past it if it's less than target
  447|  2.06M|         p += (len == 1 && p->key_hash < target);
  ------------------
  |  Branch (447:16): [True: 2.06M, False: 0]
  |  Branch (447:28): [True: 22.9k, False: 2.04M]
  ------------------
  448|  2.06M|         return p;
  449|  2.06M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9bloom_setEj:
  277|  4.93M|      {
  278|  4.93M|         const uint32_t a = h & bloom_mask;
  279|  4.93M|         const uint32_t b = (h >> 10) & bloom_mask;
  280|  4.93M|         index_->bloom[a >> 3] |= uint8_t(1) << (a & 7);
  281|  4.93M|         index_->bloom[b >> 3] |= uint8_t(1) << (b & 7);
  282|  4.93M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10index_sizeEv:
  300|  1.60M|      uint32_t index_size() const noexcept { return index_ ? index_->size : 0; }
  ------------------
  |  Branch (300:53): [True: 1.56M, False: 40.5k]
  ------------------
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21ensure_index_capacityEm:
  314|   848k|      {
  315|   848k|         if (needed == 0) return;
  ------------------
  |  Branch (315:14): [True: 0, False: 848k]
  ------------------
  316|   848k|         if (needed > static_cast<size_type>(max_u32)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 848k]
  ------------------
  317|      0|            throw_index_overflow();
  318|      0|         }
  319|   848k|         const auto needed_u32 = static_cast<uint32_t>(needed);
  320|   848k|         if (index_ && index_->capacity >= needed_u32) return;
  ------------------
  |  Branch (320:14): [True: 807k, False: 40.5k]
  |  Branch (320:24): [True: 747k, False: 60.7k]
  ------------------
  321|   101k|         uint32_t cap = index_ ? index_->capacity : 0;
  ------------------
  |  Branch (321:25): [True: 60.7k, False: 40.5k]
  ------------------
  322|   203k|         while (cap < needed_u32) {
  ------------------
  |  Branch (322:17): [True: 102k, False: 101k]
  ------------------
  323|   102k|            const uint32_t next = next_index_capacity(cap);
  324|   102k|            if (next <= cap) {
  ------------------
  |  Branch (324:17): [True: 0, False: 102k]
  ------------------
  325|      0|               throw_index_overflow();
  326|      0|            }
  327|   102k|            cap = next;
  328|   102k|         }
  329|   101k|         auto* block = static_cast<index_header*>(std::realloc(index_, checked_index_allocation_bytes(cap)));
  330|   101k|         if (!block) GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  |  Branch (330:14): [True: 0, False: 101k]
  ------------------
  331|   101k|         if (!index_) {
  ------------------
  |  Branch (331:14): [True: 40.5k, False: 60.7k]
  ------------------
  332|  40.5k|            block->size = 0;
  333|  40.5k|            std::memset(block->bloom, 0, bloom_bytes);
  334|  40.5k|         }
  335|   101k|         block->capacity = cap;
  336|   101k|         index_ = block;
  337|   101k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE19next_index_capacityEj:
  127|   102k|      {
  128|   102k|         if (current == 0) return 16;
  ------------------
  |  Branch (128:14): [True: 40.5k, False: 61.7k]
  ------------------
  129|  61.7k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (129:14): [True: 0, False: 61.7k]
  ------------------
  130|  61.7k|         return current * 2;
  131|  61.7k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE30checked_index_allocation_bytesEj:
  142|   101k|      {
  143|   101k|         constexpr size_t header = sizeof(index_header);
  144|   101k|         constexpr size_t entry = sizeof(hash_index_entry);
  145|   101k|         if (count > (((std::numeric_limits<size_t>::max)() - header) / entry)) {
  ------------------
  |  Branch (145:14): [True: 0, False: 101k]
  ------------------
  146|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  147|      0|         }
  148|   101k|         return header + static_cast<size_t>(count) * entry;
  149|   101k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13index_entriesEv:
  296|  2.91M|      {
  297|  2.91M|         return static_cast<hash_index_entry*>(static_cast<void*>(index_ + 1));
  298|  2.91M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5emptyEv:
  662|  4.88M|      [[nodiscard]] bool empty() const noexcept { return size_ == 0; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5beginEv:
  645|  82.6k|      iterator begin() noexcept { return data_; }

_ZN3glz15resize_unfilledINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
   63|  4.30M|   {
   64|  4.30M|      if constexpr (requires { b.resize_and_overwrite(n, [](auto*, size_t written) { return written; }); }) {
   65|  4.30M|         b.resize_and_overwrite(n, [](auto*, size_t written) noexcept { return written; });
   66|       |      }
   67|       |      else {
   68|       |         b.resize(n);
   69|       |      }
   70|  4.30M|   }
_ZZN3glz15resize_unfilledINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_mENKUlPS8_mE_clIcEEDaSA_m:
   65|  4.30M|         b.resize_and_overwrite(n, [](auto*, size_t written) noexcept { return written; });
_ZN3glz12ensure_spaceINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10is_contextENS_7contextEEEbRT0_RT_m:
  265|  15.3M|   {
  266|  15.3M|      using Buffer = std::remove_cvref_t<B>;
  267|       |
  268|  15.3M|      if constexpr (vector_like<Buffer>) {
  269|  15.3M|         if (required > b.size()) [[unlikely]] {
  ------------------
  |  Branch (269:14): [True: 12.8k, False: 15.3M]
  ------------------
  270|  12.8k|            grow_buffer(b, required);
  271|  12.8k|         }
  272|  15.3M|         return true;
  273|       |      }
  274|       |      else if constexpr (has_bounded_capacity<Buffer>) {
  275|       |         if (required > buffer_traits<Buffer>::capacity(b)) [[unlikely]] {
  276|       |            ctx.error = error_code::buffer_overflow;
  277|       |            return false;
  278|       |         }
  279|       |         return true;
  280|       |      }
  281|       |      else {
  282|       |         return true; // Raw pointer or other - trust caller
  283|       |      }
  284|  15.3M|   }
_ZN3glz11grow_bufferINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
  143|  15.6k|   {
  144|  15.6k|      using traits = buffer_traits<std::remove_cvref_t<B>>;
  145|  15.6k|      if constexpr (requires { traits::grow(b, required); }) {
  146|  15.6k|         traits::grow(b, required);
  147|       |      }
  148|       |      else {
  149|       |         // A user specialization written before `grow` existed: keep the growth it used to get.
  150|       |         resize_unfilled(b, 2 * required);
  151|       |      }
  152|  15.6k|   }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE4growERS7_mQL_ZNS_13buffer_traits12is_resizableEE:
  118|  15.6k|      {
  119|  15.6k|         resize_unfilled(b, 2 * required);
  120|  15.6k|      }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE8finalizeERS7_m:
  124|  26.7k|      {
  125|  26.7k|         if constexpr (is_resizable) {
  126|  26.7k|            b.resize(written);
  127|  26.7k|         }
  128|       |         // For fixed buffers: no-op, count is returned in result
  129|  26.7k|      }

_ZN3glz20inert_key_bits_scopeC2IRNS_7contextEEEOT_Pv:
  192|  4.96M|      constexpr inert_key_bits_scope(auto&&, void*) noexcept {}
_ZN3glz10get_memberIRNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERKMS4_NSt3__17variantIJDndNS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEbNS6_6vectorIS4_NSB_IS4_EEEENS3_IS4_EEEEEEEDcOT_OT0_:
  677|  21.9M|   {
  678|  21.9M|      using V = std::decay_t<decltype(element)>;
  679|  21.9M|      if constexpr (std::is_member_object_pointer_v<V>) {
  680|  21.9M|         return value.*element;
  681|       |      }
  682|       |      else if constexpr (std::is_member_function_pointer_v<V>) {
  683|       |         return element;
  684|       |      }
  685|       |      else if constexpr (std::invocable<Element, Value> && not eigen_t<Element>) {
  686|       |         // Eigen places a static_assert inside of the operator()(), so we must target
  687|       |         // matrix types and reject them from the invocable check
  688|       |         // Eigen ought to put the check in the `enable_if` for operator()()
  689|       |         return std::invoke(std::forward<Element>(element), std::forward<Value>(value));
  690|       |      }
  691|       |      else if constexpr (std::is_pointer_v<V> && !std::is_reference_v<Element>) {
  692|       |         if constexpr (std::invocable<decltype(*element), Value>) {
  693|       |            return std::invoke(*element, std::forward<Value>(value));
  694|       |         }
  695|       |         else {
  696|       |            return *element;
  697|       |         }
  698|       |      }
  699|       |      else {
  700|       |         return element;
  701|       |      }
  702|  21.9M|   }
_ZN3glz10get_memberIR9my_structRiEEDcOT_OT0_:
  677|  7.79k|   {
  678|  7.79k|      using V = std::decay_t<decltype(element)>;
  679|       |      if constexpr (std::is_member_object_pointer_v<V>) {
  680|       |         return value.*element;
  681|       |      }
  682|       |      else if constexpr (std::is_member_function_pointer_v<V>) {
  683|       |         return element;
  684|       |      }
  685|       |      else if constexpr (std::invocable<Element, Value> && not eigen_t<Element>) {
  686|       |         // Eigen places a static_assert inside of the operator()(), so we must target
  687|       |         // matrix types and reject them from the invocable check
  688|       |         // Eigen ought to put the check in the `enable_if` for operator()()
  689|       |         return std::invoke(std::forward<Element>(element), std::forward<Value>(value));
  690|       |      }
  691|       |      else if constexpr (std::is_pointer_v<V> && !std::is_reference_v<Element>) {
  692|       |         if constexpr (std::invocable<decltype(*element), Value>) {
  693|       |            return std::invoke(*element, std::forward<Value>(value));
  694|       |         }
  695|       |         else {
  696|       |            return *element;
  697|       |         }
  698|       |      }
  699|  7.79k|      else {
  700|  7.79k|         return element;
  701|  7.79k|      }
  702|  7.79k|   }
_ZN3glz10get_memberIR9my_structRdEEDcOT_OT0_:
  677|  8.65k|   {
  678|  8.65k|      using V = std::decay_t<decltype(element)>;
  679|       |      if constexpr (std::is_member_object_pointer_v<V>) {
  680|       |         return value.*element;
  681|       |      }
  682|       |      else if constexpr (std::is_member_function_pointer_v<V>) {
  683|       |         return element;
  684|       |      }
  685|       |      else if constexpr (std::invocable<Element, Value> && not eigen_t<Element>) {
  686|       |         // Eigen places a static_assert inside of the operator()(), so we must target
  687|       |         // matrix types and reject them from the invocable check
  688|       |         // Eigen ought to put the check in the `enable_if` for operator()()
  689|       |         return std::invoke(std::forward<Element>(element), std::forward<Value>(value));
  690|       |      }
  691|       |      else if constexpr (std::is_pointer_v<V> && !std::is_reference_v<Element>) {
  692|       |         if constexpr (std::invocable<decltype(*element), Value>) {
  693|       |            return std::invoke(*element, std::forward<Value>(value));
  694|       |         }
  695|       |         else {
  696|       |            return *element;
  697|       |         }
  698|       |      }
  699|  8.65k|      else {
  700|  8.65k|         return element;
  701|  8.65k|      }
  702|  8.65k|   }
_ZN3glz10get_memberIR9my_structRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEDcOT_OT0_:
  677|  1.35k|   {
  678|  1.35k|      using V = std::decay_t<decltype(element)>;
  679|       |      if constexpr (std::is_member_object_pointer_v<V>) {
  680|       |         return value.*element;
  681|       |      }
  682|       |      else if constexpr (std::is_member_function_pointer_v<V>) {
  683|       |         return element;
  684|       |      }
  685|       |      else if constexpr (std::invocable<Element, Value> && not eigen_t<Element>) {
  686|       |         // Eigen places a static_assert inside of the operator()(), so we must target
  687|       |         // matrix types and reject them from the invocable check
  688|       |         // Eigen ought to put the check in the `enable_if` for operator()()
  689|       |         return std::invoke(std::forward<Element>(element), std::forward<Value>(value));
  690|       |      }
  691|       |      else if constexpr (std::is_pointer_v<V> && !std::is_reference_v<Element>) {
  692|       |         if constexpr (std::invocable<decltype(*element), Value>) {
  693|       |            return std::invoke(*element, std::forward<Value>(value));
  694|       |         }
  695|       |         else {
  696|       |            return *element;
  697|       |         }
  698|       |      }
  699|  1.35k|      else {
  700|  1.35k|         return element;
  701|  1.35k|      }
  702|  1.35k|   }
_ZN3glz10get_memberIR9my_structRNSt3__15arrayImLm3EEEEEDcOT_OT0_:
  677|  7.35k|   {
  678|  7.35k|      using V = std::decay_t<decltype(element)>;
  679|       |      if constexpr (std::is_member_object_pointer_v<V>) {
  680|       |         return value.*element;
  681|       |      }
  682|       |      else if constexpr (std::is_member_function_pointer_v<V>) {
  683|       |         return element;
  684|       |      }
  685|       |      else if constexpr (std::invocable<Element, Value> && not eigen_t<Element>) {
  686|       |         // Eigen places a static_assert inside of the operator()(), so we must target
  687|       |         // matrix types and reject them from the invocable check
  688|       |         // Eigen ought to put the check in the `enable_if` for operator()()
  689|       |         return std::invoke(std::forward<Element>(element), std::forward<Value>(value));
  690|       |      }
  691|       |      else if constexpr (std::is_pointer_v<V> && !std::is_reference_v<Element>) {
  692|       |         if constexpr (std::invocable<decltype(*element), Value>) {
  693|       |            return std::invoke(*element, std::forward<Value>(value));
  694|       |         }
  695|       |         else {
  696|       |            return *element;
  697|       |         }
  698|       |      }
  699|  7.35k|      else {
  700|  7.35k|         return element;
  701|  7.35k|      }
  702|  7.35k|   }
_ZN3glz8str_viewINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_EENS1_17basic_string_viewIcS4_EEOT0_:
  341|   588k|   {
  342|       |      if constexpr (std::same_as<std::decay_t<T>, std::string_view>) {
  343|       |         return value; // already the answer; rebuilding it from data() and size() costs instructions
  344|       |      }
  345|       |      else if constexpr (!char_array_t<T> && std::is_pointer_v<std::decay_t<T>>) {
  346|       |         return value ? std::string_view{value} : std::string_view{};
  347|       |      }
  348|   588k|      else if constexpr (has_data<T> && has_size<T>) {
  349|   588k|         return std::string_view{value.data(), value.size()};
  350|       |      }
  351|       |      else {
  352|       |         return std::string_view{value};
  353|       |      }
  354|   588k|   }
_ZN3glz8str_viewINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKS7_EENS1_17basic_string_viewIcS4_EEOT0_:
  341|  1.41M|   {
  342|       |      if constexpr (std::same_as<std::decay_t<T>, std::string_view>) {
  343|       |         return value; // already the answer; rebuilding it from data() and size() costs instructions
  344|       |      }
  345|       |      else if constexpr (!char_array_t<T> && std::is_pointer_v<std::decay_t<T>>) {
  346|       |         return value ? std::string_view{value} : std::string_view{};
  347|       |      }
  348|  1.41M|      else if constexpr (has_data<T> && has_size<T>) {
  349|  1.41M|         return std::string_view{value.data(), value.size()};
  350|       |      }
  351|       |      else {
  352|       |         return std::string_view{value};
  353|       |      }
  354|  1.41M|   }

_ZNK3glz9error_ctxcvbEv:
  148|   106k|      operator bool() const noexcept { return ec != error_code::none; }
_ZN3glz10call_scopeINS_7contextEEC2ERS1_:
  272|  88.6k|      explicit call_scope(Ctx& c) noexcept : ctx(c), depth(c.depth)
  273|  88.6k|      {
  274|  88.6k|         ctx.error = error_code::none;
  275|  88.6k|         ctx.custom_error_message = {};
  276|  88.6k|      }
_ZN3glz11enter_depthITkNS_10is_contextENS_7contextEEEbRT_:
  344|  8.91M|   {
  345|  8.91M|      if (ctx.depth >= max_recursive_depth_limit) [[unlikely]] {
  ------------------
  |  Branch (345:11): [True: 3, False: 8.91M]
  ------------------
  346|      3|         ctx.error = error_code::exceeded_max_recursive_depth;
  347|      3|         return true;
  348|      3|      }
  349|  8.91M|      ++ctx.depth;
  350|  8.91M|      return false;
  351|  8.91M|   }
_ZN3glz18charge_speculationITkNS_10is_contextENS_7contextEEEbRT_m:
  311|  2.19k|   {
  312|  2.19k|      if constexpr (requires { ctx.speculation_budget; }) {
  313|  2.19k|         if (ctx.speculation_budget == 0) {
  ------------------
  |  Branch (313:14): [True: 0, False: 2.19k]
  ------------------
  314|      0|            return true;
  315|      0|         }
  316|  2.19k|         ctx.speculation_budget = consumed >= ctx.speculation_budget ? 1 : ctx.speculation_budget - consumed;
  ------------------
  |  Branch (316:35): [True: 0, False: 2.19k]
  ------------------
  317|  2.19k|         return ctx.speculation_budget > 1;
  318|       |      }
  319|       |      else {
  320|       |         return true;
  321|       |      }
  322|  2.19k|   }
_ZN3glz10call_scopeINS_7contextEED2Ev:
  277|  88.6k|      ~call_scope() { ctx.depth = depth; }

_ZN3glz4readITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEETkNS_10is_contextERNS_7contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSH_OSI_OT2_:
  152|  17.8k|   {
  153|  17.8k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  17.8k|      call_scope scope{ctx};
  156|       |
  157|  17.8k|      if constexpr (Opts.format != NDJSON) {
  158|  17.8k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 17.8k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  17.8k|      }
  163|       |
  164|       |      // The reader used to grow the caller's buffer by `padding_bytes` here and shrink it back on
  165|       |      // the way out, so that its fixed width loads could run off the end of the document into
  166|       |      // defined bytes. Every one of those loads is now bounded against `end` instead (see
  167|       |      // `chunk_min`), which costs the last chunk of the buffer its chunked path and nothing else --
  168|       |      // measurably less than the round trip did. `std::string::resize` is an ABI entry point on
  169|       |      // both libc++ and libstdc++, so neither call inlined and the parse was spilled around both
  170|       |      // for what amounted to a sixteen byte store; the price did not scale with the document, so on
  171|       |      // a small one it was the bulk of the call. A caller who does have that slack can still say so
  172|       |      // and get the unbounded loads back, and nobody else pays for the buffer being touched at all.
  173|  17.8k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  17.8k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  17.8k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  17.8k|      auto start = it;
  179|       |
  180|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  181|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  182|  17.8k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  17.8k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  17.8k|         ctx.speculation_budget =
  185|  17.8k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 455, False: 17.3k]
  ------------------
  186|  17.8k|      }
  187|       |
  188|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  189|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  190|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  191|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  192|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  193|       |      if constexpr (requires { ctx.stream_begin; }) {
  194|       |         ctx.stream_begin = nullptr;
  195|       |      }
  196|       |
  197|       |      // Normalized off before dispatching: no reader branches on it any more, so leaving it set
  198|       |      // would split every instantiation below between callers who declared padding and callers who
  199|       |      // did not, for a flag none of them reads.
  200|  17.8k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  17.8k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 0, False: 17.8k]
  ------------------
  203|      0|         goto finish;
  204|      0|      }
  205|       |
  206|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  207|       |      // So, trailing whitespace is permitted and sometimes we want to
  208|       |      // validate this, even though this memory will not affect Glaze.
  209|       |      if constexpr (check_validate_trailing_whitespace(Opts)) {
  210|       |         if (it < end) {
  211|       |            skip_ws<ParseOpts>(ctx, it, end);
  212|       |            if (bool(ctx.error)) [[unlikely]] {
  213|       |               goto finish;
  214|       |            }
  215|       |            if (it != end) [[unlikely]] {
  216|       |               ctx.error = error_code::syntax_error;
  217|       |            }
  218|       |         }
  219|       |      }
  220|       |
  221|  17.8k|   finish:
  222|       |      // ParseOpts, not Opts: this reads `null_terminated` to tell a value that ended with the
  223|       |      // buffer from one that ran out, and it has to be told the same thing the parse was.
  224|  17.8k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  17.8k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  17.8k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10contiguousERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEDaOT0_:
   40|  26.7k|   {
   41|  26.7k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  26.7k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  26.7k|      auto end = it + buffer.size();
   45|       |
   46|  26.7k|      return std::pair{it, end};
   47|  26.7k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextEEEvOT0_PKcS7_S7_:
  131|  44.8k|   {
  132|       |      if constexpr (Opts.format == JSON && !check_null_terminated(Opts)) {
  133|       |         // Deliberately not [[unlikely]]: a body that ends with the buffer lands here on every
  134|       |         // successful read, which is the ordinary case for a registry parsing a wire span.
  135|       |         // start < it, not !=, because a streaming origin can be empty or overshoot on an error
  136|       |         // path; neither is an absent value.
  137|       |         if (ctx.error == error_code::end_reached && ctx.depth == 0 && it == end && start < it) {
  138|       |            context ws_ctx{}; // only written to when skip_ws parses a comment; the result is unused
  139|       |            const char* consumed = start;
  140|       |            skip_ws<Opts>(ws_ctx, consumed, it);
  141|       |            if (consumed == it) {
  142|       |               ctx.error = error_code::no_read_input;
  143|       |            }
  144|       |         }
  145|       |      }
  146|  44.8k|      finalize_read_context(ctx);
  147|  44.8k|   }
_ZN3glz21finalize_read_contextITkNS_10is_contextERNS_7contextEEEvOT_:
  109|  61.9k|   {
  110|  61.9k|      settle_partial_read_complete(ctx);
  111|  61.9k|      settle_end_reached(ctx);
  112|  61.9k|   }
_ZN3glz28settle_partial_read_completeITkNS_10is_contextERNS_7contextEEEvOT_:
  102|  61.9k|   {
  103|  61.9k|      if (ctx.error == error_code::partial_read_complete) {
  ------------------
  |  Branch (103:11): [True: 0, False: 61.9k]
  ------------------
  104|      0|         ctx.error = error_code::none;
  105|      0|      }
  106|  61.9k|   }
_ZN3glz18settle_end_reachedITkNS_10is_contextERNS_7contextEEEvOT_:
   88|  61.9k|   {
   89|  61.9k|      if (ctx.error == error_code::end_reached) {
  ------------------
  |  Branch (89:11): [True: 0, False: 61.9k]
  ------------------
   90|      0|         ctx.error = (ctx.depth == 0) ? error_code::none : error_code::unexpected_end;
  ------------------
  |  Branch (90:22): [True: 0, False: 0]
  ------------------
   91|      0|      }
   92|  61.9k|   }
_ZN3glz4readITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structTkNS_10contiguousENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEETkNS_10is_contextERNS_7contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSA_OSB_OT2_:
  152|  17.0k|   {
  153|  17.0k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  17.0k|      call_scope scope{ctx};
  156|       |
  157|  17.0k|      if constexpr (Opts.format != NDJSON) {
  158|  17.0k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 17.0k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  17.0k|      }
  163|       |
  164|       |      // The reader used to grow the caller's buffer by `padding_bytes` here and shrink it back on
  165|       |      // the way out, so that its fixed width loads could run off the end of the document into
  166|       |      // defined bytes. Every one of those loads is now bounded against `end` instead (see
  167|       |      // `chunk_min`), which costs the last chunk of the buffer its chunked path and nothing else --
  168|       |      // measurably less than the round trip did. `std::string::resize` is an ABI entry point on
  169|       |      // both libc++ and libstdc++, so neither call inlined and the parse was spilled around both
  170|       |      // for what amounted to a sixteen byte store; the price did not scale with the document, so on
  171|       |      // a small one it was the bulk of the call. A caller who does have that slack can still say so
  172|       |      // and get the unbounded loads back, and nobody else pays for the buffer being touched at all.
  173|  17.0k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  17.0k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  17.0k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  17.0k|      auto start = it;
  179|       |
  180|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  181|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  182|  17.0k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  17.0k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  17.0k|         ctx.speculation_budget =
  185|  17.0k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 308, False: 16.7k]
  ------------------
  186|  17.0k|      }
  187|       |
  188|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  189|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  190|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  191|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  192|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  193|       |      if constexpr (requires { ctx.stream_begin; }) {
  194|       |         ctx.stream_begin = nullptr;
  195|       |      }
  196|       |
  197|       |      // Normalized off before dispatching: no reader branches on it any more, so leaving it set
  198|       |      // would split every instantiation below between callers who declared padding and callers who
  199|       |      // did not, for a flag none of them reads.
  200|  17.0k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  17.0k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 16.6k, False: 404]
  ------------------
  203|  16.6k|         goto finish;
  204|  16.6k|      }
  205|       |
  206|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  207|       |      // So, trailing whitespace is permitted and sometimes we want to
  208|       |      // validate this, even though this memory will not affect Glaze.
  209|       |      if constexpr (check_validate_trailing_whitespace(Opts)) {
  210|       |         if (it < end) {
  211|       |            skip_ws<ParseOpts>(ctx, it, end);
  212|       |            if (bool(ctx.error)) [[unlikely]] {
  213|       |               goto finish;
  214|       |            }
  215|       |            if (it != end) [[unlikely]] {
  216|       |               ctx.error = error_code::syntax_error;
  217|       |            }
  218|       |         }
  219|       |      }
  220|       |
  221|  17.0k|   finish:
  222|       |      // ParseOpts, not Opts: this reads `null_terminated` to tell a value that ended with the
  223|       |      // buffer from one that ran out, and it has to be told the same thing the parse was.
  224|  17.0k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  17.0k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|    404|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10contiguousERNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEDaOT0_:
   40|  17.0k|   {
   41|  17.0k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  17.0k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  17.0k|      auto end = it + buffer.size();
   45|       |
   46|  17.0k|      return std::pair{it, end};
   47|  17.0k|   }
_ZN3glz4readITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEENS_4skipETkNS_10contiguousERKNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEETkNS_10is_contextERNS_7contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSD_OSE_OT2_:
  152|  17.0k|   {
  153|  17.0k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  17.0k|      call_scope scope{ctx};
  156|       |
  157|  17.0k|      if constexpr (Opts.format != NDJSON) {
  158|  17.0k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 17.0k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  17.0k|      }
  163|       |
  164|       |      // The reader used to grow the caller's buffer by `padding_bytes` here and shrink it back on
  165|       |      // the way out, so that its fixed width loads could run off the end of the document into
  166|       |      // defined bytes. Every one of those loads is now bounded against `end` instead (see
  167|       |      // `chunk_min`), which costs the last chunk of the buffer its chunked path and nothing else --
  168|       |      // measurably less than the round trip did. `std::string::resize` is an ABI entry point on
  169|       |      // both libc++ and libstdc++, so neither call inlined and the parse was spilled around both
  170|       |      // for what amounted to a sixteen byte store; the price did not scale with the document, so on
  171|       |      // a small one it was the bulk of the call. A caller who does have that slack can still say so
  172|       |      // and get the unbounded loads back, and nobody else pays for the buffer being touched at all.
  173|  17.0k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  17.0k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  17.0k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  17.0k|      auto start = it;
  179|       |
  180|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  181|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  182|  17.0k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  17.0k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  17.0k|         ctx.speculation_budget =
  185|  17.0k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 308, False: 16.7k]
  ------------------
  186|  17.0k|      }
  187|       |
  188|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  189|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  190|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  191|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  192|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  193|       |      if constexpr (requires { ctx.stream_begin; }) {
  194|       |         ctx.stream_begin = nullptr;
  195|       |      }
  196|       |
  197|       |      // Normalized off before dispatching: no reader branches on it any more, so leaving it set
  198|       |      // would split every instantiation below between callers who declared padding and callers who
  199|       |      // did not, for a flag none of them reads.
  200|  17.0k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  17.0k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 6.97k, False: 10.0k]
  ------------------
  203|  6.97k|         goto finish;
  204|  6.97k|      }
  205|       |
  206|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  207|       |      // So, trailing whitespace is permitted and sometimes we want to
  208|       |      // validate this, even though this memory will not affect Glaze.
  209|  10.0k|      if constexpr (check_validate_trailing_whitespace(Opts)) {
  210|  10.0k|         if (it < end) {
  ------------------
  |  Branch (210:14): [True: 512, False: 9.57k]
  ------------------
  211|    512|            skip_ws<ParseOpts>(ctx, it, end);
  212|    512|            if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (212:17): [True: 47, False: 465]
  ------------------
  213|     47|               goto finish;
  214|     47|            }
  215|    465|            if (it != end) [[unlikely]] {
  ------------------
  |  Branch (215:17): [True: 58, False: 407]
  ------------------
  216|     58|               ctx.error = error_code::syntax_error;
  217|     58|            }
  218|    465|         }
  219|  10.0k|      }
  220|       |
  221|  17.0k|   finish:
  222|       |      // ParseOpts, not Opts: this reads `null_terminated` to tell a value that ended with the
  223|       |      // buffer from one that ran out, and it has to be told the same thing the parse was.
  224|  17.0k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  17.0k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  10.0k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10contiguousERKNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEEEDaOT0_:
   40|  17.0k|   {
   41|  17.0k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  17.0k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  17.0k|      auto end = it + buffer.size();
   45|       |
   46|  17.0k|      return std::pair{it, end};
   47|  17.0k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextEEEvOT0_PKcS8_S8_:
  131|  17.0k|   {
  132|       |      if constexpr (Opts.format == JSON && !check_null_terminated(Opts)) {
  133|       |         // Deliberately not [[unlikely]]: a body that ends with the buffer lands here on every
  134|       |         // successful read, which is the ordinary case for a registry parsing a wire span.
  135|       |         // start < it, not !=, because a streaming origin can be empty or overshoot on an error
  136|       |         // path; neither is an absent value.
  137|       |         if (ctx.error == error_code::end_reached && ctx.depth == 0 && it == end && start < it) {
  138|       |            context ws_ctx{}; // only written to when skip_ws parses a comment; the result is unused
  139|       |            const char* consumed = start;
  140|       |            skip_ws<Opts>(ws_ctx, consumed, it);
  141|       |            if (consumed == it) {
  142|       |               ctx.error = error_code::no_read_input;
  143|       |            }
  144|       |         }
  145|       |      }
  146|  17.0k|      finalize_read_context(ctx);
  147|  17.0k|   }
_ZN3glz4readITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEETkNS_10is_contextERNS_7contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSF_OSG_OT2_:
  152|  9.97k|   {
  153|  9.97k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  9.97k|      call_scope scope{ctx};
  156|       |
  157|  9.97k|      if constexpr (Opts.format != NDJSON) {
  158|  9.97k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 9.97k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  9.97k|      }
  163|       |
  164|       |      // The reader used to grow the caller's buffer by `padding_bytes` here and shrink it back on
  165|       |      // the way out, so that its fixed width loads could run off the end of the document into
  166|       |      // defined bytes. Every one of those loads is now bounded against `end` instead (see
  167|       |      // `chunk_min`), which costs the last chunk of the buffer its chunked path and nothing else --
  168|       |      // measurably less than the round trip did. `std::string::resize` is an ABI entry point on
  169|       |      // both libc++ and libstdc++, so neither call inlined and the parse was spilled around both
  170|       |      // for what amounted to a sixteen byte store; the price did not scale with the document, so on
  171|       |      // a small one it was the bulk of the call. A caller who does have that slack can still say so
  172|       |      // and get the unbounded loads back, and nobody else pays for the buffer being touched at all.
  173|  9.97k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  9.97k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  9.97k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  9.97k|      auto start = it;
  179|       |
  180|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  181|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  182|  9.97k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  9.97k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  9.97k|         ctx.speculation_budget =
  185|  9.97k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 240, False: 9.73k]
  ------------------
  186|  9.97k|      }
  187|       |
  188|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  189|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  190|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  191|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  192|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  193|       |      if constexpr (requires { ctx.stream_begin; }) {
  194|       |         ctx.stream_begin = nullptr;
  195|       |      }
  196|       |
  197|       |      // Normalized off before dispatching: no reader branches on it any more, so leaving it set
  198|       |      // would split every instantiation below between callers who declared padding and callers who
  199|       |      // did not, for a flag none of them reads.
  200|  9.97k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  9.97k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 1.07k, False: 8.90k]
  ------------------
  203|  1.07k|         goto finish;
  204|  1.07k|      }
  205|       |
  206|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  207|       |      // So, trailing whitespace is permitted and sometimes we want to
  208|       |      // validate this, even though this memory will not affect Glaze.
  209|       |      if constexpr (check_validate_trailing_whitespace(Opts)) {
  210|       |         if (it < end) {
  211|       |            skip_ws<ParseOpts>(ctx, it, end);
  212|       |            if (bool(ctx.error)) [[unlikely]] {
  213|       |               goto finish;
  214|       |            }
  215|       |            if (it != end) [[unlikely]] {
  216|       |               ctx.error = error_code::syntax_error;
  217|       |            }
  218|       |         }
  219|       |      }
  220|       |
  221|  9.97k|   finish:
  222|       |      // ParseOpts, not Opts: this reads `null_terminated` to tell a value that ended with the
  223|       |      // buffer from one that ran out, and it has to be told the same thing the parse was.
  224|  9.97k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  9.97k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  8.90k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10contiguousERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEDaOT0_:
   40|  9.97k|   {
   41|  9.97k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  9.97k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  9.97k|      auto end = it + buffer.size();
   45|       |
   46|  9.97k|      return std::pair{it, end};
   47|  9.97k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10contiguousERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEDaOT0_:
   40|  8.90k|   {
   41|  8.90k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  8.90k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  8.90k|      auto end = it + buffer.size();
   45|       |
   46|  8.90k|      return std::pair{it, end};
   47|  8.90k|   }

_ZN3glz11decode_hashILj10E9my_structXtlNS_11hash_info_tIS1_Lm256EEELNS_9hash_typeE1EtlNSt3__15arrayIhLm256EEEtlA256_hLh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh3ELh4ELh4ELh1ELh4ELh4ELh4ELh2ELh0ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4ELh4EEELm1ELm5EEELS4_1EE2opIRPKcSC_EEmOT_T0_:
 2584|  31.2k|      {
 2585|       |         if constexpr (HashInfo.sized_hash) {
 2586|       |            const auto* c = quote_memchr<HashInfo.min_length, HashInfo.max_length>(it, end);
 2587|       |            if (c) [[likely]] {
 2588|       |               const auto n = size_t(static_cast<std::decay_t<decltype(it)>>(c) - it);
 2589|       |               if (n == 0 || n > HashInfo.max_length || HashInfo.unique_index >= size_t(end - it)) [[unlikely]] {
 2590|       |                  return N; // error
 2591|       |               }
 2592|       |
 2593|       |               const auto h = bitmix(uint16_t(it[HashInfo.unique_index]) | (uint16_t(n) << 8), HashInfo.seed);
 2594|       |               return HashInfo.table[h % bsize];
 2595|       |            }
 2596|       |            else [[unlikely]] {
 2597|       |               return N;
 2598|       |            }
 2599|       |         }
 2600|  31.2k|         else {
 2601|       |            if constexpr (N == 2) {
 2602|       |               if constexpr (uindex > 0) {
 2603|       |                  if (size_t(end - it) <= uindex) [[unlikely]] {
 2604|       |                     return N; // error
 2605|       |                  }
 2606|       |               }
 2607|       |               // Avoids using a hash table
 2608|       |               constexpr auto first_key_char = reflect<T>::keys[0][uindex];
 2609|       |               return size_t(bool(it[uindex] ^ first_key_char));
 2610|       |            }
 2611|  31.2k|            else {
 2612|       |               if constexpr (uindex > 0) {
 2613|       |                  if (size_t(end - it) <= uindex) [[unlikely]] {
 2614|       |                     return N; // error
 2615|       |                  }
 2616|       |               }
 2617|  31.2k|               return HashInfo.table[uint8_t(it[uindex])];
 2618|  31.2k|            }
 2619|  31.2k|         }
 2620|  31.2k|      }

_ZN3glz3getILm0ETkNS_12tuple_detail9indexableENS_5tupleIJRiRdRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERNS5_5arrayImLm3EEEEEEEEDcOT0_:
  116|  7.79k|   {
  117|  7.79k|      using D = std::remove_cvref_t<Tup>;
  118|  7.79k|      if constexpr (tuple_detail::is_tuple<D>) {
  119|  7.79k|         static_assert(I < D::N, "glz::get index is out of range");
  120|  7.79k|         using T = typename D::template type_at<I>;
  121|       |         if constexpr (std::is_reference_v<Tup> || std::is_const_v<std::remove_reference_t<Tup>>) {
  122|       |            // An lvalue, or a const tuple of either value category: element access carries the
  123|       |            // constness of the tuple, except for elements that are themselves references.
  124|       |            using leaf = tuple_detail::match_const_t<std::remove_reference_t<Tup>, tuple_detail::elem<I, T>>;
  125|       |            return (static_cast<leaf&>(tup).value);
  126|       |         }
  127|  7.79k|         else {
  128|  7.79k|            return static_cast<T&&>(static_cast<tuple_detail::elem<I, T>&>(tup).value);
  129|  7.79k|         }
  130|       |      }
  131|       |      else {
  132|       |         return (static_cast<Tup&&>(tup)[I]);
  133|       |      }
  134|  7.79k|   }
_ZN3glz3tieIJidNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_5arrayImLm3EEEEEENS_5tupleIJDpRT_EEESD_:
  325|  25.1k|   {
  326|  25.1k|      return {{{ts}...}};
  327|  25.1k|   }
_ZN3glz3getILm1ETkNS_12tuple_detail9indexableENS_5tupleIJRiRdRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERNS5_5arrayImLm3EEEEEEEEDcOT0_:
  116|  8.65k|   {
  117|  8.65k|      using D = std::remove_cvref_t<Tup>;
  118|  8.65k|      if constexpr (tuple_detail::is_tuple<D>) {
  119|  8.65k|         static_assert(I < D::N, "glz::get index is out of range");
  120|  8.65k|         using T = typename D::template type_at<I>;
  121|       |         if constexpr (std::is_reference_v<Tup> || std::is_const_v<std::remove_reference_t<Tup>>) {
  122|       |            // An lvalue, or a const tuple of either value category: element access carries the
  123|       |            // constness of the tuple, except for elements that are themselves references.
  124|       |            using leaf = tuple_detail::match_const_t<std::remove_reference_t<Tup>, tuple_detail::elem<I, T>>;
  125|       |            return (static_cast<leaf&>(tup).value);
  126|       |         }
  127|  8.65k|         else {
  128|  8.65k|            return static_cast<T&&>(static_cast<tuple_detail::elem<I, T>&>(tup).value);
  129|  8.65k|         }
  130|       |      }
  131|       |      else {
  132|       |         return (static_cast<Tup&&>(tup)[I]);
  133|       |      }
  134|  8.65k|   }
_ZN3glz3getILm2ETkNS_12tuple_detail9indexableENS_5tupleIJRiRdRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERNS5_5arrayImLm3EEEEEEEEDcOT0_:
  116|  1.35k|   {
  117|  1.35k|      using D = std::remove_cvref_t<Tup>;
  118|  1.35k|      if constexpr (tuple_detail::is_tuple<D>) {
  119|  1.35k|         static_assert(I < D::N, "glz::get index is out of range");
  120|  1.35k|         using T = typename D::template type_at<I>;
  121|       |         if constexpr (std::is_reference_v<Tup> || std::is_const_v<std::remove_reference_t<Tup>>) {
  122|       |            // An lvalue, or a const tuple of either value category: element access carries the
  123|       |            // constness of the tuple, except for elements that are themselves references.
  124|       |            using leaf = tuple_detail::match_const_t<std::remove_reference_t<Tup>, tuple_detail::elem<I, T>>;
  125|       |            return (static_cast<leaf&>(tup).value);
  126|       |         }
  127|  1.35k|         else {
  128|  1.35k|            return static_cast<T&&>(static_cast<tuple_detail::elem<I, T>&>(tup).value);
  129|  1.35k|         }
  130|       |      }
  131|       |      else {
  132|       |         return (static_cast<Tup&&>(tup)[I]);
  133|       |      }
  134|  1.35k|   }
_ZN3glz3getILm3ETkNS_12tuple_detail9indexableENS_5tupleIJRiRdRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERNS5_5arrayImLm3EEEEEEEEDcOT0_:
  116|  7.35k|   {
  117|  7.35k|      using D = std::remove_cvref_t<Tup>;
  118|  7.35k|      if constexpr (tuple_detail::is_tuple<D>) {
  119|  7.35k|         static_assert(I < D::N, "glz::get index is out of range");
  120|  7.35k|         using T = typename D::template type_at<I>;
  121|       |         if constexpr (std::is_reference_v<Tup> || std::is_const_v<std::remove_reference_t<Tup>>) {
  122|       |            // An lvalue, or a const tuple of either value category: element access carries the
  123|       |            // constness of the tuple, except for elements that are themselves references.
  124|       |            using leaf = tuple_detail::match_const_t<std::remove_reference_t<Tup>, tuple_detail::elem<I, T>>;
  125|       |            return (static_cast<leaf&>(tup).value);
  126|       |         }
  127|  7.35k|         else {
  128|  7.35k|            return static_cast<T&&>(static_cast<tuple_detail::elem<I, T>&>(tup).value);
  129|  7.35k|         }
  130|       |      }
  131|       |      else {
  132|       |         return (static_cast<Tup&&>(tup)[I]);
  133|       |      }
  134|  7.35k|   }

_ZN3glz5writeITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEQ15write_supportedIT0_XdtT_6formatEEEENS_9error_ctxEOSE_RT1_:
   93|  26.7k|   {
   94|  26.7k|      context ctx{};
   95|  26.7k|      return write<Opts>(std::forward<T>(value), buffer, ctx);
   96|  26.7k|   }
_ZN3glz5writeITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEETkNS_10is_contextERNS_7contextEQ15write_supportedIT0_XdtT_6formatEEEENS_9error_ctxEOSG_RT1_OT2_:
   18|  26.7k|   {
   19|  26.7k|      using traits = buffer_traits<std::remove_cvref_t<Buffer>>;
   20|  26.7k|      call_scope scope{ctx};
   21|       |
   22|  26.7k|      if constexpr (traits::is_resizable) {
   23|       |         // A buffer could be size 1, to ensure we have sufficient memory we can't just check `empty()`
   24|  26.7k|         if (buffer.size() < 2 * write_padding_bytes) {
  ------------------
  |  Branch (24:14): [True: 26.7k, False: 0]
  ------------------
   25|  26.7k|            resize_unfilled(buffer, 2 * write_padding_bytes);
   26|  26.7k|         }
   27|  26.7k|      }
   28|  26.7k|      size_t ix = 0; // overwrite index
   29|  26.7k|      to<Opts.format, std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), ctx, buffer, ix);
   30|       |
   31|  26.7k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (31:11): [True: 0, False: 26.7k]
  ------------------
   32|       |         // Truncate on the way out too: the padding above is grown without being filled, so a
   33|       |         // buffer left at its padded length would hand the caller indeterminate bytes. Not
   34|       |         // `finalize`, which for a streaming buffer means flushing -- a failed write must not
   35|       |         // push the partial document downstream on its way out.
   36|      0|         if constexpr (traits::is_resizable && not traits::is_output_streaming) {
   37|      0|            buffer.resize(ix);
   38|      0|         }
   39|      0|         return {ix, ctx.error, ctx.custom_error_message};
   40|      0|      }
   41|       |
   42|  26.7k|      traits::finalize(buffer, ix);
   43|  26.7k|      return {ix, error_code::none, ctx.custom_error_message};
   44|  26.7k|   }

_ZN3glz11write_chars2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj128EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEETkNS_5num_tERdTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  205|  2.11M|      {
  206|       |         /*if constexpr (std::same_as<std::decay_t<B>, std::string>) {
  207|       |            // more efficient strings in C++23:
  208|       |          https://en.cppreference.com/w/cpp/string/basic_string/resize_and_overwrite
  209|       |          }*/
  210|       |
  211|       |         // https://stackoverflow.com/questions/1701055/what-is-the-maximum-length-in-chars-needed-to-represent-any-double-value
  212|       |         // maximum length for a double should be 24 chars, we use 64 to be sufficient for float128_t
  213|       |         if constexpr (resizable<B> && not check_write_unchecked(Opts)) {
  214|       |            if (const auto k = ix + 64; k > b.size()) {
  215|       |               grow_buffer(b, k);
  216|       |            }
  217|       |         }
  218|       |
  219|  2.11M|         using V = std::decay_t<decltype(value)>;
  220|       |
  221|  2.11M|         if constexpr (std::floating_point<V>) {
  222|  2.11M|            using opts_type = std::decay_t<decltype(Opts)>;
  223|  2.11M|            constexpr bool use_float_format = requires { opts_type::float_format; };
  224|       |
  225|       |            // User-specified float_format takes priority over all other options
  226|       |            if constexpr (use_float_format && is_any_of<V, float, double>) {
  227|       |#if GLZ_USE_STD_FORMAT_FLOAT
  228|       |               // Use std::format with user-provided format string (e.g., "{:.2f}")
  229|       |               // Format string is validated at compile-time via std::format_string
  230|       |               constexpr auto fmt = std::format_string<V>{opts_type::float_format};
  231|       |
  232|       |               if constexpr (check_write_unchecked(Opts)) {
  233|       |                  // Caller guarantees buffer has enough space
  234|       |                  const auto start = reinterpret_cast<char*>(&b[ix]);
  235|       |                  auto result = std::format_to(start, fmt, V(value));
  236|       |                  ix += size_t(result - start);
  237|       |               }
  238|       |               else {
  239|       |                  // format_to_n writes up to 'available' chars and returns total size needed.
  240|       |                  // Common case: output fits in pre-allocated buffer (single pass).
  241|       |                  // Rare case: output exceeds buffer (e.g., "{:.100f}"), requires resize.
  242|       |                  const auto start = reinterpret_cast<char*>(&b[ix]);
  243|       |                  const auto available = b.size() - ix;
  244|       |                  auto [out, size] = std::format_to_n(start, available, fmt, V(value));
  245|       |
  246|       |                  if (static_cast<size_t>(size) > available) {
  247|       |                     // Output was truncated - size tells us exactly how much space we need
  248|       |                     if constexpr (resizable<B>) {
  249|       |                        grow_buffer(b, ix + size);
  250|       |                        std::format_to(reinterpret_cast<char*>(&b[ix]), fmt, V(value));
  251|       |                     }
  252|       |                     else {
  253|       |                        ctx.error = error_code::unexpected_end;
  254|       |                        return;
  255|       |                     }
  256|       |                  }
  257|       |                  ix += size;
  258|       |               }
  259|       |#else
  260|       |               // snprintf fallback for platforms without std::format float support (e.g., iOS < 16.3)
  261|       |               // Convert std::format spec to printf format at compile time
  262|       |               constexpr auto printf_fmt = detail::to_printf_fmt(opts_type::float_format);
  263|       |
  264|       |               const auto start = reinterpret_cast<char*>(&b[ix]);
  265|       |               const auto available = check_write_unchecked(Opts) ? size_t(64) : (b.size() - ix);
  266|       |
  267|       |               // snprintf returns chars that would be written (excluding null), or negative on error
  268|       |               const int len = std::snprintf(start, available, printf_fmt.data, static_cast<double>(value));
  269|       |
  270|       |               if (len < 0) {
  271|       |                  ctx.error = error_code::unexpected_end;
  272|       |                  return;
  273|       |               }
  274|       |
  275|       |               if (static_cast<size_t>(len) >= available) {
  276|       |                  // Output was truncated, need to resize and retry
  277|       |                  if constexpr (resizable<B> && not check_write_unchecked(Opts)) {
  278|       |                     grow_buffer(b, ix + static_cast<size_t>(len) + 1);
  279|       |                     std::snprintf(reinterpret_cast<char*>(&b[ix]), static_cast<size_t>(len) + 1, printf_fmt.data,
  280|       |                                   static_cast<double>(value));
  281|       |                  }
  282|       |                  else {
  283|       |                     ctx.error = error_code::unexpected_end;
  284|       |                     return;
  285|       |                  }
  286|       |               }
  287|       |               ix += static_cast<size_t>(len);
  288|       |#endif
  289|       |            }
  290|       |            else if constexpr (uint8_t(check_float_max_write_precision(Opts)) > 0 &&
  291|       |                               uint8_t(check_float_max_write_precision(Opts)) < sizeof(V)) {
  292|       |               // we cast to a lower precision floating point value before writing out
  293|       |               if constexpr (uint8_t(check_float_max_write_precision(Opts)) == 8) {
  294|       |                  const auto reduced = static_cast<double>(value);
  295|       |                  const auto start = reinterpret_cast<char*>(&b[ix]);
  296|       |                  const auto end = glz::to_chars(start, reduced);
  297|       |                  ix += size_t(end - start);
  298|       |               }
  299|       |               else if constexpr (uint8_t(check_float_max_write_precision(Opts)) == 4) {
  300|       |                  const auto reduced = static_cast<float>(value);
  301|       |                  const auto start = reinterpret_cast<char*>(&b[ix]);
  302|       |                  const auto end = glz::to_chars(start, reduced);
  303|       |                  ix += size_t(end - start);
  304|       |               }
  305|       |               else {
  306|       |                  static_assert(false_v<V>, "invalid float_max_write_precision");
  307|       |               }
  308|       |            }
  309|       |            // Size optimization: pass OptSize=true so the ~17KB pow-10 lookup
  310|       |            // tables are dropped (recomputed on the fly). Much faster than the
  311|       |            // old simple_float::to_chars path at essentially the same footprint.
  312|       |            // See discussion #2519.
  313|       |            else if constexpr (is_size_optimized(Opts) && is_any_of<V, float, double>) {
  314|       |               const auto start = reinterpret_cast<char*>(&b[ix]);
  315|       |               const auto end = glz::to_chars<V, /*OptSize=*/true>(start, V(value));
  316|       |               ix += size_t(end - start);
  317|       |            }
  318|  2.11M|            else if constexpr (is_any_of<V, float, double>) {
  319|  2.11M|               const auto start = reinterpret_cast<char*>(&b[ix]);
  320|  2.11M|               const auto end = glz::to_chars(start, value);
  321|  2.11M|               ix += size_t(end - start);
  322|       |            }
  323|       |// float128_t requires std::to_chars for floating-point, unavailable on older Apple platforms (iOS < 16.3)
  324|       |#if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
  325|       |            else if constexpr (is_float128<V>) {
  326|       |               const auto start = reinterpret_cast<char*>(&b[ix]);
  327|       |               const auto [ptr, ec] = std::to_chars(start, &b[0] + b.size(), value, std::chars_format::general);
  328|       |               if (ec != std::errc()) {
  329|       |                  ctx.error = error_code::unexpected_end;
  330|       |                  return;
  331|       |               }
  332|       |               ix += size_t(ptr - start);
  333|       |            }
  334|       |#endif
  335|       |            else {
  336|       |               static_assert(false_v<V>, "type is not supported");
  337|       |            }
  338|       |         }
  339|       |         else if constexpr (is_any_of<V, int8_t, uint8_t, int16_t, uint16_t>) {
  340|       |            // Small integers: always use to_chars (400B tables)
  341|       |            // The 40KB digit_quads table doesn't help for these small ranges
  342|       |            const auto start = reinterpret_cast<char*>(&b[ix]);
  343|       |            const auto end = glz::to_chars(start, value);
  344|       |            ix += size_t(end - start);
  345|       |         }
  346|       |         else if constexpr (is_any_of<V, int32_t, uint32_t, int64_t, uint64_t>) {
  347|       |            const auto start = reinterpret_cast<char*>(&b[ix]);
  348|       |            if constexpr (is_size_optimized(Opts)) {
  349|       |               // Size mode: use glz::to_chars (400B lookup tables)
  350|       |               const auto end = glz::to_chars(start, value);
  351|       |               ix += size_t(end - start);
  352|       |            }
  353|       |            else {
  354|       |               // Normal mode: use to_chars_40kb (40KB digit_quads table)
  355|       |               const auto end = glz::to_chars_40kb(start, value);
  356|       |               ix += size_t(end - start);
  357|       |            }
  358|       |         }
  359|       |         else if constexpr (std::integral<V>) {
  360|       |            // Handle other integral types (char, wchar_t, etc.) by casting to sized types
  361|       |            using X = std::decay_t<decltype(sized_integer_conversion<V>())>;
  362|       |            const auto start = reinterpret_cast<char*>(&b[ix]);
  363|       |            if constexpr (is_size_optimized(Opts)) {
  364|       |               // Size mode: use glz::to_chars (400B lookup tables)
  365|       |               const auto end = glz::to_chars(start, static_cast<X>(value));
  366|       |               ix += size_t(end - start);
  367|       |            }
  368|       |            else {
  369|       |               // Normal mode: use to_chars_40kb
  370|       |               const auto end = glz::to_chars_40kb(start, static_cast<X>(value));
  371|       |               ix += size_t(end - start);
  372|       |            }
  373|       |         }
  374|       |         else {
  375|       |            static_assert(false_v<V>, "type is not supported");
  376|       |         }
  377|  2.11M|      }

_ZN3glz9sweethash7sweet32ITkNS0_16contiguous_rangeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEjRKT_j:
  270|  6.85M|   {
  271|  6.85M|      return sweet32(static_cast<const void*>(s.data()), s.size(), seed);
  272|  6.85M|   }
_ZN3glz9sweethash7sweet32EPKvmj:
  154|  6.85M|   {
  155|  6.85M|      const uint8_t* p = static_cast<const uint8_t*>(data);
  156|       |
  157|       |      // For inputs <= 8 bytes, use simple hash (tail handler requires len >= 9)
  158|  6.85M|      if (len <= 8) {
  ------------------
  |  Branch (158:11): [True: 2.68M, False: 4.17M]
  ------------------
  159|  2.68M|         uint64_t v = 0;
  160|  2.68M|         switch (len) {
  161|   212k|         case 8:
  ------------------
  |  Branch (161:10): [True: 212k, False: 2.47M]
  ------------------
  162|   212k|            std::memcpy(&v, p, 8);
  163|   212k|            break;
  164|   180k|         case 7:
  ------------------
  |  Branch (164:10): [True: 180k, False: 2.50M]
  ------------------
  165|   180k|            std::memcpy(&v, p, 7);
  166|   180k|            break;
  167|   178k|         case 6:
  ------------------
  |  Branch (167:10): [True: 178k, False: 2.50M]
  ------------------
  168|   178k|            std::memcpy(&v, p, 6);
  169|   178k|            break;
  170|   357k|         case 5:
  ------------------
  |  Branch (170:10): [True: 357k, False: 2.32M]
  ------------------
  171|   357k|            std::memcpy(&v, p, 5);
  172|   357k|            break;
  173|   346k|         case 4:
  ------------------
  |  Branch (173:10): [True: 346k, False: 2.33M]
  ------------------
  174|   346k|            std::memcpy(&v, p, 4);
  175|   346k|            break;
  176|   559k|         case 3:
  ------------------
  |  Branch (176:10): [True: 559k, False: 2.12M]
  ------------------
  177|   559k|            std::memcpy(&v, p, 3);
  178|   559k|            break;
  179|   225k|         case 2:
  ------------------
  |  Branch (179:10): [True: 225k, False: 2.45M]
  ------------------
  180|   225k|            std::memcpy(&v, p, 2);
  181|   225k|            break;
  182|   430k|         case 1:
  ------------------
  |  Branch (182:10): [True: 430k, False: 2.25M]
  ------------------
  183|   430k|            v = p[0];
  184|   430k|            break;
  185|   192k|         default:
  ------------------
  |  Branch (185:10): [True: 192k, False: 2.49M]
  ------------------
  186|   192k|            break;
  187|  2.68M|         }
  188|  2.68M|         v = v ^ seed ^ (len + 1);
  189|  2.68M|         return static_cast<uint32_t>(v) ^ static_cast<uint32_t>(v >> 32);
  190|  2.68M|      }
  191|       |
  192|       |      // Full hash for inputs > 8 bytes
  193|  4.17M|      uint64_t seed64 = (static_cast<uint64_t>(seed) << 32) | static_cast<uint64_t>(seed);
  194|  4.17M|      uint64_t h = (seed64 ^ prime4) + (len * prime1);
  195|  4.17M|      const uint8_t* const end = p + len;
  196|       |
  197|  4.17M|      if (len >= 32) {
  ------------------
  |  Branch (197:11): [True: 2.14M, False: 2.02M]
  ------------------
  198|  2.14M|         uint64_t h1 = h;
  199|  2.14M|         uint64_t h2 = (seed64 * prime2) ^ prime3;
  200|  2.14M|         uint64_t h3 = (seed64 * prime3) ^ prime4;
  201|  2.14M|         uint64_t h4 = (seed64 * prime4) ^ prime5;
  202|       |
  203|  10.9M|         do {
  204|  10.9M|            uint64_t k1, k2, k3, k4;
  205|  10.9M|            std::memcpy(&k1, p, 8);
  206|  10.9M|            std::memcpy(&k2, p + 8, 8);
  207|  10.9M|            std::memcpy(&k3, p + 16, 8);
  208|  10.9M|            std::memcpy(&k4, p + 24, 8);
  209|       |
  210|  10.9M|            k1 = k1 * prime2;
  211|  10.9M|            k1 = k1 ^ (k1 >> 47);
  212|  10.9M|            h1 = h1 ^ k1;
  213|  10.9M|            h1 = h1 * prime1;
  214|       |
  215|  10.9M|            k2 = k2 * prime3;
  216|  10.9M|            k2 = k2 ^ (k2 >> 47);
  217|  10.9M|            h2 = h2 ^ k2;
  218|  10.9M|            h2 = h2 * prime2;
  219|       |
  220|  10.9M|            k3 = k3 * prime4;
  221|  10.9M|            k3 = k3 ^ (k3 >> 47);
  222|  10.9M|            h3 = h3 ^ k3;
  223|  10.9M|            h3 = h3 * prime3;
  224|       |
  225|  10.9M|            k4 = k4 * prime5;
  226|  10.9M|            k4 = k4 ^ (k4 >> 47);
  227|  10.9M|            h4 = h4 ^ k4;
  228|  10.9M|            h4 = h4 * prime4;
  229|       |
  230|  10.9M|            p = p + 32;
  231|  10.9M|            len = len - 32;
  232|  10.9M|         } while (len >= 32);
  ------------------
  |  Branch (232:19): [True: 8.76M, False: 2.14M]
  ------------------
  233|       |
  234|  2.14M|         h = h1 + h2 + h3 + h4;
  235|  2.14M|      }
  236|       |
  237|  9.64M|      while (len >= 8) {
  ------------------
  |  Branch (237:14): [True: 5.47M, False: 4.17M]
  ------------------
  238|  5.47M|         uint64_t k;
  239|  5.47M|         std::memcpy(&k, p, 8);
  240|  5.47M|         k = k * prime2;
  241|  5.47M|         k = k ^ (k >> 47);
  242|  5.47M|         h = h ^ k;
  243|  5.47M|         h = h * prime1;
  244|  5.47M|         p = p + 8;
  245|  5.47M|         len = len - 8;
  246|  5.47M|      }
  247|       |
  248|  4.17M|      if (len > 0) {
  ------------------
  |  Branch (248:11): [True: 3.75M, False: 415k]
  ------------------
  249|  3.75M|         uint64_t k;
  250|  3.75M|         std::memcpy(&k, end - 8, 8);
  251|  3.75M|         k = k * prime2;
  252|  3.75M|         k = k ^ (k >> 47);
  253|  3.75M|         k = k * prime3;
  254|  3.75M|         h = h ^ k;
  255|  3.75M|      }
  256|       |
  257|  4.17M|      h = mix64(h);
  258|  4.17M|      return static_cast<uint32_t>(h) ^ static_cast<uint32_t>(h >> 32);
  259|  6.85M|   }
_ZN3glz9sweethash5mix64Em:
   33|  4.17M|   {
   34|  4.17M|      v = v ^ (v >> 33);
   35|  4.17M|      v = v * prime2;
   36|  4.17M|      v = v ^ (v >> 29);
   37|  4.17M|      v = v * prime3;
   38|  4.17M|      return v;
   39|  4.17M|   }

_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2Ev:
  379|  10.5M|      generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2EOS3_:
  382|  18.4M|      generic_json(generic_json&& other) noexcept : data(std::move(other.data)) {}
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEED2Ev:
  131|  28.9M|      ~generic_json() = default;

_ZN3glz6detail16read_json_stringITkNS_10is_contextERNS_7contextERPKcS5_EENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEEOT_OT0_T1_:
  156|  2.80M|   {
  157|  2.80M|      auto start = it;
  158|  2.80M|      ++it; // skip quote
  159|       |      // The bound as a pointer, so each chunk costs one compare. Where eight bytes are not left,
  160|       |      // the fallback is the opening quote, which sits before `it` and fails the test on the first
  161|       |      // look; never `it` itself, which would pass and read a chunk past `end`.
  162|  2.80M|      const auto* const chunk_limit = (end - it >= 8) ? end - 8 : it - 1;
  ------------------
  |  Branch (162:39): [True: 2.80M, False: 4.75k]
  ------------------
  163|  15.8M|      while (it <= chunk_limit) {
  ------------------
  |  Branch (163:14): [True: 15.8M, False: 5.90k]
  ------------------
  164|  15.8M|         uint64_t chunk;
  165|  15.8M|         std::memcpy(&chunk, it, 8);
  166|       |         if constexpr (std::endian::native == std::endian::big) {
  167|       |            chunk = std::byteswap(chunk);
  168|       |         }
  169|  15.8M|         const uint64_t quote = has_quote(chunk);
  170|  15.8M|         if (quote) {
  ------------------
  |  Branch (170:14): [True: 2.80M, False: 13.0M]
  ------------------
  171|  2.80M|            it += (countr_zero(quote) >> 3);
  172|       |
  173|  2.80M|            auto* prev = it - 1;
  174|  2.82M|            while (*prev == '\\') {
  ------------------
  |  Branch (174:20): [True: 24.8k, False: 2.80M]
  ------------------
  175|  24.8k|               --prev;
  176|  24.8k|            }
  177|  2.80M|            if (size_t(it - prev) % 2) {
  ------------------
  |  Branch (177:17): [True: 2.79M, False: 4.71k]
  ------------------
  178|  2.79M|               ++it; // add quote
  179|  2.79M|               return {start, size_t(it - start)};
  180|  2.79M|            }
  181|  4.71k|            ++it; // skip escaped quote and continue
  182|  4.71k|         }
  183|  13.0M|         else {
  184|  13.0M|            it += 8;
  185|  13.0M|         }
  186|  15.8M|      }
  187|       |
  188|  13.7k|      while (it < end) {
  ------------------
  |  Branch (188:14): [True: 13.7k, False: 0]
  ------------------
  189|  13.7k|         if (*it == '"') {
  ------------------
  |  Branch (189:14): [True: 5.97k, False: 7.75k]
  ------------------
  190|  5.97k|            auto* prev = it - 1;
  191|  9.33k|            while (*prev == '\\') {
  ------------------
  |  Branch (191:20): [True: 3.36k, False: 5.97k]
  ------------------
  192|  3.36k|               --prev;
  193|  3.36k|            }
  194|  5.97k|            if (size_t(it - prev) % 2) {
  ------------------
  |  Branch (194:17): [True: 5.90k, False: 70]
  ------------------
  195|  5.90k|               ++it; // add quote
  196|  5.90k|               return {start, size_t(it - start)};
  197|  5.90k|            }
  198|  5.97k|         }
  199|  7.82k|         ++it;
  200|  7.82k|      }
  201|       |
  202|      0|      ctx.error = error_code::unexpected_end;
  203|      0|      return {};
  204|  5.90k|   }
_ZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextENS2_17basic_string_viewIcS5_EEEEbRT1_RT0_RmRKT2_:
   91|  2.42M|   {
   92|  2.42M|      using T = std::remove_cvref_t<decltype(x)>;
   93|       |      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|       |         dump<Checked>(x, b, ix);
  100|       |      }
  101|  2.42M|      else {
  102|  2.42M|         const sv s = [&] {
  103|  2.42M|            if constexpr (std::is_bounded_array_v<T>) {
  104|  2.42M|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|  2.42M|            }
  106|  2.42M|            else {
  107|  2.42M|               return sv{x};
  108|  2.42M|            }
  109|  2.42M|         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|  2.42M|         dump<Checked>(s, b, ix);
  116|  2.42M|      }
  117|  2.42M|      return true;
  118|  2.42M|   }
_ZZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextENS2_17basic_string_viewIcS5_EEEEbRT1_RT0_RmRKT2_ENKUlvE_clEv:
  102|  2.42M|         const sv s = [&] {
  103|       |            if constexpr (std::is_bounded_array_v<T>) {
  104|       |               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|  2.42M|            else {
  107|  2.42M|               return sv{x};
  108|  2.42M|            }
  109|  2.42M|         }();
_ZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEcEEbRT1_RT0_RmRKT2_:
   91|  9.25M|   {
   92|  9.25M|      using T = std::remove_cvref_t<decltype(x)>;
   93|  9.25M|      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|  9.25M|         dump<Checked>(x, b, ix);
  100|       |      }
  101|       |      else {
  102|       |         const sv s = [&] {
  103|       |            if constexpr (std::is_bounded_array_v<T>) {
  104|       |               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|       |            else {
  107|       |               return sv{x};
  108|       |            }
  109|       |         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|       |         dump<Checked>(s, b, ix);
  116|       |      }
  117|  9.25M|      return true;
  118|  9.25M|   }
_ZN3glz6detail16read_json_numberILb1ERPKcS3_EENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEEOT0_T1_:
  304|  2.02M|   {
  305|  2.02M|      auto start = it;
  306|  2.02M|      if constexpr (null_terminated) {
  307|  10.8M|         while (numeric_table[uint8_t(*it)]) {
  ------------------
  |  Branch (307:17): [True: 8.82M, False: 2.02M]
  ------------------
  308|  8.82M|            ++it;
  309|  8.82M|         }
  310|       |      }
  311|       |      else {
  312|       |         while ((it < end) && numeric_table[uint8_t(*it)]) {
  313|       |            ++it;
  314|       |         }
  315|       |      }
  316|  2.02M|      return {start, size_t(it - start)};
  317|  2.02M|   }
_ZN3glz6detail13match_literalITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc110ELc117ELc108ELc108EEEETkNS_10is_contextERNS_7contextERPKcS8_EEbOT0_OT1_T2_:
  130|   134k|   {
  131|   134k|      static constexpr auto s = literal.sv();
  132|   134k|      if (end - it < std::ptrdiff_t(s.size())) [[unlikely]] {
  ------------------
  |  Branch (132:11): [True: 0, False: 134k]
  ------------------
  133|      0|         ctx.error = error_code::unexpected_end;
  134|      0|         return false;
  135|      0|      }
  136|   134k|      if (not comparitor<s>(it)) [[unlikely]] {
  ------------------
  |  Branch (136:11): [True: 0, False: 134k]
  ------------------
  137|      0|         ctx.error = error_code::syntax_error;
  138|      0|         return false;
  139|      0|      }
  140|   134k|      it += s.size();
  141|   134k|      return true;
  142|   134k|   }
_ZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA5_cEEbRT1_RT0_RmRKT2_:
   91|   148k|   {
   92|   148k|      using T = std::remove_cvref_t<decltype(x)>;
   93|       |      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|       |         dump<Checked>(x, b, ix);
  100|       |      }
  101|   148k|      else {
  102|   148k|         const sv s = [&] {
  103|   148k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   148k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|   148k|            }
  106|   148k|            else {
  107|   148k|               return sv{x};
  108|   148k|            }
  109|   148k|         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|   148k|         dump<Checked>(s, b, ix);
  116|   148k|      }
  117|   148k|      return true;
  118|   148k|   }
_ZZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA5_cEEbRT1_RT0_RmRKT2_ENKUlvE_clEv:
  102|   148k|         const sv s = [&] {
  103|   148k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   148k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|       |            else {
  107|       |               return sv{x};
  108|       |            }
  109|   148k|         }();
_ZN3glz6detail13match_literalITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc116ELc114ELc117ELc101EEEETkNS_10is_contextERNS_7contextERPKcS8_EEbOT0_OT1_T2_:
  130|   162k|   {
  131|   162k|      static constexpr auto s = literal.sv();
  132|   162k|      if (end - it < std::ptrdiff_t(s.size())) [[unlikely]] {
  ------------------
  |  Branch (132:11): [True: 0, False: 162k]
  ------------------
  133|      0|         ctx.error = error_code::unexpected_end;
  134|      0|         return false;
  135|      0|      }
  136|   162k|      if (not comparitor<s>(it)) [[unlikely]] {
  ------------------
  |  Branch (136:11): [True: 0, False: 162k]
  ------------------
  137|      0|         ctx.error = error_code::syntax_error;
  138|      0|         return false;
  139|      0|      }
  140|   162k|      it += s.size();
  141|   162k|      return true;
  142|   162k|   }
_ZN3glz6detail13match_literalITnNS_14string_literalEXtlNS2_ILm6EEEtlA6_cLc102ELc97ELc108ELc115ELc101EEEETkNS_10is_contextERNS_7contextERPKcS8_EEbOT0_OT1_T2_:
  130|   752k|   {
  131|   752k|      static constexpr auto s = literal.sv();
  132|   752k|      if (end - it < std::ptrdiff_t(s.size())) [[unlikely]] {
  ------------------
  |  Branch (132:11): [True: 0, False: 752k]
  ------------------
  133|      0|         ctx.error = error_code::unexpected_end;
  134|      0|         return false;
  135|      0|      }
  136|   752k|      if (not comparitor<s>(it)) [[unlikely]] {
  ------------------
  |  Branch (136:11): [True: 0, False: 752k]
  ------------------
  137|      0|         ctx.error = error_code::syntax_error;
  138|      0|         return false;
  139|      0|      }
  140|   752k|      it += s.size();
  141|   752k|      return true;
  142|   752k|   }
_ZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA6_cEEbRT1_RT0_RmRKT2_:
   91|   376k|   {
   92|   376k|      using T = std::remove_cvref_t<decltype(x)>;
   93|       |      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|       |         dump<Checked>(x, b, ix);
  100|       |      }
  101|   376k|      else {
  102|   376k|         const sv s = [&] {
  103|   376k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   376k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|   376k|            }
  106|   376k|            else {
  107|   376k|               return sv{x};
  108|   376k|            }
  109|   376k|         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|   376k|         dump<Checked>(s, b, ix);
  116|   376k|      }
  117|   376k|      return true;
  118|   376k|   }
_ZZN3glz6detail10emit_bytesILb0ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA6_cEEbRT1_RT0_RmRKT2_ENKUlvE_clEv:
  102|   376k|         const sv s = [&] {
  103|   376k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   376k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|       |            else {
  107|       |               return sv{x};
  108|       |            }
  109|   376k|         }();
_ZN3glz6detail18read_jsonc_commentITkNS_10is_contextERNS_7contextERPKcS5_EENS0_13jsonc_commentEOT_OT0_T1_:
  227|  1.11M|   {
  228|  1.11M|      const auto start = it;
  229|  1.11M|      ++it; // past the opening '/'
  230|       |
  231|       |      // The caller matched one '/'; that says nothing about a second byte being there at all.
  232|       |      // Stepping over both regardless leaves `it` past `end`, and every scan the caller runs after
  233|       |      // this one starts from there.
  234|  1.11M|      if (it == end) [[unlikely]] {
  ------------------
  |  Branch (234:11): [True: 0, False: 1.11M]
  ------------------
  235|      0|         ctx.error = error_code::unexpected_end;
  236|      0|         return {};
  237|      0|      }
  238|       |
  239|  1.11M|      if (*it == '/') {
  ------------------
  |  Branch (239:11): [True: 1.09M, False: 16.9k]
  ------------------
  240|  1.09M|         ++it; // past the second '/'
  241|  50.8M|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (241:17): [True: 50.8M, False: 432]
  |  Branch (241:30): [True: 49.8M, False: 1.01M]
  |  Branch (241:45): [True: 49.7M, False: 81.6k]
  ------------------
  242|  49.7M|            ++it;
  243|  49.7M|         }
  244|       |         // The terminator is left where it is: minify drops it along with the rest of the
  245|       |         // whitespace and prettify emits its own break. A carriage return ends the comment on its
  246|       |         // own, so a file with CR line endings is not swallowed by its first comment; a line feed
  247|       |         // behind it is then ordinary whitespace.
  248|  1.09M|         return {sv{start, size_t(it - start)}, true};
  249|  1.09M|      }
  250|       |
  251|  16.9k|      if (*it != '*') [[unlikely]] {
  ------------------
  |  Branch (251:11): [True: 0, False: 16.9k]
  ------------------
  252|      0|         ctx.error = error_code::expected_end_comment;
  253|      0|         return {};
  254|      0|      }
  255|  16.9k|      ++it; // past the '*' of the opener
  256|       |
  257|       |      // Only a '*' after the opening delimiter can close the comment, which is what the `content`
  258|       |      // guards below are for: without them the '*' of the opener closes the comment it opened, so
  259|       |      // "/*/" reads as complete and swallows whatever follows it.
  260|  16.9k|      const auto content = it;
  261|       |
  262|       |      // The bound as a pointer, so each chunk costs one compare. `end - 8` only points into the
  263|       |      // buffer once that much of it is left; where it is not, the fallback is the byte before the
  264|       |      // cursor, which is inside the opener and so fails the test on the first look. Never `it`
  265|       |      // itself -- that passes, and the chunk behind it would read past the end of the buffer.
  266|  16.9k|      const auto* const chunk_limit = (end - it >= 8) ? end - 8 : it - 1;
  ------------------
  |  Branch (266:39): [True: 16.3k, False: 582]
  ------------------
  267|  1.66M|      while (it <= chunk_limit) {
  ------------------
  |  Branch (267:14): [True: 1.66M, False: 798]
  ------------------
  268|  1.66M|         uint64_t chunk;
  269|  1.66M|         std::memcpy(&chunk, it, 8);
  270|       |         if constexpr (std::endian::native == std::endian::big) {
  271|       |            chunk = std::byteswap(chunk);
  272|       |         }
  273|  1.66M|         const uint64_t slash = has_char<'/'>(chunk);
  274|  1.66M|         if (slash) {
  ------------------
  |  Branch (274:14): [True: 492k, False: 1.17M]
  ------------------
  275|   492k|            it += (countr_zero(slash) >> 3);
  276|       |
  277|   492k|            if (it > content && it[-1] == '*') {
  ------------------
  |  Branch (277:17): [True: 491k, False: 840]
  |  Branch (277:33): [True: 16.1k, False: 475k]
  ------------------
  278|  16.1k|               ++it; // add slash
  279|  16.1k|               return {sv{start, size_t(it - start)}, false};
  280|  16.1k|            }
  281|       |            // skip slash and continue
  282|   475k|            ++it;
  283|   475k|         }
  284|  1.17M|         else {
  285|  1.17M|            it += 8;
  286|  1.17M|         }
  287|  1.66M|      }
  288|       |
  289|       |      // Tail end of buffer. Should be rare we even get here
  290|  2.49k|      while (it < end) {
  ------------------
  |  Branch (290:14): [True: 2.49k, False: 0]
  ------------------
  291|  2.49k|         if (it > content && it[-1] == '*' && *it == '/') {
  ------------------
  |  Branch (291:14): [True: 1.91k, False: 582]
  |  Branch (291:30): [True: 1.14k, False: 772]
  |  Branch (291:47): [True: 798, False: 346]
  ------------------
  292|    798|            ++it; // add slash
  293|    798|            return {sv{start, size_t(it - start)}, false};
  294|    798|         }
  295|  1.70k|         ++it;
  296|  1.70k|      }
  297|       |
  298|      0|      ctx.error = error_code::expected_end_comment;
  299|      0|      return {};
  300|    798|   }
_ZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextENS2_17basic_string_viewIcS5_EEEEbRT1_RT0_RmRKT2_:
   91|  4.08M|   {
   92|  4.08M|      using T = std::remove_cvref_t<decltype(x)>;
   93|       |      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|       |         dump<Checked>(x, b, ix);
  100|       |      }
  101|  4.08M|      else {
  102|  4.08M|         const sv s = [&] {
  103|  4.08M|            if constexpr (std::is_bounded_array_v<T>) {
  104|  4.08M|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|  4.08M|            }
  106|  4.08M|            else {
  107|  4.08M|               return sv{x};
  108|  4.08M|            }
  109|  4.08M|         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|  4.08M|         dump<Checked>(s, b, ix);
  116|  4.08M|      }
  117|  4.08M|      return true;
  118|  4.08M|   }
_ZZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextENS2_17basic_string_viewIcS5_EEEEbRT1_RT0_RmRKT2_ENKUlvE_clEv:
  102|  4.08M|         const sv s = [&] {
  103|       |            if constexpr (std::is_bounded_array_v<T>) {
  104|       |               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|  4.08M|            else {
  107|  4.08M|               return sv{x};
  108|  4.08M|            }
  109|  4.08M|         }();
_ZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEcEEbRT1_RT0_RmRKT2_:
   91|  8.14M|   {
   92|  8.14M|      using T = std::remove_cvref_t<decltype(x)>;
   93|  8.14M|      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|  8.14M|         dump<Checked>(x, b, ix);
  100|       |      }
  101|       |      else {
  102|       |         const sv s = [&] {
  103|       |            if constexpr (std::is_bounded_array_v<T>) {
  104|       |               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|       |            else {
  107|       |               return sv{x};
  108|       |            }
  109|       |         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|       |         dump<Checked>(s, b, ix);
  116|       |      }
  117|  8.14M|      return true;
  118|  8.14M|   }
_ZN3glz6detail15append_new_lineILb0ELh3ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERmEEvOT1_OT2_l:
   63|  5.27M|   {
   64|  5.27M|      dump('\n', b, ix);
   65|       |      if constexpr (use_tabs) {
   66|       |         dumpn('\t', indent, b, ix);
   67|       |      }
   68|  5.27M|      else {
   69|  5.27M|         dumpn(' ', indent * indentation_width, b, ix);
   70|  5.27M|      }
   71|  5.27M|   };
_ZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA5_cEEbRT1_RT0_RmRKT2_:
   91|   148k|   {
   92|   148k|      using T = std::remove_cvref_t<decltype(x)>;
   93|       |      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|       |         dump<Checked>(x, b, ix);
  100|       |      }
  101|   148k|      else {
  102|   148k|         const sv s = [&] {
  103|   148k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   148k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|   148k|            }
  106|   148k|            else {
  107|   148k|               return sv{x};
  108|   148k|            }
  109|   148k|         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|   148k|         dump<Checked>(s, b, ix);
  116|   148k|      }
  117|   148k|      return true;
  118|   148k|   }
_ZZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA5_cEEbRT1_RT0_RmRKT2_ENKUlvE_clEv:
  102|   148k|         const sv s = [&] {
  103|   148k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   148k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|       |            else {
  107|       |               return sv{x};
  108|       |            }
  109|   148k|         }();
_ZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA6_cEEbRT1_RT0_RmRKT2_:
   91|   376k|   {
   92|   376k|      using T = std::remove_cvref_t<decltype(x)>;
   93|       |      if constexpr (byte_sized<T>) {
   94|       |         if constexpr (has_bounded_capacity<B>) {
   95|       |            if (not ensure_space(ctx, b, ix + 1)) [[unlikely]] {
   96|       |               return false;
   97|       |            }
   98|       |         }
   99|       |         dump<Checked>(x, b, ix);
  100|       |      }
  101|   376k|      else {
  102|   376k|         const sv s = [&] {
  103|   376k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   376k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|   376k|            }
  106|   376k|            else {
  107|   376k|               return sv{x};
  108|   376k|            }
  109|   376k|         }();
  110|       |         if constexpr (has_bounded_capacity<B>) {
  111|       |            if (not ensure_space(ctx, b, ix + s.size())) [[unlikely]] {
  112|       |               return false;
  113|       |            }
  114|       |         }
  115|   376k|         dump<Checked>(s, b, ix);
  116|   376k|      }
  117|   376k|      return true;
  118|   376k|   }
_ZZN3glz6detail10emit_bytesILb1ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextENS_7contextEA6_cEEbRT1_RT0_RmRKT2_ENKUlvE_clEv:
  102|   376k|         const sv s = [&] {
  103|   376k|            if constexpr (std::is_bounded_array_v<T>) {
  104|   376k|               return sv{x, std::extent_v<T> - 1}; // a string literal, without its terminator
  105|       |            }
  106|       |            else {
  107|       |               return sv{x};
  108|       |            }
  109|   376k|         }();

_ZN3glz12minify_jsoncITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEETkNS_9resizableENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES8_EENS_9error_ctxERT0_RT1_:
  300|  8.90k|   {
  301|  8.90k|      context ctx{};
  302|  8.90k|      const auto n = detail::minify_json<opt_true<Opts, &opts::comments>>(ctx, in, out);
  303|  8.90k|      return {n, ctx.error, ctx.custom_error_message};
  304|  8.90k|   }
_ZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEETkNS_13output_bufferESA_TkNS_10is_contextERNS_7contextEQaa10contiguousIT0_E9resizableISD_EEEmOT2_OSD_OT1_:
  230|  8.90k|      {
  231|  8.90k|         if (in.size() == 0) {
  ------------------
  |  Branch (231:14): [True: 0, False: 8.90k]
  ------------------
  232|      0|            return 0;
  233|      0|         }
  234|       |
  235|  8.90k|         if constexpr (resizable<Out>) {
  236|       |            // Minifying only ever removes bytes, so this is room enough for whatever comes out.
  237|       |            // A bounded output is checked per write instead; see the scan above for why.
  238|  8.90k|            out.resize(in.size() + 2 * padding_bytes);
  239|  8.90k|         }
  240|  8.90k|         size_t ix = 0;
  241|  8.90k|         auto [it, end] = read_iterators<Opts>(in);
  242|  8.90k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (242:14): [True: 0, False: 8.90k]
  ------------------
  243|      0|            return 0;
  244|      0|         }
  245|       |
  246|       |         // The input is no longer grown and shrunk around this: everything the scan below reads
  247|       |         // through -- read_json_string, read_json_number, skip_matching_ws -- bounds its own loads
  248|       |         // against `end`, so there is nothing left for the padding to protect.
  249|  8.90k|         if constexpr (self_terminating<In>) {
  250|  8.90k|            minify_json<opt_true<Opts, &opts::null_terminated>>(ctx, it, end, out, ix);
  251|       |         }
  252|       |         else {
  253|       |            minify_json<opt_false<Opts, &opts::null_terminated>>(ctx, it, end, out, ix);
  254|       |         }
  255|       |
  256|  8.90k|         if constexpr (resizable<Out>) {
  257|  8.90k|            out.resize(ix);
  258|  8.90k|         }
  259|  8.90k|         return ix;
  260|  8.90k|      }
_ZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_:
   18|  8.90k|      {
   19|  8.90k|         using enum json_type;
   20|       |
   21|       |         // Every write below goes through this, and the dump it makes is unchecked: the caller's
   22|       |         // one-shot sizing covers a resizable destination, because minifying only ever removes
   23|       |         // bytes, so the input's length is room enough.
   24|       |         //
   25|       |         // A bounded destination cannot be grown, and asking it for the input's length up front
   26|       |         // refuses a buffer that fits the result -- sizing the output to the minified length is the
   27|       |         // obvious thing to do, and `{ "a" : 1 }` into a 7 byte buffer has to work. So each write
   28|       |         // asks for exactly what it stores instead; see emit_bytes for where that count comes from.
   29|       |         // None of it survives for a resizable destination, which keeps the unchecked dumps and
   30|       |         // nothing more.
   31|  8.90k|         const auto put = [&](const auto& x) { return emit_bytes<false>(ctx, b, ix, x); };
   32|       |
   33|  8.90k|         auto ws_start = it;
   34|  8.90k|         uint64_t ws_size{};
   35|       |
   36|  8.90k|         auto skip_expected_whitespace = [&] {
   37|  8.90k|            auto new_ws_start = it;
   38|  8.90k|            if (ws_size && std::ptrdiff_t(ws_size) < end - it) [[likely]] {
   39|  8.90k|               skip_matching_ws(ws_start, it, ws_size);
   40|  8.90k|            }
   41|       |
   42|  8.90k|            if constexpr (Opts.null_terminated) {
   43|  8.90k|               while (whitespace_table[uint8_t(*it)]) {
   44|  8.90k|                  ++it;
   45|  8.90k|               }
   46|  8.90k|            }
   47|  8.90k|            else {
   48|  8.90k|               while ((it < end) && whitespace_table[uint8_t(*it)]) {
   49|  8.90k|                  ++it;
   50|  8.90k|               }
   51|  8.90k|            }
   52|  8.90k|            ws_start = new_ws_start;
   53|  8.90k|            ws_size = size_t(it - new_ws_start);
   54|  8.90k|         };
   55|       |
   56|  8.90k|         auto skip_whitespace = [&] {
   57|  8.90k|            if constexpr (Opts.null_terminated) {
   58|  8.90k|               while (whitespace_table[uint8_t(*it)]) {
   59|  8.90k|                  ++it;
   60|  8.90k|               }
   61|  8.90k|            }
   62|  8.90k|            else {
   63|  8.90k|               while ((it < end) && whitespace_table[uint8_t(*it)]) {
   64|  8.90k|                  ++it;
   65|  8.90k|               }
   66|  8.90k|            }
   67|  8.90k|         };
   68|       |
   69|  8.90k|         skip_whitespace();
   70|       |
   71|  12.7M|         while ([&]() -> bool {
  ------------------
  |  Branch (71:17): [True: 12.7M, Folded]
  ------------------
   72|  12.7M|            if constexpr (Opts.null_terminated) {
   73|  12.7M|               return true;
   74|  12.7M|            }
   75|  12.7M|            else {
   76|  12.7M|               return it < end;
   77|  12.7M|            }
   78|  12.7M|         }()) {
   79|  12.7M|            switch (json_types[uint8_t(*it)]) {
   80|  1.40M|            case String: {
  ------------------
  |  Branch (80:13): [True: 1.40M, False: 11.3M]
  ------------------
   81|  1.40M|               const auto value = read_json_string(ctx, it, end);
   82|  1.40M|               if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (82:20): [True: 0, False: 1.40M]
  ------------------
   83|      0|                  return;
   84|      0|               }
   85|       |               // non-empty: the scanner reports an empty view as an error
   86|  1.40M|               if (not put(value)) [[unlikely]] {
  ------------------
  |  Branch (86:20): [True: 0, False: 1.40M]
  ------------------
   87|      0|                  return;
   88|      0|               }
   89|  1.40M|               skip_whitespace();
   90|  1.40M|               break;
   91|  1.40M|            }
   92|  3.73M|            case Comma: {
  ------------------
  |  Branch (92:13): [True: 3.73M, False: 9.01M]
  ------------------
   93|  3.73M|               if (not put(',')) [[unlikely]] {
  ------------------
  |  Branch (93:20): [True: 0, False: 3.73M]
  ------------------
   94|      0|                  return;
   95|      0|               }
   96|  3.73M|               ++it;
   97|  3.73M|               skip_expected_whitespace();
   98|  3.73M|               break;
   99|  3.73M|            }
  100|  1.01M|            case Number: {
  ------------------
  |  Branch (100:13): [True: 1.01M, False: 11.7M]
  ------------------
  101|  1.01M|               const auto value = read_json_number<Opts.null_terminated>(it, end);
  102|       |               // non-empty: a Number match is one valid character
  103|  1.01M|               if (not put(value)) [[unlikely]] {
  ------------------
  |  Branch (103:20): [True: 0, False: 1.01M]
  ------------------
  104|      0|                  return;
  105|      0|               }
  106|  1.01M|               skip_whitespace();
  107|  1.01M|               break;
  108|  1.01M|            }
  109|  1.10M|            case Colon: {
  ------------------
  |  Branch (109:13): [True: 1.10M, False: 11.6M]
  ------------------
  110|  1.10M|               if (not put(':')) [[unlikely]] {
  ------------------
  |  Branch (110:20): [True: 0, False: 1.10M]
  ------------------
  111|      0|                  return;
  112|      0|               }
  113|  1.10M|               ++it;
  114|  1.10M|               skip_whitespace();
  115|  1.10M|               break;
  116|  1.10M|            }
  117|   551k|            case Array_Start: {
  ------------------
  |  Branch (117:13): [True: 551k, False: 12.2M]
  ------------------
  118|   551k|               if (not put('[')) [[unlikely]] {
  ------------------
  |  Branch (118:20): [True: 0, False: 551k]
  ------------------
  119|      0|                  return;
  120|      0|               }
  121|   551k|               ++it;
  122|   551k|               skip_expected_whitespace();
  123|   551k|               break;
  124|   551k|            }
  125|   551k|            case Array_End: {
  ------------------
  |  Branch (125:13): [True: 551k, False: 12.2M]
  ------------------
  126|   551k|               if (not put(']')) [[unlikely]] {
  ------------------
  |  Branch (126:20): [True: 0, False: 551k]
  ------------------
  127|      0|                  return;
  128|      0|               }
  129|   551k|               ++it;
  130|   551k|               skip_whitespace();
  131|   551k|               break;
  132|   551k|            }
  133|  67.2k|            case Null: {
  ------------------
  |  Branch (133:13): [True: 67.2k, False: 12.6M]
  ------------------
  134|       |               // The type table matched on the first byte alone; see match_literal for why writing
  135|       |               // the literal from the writer's own spelling needs the rest of it checked. Stepping
  136|       |               // over it unchecked also puts `it` past `end`, and from there the loop goes on
  137|       |               // minifying whatever follows the document into an output sized for the document.
  138|  67.2k|               if (not match_literal<"null">(ctx, it, end)) [[unlikely]] {
  ------------------
  |  Branch (138:20): [True: 0, False: 67.2k]
  ------------------
  139|      0|                  return;
  140|      0|               }
  141|  67.2k|               if (not put("null")) [[unlikely]] {
  ------------------
  |  Branch (141:20): [True: 0, False: 67.2k]
  ------------------
  142|      0|                  return;
  143|      0|               }
  144|  67.2k|               skip_whitespace();
  145|  67.2k|               break;
  146|  67.2k|            }
  147|   457k|            case Bool: {
  ------------------
  |  Branch (147:13): [True: 457k, False: 12.3M]
  ------------------
  148|   457k|               if (*it == 't') {
  ------------------
  |  Branch (148:20): [True: 81.0k, False: 376k]
  ------------------
  149|  81.0k|                  if (not match_literal<"true">(ctx, it, end)) [[unlikely]] {
  ------------------
  |  Branch (149:23): [True: 0, False: 81.0k]
  ------------------
  150|      0|                     return;
  151|      0|                  }
  152|  81.0k|                  if (not put("true")) [[unlikely]] {
  ------------------
  |  Branch (152:23): [True: 0, False: 81.0k]
  ------------------
  153|      0|                     return;
  154|      0|                  }
  155|  81.0k|                  skip_whitespace();
  156|  81.0k|                  break;
  157|  81.0k|               }
  158|   376k|               else {
  159|   376k|                  if (not match_literal<"false">(ctx, it, end)) [[unlikely]] {
  ------------------
  |  Branch (159:23): [True: 0, False: 376k]
  ------------------
  160|      0|                     return;
  161|      0|                  }
  162|   376k|                  if (not put("false")) [[unlikely]] {
  ------------------
  |  Branch (162:23): [True: 0, False: 376k]
  ------------------
  163|      0|                     return;
  164|      0|                  }
  165|   376k|                  skip_whitespace();
  166|   376k|                  break;
  167|   376k|               }
  168|   457k|            }
  169|  1.65M|            case Object_Start: {
  ------------------
  |  Branch (169:13): [True: 1.65M, False: 11.1M]
  ------------------
  170|  1.65M|               if (not put('{')) [[unlikely]] {
  ------------------
  |  Branch (170:20): [True: 0, False: 1.65M]
  ------------------
  171|      0|                  return;
  172|      0|               }
  173|  1.65M|               ++it;
  174|  1.65M|               skip_expected_whitespace();
  175|  1.65M|               break;
  176|  1.65M|            }
  177|  1.65M|            case Object_End: {
  ------------------
  |  Branch (177:13): [True: 1.65M, False: 11.1M]
  ------------------
  178|  1.65M|               if (not put('}')) [[unlikely]] {
  ------------------
  |  Branch (178:20): [True: 0, False: 1.65M]
  ------------------
  179|      0|                  return;
  180|      0|               }
  181|  1.65M|               ++it;
  182|  1.65M|               skip_whitespace();
  183|  1.65M|               break;
  184|  1.65M|            }
  185|   557k|            case Comment: {
  ------------------
  |  Branch (185:13): [True: 557k, False: 12.2M]
  ------------------
  186|   557k|               if constexpr (Opts.comments) {
  187|   557k|                  const auto comment = read_jsonc_comment(ctx, it, end);
  188|   557k|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (188:23): [True: 0, False: 557k]
  ------------------
  189|      0|                     return;
  190|      0|                  }
  191|       |                  // A line comment is dropped rather than written out. Minifying is what removes
  192|       |                  // the newline that ends it, and a line comment with no line break behind it
  193|       |                  // comments out the whole rest of the output.
  194|   557k|                  if (not comment.line) {
  ------------------
  |  Branch (194:23): [True: 8.46k, False: 549k]
  ------------------
  195|       |                     // non-empty: an empty view comes with an error
  196|  8.46k|                     if (not put(comment.text)) [[unlikely]] {
  ------------------
  |  Branch (196:26): [True: 0, False: 8.46k]
  ------------------
  197|      0|                        return;
  198|      0|                     }
  199|  8.46k|                  }
  200|   557k|                  skip_whitespace();
  201|   557k|                  break;
  202|       |               }
  203|       |               else {
  204|       |                  [[fallthrough]];
  205|       |               }
  206|   557k|            }
  207|   566k|            [[unlikely]] default: {
  ------------------
  |  Branch (207:26): [True: 8.90k, False: 12.7M]
  ------------------
  208|       |               // A null terminated run carries no bound in its loop condition, so it ends here, on
  209|       |               // the terminator, which is not a JSON token. Reaching it is the end of the document
  210|       |               // rather than an error -- unclassified is how the type table reports both, and
  211|       |               // without this the minifier left syntax_error behind on every input it was ever
  212|       |               // given, valid or not, which is what made its error not worth returning.
  213|   566k|               if constexpr (Opts.null_terminated) {
  214|   566k|                  if (it >= end) {
  ------------------
  |  Branch (214:23): [True: 8.90k, False: 557k]
  ------------------
  215|  8.90k|                     return;
  216|  8.90k|                  }
  217|   566k|               }
  218|   557k|               ctx.error = error_code::syntax_error;
  219|   566k|               return;
  220|   557k|            }
  221|  12.7M|            }
  222|  12.7M|         }
  223|  8.90k|      }
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlvE0_clEv:
   56|  6.81M|         auto skip_whitespace = [&] {
   57|  6.81M|            if constexpr (Opts.null_terminated) {
   58|  10.1M|               while (whitespace_table[uint8_t(*it)]) {
  ------------------
  |  Branch (58:23): [True: 3.30M, False: 6.81M]
  ------------------
   59|  3.30M|                  ++it;
   60|  3.30M|               }
   61|       |            }
   62|       |            else {
   63|       |               while ((it < end) && whitespace_table[uint8_t(*it)]) {
   64|       |                  ++it;
   65|       |               }
   66|       |            }
   67|  6.81M|         };
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlvE1_clEv:
   71|  12.7M|         while ([&]() -> bool {
   72|  12.7M|            if constexpr (Opts.null_terminated) {
   73|  12.7M|               return true;
   74|       |            }
   75|       |            else {
   76|       |               return it < end;
   77|       |            }
   78|  12.7M|         }()) {
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clINS8_17basic_string_viewIcSB_EEEEDaSS_:
   31|  2.42M|         const auto put = [&](const auto& x) { return emit_bytes<false>(ctx, b, ix, x); };
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clIcEEDaSS_:
   31|  9.25M|         const auto put = [&](const auto& x) { return emit_bytes<false>(ctx, b, ix, x); };
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlvE_clEv:
   36|  5.94M|         auto skip_expected_whitespace = [&] {
   37|  5.94M|            auto new_ws_start = it;
   38|  5.94M|            if (ws_size && std::ptrdiff_t(ws_size) < end - it) [[likely]] {
  ------------------
  |  Branch (38:17): [True: 2.15M, False: 3.79M]
  |  Branch (38:28): [True: 2.15M, False: 258]
  ------------------
   39|  2.15M|               skip_matching_ws(ws_start, it, ws_size);
   40|  2.15M|            }
   41|       |
   42|  5.94M|            if constexpr (Opts.null_terminated) {
   43|  14.6M|               while (whitespace_table[uint8_t(*it)]) {
  ------------------
  |  Branch (43:23): [True: 8.68M, False: 5.94M]
  ------------------
   44|  8.68M|                  ++it;
   45|  8.68M|               }
   46|       |            }
   47|       |            else {
   48|       |               while ((it < end) && whitespace_table[uint8_t(*it)]) {
   49|       |                  ++it;
   50|       |               }
   51|       |            }
   52|  5.94M|            ws_start = new_ws_start;
   53|  5.94M|            ws_size = size_t(it - new_ws_start);
   54|  5.94M|         };
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clIA5_cEEDaSS_:
   31|   148k|         const auto put = [&](const auto& x) { return emit_bytes<false>(ctx, b, ix, x); };
_ZZN3glz6detail11minify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clIA6_cEEDaSS_:
   31|   376k|         const auto put = [&](const auto& x) { return emit_bytes<false>(ctx, b, ix, x); };

_ZN3glz14prettify_jsoncITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES8_EENS_9error_ctxERKT0_RT1_:
  362|  8.90k|   {
  363|  8.90k|      context ctx{};
  364|  8.90k|      const auto n = detail::prettify_json<opt_true<Opts, &opts::comments>>(ctx, in, out);
  365|  8.90k|      return {n, ctx.error, ctx.custom_error_message};
  366|  8.90k|   }
_ZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10contiguousERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEETkNS_13output_bufferERS9_TkNS_10is_contextERNS_7contextEEEmOT2_OT0_OT1_:
  294|  8.90k|      {
  295|  8.90k|         if constexpr (resizable<Out>) {
  296|  8.90k|            if (in.size() == 0) {
  ------------------
  |  Branch (296:17): [True: 0, False: 8.90k]
  ------------------
  297|      0|               out.resize(0); // resize is what `resizable` promises; clear() is not
  298|      0|               return 0;
  299|      0|            }
  300|  8.90k|            out.resize(in.size() * 2);
  301|  8.90k|         }
  302|      0|         size_t ix = 0;
  303|  8.90k|         auto [it, end] = read_iterators<Opts>(in);
  304|  8.90k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (304:14): [True: 0, False: 8.90k]
  ------------------
  305|      0|            return 0;
  306|      0|         }
  307|       |
  308|  8.90k|         if constexpr (self_terminating<In>) {
  309|  8.90k|            prettify_json<opt_true<Opts, &opts::null_terminated>>(ctx, it, end, out, ix);
  310|       |         }
  311|       |         else {
  312|       |            prettify_json<opt_false<Opts, &opts::null_terminated>>(ctx, it, end, out, ix);
  313|       |         }
  314|       |
  315|  8.90k|         if constexpr (resizable<Out>) {
  316|  8.90k|            out.resize(ix);
  317|  8.90k|         }
  318|  8.90k|         return ix;
  319|  8.90k|      }
_ZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_:
   17|  8.90k|      {
   18|  8.90k|         constexpr bool use_tabs = check_indentation_char(Opts) == '\t';
   19|  8.90k|         constexpr auto indent_width = check_indentation_width(Opts);
   20|       |
   21|  8.90k|         using enum json_type;
   22|       |
   23|       |         // Indexed by nesting level, with level 0 the top. Sized for the depth the readers accept (see
   24|       |         // enter_depth), so that every document glz::validate_jsonc passes can be prettified.
   25|  8.90k|         std::array<json_type, max_recursive_depth_limit + 1> state{};
   26|  8.90k|         int64_t indent{};
   27|       |
   28|       |         // Enters one level of nesting, failing past the readers' limit.
   29|  8.90k|         const auto open_level = [&](const json_type type) {
   30|  8.90k|            if (size_t(indent) >= max_recursive_depth_limit) [[unlikely]] {
   31|  8.90k|               ctx.error = error_code::exceeded_max_recursive_depth;
   32|  8.90k|               return false;
   33|  8.90k|            }
   34|  8.90k|            state[++indent] = type;
   35|  8.90k|            return true;
   36|  8.90k|         };
   37|       |
   38|       |         // Set while the output cursor sits on a line that a `//` comment has commented out. Only
   39|       |         // the comment-enabled path can set it, so the plain JSON writer keeps the code it had.
   40|  8.90k|         [[maybe_unused]] bool line_comment_open = false;
   41|       |
   42|       |         // Every line break the writer emits goes through this, because a break is also what ends a
   43|       |         // line comment: doing it in one place is what keeps the two from doubling up. The newline
   44|       |         // and the indentation behind it are also what make the output unbounded -- there is no
   45|       |         // bound on prettified output that a single reservation up front could use -- so this is
   46|       |         // the write a bounded destination is likeliest to run out on.
   47|  8.90k|         const auto new_line = [&] {
   48|  8.90k|            if constexpr (has_bounded_capacity<decltype(b)>) {
   49|  8.90k|               const size_t n = use_tabs ? size_t(indent) : size_t(indent) * indent_width;
   50|  8.90k|               if (not ensure_space(ctx, b, ix + 1 + n)) [[unlikely]] {
   51|  8.90k|                  return false;
   52|  8.90k|               }
   53|  8.90k|            }
   54|  8.90k|            append_new_line<use_tabs, indent_width>(b, ix, indent);
   55|  8.90k|            if constexpr (Opts.comments) {
   56|  8.90k|               line_comment_open = false;
   57|  8.90k|            }
   58|  8.90k|            return true;
   59|  8.90k|         };
   60|       |
   61|       |         // Every write below goes through this, which is what fixes their order in one place: an
   62|       |         // open line comment is closed first, because anything written into one is commented out,
   63|       |         // and emit_bytes then takes the reservation from the argument rather than from a byte
   64|       |         // count spelled out beside the write.
   65|       |         //
   66|       |         // Deferring that break to the next write rather than emitting it with the comment is what
   67|       |         // keeps a comment at the end of the input from leaving a trailing newline behind, and lets
   68|       |         // a break the writer was going to emit anyway serve as this one.
   69|       |         //
   70|       |         // A break that fails is reported rather than swallowed: on a bounded destination that ran
   71|       |         // out, carrying on would leave `line_comment_open` set and put this write *inside* the
   72|       |         // comment, which is not a truncated document but a wrong one.
   73|  8.90k|         const auto put = [&](const auto& x) {
   74|  8.90k|            if constexpr (Opts.comments) {
   75|  8.90k|               if (line_comment_open) [[unlikely]] {
   76|  8.90k|                  if (not new_line()) [[unlikely]] {
   77|  8.90k|                     return false;
   78|  8.90k|                  }
   79|  8.90k|               }
   80|  8.90k|            }
   81|  8.90k|            return emit_bytes<true>(ctx, b, ix, x);
   82|  8.90k|         };
   83|       |
   84|  24.8M|         while (it < end) {
  ------------------
  |  Branch (84:17): [True: 24.8M, False: 8.90k]
  ------------------
   85|  24.8M|            switch (json_types[uint8_t(*it)]) {
   86|  1.40M|            case String: {
  ------------------
  |  Branch (86:13): [True: 1.40M, False: 23.4M]
  ------------------
   87|  1.40M|               const auto value = read_json_string(ctx, it, end);
   88|  1.40M|               if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (88:20): [True: 0, False: 1.40M]
  ------------------
   89|      0|                  return;
   90|      0|               }
   91|       |               // non-empty: the scanner reports an empty view as an error
   92|  1.40M|               if (not put(value)) [[unlikely]] {
  ------------------
  |  Branch (92:20): [True: 0, False: 1.40M]
  ------------------
   93|      0|                  return;
   94|      0|               }
   95|  1.40M|               break;
   96|  1.40M|            }
   97|  3.73M|            case Comma: {
  ------------------
  |  Branch (97:13): [True: 3.73M, False: 21.1M]
  ------------------
   98|  3.73M|               if (not put(',')) [[unlikely]] {
  ------------------
  |  Branch (98:20): [True: 0, False: 3.73M]
  ------------------
   99|      0|                  return;
  100|      0|               }
  101|  3.73M|               ++it;
  102|  3.73M|               if constexpr (check_new_lines_in_arrays(Opts)) {
  103|  3.73M|                  if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (103:23): [True: 0, False: 3.73M]
  ------------------
  104|      0|                     return;
  105|      0|                  }
  106|       |               }
  107|       |               else {
  108|       |                  if (state[indent] == Object_Start) {
  109|       |                     if (not new_line()) [[unlikely]] {
  110|       |                        return;
  111|       |                     }
  112|       |                  }
  113|       |                  else if (not put(use_tabs ? '\t' : ' ')) [[unlikely]] {
  114|       |                     return;
  115|       |                  }
  116|       |               }
  117|  3.73M|               break;
  118|  3.73M|            }
  119|  3.73M|            case Number: {
  ------------------
  |  Branch (119:13): [True: 1.01M, False: 23.8M]
  ------------------
  120|  1.01M|               const auto value = read_json_number<Opts.null_terminated>(it, end);
  121|       |               // non-empty: a Number match is one valid character
  122|  1.01M|               if (not put(value)) [[unlikely]] {
  ------------------
  |  Branch (122:20): [True: 0, False: 1.01M]
  ------------------
  123|      0|                  return;
  124|      0|               }
  125|  1.01M|               break;
  126|  1.01M|            }
  127|  1.10M|            case Colon: {
  ------------------
  |  Branch (127:13): [True: 1.10M, False: 23.7M]
  ------------------
  128|  1.10M|               static constexpr sv colon = use_tabs ? sv{":\t"} : sv{": "};
  ------------------
  |  Branch (128:44): [Folded, False: 1.10M]
  ------------------
  129|  1.10M|               if (not put(colon)) [[unlikely]] {
  ------------------
  |  Branch (129:20): [True: 0, False: 1.10M]
  ------------------
  130|      0|                  return;
  131|      0|               }
  132|  1.10M|               ++it;
  133|  1.10M|               break;
  134|  1.10M|            }
  135|   551k|            case Array_Start: {
  ------------------
  |  Branch (135:13): [True: 551k, False: 24.3M]
  ------------------
  136|   551k|               if (not put('[')) [[unlikely]] {
  ------------------
  |  Branch (136:20): [True: 0, False: 551k]
  ------------------
  137|      0|                  return;
  138|      0|               }
  139|   551k|               ++it;
  140|   551k|               if (not open_level(Array_Start)) [[unlikely]] {
  ------------------
  |  Branch (140:20): [True: 0, False: 551k]
  ------------------
  141|      0|                  return;
  142|      0|               }
  143|   551k|               if constexpr (check_new_lines_in_arrays(Opts)) {
  144|       |                  if constexpr (not Opts.null_terminated) {
  145|       |                     if (it != end && *it != ']') {
  146|       |                        if (not new_line()) [[unlikely]] {
  147|       |                           return;
  148|       |                        }
  149|       |                     }
  150|       |                  }
  151|   551k|                  else {
  152|   551k|                     if (*it != ']') {
  ------------------
  |  Branch (152:26): [True: 275k, False: 275k]
  ------------------
  153|   275k|                        if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (153:29): [True: 0, False: 275k]
  ------------------
  154|      0|                           return;
  155|      0|                        }
  156|   275k|                     }
  157|   551k|                  }
  158|   551k|               }
  159|   551k|               break;
  160|   551k|            }
  161|   551k|            case Array_End: {
  ------------------
  |  Branch (161:13): [True: 551k, False: 24.3M]
  ------------------
  162|   551k|               --indent;
  163|   551k|               if (indent < 0) {
  ------------------
  |  Branch (163:20): [True: 0, False: 551k]
  ------------------
  164|      0|                  ctx.error = error_code::syntax_error;
  165|      0|                  return;
  166|      0|               }
  167|       |               // This break is the one the bracket wanted anyway, and it closes an open line
  168|       |               // comment on its way, leaving the put below nothing to close.
  169|   551k|               if constexpr (check_new_lines_in_arrays(Opts)) {
  170|   551k|                  if (it[-1] != '[') {
  ------------------
  |  Branch (170:23): [True: 275k, False: 275k]
  ------------------
  171|   275k|                     if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (171:26): [True: 0, False: 275k]
  ------------------
  172|      0|                        return;
  173|      0|                     }
  174|   275k|                  }
  175|   551k|               }
  176|   551k|               if (not put(']')) [[unlikely]] {
  ------------------
  |  Branch (176:20): [True: 0, False: 551k]
  ------------------
  177|      0|                  return;
  178|      0|               }
  179|   551k|               ++it;
  180|   551k|               break;
  181|   551k|            }
  182|  67.2k|            case Null: {
  ------------------
  |  Branch (182:13): [True: 67.2k, False: 24.8M]
  ------------------
  183|       |               // The type table matched on the first byte alone; see match_literal for why writing
  184|       |               // the literal from the writer's own spelling needs the rest of it checked.
  185|  67.2k|               if (not match_literal<"null">(ctx, it, end)) [[unlikely]] {
  ------------------
  |  Branch (185:20): [True: 0, False: 67.2k]
  ------------------
  186|      0|                  return;
  187|      0|               }
  188|  67.2k|               if (not put("null")) [[unlikely]] {
  ------------------
  |  Branch (188:20): [True: 0, False: 67.2k]
  ------------------
  189|      0|                  return;
  190|      0|               }
  191|  67.2k|               break;
  192|  67.2k|            }
  193|   457k|            case Bool: {
  ------------------
  |  Branch (193:13): [True: 457k, False: 24.4M]
  ------------------
  194|   457k|               if (*it == 't') {
  ------------------
  |  Branch (194:20): [True: 81.0k, False: 376k]
  ------------------
  195|  81.0k|                  if (not match_literal<"true">(ctx, it, end)) [[unlikely]] {
  ------------------
  |  Branch (195:23): [True: 0, False: 81.0k]
  ------------------
  196|      0|                     return;
  197|      0|                  }
  198|  81.0k|                  if (not put("true")) [[unlikely]] {
  ------------------
  |  Branch (198:23): [True: 0, False: 81.0k]
  ------------------
  199|      0|                     return;
  200|      0|                  }
  201|  81.0k|                  break;
  202|  81.0k|               }
  203|   376k|               else {
  204|   376k|                  if (not match_literal<"false">(ctx, it, end)) [[unlikely]] {
  ------------------
  |  Branch (204:23): [True: 0, False: 376k]
  ------------------
  205|      0|                     return;
  206|      0|                  }
  207|   376k|                  if (not put("false")) [[unlikely]] {
  ------------------
  |  Branch (207:23): [True: 0, False: 376k]
  ------------------
  208|      0|                     return;
  209|      0|                  }
  210|   376k|                  break;
  211|   376k|               }
  212|   457k|            }
  213|  1.65M|            case Object_Start: {
  ------------------
  |  Branch (213:13): [True: 1.65M, False: 23.2M]
  ------------------
  214|  1.65M|               if (not put('{')) [[unlikely]] {
  ------------------
  |  Branch (214:20): [True: 0, False: 1.65M]
  ------------------
  215|      0|                  return;
  216|      0|               }
  217|  1.65M|               ++it;
  218|  1.65M|               if (not open_level(Object_Start)) [[unlikely]] {
  ------------------
  |  Branch (218:20): [True: 0, False: 1.65M]
  ------------------
  219|      0|                  return;
  220|      0|               }
  221|       |               if constexpr (not Opts.null_terminated) {
  222|       |                  if (it != end && *it != '}') {
  223|       |                     if (not new_line()) [[unlikely]] {
  224|       |                        return;
  225|       |                     }
  226|       |                  }
  227|       |               }
  228|  1.65M|               else {
  229|  1.65M|                  if (*it != '}') {
  ------------------
  |  Branch (229:23): [True: 220k, False: 1.43M]
  ------------------
  230|   220k|                     if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (230:26): [True: 0, False: 220k]
  ------------------
  231|      0|                        return;
  232|      0|                     }
  233|   220k|                  }
  234|  1.65M|               }
  235|  1.65M|               break;
  236|  1.65M|            }
  237|  1.65M|            case Object_End: {
  ------------------
  |  Branch (237:13): [True: 1.65M, False: 23.2M]
  ------------------
  238|  1.65M|               --indent;
  239|  1.65M|               if (indent < 0) {
  ------------------
  |  Branch (239:20): [True: 0, False: 1.65M]
  ------------------
  240|      0|                  ctx.error = error_code::syntax_error;
  241|      0|                  return;
  242|      0|               }
  243|       |               // As in Array_End, this break doubles as the close of an open line comment.
  244|  1.65M|               if (it[-1] != '{') {
  ------------------
  |  Branch (244:20): [True: 220k, False: 1.43M]
  ------------------
  245|   220k|                  if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (245:23): [True: 0, False: 220k]
  ------------------
  246|      0|                     return;
  247|      0|                  }
  248|   220k|               }
  249|  1.65M|               if (not put('}')) [[unlikely]] {
  ------------------
  |  Branch (249:20): [True: 0, False: 1.65M]
  ------------------
  250|      0|                  return;
  251|      0|               }
  252|  1.65M|               ++it;
  253|  1.65M|               break;
  254|  1.65M|            }
  255|   557k|            case Comment: {
  ------------------
  |  Branch (255:13): [True: 557k, False: 24.3M]
  ------------------
  256|   557k|               if constexpr (Opts.comments) {
  257|   557k|                  const auto comment = read_jsonc_comment(ctx, it, end);
  258|   557k|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (258:23): [True: 0, False: 557k]
  ------------------
  259|      0|                     return;
  260|      0|                  }
  261|       |                  // non-empty: an empty view comes with an error
  262|   557k|                  if (not put(comment.text)) [[unlikely]] {
  ------------------
  |  Branch (262:23): [True: 0, False: 557k]
  ------------------
  263|      0|                     return;
  264|      0|                  }
  265|   557k|                  line_comment_open = comment.line;
  266|   557k|                  break;
  267|       |               }
  268|       |               else {
  269|       |                  // A '/' opens a comment, and plain JSON has none. Skipping it as though it were
  270|       |                  // whitespace silently rewrote the document: "{\"a\":1} // tail" came out as
  271|       |                  // "{...}true", the 't' of "tail" taken for a literal. minify_json has always
  272|       |                  // reported this, and the two had no business disagreeing.
  273|       |                  ctx.error = error_code::syntax_error;
  274|       |                  return;
  275|       |               }
  276|   557k|            }
  277|  12.6M|            case Whitespace: {
  ------------------
  |  Branch (277:13): [True: 12.1M, False: 12.7M]
  ------------------
  278|       |               // Skip whitespace characters that are part of raw JSON content
  279|  12.6M|               ++it;
  280|  12.6M|               break;
  281|   557k|            }
  282|      0|            [[unlikely]] default: {
  ------------------
  |  Branch (282:26): [True: 0, False: 24.8M]
  ------------------
  283|      0|               ctx.error = error_code::syntax_error;
  284|      0|               return;
  285|      0|            }
  286|  24.8M|            }
  287|  24.8M|         }
  288|  8.90k|      }
_ZZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clINS8_17basic_string_viewIcSB_EEEEDaSS_:
   73|  4.08M|         const auto put = [&](const auto& x) {
   74|  4.08M|            if constexpr (Opts.comments) {
   75|  4.08M|               if (line_comment_open) [[unlikely]] {
  ------------------
  |  Branch (75:20): [True: 70.5k, False: 4.01M]
  ------------------
   76|  70.5k|                  if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (76:23): [True: 0, False: 70.5k]
  ------------------
   77|      0|                     return false;
   78|      0|                  }
   79|  70.5k|               }
   80|  4.08M|            }
   81|  4.08M|            return emit_bytes<true>(ctx, b, ix, x);
   82|  4.08M|         };
_ZZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clIcEEDaSS_:
   73|  8.14M|         const auto put = [&](const auto& x) {
   74|  8.14M|            if constexpr (Opts.comments) {
   75|  8.14M|               if (line_comment_open) [[unlikely]] {
  ------------------
  |  Branch (75:20): [True: 365k, False: 7.77M]
  ------------------
   76|   365k|                  if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (76:23): [True: 0, False: 365k]
  ------------------
   77|      0|                     return false;
   78|      0|                  }
   79|   365k|               }
   80|  8.14M|            }
   81|  8.14M|            return emit_bytes<true>(ctx, b, ix, x);
   82|  8.14M|         };
_ZZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlvE_clEv:
   47|  5.27M|         const auto new_line = [&] {
   48|       |            if constexpr (has_bounded_capacity<decltype(b)>) {
   49|       |               const size_t n = use_tabs ? size_t(indent) : size_t(indent) * indent_width;
   50|       |               if (not ensure_space(ctx, b, ix + 1 + n)) [[unlikely]] {
   51|       |                  return false;
   52|       |               }
   53|       |            }
   54|  5.27M|            append_new_line<use_tabs, indent_width>(b, ix, indent);
   55|  5.27M|            if constexpr (Opts.comments) {
   56|  5.27M|               line_comment_open = false;
   57|  5.27M|            }
   58|  5.27M|            return true;
   59|  5.27M|         };
_ZZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlNS0_9json_typeEE_clESQ_:
   29|  2.20M|         const auto open_level = [&](const json_type type) {
   30|  2.20M|            if (size_t(indent) >= max_recursive_depth_limit) [[unlikely]] {
  ------------------
  |  Branch (30:17): [True: 0, False: 2.20M]
  ------------------
   31|      0|               ctx.error = error_code::exceeded_max_recursive_depth;
   32|      0|               return false;
   33|      0|            }
   34|  2.20M|            state[++indent] = type;
   35|  2.20M|            return true;
   36|  2.20M|         };
_ZZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clIA5_cEEDaSS_:
   73|   148k|         const auto put = [&](const auto& x) {
   74|   148k|            if constexpr (Opts.comments) {
   75|   148k|               if (line_comment_open) [[unlikely]] {
  ------------------
  |  Branch (75:20): [True: 65.5k, False: 82.7k]
  ------------------
   76|  65.5k|                  if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (76:23): [True: 0, False: 65.5k]
  ------------------
   77|      0|                     return false;
   78|      0|                  }
   79|  65.5k|               }
   80|   148k|            }
   81|   148k|            return emit_bytes<true>(ctx, b, ix, x);
   82|   148k|         };
_ZZN3glz6detail13prettify_jsonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS7_RNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEmEEvOT0_OT1_OT2_OT3_RT4_ENKUlRKT_E_clIA6_cEEDaSS_:
   73|   376k|         const auto put = [&](const auto& x) {
   74|   376k|            if constexpr (Opts.comments) {
   75|   376k|               if (line_comment_open) [[unlikely]] {
  ------------------
  |  Branch (75:20): [True: 44.6k, False: 331k]
  ------------------
   76|  44.6k|                  if (not new_line()) [[unlikely]] {
  ------------------
  |  Branch (76:23): [True: 0, False: 44.6k]
  ------------------
   77|      0|                     return false;
   78|      0|                  }
   79|  44.6k|               }
   80|   376k|            }
   81|   376k|            return emit_bytes<true>(ctx, b, ix, x);
   82|   376k|         };

_ZN3glz10read_jsoncITkNS_14read_supportedIL_ZNS_4JSONEEEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_9is_bufferERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS_9error_ctxERT_OT0_:
 5097|  17.8k|   {
 5098|  17.8k|      context ctx{};
 5099|  17.8k|      return read<opts{.comments = true}>(value, std::forward<Buffer>(buffer), ctx);
 5100|  17.8k|   }
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_7contextERPKcSC_EEvOT0_OT1_OT2_T3_:
   49|  27.7k|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  27.7k|         else {
   60|  27.7k|            using V = std::remove_cvref_t<T>;
   61|  27.7k|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  27.7k|                                             end);
   63|  27.7k|         }
   64|  27.7k|      }
_ZN3glz4fromILj10ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERS4_TkNS_10is_contextERNS_7contextERPKcSC_EEvOT0_OT1_OT2_T3_:
  150|  27.7k|      {
  151|  27.7k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  152|  27.7k|         from<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  153|  27.7k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  154|  27.7k|      }
_ZN3glz4fromILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSP_EEvOT0_OT1_OT2_T3_:
 3860|  27.7k|      {
 3861|       |         if constexpr (tagging == variant_tagging_kind::adjacent) {
 3862|       |            read_adjacent<Options>(value, ctx, it, end);
 3863|       |         }
 3864|  27.7k|         else {
 3865|  27.7k|            read_deduced<Options>(value, ctx, it, end);
 3866|  27.7k|         }
 3867|  27.7k|      }
_ZN3glz4fromILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE12read_deducedITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSP_EEvOT0_OT1_OT2_T3_:
 3871|  27.7k|      {
 3872|  27.7k|         constexpr auto Opts = ws_handled_off<Options>();
 3873|  27.7k|         if constexpr (variant_is_auto_deducible<T>()) {
 3874|  27.7k|            if constexpr (not check_ws_handled(Options)) {
 3875|  27.7k|               if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3875:20): [True: 0, False: 27.7k]
  ------------------
 3876|      0|                  return;
 3877|      0|               }
 3878|  27.7k|            }
 3879|       |
 3880|  27.7k|            switch (*it) {
 3881|      0|            case '\0':
  ------------------
  |  Branch (3881:13): [True: 0, False: 27.7k]
  ------------------
 3882|      0|               ctx.error = error_code::unexpected_end;
 3883|      0|               return;
 3884|  12.0k|            case '{': {
  ------------------
  |  Branch (3884:13): [True: 12.0k, False: 15.7k]
  ------------------
 3885|       |               // This branch consumes the brace itself and hands the object to a reader with
 3886|       |               // `opening_handled`, which therefore does not count the level -- but does release it at
 3887|       |               // the closing brace. So the level is taken here, in both buffer modes, and paid back by
 3888|       |               // the reader below.
 3889|  12.0k|               if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (3889:20): [True: 0, False: 12.0k]
  ------------------
 3890|      0|                  return;
 3891|      0|               }
 3892|       |
 3893|  12.0k|               ++it;
 3894|       |               if constexpr (not Opts.null_terminated) {
 3895|       |                  if (it == end) [[unlikely]] {
 3896|       |                     ctx.error = error_code::unexpected_end;
 3897|       |                     return;
 3898|       |                  }
 3899|       |               }
 3900|  12.0k|               using type_counts = variant_type_count<T>;
 3901|  12.0k|               constexpr auto n_object_candidates = variant_object_candidate_count_v<Opts, T>;
 3902|       |               if constexpr (n_object_candidates < 1) {
 3903|       |                  ctx.error = error_code::no_matching_variant_type;
 3904|       |                  return;
 3905|       |               }
 3906|  12.0k|               else if constexpr (n_object_candidates == 1 && tag_v<T>.empty()) {
 3907|  12.0k|                  constexpr auto first_idx = variant_first_object_candidate_v<Opts, T>;
 3908|  12.0k|                  using V = std::variant_alternative_t<first_idx, T>;
 3909|  12.0k|                  if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (3909:23): [True: 12.0k, False: 0]
  ------------------
 3910|  12.0k|                  parse<JSON>::op<opening_handled<Opts>()>(std::get<V>(value), ctx, it, end);
 3911|  12.0k|                  return;
 3912|       |               }
 3913|       |               else {
 3914|       |                  auto possible_types = bit_array<std::variant_size_v<T>>{}.flip();
 3915|       |                  static constexpr auto& deduction_bits = variant_deduction_bits<T>;
 3916|       |                  static constexpr size_t deduction_key_count = variant_deduction_key_count<T>;
 3917|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<T>.size()>(tag_v<T>);
 3918|       |
 3919|       |                  // Track if we've encountered a tag and what value it had
 3920|       |                  std::optional<size_t> tag_specified_index{};
 3921|       |
 3922|       |                  if (skip_ws<Opts>(ctx, it, end)) {
 3923|       |                     return;
 3924|       |                  }
 3925|       |                  // Once the reader knows which alternative this object holds it may have to read
 3926|       |                  // it again from here. Anchor the position rather than keep the pointer: the scan
 3927|       |                  // below skips values, and a streaming skip refills, which moves the window out
 3928|       |                  // from under a raw pointer (see rewind_anchor).
 3929|       |                  auto start = make_rewind_anchor(ctx, it);
 3930|       |                  bool first_key = true;
 3931|       |                  // Parse bifurcation for tagged variants:
 3932|       |                  //
 3933|       |                  // Without this optimization, tagged variant parsing always uses two passes:
 3934|       |                  //   1. Scan all keys to find the tag (e.g. "type"), skipping values
 3935|       |                  //   2. Reset `it = start` and re-parse the entire object into the resolved type
 3936|       |                  //
 3937|       |                  // When the tag is the first key, the second pass redundantly re-reads every
 3938|       |                  // field that follows it. This lambda avoids that: if the tag was the first key,
 3939|       |                  // it advances past the trailing comma so the object parser picks up at the
 3940|       |                  // second field. If the tag was found later, it falls back to the full re-parse.
 3941|       |                  //
 3942|       |                  // One exception: if the tag name is also a field on the resolved struct
 3943|       |                  // (contains_tag), we must re-parse regardless so the value is stored in
 3944|       |                  // the struct field. This override is applied inside each std::visit lambda.
 3945|       |                  //
 3946|       |                  // Either way the rewind can fail under a streaming read: the window only holds so
 3947|       |                  // much, and an object wider than it has no start left to return to.
 3948|       |                  auto position_after_tag = [&] {
 3949|       |                     if (first_key) {
 3950|       |                        if (*it == ',') ++it; // skip comma; handles tag-only objects where *it == '}'
 3951|       |                        return true;
 3952|       |                     }
 3953|       |                     return start.rewind(ctx, it, end); // tag came later, re-parse from the beginning
 3954|       |                  };
 3955|       |                  // `first_key` also answers "were we reset to the object start", which is what
 3956|       |                  // position_after_tag does for every key but the first.
 3957|       |                  for (; *it != '}'; first_key = false) {
 3958|       |                     if (!first_key) {
 3959|       |                        if (match_invalid_end<',', Opts>(ctx, it, end)) {
 3960|       |                           return;
 3961|       |                        }
 3962|       |                     }
 3963|       |
 3964|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 3965|       |                        return;
 3966|       |                     }
 3967|       |                     if (match_invalid_end<'"', Opts>(ctx, it, end)) {
 3968|       |                        return;
 3969|       |                     }
 3970|       |
 3971|       |                     auto* key_start = it;
 3972|       |                     skip_string_view(ctx, it, end);
 3973|       |                     if (bool(ctx.error)) [[unlikely]]
 3974|       |                        return;
 3975|       |                     if (validate_utf8_span<Opts>(ctx, key_start, it)) [[unlikely]]
 3976|       |                        return;
 3977|       |                     const sv key = {key_start, size_t(it - key_start)};
 3978|       |
 3979|       |                     if (match_invalid_end<'"', Opts>(ctx, it, end)) {
 3980|       |                        return;
 3981|       |                     }
 3982|       |
 3983|       |                     if constexpr (deduction_key_count > 0) {
 3984|       |                        // We first check if a tag is defined and see if the key matches the tag
 3985|       |                        if constexpr (not tag_v<T>.empty()) {
 3986|       |                           if (key == tag_v<T>) {
 3987|       |                              if (parse_ws_colon<Opts>(ctx, it, end)) {
 3988|       |                                 return;
 3989|       |                              }
 3990|       |
 3991|       |                              using id_type = std::decay_t<decltype(ids_v<T>[0])>;
 3992|       |
 3993|       |                              std::conditional_t<std::integral<id_type>, id_type, sv> type_id{};
 3994|       |                              if constexpr (std::integral<id_type>) {
 3995|       |                                 from<JSON, id_type>::template op<ws_handled<Opts>()>(type_id, ctx, it, end);
 3996|       |                              }
 3997|       |                              else {
 3998|       |                                 // The id is turned into an index below and never leaves this
 3999|       |                                 // reader, so the view of the window it borrows cannot outlive it.
 4000|       |                                 parse_transient_string_view<ws_handled<Opts>()>(type_id, ctx, it, end);
 4001|       |                              }
 4002|       |                              if (bool(ctx.error)) [[unlikely]]
 4003|       |                                 return;
 4004|       |                              if (skip_ws<Opts>(ctx, it, end)) {
 4005|       |                                 return;
 4006|       |                              }
 4007|       |                              if (!(*it == ',' || *it == '}')) [[unlikely]] {
 4008|       |                                 ctx.error = error_code::syntax_error;
 4009|       |                                 return;
 4010|       |                              }
 4011|       |
 4012|       |                              size_t type_index;
 4013|       |                              if constexpr (std::integral<id_type>) {
 4014|       |                                 type_index = variant_id_to_index<T>::op(type_id);
 4015|       |                              }
 4016|       |                              else {
 4017|       |                                 type_index = variant_id_to_index<T>::op(
 4018|       |                                    type_id.data(), type_id.data() + type_id.size(), type_id.size());
 4019|       |                              }
 4020|       |                              if (type_index < ids_v<T>.size()) [[likely]] {
 4021|       |                                 // Check if the deduced types include the tag-specified type
 4022|       |                                 // If not, the tag doesn't match the fields
 4023|       |                                 // We're already inside if constexpr (deduction_registry.size()), so we know deduction
 4024|       |                                 // is happening. At this point, possible_types has been narrowed by field deduction.
 4025|       |                                 // Check if the tag-specified type is still possible
 4026|       |                                 const bool type_is_possible = possible_types[type_index];
 4027|       |                                 if (!type_is_possible) {
 4028|       |                                    // Tag specifies a type that doesn't match the fields seen so far
 4029|       |                                    ctx.error = error_code::no_matching_variant_type;
 4030|       |                                    return;
 4031|       |                                 }
 4032|       |
 4033|       |                                 if (!position_after_tag()) return;
 4034|       |                                 tag_specified_index = type_index; // Store the tag-specified type
 4035|       |                                 if (value.index() != type_index) emplace_runtime_variant(value, type_index);
 4036|       |                                 std::visit(
 4037|       |                                    [&](auto&& v) {
 4038|       |                                       using V = std::decay_t<decltype(v)>;
 4039|       |                                       constexpr bool is_object =
 4040|       |                                          (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4041|       |                                       if constexpr (variant_unit_alternative<V>) {
 4042|       |                                          // A unit alternative carries no data; its object holds only the
 4043|       |                                          // discriminator. Consume that body through an empty reflected object so
 4044|       |                                          // unknown-key policy and terminator handling match every other alternative.
 4045|       |                                          detail::variant_unit_body unit_body{};
 4046|       |                                          from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4047|       |                                                                                             tag_literal>(unit_body,
 4048|       |                                                                                                          ctx, it, end);
 4049|       |                                       }
 4050|       |                                       else if constexpr (is_object) {
 4051|       |                                          if constexpr (contains_tag<V, tag_literal>()) {
 4052|       |                                             // tag is a struct field, must re-parse
 4053|       |                                             if (!start.rewind(ctx, it, end)) return;
 4054|       |                                          }
 4055|       |                                          from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it,
 4056|       |                                                                                                           end);
 4057|       |                                       }
 4058|       |                                       else if constexpr (is_memory_object<V>) {
 4059|       |                                          if (!v) {
 4060|       |                                             if constexpr (is_specialization_v<V, std::optional>) {
 4061|       |                                                if constexpr (requires { v.emplace(); }) {
 4062|       |                                                   v.emplace();
 4063|       |                                                }
 4064|       |                                                else {
 4065|       |                                                   v = typename V::value_type{};
 4066|       |                                                }
 4067|       |                                             }
 4068|       |                                             else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4069|       |                                                v = std::make_unique<typename V::element_type>();
 4070|       |                                             else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4071|       |                                                v = std::make_shared<typename V::element_type>();
 4072|       |                                             else if constexpr (constructible<V>) {
 4073|       |                                                v = meta_construct_v<V>();
 4074|       |                                             }
 4075|       |                                             else if constexpr (std::is_pointer_v<V> &&
 4076|       |                                                                can_allocate_raw_pointer<Opts,
 4077|       |                                                                                         std::decay_t<decltype(ctx)>>) {
 4078|       |                                                if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4079|       |                                                   return;
 4080|       |                                                }
 4081|       |                                             }
 4082|       |                                             else {
 4083|       |                                                ctx.error = error_code::invalid_nullable_read;
 4084|       |                                                return;
 4085|       |                                                // Cannot read into unset nullable that is not std::optional,
 4086|       |                                                // std::unique_ptr, or std::shared_ptr
 4087|       |                                             }
 4088|       |                                          }
 4089|       |                                          if constexpr (contains_tag<memory_type<V>, tag_literal>()) {
 4090|       |                                             // tag is a struct field, must re-parse
 4091|       |                                             if (!start.rewind(ctx, it, end)) return;
 4092|       |                                          }
 4093|       |                                          from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(
 4094|       |                                             *v, ctx, it, end);
 4095|       |                                       }
 4096|       |                                       else if constexpr (custom_read<V>) {
 4097|       |                                          // Custom handlers parse the remaining body themselves and do not
 4098|       |                                          // accept the tag template parameter; the tag was already consumed.
 4099|       |                                          // This only works when the tag was the first key. If it came later,
 4100|       |                                          // we were reset to the object start and the custom handler would
 4101|       |                                          // absorb the tag, so error rather than corrupt the value.
 4102|       |                                          if (!first_key) {
 4103|       |                                             ctx.error = error_code::feature_not_supported;
 4104|       |                                             ctx.custom_error_message =
 4105|       |                                                "the tag must be the first key for a custom variant alternative";
 4106|       |                                             return;
 4107|       |                                          }
 4108|       |                                          from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4109|       |                                       }
 4110|       |                                    },
 4111|       |                                    value);
 4112|       |
 4113|       |                                 return; // we've decoded our target type
 4114|       |                              }
 4115|       |                              else [[unlikely]] {
 4116|       |                                 // Check if we have a default type (ids array shorter than variant)
 4117|       |                                 constexpr auto ids_size = ids_v<T>.size();
 4118|       |                                 constexpr auto variant_size = std::variant_size_v<T>;
 4119|       |                                 if constexpr (ids_size < variant_size) {
 4120|       |                                    // Use the first unlabeled type as the default
 4121|       |                                    const auto default_type_index = ids_size;
 4122|       |
 4123|       |                                    if (!position_after_tag()) return;
 4124|       |                                    tag_specified_index = default_type_index; // Store the default type index
 4125|       |                                    if (value.index() != default_type_index)
 4126|       |                                       emplace_runtime_variant(value, default_type_index);
 4127|       |                                    std::visit(
 4128|       |                                       [&](auto&& v) {
 4129|       |                                          using V = std::decay_t<decltype(v)>;
 4130|       |                                          constexpr bool is_object =
 4131|       |                                             (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4132|       |                                          if constexpr (variant_unit_alternative<V>) {
 4133|       |                                             // A unit alternative carries no data; its object holds only the
 4134|       |                                             // discriminator. Consume that body through an empty reflected object so
 4135|       |                                             // unknown-key policy and terminator handling match every other
 4136|       |                                             // alternative.
 4137|       |                                             detail::variant_unit_body unit_body{};
 4138|       |                                             from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4139|       |                                                                                                tag_literal>(
 4140|       |                                                unit_body, ctx, it, end);
 4141|       |                                          }
 4142|       |                                          else if constexpr (is_object) {
 4143|       |                                             if constexpr (contains_tag<V, tag_literal>()) {
 4144|       |                                                // tag is a struct field, must re-parse
 4145|       |                                                if (!start.rewind(ctx, it, end)) return;
 4146|       |                                             }
 4147|       |                                             from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4148|       |                                          }
 4149|       |                                          else if constexpr (is_memory_object<V>) {
 4150|       |                                             if (!v) {
 4151|       |                                                if constexpr (is_specialization_v<V, std::optional>) {
 4152|       |                                                   if constexpr (requires { v.emplace(); }) {
 4153|       |                                                      v.emplace();
 4154|       |                                                   }
 4155|       |                                                   else {
 4156|       |                                                      v = typename V::value_type{};
 4157|       |                                                   }
 4158|       |                                                }
 4159|       |                                                else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4160|       |                                                   v = std::make_unique<typename V::element_type>();
 4161|       |                                                else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4162|       |                                                   v = std::make_shared<typename V::element_type>();
 4163|       |                                                else if constexpr (constructible<V>) {
 4164|       |                                                   v = meta_construct_v<V>();
 4165|       |                                                }
 4166|       |                                                else if constexpr (std::is_pointer_v<V> &&
 4167|       |                                                                   can_allocate_raw_pointer<
 4168|       |                                                                      Opts, std::decay_t<decltype(ctx)>>) {
 4169|       |                                                   if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4170|       |                                                      return;
 4171|       |                                                   }
 4172|       |                                                }
 4173|       |                                                else {
 4174|       |                                                   ctx.error = error_code::invalid_nullable_read;
 4175|       |                                                   return;
 4176|       |                                                }
 4177|       |                                             }
 4178|       |                                             if constexpr (contains_tag<memory_type<V>, tag_literal>()) {
 4179|       |                                                // tag is a struct field, must re-parse
 4180|       |                                                if (!start.rewind(ctx, it, end)) return;
 4181|       |                                             }
 4182|       |                                             from<JSON, memory_type<V>>::template op<opening_handled<Opts>()>(*v, ctx,
 4183|       |                                                                                                              it, end);
 4184|       |                                          }
 4185|       |                                          else if constexpr (custom_read<V>) {
 4186|       |                                             // Custom handlers parse the remaining body themselves; this only
 4187|       |                                             // works when the tag was the first key (see above). If it came
 4188|       |                                             // later we were reset to the object start, so error rather than
 4189|       |                                             // let the custom handler absorb the tag.
 4190|       |                                             if (!first_key) {
 4191|       |                                                ctx.error = error_code::feature_not_supported;
 4192|       |                                                ctx.custom_error_message =
 4193|       |                                                   "the tag must be the first key for a custom variant alternative";
 4194|       |                                                return;
 4195|       |                                             }
 4196|       |                                             from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4197|       |                                          }
 4198|       |                                       },
 4199|       |                                       value);
 4200|       |
 4201|       |                                    return;
 4202|       |                                 }
 4203|       |                                 else {
 4204|       |                                    ctx.error = error_code::no_matching_variant_type;
 4205|       |                                    ctx.custom_error_message = variant_ids_string_v<T>;
 4206|       |                                    return;
 4207|       |                                 }
 4208|       |                              }
 4209|       |                           }
 4210|       |                        }
 4211|       |
 4212|       |                        // Inline decode_hash lookup for variant deduction
 4213|       |                        using deduction_keys_t = keys_wrapper<variant_deduction_keys<T>>;
 4214|       |                        constexpr auto& DeductionHashInfo = hash_info<deduction_keys_t>;
 4215|       |                        const auto deduction_index =
 4216|       |                           decode_hash_with_size<JSON, deduction_keys_t, DeductionHashInfo, DeductionHashInfo.type>::op(
 4217|       |                              key.data(), key.data() + key.size(), key.size());
 4218|       |                        if (deduction_index < deduction_key_count && variant_deduction_keys<T>[deduction_index] == key)
 4219|       |                           [[likely]] {
 4220|       |                           possible_types &= deduction_bits[deduction_index];
 4221|       |                        }
 4222|       |                        else if constexpr (Opts.error_on_unknown_keys) {
 4223|       |                           ctx.error = error_code::unknown_key;
 4224|       |                           return;
 4225|       |                        }
 4226|       |                     }
 4227|       |                     else if constexpr (not tag_v<T>.empty()) {
 4228|       |                        // empty object case for variant, if there are no normal elements
 4229|       |                        if (key == tag_v<T>) {
 4230|       |                           if (parse_ws_colon<Opts>(ctx, it, end)) {
 4231|       |                              return;
 4232|       |                           }
 4233|       |
 4234|       |                           // The id is turned into an index below and never leaves this reader,
 4235|       |                           // so the view of the window it borrows cannot outlive that window.
 4236|       |                           std::string_view type_id{};
 4237|       |                           parse_transient_string_view<ws_handled<Opts>()>(type_id, ctx, it, end);
 4238|       |                           if (bool(ctx.error)) [[unlikely]]
 4239|       |                              return;
 4240|       |                           if (skip_ws<Opts>(ctx, it, end)) {
 4241|       |                              return;
 4242|       |                           }
 4243|       |
 4244|       |                           const auto type_index = variant_id_to_index<T>::op(
 4245|       |                              type_id.data(), type_id.data() + type_id.size(), type_id.size());
 4246|       |                           if (type_index < ids_v<T>.size()) [[likely]] {
 4247|       |                              if (!position_after_tag()) return;
 4248|       |                              tag_specified_index = type_index; // Store the tag-specified type
 4249|       |                              if (value.index() != type_index) emplace_runtime_variant(value, type_index);
 4250|       |                           }
 4251|       |                           else {
 4252|       |                              // Check if we have a default type (ids array shorter than variant)
 4253|       |                              constexpr auto ids_size = ids_v<T>.size();
 4254|       |                              constexpr auto variant_size = std::variant_size_v<T>;
 4255|       |                              if constexpr (ids_size < variant_size) {
 4256|       |                                 // Use the first unlabeled type as the default
 4257|       |                                 if (!position_after_tag()) return;
 4258|       |                                 const auto default_index = ids_size;
 4259|       |                                 tag_specified_index = default_index; // Store the default type index
 4260|       |                                 if (value.index() != default_index) emplace_runtime_variant(value, default_index);
 4261|       |                              }
 4262|       |                              else {
 4263|       |                                 ctx.error = error_code::no_matching_variant_type;
 4264|       |                                 ctx.custom_error_message = variant_ids_string_v<T>;
 4265|       |                                 return;
 4266|       |                              }
 4267|       |                           }
 4268|       |                           // Parse the type (handles tag skipping and unknown keys)
 4269|       |                           std::visit(
 4270|       |                              [&](auto&& v) {
 4271|       |                                 using V = std::decay_t<decltype(v)>;
 4272|       |                                 if constexpr (custom_read<V>) {
 4273|       |                                    // Custom handlers parse the remaining object body themselves and do not
 4274|       |                                    // accept the tag template parameter that reflected objects use to skip an
 4275|       |                                    // interior tag key. That only works when the tag is the first key (it was
 4276|       |                                    // just consumed). If the tag came after other keys, position_after_tag()
 4277|       |                                    // reset us to the object start and the custom handler would absorb the tag
 4278|       |                                    // into its value, so error here rather than corrupt the result.
 4279|       |                                    if (!first_key) {
 4280|       |                                       ctx.error = error_code::feature_not_supported;
 4281|       |                                       ctx.custom_error_message =
 4282|       |                                          "the tag must be the first key for a custom variant alternative";
 4283|       |                                       return;
 4284|       |                                    }
 4285|       |                                    from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4286|       |                                 }
 4287|       |                                 else {
 4288|       |                                    if constexpr (contains_tag<V, tag_literal>()) {
 4289|       |                                       // tag is a struct field, must re-parse
 4290|       |                                       if (!start.rewind(ctx, it, end)) return;
 4291|       |                                    }
 4292|       |                                    from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4293|       |                                 }
 4294|       |                              },
 4295|       |                              value);
 4296|       |                           return;
 4297|       |                        }
 4298|       |                        else if constexpr (Opts.error_on_unknown_keys) {
 4299|       |                           ctx.error = error_code::unknown_key;
 4300|       |                           return;
 4301|       |                        }
 4302|       |                        else {
 4303|       |                           // Skip unknown key's value (non-tag key in empty variant)
 4304|       |                           if (parse_ws_colon<Opts>(ctx, it, end)) {
 4305|       |                              return;
 4306|       |                           }
 4307|       |                           skip_value<JSON>::op<Opts>(ctx, it, end);
 4308|       |                           if (bool(ctx.error)) [[unlikely]]
 4309|       |                              return;
 4310|       |                           resync_window_end(ctx, end); // a streaming skip refills
 4311|       |                           if (skip_ws<Opts>(ctx, it, end)) {
 4312|       |                              return;
 4313|       |                           }
 4314|       |                           continue; // Continue loop to find the tag
 4315|       |                        }
 4316|       |                     }
 4317|       |                     else if constexpr (Opts.error_on_unknown_keys) {
 4318|       |                        ctx.error = error_code::unknown_key;
 4319|       |                        return;
 4320|       |                     }
 4321|       |
 4322|       |                     auto matching_types = possible_types.popcount();
 4323|       |                     if (matching_types == 0) {
 4324|       |                        ctx.error = error_code::no_matching_variant_type;
 4325|       |                        return;
 4326|       |                     }
 4327|       |                     // Only short-circuit for variants without tags
 4328|       |                     else if constexpr (tag_v<T>.empty()) {
 4329|       |                        if (matching_types == 1) {
 4330|       |                           if (!start.rewind(ctx, it, end)) return;
 4331|       |                           const auto type_index = possible_types.countr_zero();
 4332|       |
 4333|       |                           if (value.index() != static_cast<size_t>(type_index))
 4334|       |                              emplace_runtime_variant(value, type_index);
 4335|       |                           std::visit(
 4336|       |                              [&](auto&& v) {
 4337|       |                                 using V = std::decay_t<decltype(v)>;
 4338|       |                                 constexpr bool is_object = (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4339|       |                                 if constexpr (variant_unit_alternative<V>) {
 4340|       |                                    // A unit alternative carries no data; its object holds only the discriminator.
 4341|       |                                    // Consume that body through an empty reflected object so unknown-key policy and
 4342|       |                                    // terminator handling match every other alternative.
 4343|       |                                    detail::variant_unit_body unit_body{};
 4344|       |                                    from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4345|       |                                                                                       tag_literal>(unit_body, ctx, it,
 4346|       |                                                                                                    end);
 4347|       |                                 }
 4348|       |                                 else if constexpr (is_object) {
 4349|       |                                    from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4350|       |                                 }
 4351|       |                                 else if constexpr (is_memory_object<V>) {
 4352|       |                                    if (!v) {
 4353|       |                                       if constexpr (is_specialization_v<V, std::optional>) {
 4354|       |                                          if constexpr (requires { v.emplace(); }) {
 4355|       |                                             v.emplace();
 4356|       |                                          }
 4357|       |                                          else {
 4358|       |                                             v = typename V::value_type{};
 4359|       |                                          }
 4360|       |                                       }
 4361|       |                                       else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4362|       |                                          v = std::make_unique<typename V::element_type>();
 4363|       |                                       else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4364|       |                                          v = std::make_shared<typename V::element_type>();
 4365|       |                                       else if constexpr (constructible<V>) {
 4366|       |                                          v = meta_construct_v<V>();
 4367|       |                                       }
 4368|       |                                       else if constexpr (std::is_pointer_v<V> &&
 4369|       |                                                          can_allocate_raw_pointer<Opts, std::decay_t<decltype(ctx)>>) {
 4370|       |                                          if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4371|       |                                             return;
 4372|       |                                          }
 4373|       |                                       }
 4374|       |                                       else {
 4375|       |                                          ctx.error = error_code::invalid_nullable_read;
 4376|       |                                          return;
 4377|       |                                          // Cannot read into unset nullable that is not std::optional,
 4378|       |                                          // std::unique_ptr, or std::shared_ptr
 4379|       |                                       }
 4380|       |                                    }
 4381|       |                                    from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(
 4382|       |                                       *v, ctx, it, end);
 4383|       |                                 }
 4384|       |                                 else if constexpr (custom_read<V>) {
 4385|       |                                    // Custom handlers parse the remaining body themselves.
 4386|       |                                    from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4387|       |                                 }
 4388|       |                              },
 4389|       |                              value);
 4390|       |
 4391|       |                           return; // we've decoded our target type
 4392|       |                        }
 4393|       |                     }
 4394|       |                     // For tagged variants, continue processing to validate tags
 4395|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 4396|       |                        return;
 4397|       |                     }
 4398|       |
 4399|       |                     skip_value<JSON>::op<Opts>(ctx, it, end);
 4400|       |                     if (bool(ctx.error)) [[unlikely]]
 4401|       |                        return;
 4402|       |                     resync_window_end(ctx, end); // a streaming skip refills
 4403|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 4404|       |                        return;
 4405|       |                     }
 4406|       |                  }
 4407|       |                  // Only apply ambiguous variant resolution if we have multiple object types
 4408|       |                  if constexpr ((type_counts::n_object + type_counts::n_nullable_object) > 1) {
 4409|       |                     // After parsing all keys, check if we have multiple matching types
 4410|       |                     // If so, choose the one with the fewest fields
 4411|       |                     auto final_matching = possible_types.popcount();
 4412|       |                     if (final_matching == 0) {
 4413|       |                        ctx.error = error_code::no_matching_variant_type;
 4414|       |                     }
 4415|       |                     else if (final_matching == 1) {
 4416|       |                        // Single type remains after field deduction
 4417|       |                        const auto type_index = possible_types.countr_zero();
 4418|       |
 4419|       |                        // Validate against tag if one was specified
 4420|       |                        if (tag_specified_index.has_value() &&
 4421|       |                            tag_specified_index.value() != static_cast<size_t>(type_index)) {
 4422|       |                           ctx.error = error_code::no_matching_variant_type;
 4423|       |                           return;
 4424|       |                        }
 4425|       |
 4426|       |                        if (!start.rewind(ctx, it, end)) return;
 4427|       |                        if (value.index() != static_cast<size_t>(type_index))
 4428|       |                           emplace_runtime_variant(value, type_index);
 4429|       |                        std::visit(
 4430|       |                           [&](auto&& v) {
 4431|       |                              using V = std::decay_t<decltype(v)>;
 4432|       |                              constexpr bool is_object = (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4433|       |                              if constexpr (variant_unit_alternative<V>) {
 4434|       |                                 // A unit alternative carries no data; its object holds only the discriminator.
 4435|       |                                 // Consume that body through an empty reflected object so unknown-key policy and
 4436|       |                                 // terminator handling match every other alternative.
 4437|       |                                 detail::variant_unit_body unit_body{};
 4438|       |                                 from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4439|       |                                                                                    tag_literal>(unit_body, ctx, it,
 4440|       |                                                                                                 end);
 4441|       |                              }
 4442|       |                              else if constexpr (is_object) {
 4443|       |                                 from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4444|       |                              }
 4445|       |                              else if constexpr (is_memory_object<V>) {
 4446|       |                                 if (!v) {
 4447|       |                                    if constexpr (is_specialization_v<V, std::optional>) {
 4448|       |                                       if constexpr (requires { v.emplace(); }) {
 4449|       |                                          v.emplace();
 4450|       |                                       }
 4451|       |                                       else {
 4452|       |                                          v = typename V::value_type{};
 4453|       |                                       }
 4454|       |                                    }
 4455|       |                                    else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4456|       |                                       v = std::make_unique<typename V::element_type>();
 4457|       |                                    else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4458|       |                                       v = std::make_shared<typename V::element_type>();
 4459|       |                                    else if constexpr (constructible<V>) {
 4460|       |                                       v = meta_construct_v<V>();
 4461|       |                                    }
 4462|       |                                    else if constexpr (std::is_pointer_v<V> &&
 4463|       |                                                       can_allocate_raw_pointer<Opts, std::decay_t<decltype(ctx)>>) {
 4464|       |                                       if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4465|       |                                          return;
 4466|       |                                       }
 4467|       |                                    }
 4468|       |                                    else {
 4469|       |                                       ctx.error = error_code::invalid_nullable_read;
 4470|       |                                       return;
 4471|       |                                    }
 4472|       |                                 }
 4473|       |                                 from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(*v, ctx,
 4474|       |                                                                                                               it, end);
 4475|       |                              }
 4476|       |                              else if constexpr (custom_read<V>) {
 4477|       |                                 // Custom handlers parse the remaining body themselves.
 4478|       |                                 from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4479|       |                              }
 4480|       |                           },
 4481|       |                           value);
 4482|       |                     }
 4483|       |                     else if (final_matching > 1) {
 4484|       |                        constexpr auto N = std::variant_size_v<T>;
 4485|       |
 4486|       |                        // Compile-time array of field counts for each variant type
 4487|       |                        constexpr auto field_counts = []<size_t... I>(std::index_sequence<I...>) {
 4488|       |                           return std::array<size_t, N> {
 4489|       |                              ([]<size_t J = I>() -> size_t {
 4490|       |                                 using V = std::decay_t<std::variant_alternative_t<J, T>>;
 4491|       |                                 if constexpr (glaze_object_t<V> || reflectable<V>) {
 4492|       |                                    return reflect<V>::size;
 4493|       |                                 }
 4494|       |                                 else if constexpr (is_memory_object<V>) {
 4495|       |                                    using X = memory_type<V>;
 4496|       |                                    if constexpr (glaze_object_t<X> || reflectable<X>) {
 4497|       |                                       return reflect<X>::size;
 4498|       |                                    }
 4499|       |                                    else {
 4500|       |                                       return (std::numeric_limits<size_t>::max)();
 4501|       |                                    }
 4502|       |                                 }
 4503|       |                                 else {
 4504|       |                                    return (std::numeric_limits<size_t>::max)();
 4505|       |                                 }
 4506|       |                              }.template operator()<I>())...
 4507|       |                           };
 4508|       |                        }(std::make_index_sequence<N>{});
 4509|       |
 4510|       |                        // Find the type with minimum field count among the possible types
 4511|       |                        size_t min_fields = (std::numeric_limits<size_t>::max)();
 4512|       |                        size_t chosen_index = N; // Invalid index initially
 4513|       |
 4514|       |                        for (size_t i = 0; i < N; ++i) {
 4515|       |                           if (possible_types[i] && field_counts[i] < min_fields) {
 4516|       |                              min_fields = field_counts[i];
 4517|       |                              chosen_index = i;
 4518|       |                           }
 4519|       |                        }
 4520|       |
 4521|       |                        if (chosen_index < N) {
 4522|       |                           // Validate against tag if one was specified
 4523|       |                           if (tag_specified_index.has_value() && tag_specified_index.value() != chosen_index) {
 4524|       |                              ctx.error = error_code::no_matching_variant_type;
 4525|       |                              return;
 4526|       |                           }
 4527|       |
 4528|       |                           if (!start.rewind(ctx, it, end)) return;
 4529|       |                           if (value.index() != chosen_index) emplace_runtime_variant(value, chosen_index);
 4530|       |                           std::visit(
 4531|       |                              [&](auto&& v) {
 4532|       |                                 using V = std::decay_t<decltype(v)>;
 4533|       |                                 constexpr bool is_object = (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4534|       |                                 if constexpr (variant_unit_alternative<V>) {
 4535|       |                                    // A unit alternative carries no data; its object holds only the discriminator.
 4536|       |                                    // Consume that body through an empty reflected object so unknown-key policy and
 4537|       |                                    // terminator handling match every other alternative.
 4538|       |                                    detail::variant_unit_body unit_body{};
 4539|       |                                    from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4540|       |                                                                                       tag_literal>(unit_body, ctx, it,
 4541|       |                                                                                                    end);
 4542|       |                                 }
 4543|       |                                 else if constexpr (is_object) {
 4544|       |                                    from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4545|       |                                 }
 4546|       |                                 else if constexpr (is_memory_object<V>) {
 4547|       |                                    if (!v) {
 4548|       |                                       if constexpr (is_specialization_v<V, std::optional>) {
 4549|       |                                          if constexpr (requires { v.emplace(); }) {
 4550|       |                                             v.emplace();
 4551|       |                                          }
 4552|       |                                          else {
 4553|       |                                             v = typename V::value_type{};
 4554|       |                                          }
 4555|       |                                       }
 4556|       |                                       else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4557|       |                                          v = std::make_unique<typename V::element_type>();
 4558|       |                                       else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4559|       |                                          v = std::make_shared<typename V::element_type>();
 4560|       |                                       else if constexpr (constructible<V>) {
 4561|       |                                          v = meta_construct_v<V>();
 4562|       |                                       }
 4563|       |                                       else if constexpr (std::is_pointer_v<V> &&
 4564|       |                                                          can_allocate_raw_pointer<Opts, std::decay_t<decltype(ctx)>>) {
 4565|       |                                          if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4566|       |                                             return;
 4567|       |                                          }
 4568|       |                                       }
 4569|       |                                       else {
 4570|       |                                          ctx.error = error_code::invalid_nullable_read;
 4571|       |                                          return;
 4572|       |                                       }
 4573|       |                                    }
 4574|       |                                    from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(
 4575|       |                                       *v, ctx, it, end);
 4576|       |                                 }
 4577|       |                                 else if constexpr (custom_read<V>) {
 4578|       |                                    // Custom handlers parse the remaining body themselves.
 4579|       |                                    from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4580|       |                                 }
 4581|       |                              },
 4582|       |                              value);
 4583|       |                        }
 4584|       |                        else {
 4585|       |                           ctx.error = error_code::no_matching_variant_type;
 4586|       |                        }
 4587|       |                     }
 4588|       |                  }
 4589|       |                  else {
 4590|       |                     // For variants with 0 or 1 object types, use the original error handling
 4591|       |                     ctx.error = error_code::no_matching_variant_type;
 4592|       |                  }
 4593|       |               }
 4594|      0|               break;
 4595|  12.0k|            }
 4596|  7.20k|            case '[':
  ------------------
  |  Branch (4596:13): [True: 7.20k, False: 20.5k]
  ------------------
 4597|       |               // As with '{' above: the array reader each alternative goes through counts the level.
 4598|  7.20k|               process_variant_alternatives<T, is_variant_array>::template op<Opts>(value, ctx, it, end);
 4599|  7.20k|               break;
 4600|  1.60k|            case '"': {
  ------------------
  |  Branch (4600:13): [True: 1.60k, False: 26.1k]
  ------------------
 4601|  1.60k|               process_variant_alternatives<T, is_variant_str>::template op<Opts>(value, ctx, it, end);
 4602|  1.60k|               break;
 4603|  12.0k|            }
 4604|     51|            case 't':
  ------------------
  |  Branch (4604:13): [True: 51, False: 27.7k]
  ------------------
 4605|     87|            case 'f': {
  ------------------
  |  Branch (4605:13): [True: 36, False: 27.7k]
  ------------------
 4606|     87|               process_variant_alternatives<T, is_variant_bool>::template op<Opts>(value, ctx, it, end);
 4607|     87|               break;
 4608|     51|            }
 4609|     33|            case 'n':
  ------------------
  |  Branch (4609:13): [True: 33, False: 27.7k]
  ------------------
 4610|       |               if constexpr (variant_count_v<T, is_variant_null> == 0) {
 4611|       |                  ctx.error = error_code::no_matching_variant_type;
 4612|       |               }
 4613|     33|               else {
 4614|     33|                  constexpr auto first_idx = variant_first_index_v<T, is_variant_null>;
 4615|     33|                  using V = std::variant_alternative_t<first_idx, T>;
 4616|     33|                  if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (4616:23): [True: 0, False: 33]
  ------------------
 4617|     33|                  match<"null", Opts>(ctx, it, end);
 4618|     33|               }
 4619|     33|               break;
 4620|  6.82k|            default: {
  ------------------
  |  Branch (4620:13): [True: 6.82k, False: 20.9k]
  ------------------
 4621|       |               // Not bool, string, object, or array so must be number or null
 4622|  6.82k|               process_variant_alternatives<T, is_variant_num>::template op<Opts>(value, ctx, it, end);
 4623|  6.82k|            }
 4624|  27.7k|            }
 4625|       |         }
 4626|       |         else {
 4627|       |            // For non-auto-deducible variants, try each type until one succeeds
 4628|       |            constexpr auto N = std::variant_size_v<T>;
 4629|       |            bool parsed = false;
 4630|       |            bool exhausted = false; // speculation budget spent; see charge_speculation
 4631|       |
 4632|       |            for_each<N>([&]<size_t I>() {
 4633|       |               if (parsed || exhausted || variant_alternative_exhausted(ctx)) return;
 4634|       |
 4635|       |               auto copy_it = it;
 4636|       |               // A rejected alternative may have bailed out inside a container, which leaves its
 4637|       |               // nesting level counted (see enter_depth), so the depth rewinds with the iterator.
 4638|       |               const auto copy_depth = ctx.depth;
 4639|       |
 4640|       |               // Try parsing as this type
 4641|       |               if (value.index() != I) {
 4642|       |                  emplace_runtime_variant(value, I);
 4643|       |               }
 4644|       |
 4645|       |               std::visit([&](auto&& v) { parse<JSON>::op<Options>(v, ctx, it, end); }, value);
 4646|       |               if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 4647|       |                  exhausted = true; // only rejected attempts are charged; see charge_speculation
 4648|       |               }
 4649|       |
 4650|       |               if (!bool(ctx.error)) {
 4651|       |                  parsed = true;
 4652|       |               }
 4653|       |               else if constexpr (not Options.null_terminated) {
 4654|       |                  // In non-null-terminated mode, if we hit end_reached after advancing the iterator,
 4655|       |                  // it means we successfully parsed the value but couldn't skip trailing whitespace
 4656|       |                  if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 4657|       |                     // We advanced the iterator, so we did parse something -- unless what advanced it
 4658|       |                     // was an abandoned attempt, which is what a spent speculation budget means.
 4659|       |                     parsed = true;
 4660|       |                     ctx.error = error_code::none;
 4661|       |                  }
 4662|       |                  else {
 4663|       |                     // Reset for next attempt (unless this is the last type)
 4664|       |                     it = copy_it;
 4665|       |                     rewind_depth<Options>(ctx, copy_depth);
 4666|       |                     if constexpr (I + 1 < N) {
 4667|       |                        if (not exhausted && not variant_alternative_exhausted(ctx)) {
 4668|       |                           ctx.error = error_code::none; // Clear error for next attempt
 4669|       |                        }
 4670|       |                     }
 4671|       |                  }
 4672|       |               }
 4673|       |               else {
 4674|       |                  // Reset for next attempt (unless this is the last type)
 4675|       |                  it = copy_it;
 4676|       |                  rewind_depth<Options>(ctx, copy_depth);
 4677|       |                  if constexpr (I + 1 < N) {
 4678|       |                     if (not exhausted && not variant_alternative_exhausted(ctx)) {
 4679|       |                        ctx.error = error_code::none; // Clear error for next attempt
 4680|       |                     }
 4681|       |                  }
 4682|       |               }
 4683|       |            });
 4684|       |         }
 4685|  27.7k|      }
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEETkNS_10is_contextERNS_7contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   49|  4.95M|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  4.95M|         else {
   60|  4.95M|            using V = std::remove_cvref_t<T>;
   61|  4.95M|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  4.95M|                                             end);
   63|  4.95M|         }
   64|  4.95M|      }
_ZN3glz4fromILj10ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEETnNS_14string_literalEXtlNS9_ILm1EEEEERS5_TkNS_10is_contextERNS_7contextERPKcSF_EEvOT1_OT2_OT3_T4_:
 2791|  4.95M|      {
 2792|  4.95M|         static constexpr auto num_members = reflect<T>::size;
 2793|       |
 2794|  4.95M|         static constexpr auto Opts = opening_handled_off<ws_handled_off<Options>()>();
 2795|       |         if constexpr (!check_opening_handled(Options)) {
 2796|       |            if constexpr (!check_ws_handled(Options)) {
 2797|       |               if (skip_ws<Opts>(ctx, it, end)) {
 2798|       |                  return;
 2799|       |               }
 2800|       |            }
 2801|       |            if (match_invalid_end<'{', Opts>(ctx, it, end)) {
 2802|       |               return;
 2803|       |            }
 2804|       |            if constexpr (not Opts.null_terminated) {
 2805|       |               if (it == end) [[unlikely]] {
 2806|       |                  ctx.error = error_code::unexpected_end;
 2807|       |                  return;
 2808|       |               }
 2809|       |            }
 2810|       |            // one nesting level (see enter_depth): counted in both modes so the limit binds,
 2811|       |            // released at each syntactic close below
 2812|       |            if (enter_depth(ctx)) [[unlikely]] {
 2813|       |               return;
 2814|       |            }
 2815|       |         }
 2816|  4.95M|         const auto ws_start = it;
 2817|  4.95M|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2817:14): [True: 0, False: 4.95M]
  ------------------
 2818|      0|            return;
 2819|      0|         }
 2820|  4.95M|         const size_t ws_size = size_t(it - ws_start);
 2821|       |
 2822|       |         if constexpr ((glaze_object_t<T> || reflectable<T>) && num_members == 0 && Opts.error_on_unknown_keys) {
 2823|       |            if constexpr (not tag.sv().empty()) {
 2824|       |               if (*it == '"') {
 2825|       |                  ++it;
 2826|       |                  if constexpr (not Opts.null_terminated) {
 2827|       |                     if (it == end) [[unlikely]] {
 2828|       |                        ctx.error = error_code::unexpected_end;
 2829|       |                        return;
 2830|       |                     }
 2831|       |                  }
 2832|       |
 2833|       |                  const auto start = it;
 2834|       |                  skip_string_view(ctx, it, end);
 2835|       |                  if (bool(ctx.error)) [[unlikely]]
 2836|       |                     return;
 2837|       |                  if (validate_utf8_span<Opts>(ctx, start, it)) [[unlikely]]
 2838|       |                     return;
 2839|       |                  const sv key{start, size_t(it - start)};
 2840|       |                  ++it;
 2841|       |                  if constexpr (not Opts.null_terminated) {
 2842|       |                     if (it == end) [[unlikely]] {
 2843|       |                        ctx.error = error_code::unexpected_end;
 2844|       |                        return;
 2845|       |                     }
 2846|       |                  }
 2847|       |
 2848|       |                  if (key == tag.sv()) {
 2849|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 2850|       |                        return;
 2851|       |                     }
 2852|       |
 2853|       |                     parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
 2854|       |                     if (bool(ctx.error)) [[unlikely]]
 2855|       |                        return;
 2856|       |
 2857|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 2858|       |                        return;
 2859|       |                     }
 2860|       |                  }
 2861|       |                  else {
 2862|       |                     ctx.error = error_code::unknown_key;
 2863|       |                     return;
 2864|       |                  }
 2865|       |               }
 2866|       |            }
 2867|       |
 2868|       |            if (*it == '}') [[likely]] {
 2869|       |               --ctx.depth;
 2870|       |               if constexpr (glaze_object_t<T> || reflectable<T>) {
 2871|       |                  if constexpr (has_self_constraint_v<T> && !check_skip_self_constraint(Opts)) {
 2872|       |                     auto wrapper = self_constraint_v<T>(value);
 2873|       |                     from<JSON, decltype(wrapper)>::template op<ws_handled<Opts>()>(wrapper, ctx, it, end);
 2874|       |                     if (bool(ctx.error)) {
 2875|       |                        return;
 2876|       |                     }
 2877|       |                  }
 2878|       |               }
 2879|       |               ++it;
 2880|       |               if constexpr (not Opts.null_terminated) {
 2881|       |                  if (it == end) {
 2882|       |                     ctx.error = error_code::end_reached;
 2883|       |                     return;
 2884|       |                  }
 2885|       |               }
 2886|       |               if constexpr (Opts.partial_read) {
 2887|       |                  ctx.error = error_code::partial_read_complete;
 2888|       |               }
 2889|       |               return;
 2890|       |            }
 2891|       |            ctx.error = error_code::unknown_key;
 2892|       |            return;
 2893|       |         }
 2894|  4.95M|         else {
 2895|  4.95M|            decltype(auto) fields = [&]() -> decltype(auto) {
 2896|  4.95M|               if constexpr ((glaze_object_t<T> || reflectable<T>) &&
 2897|  4.95M|                             (Opts.error_on_missing_keys || Opts.partial_read)) {
 2898|  4.95M|                  return bit_array<num_members>{};
 2899|  4.95M|               }
 2900|  4.95M|               else {
 2901|  4.95M|                  return nullptr;
 2902|  4.95M|               }
 2903|  4.95M|            }();
 2904|       |
 2905|       |            // A file include merges an external document into this object, so with
 2906|       |            // error_on_missing_keys the keys have to be counted across both documents (see
 2907|       |            // context::key_bits). While this object parses, its bits are published for its
 2908|       |            // includer members to hand down; and if this parse is itself an included document,
 2909|       |            // it claims the bits of the object that included us and merges into them at the
 2910|       |            // closing brace instead of running a check of its own.
 2911|  4.95M|            static constexpr bool tracks_include_keys = [] {
 2912|       |               // Nested so that reflecting over the members is only asked for when it can matter
 2913|  4.95M|               if constexpr ((glaze_object_t<T> || reflectable<T>) && Opts.error_on_missing_keys) {
 2914|  4.95M|                  return has_includer_member<T>;
 2915|  4.95M|               }
 2916|  4.95M|               else {
 2917|  4.95M|                  return false;
 2918|  4.95M|               }
 2919|  4.95M|            }();
 2920|  4.95M|            [[maybe_unused]] bit_array<num_members>* include_bits{};
 2921|       |            if constexpr (tracks_include_keys) {
 2922|       |               if (ctx.include_key_type == &include_key_tag<T>) {
 2923|       |                  include_bits = static_cast<bit_array<num_members>*>(ctx.include_key_bits);
 2924|       |                  ctx.include_key_bits = nullptr;
 2925|       |                  ctx.include_key_type = nullptr;
 2926|       |               }
 2927|       |            }
 2928|  4.95M|            [[maybe_unused]] const std::conditional_t<tracks_include_keys,
 2929|  4.95M|                                                      key_bits_scope<std::remove_reference_t<decltype(ctx)>>,
 2930|  4.95M|                                                      inert_key_bits_scope> published_bits{
 2931|  4.95M|               ctx, [&]() -> void* {
 2932|  4.95M|                  if constexpr (tracks_include_keys) {
 2933|  4.95M|                     return &fields;
 2934|  4.95M|                  }
 2935|  4.95M|                  else {
 2936|  4.95M|                     return nullptr;
 2937|  4.95M|                  }
 2938|  4.95M|               }()};
 2939|       |
 2940|  4.95M|            size_t read_count{}; // for partial_read
 2941|       |
 2942|  4.95M|            bool first = true;
 2943|  8.31M|            while (true) {
  ------------------
  |  Branch (2943:20): [True: 8.31M, Folded]
  ------------------
 2944|       |               if constexpr ((glaze_object_t<T> || reflectable<T>) && Opts.partial_read) {
 2945|       |                  static constexpr bit_array<num_members> all_fields = [] {
 2946|       |                     bit_array<num_members> arr{};
 2947|       |                     for (size_t i = 0; i < num_members; ++i) {
 2948|       |                        arr[i] = true;
 2949|       |                     }
 2950|       |                     return arr;
 2951|       |                  }();
 2952|       |
 2953|       |                  if ((all_fields & fields) == all_fields) {
 2954|       |                     ctx.error = error_code::partial_read_complete;
 2955|       |                     --ctx.depth; // as above: an early success still closes this level
 2956|       |                     return;
 2957|       |                  }
 2958|       |               }
 2959|       |
 2960|       |               // Streaming refill point: at start of each iteration, ensure buffer has data
 2961|       |               if constexpr (has_streaming_state<decltype(ctx)>) {
 2962|       |                  if (ctx.stream.enabled()) {
 2963|       |                     const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 2964|       |                     const size_t remaining = ctx.stream.size() - consumed;
 2965|       |                     // Refill when less than half of buffer remains to ensure space for next key-value pair
 2966|       |                     if (remaining <= ctx.stream.size() / 2 || it >= end) {
 2967|       |                        const char* new_it;
 2968|       |                        const char* new_end;
 2969|       |                        ctx.stream.consume_and_refill(consumed, new_it, new_end);
 2970|       |                        it = new_it;
 2971|       |                        end = new_end;
 2972|       |                        if (it >= end && ctx.stream.at_eof()) {
 2973|       |                           ctx.error = error_code::unexpected_end;
 2974|       |                           return;
 2975|       |                        }
 2976|       |                     }
 2977|       |                  }
 2978|       |               }
 2979|       |
 2980|  8.31M|               if (*it == '}') {
  ------------------
  |  Branch (2980:20): [True: 4.95M, False: 3.36M]
  ------------------
 2981|  4.95M|                  --ctx.depth;
 2982|       |                  if constexpr ((glaze_object_t<T> || reflectable<T>) && Opts.error_on_missing_keys) {
 2983|       |                     const bool defer_to_includer = [&] {
 2984|       |                        if constexpr (tracks_include_keys) {
 2985|       |                           if (include_bits) {
 2986|       |                              // An included document is a fragment: hand the keys it supplied to
 2987|       |                              // the object that included it, which checks the union of both.
 2988|       |                              *include_bits |= fields;
 2989|       |                              return true;
 2990|       |                           }
 2991|       |                        }
 2992|       |                        return false;
 2993|       |                     }();
 2994|       |                     constexpr auto req_fields = required_fields<T, Opts>();
 2995|       |                     if (not defer_to_includer && (req_fields & fields) != req_fields) {
 2996|       |                        for (size_t i = 0; i < num_members; ++i) {
 2997|       |                           if (not fields[i] && req_fields[i]) {
 2998|       |                              ctx.custom_error_message = reflect<T>::keys[i];
 2999|       |                              // We just return the first missing key in order to avoid heap allocations
 3000|       |                              break;
 3001|       |                           }
 3002|       |                        }
 3003|       |
 3004|       |                        ctx.error = error_code::missing_key;
 3005|       |                        return;
 3006|       |                     }
 3007|       |                  }
 3008|       |                  if constexpr (glaze_object_t<T> || reflectable<T>) {
 3009|       |                     if constexpr (has_self_constraint_v<T> && !check_skip_self_constraint(Opts)) {
 3010|       |                        auto wrapper = self_constraint_v<T>(value);
 3011|       |                        from<JSON, decltype(wrapper)>::template op<ws_handled<Opts>()>(wrapper, ctx, it, end);
 3012|       |                        if (bool(ctx.error)) {
 3013|       |                           return;
 3014|       |                        }
 3015|       |                     }
 3016|       |                  }
 3017|  4.95M|                  ++it; // Increment after checking for missing keys so errors are within buffer bounds
 3018|       |                  if constexpr (not Opts.null_terminated) {
 3019|       |                     if (it == end) {
 3020|       |                        ctx.error = error_code::end_reached;
 3021|       |                        return;
 3022|       |                     }
 3023|       |                  }
 3024|  4.95M|                  return;
 3025|  4.95M|               }
 3026|  3.36M|               else if (first) {
  ------------------
  |  Branch (3026:25): [True: 147k, False: 3.21M]
  ------------------
 3027|   147k|                  first = false;
 3028|   147k|               }
 3029|  3.21M|               else {
 3030|  3.21M|                  if (match_invalid_end<',', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3030:23): [True: 0, False: 3.21M]
  ------------------
 3031|      0|                     return;
 3032|      0|                  }
 3033|       |                  if constexpr (not Opts.null_terminated) {
 3034|       |                     if (it == end) [[unlikely]] {
 3035|       |                        ctx.error = error_code::unexpected_end;
 3036|       |                        return;
 3037|       |                     }
 3038|       |                  }
 3039|       |
 3040|       |                  if constexpr ((not Opts.minified) && (num_members > 1 || not Opts.error_on_unknown_keys) &&
 3041|       |                                (!Opts.comments)) {
 3042|       |                     if (ws_size && ws_size < size_t(end - it)) {
 3043|       |                        skip_matching_ws(ws_start, it, ws_size);
 3044|       |                     }
 3045|       |                  }
 3046|       |
 3047|  3.21M|                  if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3047:23): [True: 0, False: 3.21M]
  ------------------
 3048|      0|                     return;
 3049|      0|                  }
 3050|  3.21M|               }
 3051|       |
 3052|  3.36M|               constexpr auto reflection_type = glaze_object_t<T> || reflectable<T>;
  ------------------
  |  Branch (3052:49): [Folded, False: 0]
  |  Branch (3052:70): [Folded, False: 0]
  ------------------
 3053|       |
 3054|       |               if constexpr (reflection_type && (num_members == 0)) {
 3055|       |                  if constexpr (Opts.error_on_unknown_keys) {
 3056|       |                     static_assert(false_v<T>, "This should be unreachable");
 3057|       |                  }
 3058|       |                  else {
 3059|       |                     if (match_invalid_end<'"', Opts>(ctx, it, end)) {
 3060|       |                        return;
 3061|       |                     }
 3062|       |
 3063|       |                     // parsing to an empty object, but at this point the JSON presents keys
 3064|       |
 3065|       |                     // Unknown key handler does not unescape keys. Unknown escaped keys are
 3066|       |                     // handled by the user.
 3067|       |
 3068|       |                     const auto start = it;
 3069|       |                     uint64_t ascii_acc{};
 3070|       |                     skip_string_view(ctx, it, end, ascii_acc);
 3071|       |                     if (bool(ctx.error)) [[unlikely]]
 3072|       |                        return;
 3073|       |                     if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]]
 3074|       |                        return;
 3075|       |                     const sv key{start, size_t(it - start)};
 3076|       |                     ++it;
 3077|       |                     if constexpr (not Opts.null_terminated) {
 3078|       |                        if (it == end) [[unlikely]] {
 3079|       |                           ctx.error = error_code::unexpected_end;
 3080|       |                           return;
 3081|       |                        }
 3082|       |                     }
 3083|       |
 3084|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3085|       |                        return;
 3086|       |                     }
 3087|       |
 3088|       |                     // Check if this key is the variant tag that should be skipped
 3089|       |                     if constexpr (not tag.sv().empty()) {
 3090|       |                        if (key == tag.sv()) {
 3091|       |                           // Skip the tag value
 3092|       |                           skip_value<JSON>::op<Opts>(ctx, it, end);
 3093|       |                           if (bool(ctx.error)) [[unlikely]]
 3094|       |                              return;
 3095|       |                           resync_window_end(ctx, end); // a streaming skip refills
 3096|       |                           if (skip_ws<Opts>(ctx, it, end)) {
 3097|       |                              return;
 3098|       |                           }
 3099|       |                           continue;
 3100|       |                        }
 3101|       |                     }
 3102|       |
 3103|       |                     parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
 3104|       |                     if (bool(ctx.error)) [[unlikely]]
 3105|       |                        return;
 3106|       |                     if constexpr (not Opts.null_terminated) {
 3107|       |                        if (it == end) [[unlikely]] {
 3108|       |                           ctx.error = error_code::unexpected_end;
 3109|       |                           return;
 3110|       |                        }
 3111|       |                     }
 3112|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 3113|       |                        return;
 3114|       |                     }
 3115|       |                  }
 3116|       |               }
 3117|       |               else if constexpr (reflection_type) {
 3118|       |                  static_assert(bool(hash_info<T>.type));
 3119|       |
 3120|       |                  if (*it != '"') [[unlikely]] {
 3121|       |                     ctx.error = error_code::expected_quote;
 3122|       |                     return;
 3123|       |                  }
 3124|       |                  ++it;
 3125|       |                  if constexpr (not Opts.null_terminated) {
 3126|       |                     if (it == end) [[unlikely]] {
 3127|       |                        ctx.error = error_code::unexpected_end;
 3128|       |                        return;
 3129|       |                     }
 3130|       |                  }
 3131|       |
 3132|       |                  if constexpr (not tag.sv().empty() && not contains_tag<T, tag>()) {
 3133|       |                     // For tagged variants we first check to see if the key matches the tag
 3134|       |                     // We only need to do this if the tag is not part of the keys
 3135|       |
 3136|       |                     const auto start = it;
 3137|       |                     uint64_t ascii_acc{};
 3138|       |                     skip_string_view(ctx, it, end, ascii_acc);
 3139|       |                     if (bool(ctx.error)) [[unlikely]]
 3140|       |                        return;
 3141|       |                     if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]]
 3142|       |                        return;
 3143|       |                     const sv key{start, size_t(it - start)};
 3144|       |                     ++it;
 3145|       |                     if constexpr (not Opts.null_terminated) {
 3146|       |                        if (it == end) [[unlikely]] {
 3147|       |                           ctx.error = error_code::unexpected_end;
 3148|       |                           return;
 3149|       |                        }
 3150|       |                     }
 3151|       |
 3152|       |                     if (key == tag.sv()) {
 3153|       |                        if (parse_ws_colon<Opts>(ctx, it, end)) {
 3154|       |                           return;
 3155|       |                        }
 3156|       |
 3157|       |                        parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
 3158|       |                        if (bool(ctx.error)) [[unlikely]]
 3159|       |                           return;
 3160|       |
 3161|       |                        if (skip_ws<Opts>(ctx, it, end)) {
 3162|       |                           return;
 3163|       |                        }
 3164|       |                        continue;
 3165|       |                     }
 3166|       |                     else {
 3167|       |                        it = start; // reset the iterator
 3168|       |                     }
 3169|       |                  }
 3170|       |
 3171|       |                  if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
 3172|       |                     size_t index = num_members;
 3173|       |                     parse_and_invoke<Opts, T>(value, ctx, it, end, index);
 3174|       |                     if (bool(ctx.error)) [[unlikely]]
 3175|       |                        return;
 3176|       |                     if (index < num_members) {
 3177|       |                        fields[index] = true;
 3178|       |                     }
 3179|       |                  }
 3180|       |                  else {
 3181|       |                     parse_and_invoke<Opts, T>(value, ctx, it, end);
 3182|       |                     if (bool(ctx.error)) [[unlikely]]
 3183|       |                        return;
 3184|       |                  }
 3185|       |               }
 3186|  3.36M|               else {
 3187|       |                  // For types like std::map, std::unordered_map
 3188|       |
 3189|  3.36M|                  auto reading = [&](auto&& key) {
 3190|  3.36M|                     if constexpr (Opts.partial_read) {
 3191|  3.36M|                        if (auto element = value.find(key); element != value.end()) {
 3192|  3.36M|                           ++read_count;
 3193|  3.36M|                           parse<JSON>::op<ws_handled<Opts>()>(element->second, ctx, it, end);
 3194|  3.36M|                        }
 3195|  3.36M|                        else {
 3196|  3.36M|                           skip_value<JSON>::op<Opts>(ctx, it, end);
 3197|  3.36M|                        }
 3198|  3.36M|                     }
 3199|  3.36M|                     else {
 3200|  3.36M|                        parse<JSON>::op<ws_handled<Opts>()>(value[key], ctx, it, end);
 3201|  3.36M|                     }
 3202|  3.36M|                  };
 3203|       |
 3204|       |                  // using Key = std::conditional_t<heterogeneous_map<T>, sv, typename T::key_type>;
 3205|  3.36M|                  using Key = typename T::key_type;
 3206|  3.36M|                  if constexpr (std::is_same_v<Key, std::string>) {
 3207|  3.36M|                     ctx.scratch.clear();
 3208|  3.36M|                     parse<JSON>::op<Opts>(ctx.scratch, ctx, it, end);
 3209|  3.36M|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3209:26): [True: 0, False: 3.36M]
  ------------------
 3210|      0|                        return;
 3211|       |
 3212|  3.36M|                     if (parse_ws_colon<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3212:26): [True: 0, False: 3.36M]
  ------------------
 3213|      0|                        return;
 3214|      0|                     }
 3215|       |
 3216|  3.36M|                     reading(ctx.scratch);
 3217|       |                     if constexpr (Opts.partial_read) {
 3218|       |                        if (read_count == value.size()) {
 3219|       |                           return;
 3220|       |                        }
 3221|       |                     }
 3222|  3.36M|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3222:26): [True: 887, False: 3.36M]
  ------------------
 3223|    887|                        return;
 3224|       |                  }
 3225|       |                  else if constexpr (str_t<Key>) {
 3226|       |                     Key key;
 3227|       |                     parse<JSON>::op<Opts>(key, ctx, it, end);
 3228|       |                     if (bool(ctx.error)) [[unlikely]]
 3229|       |                        return;
 3230|       |
 3231|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3232|       |                        return;
 3233|       |                     }
 3234|       |
 3235|       |                     reading(key);
 3236|       |                     if constexpr (Opts.partial_read) {
 3237|       |                        if (read_count == value.size()) {
 3238|       |                           return;
 3239|       |                        }
 3240|       |                     }
 3241|       |                     if (bool(ctx.error)) [[unlikely]]
 3242|       |                        return;
 3243|       |                  }
 3244|       |                  else {
 3245|       |                     Key key_value{};
 3246|       |                     if constexpr (is_named_enum<Key> || mimics_str_t<Key>) {
 3247|       |                        parse<JSON>::op<Opts>(key_value, ctx, it, end);
 3248|       |                     }
 3249|       |                     else if constexpr (std::is_arithmetic_v<Key>) {
 3250|       |                        // prefer over quoted_t below to avoid double parsing of quoted_t
 3251|       |                        parse<JSON>::op<opt_true<Opts, quoted_num_opt_tag{}>>(key_value, ctx, it, end);
 3252|       |                     }
 3253|       |                     else {
 3254|       |                        parse<JSON>::op<opt_false<Opts, raw_string_opt_tag{}>>(quoted_t<Key>{key_value}, ctx, it, end);
 3255|       |                     }
 3256|       |                     if (bool(ctx.error)) [[unlikely]]
 3257|       |                        return;
 3258|       |
 3259|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3260|       |                        return;
 3261|       |                     }
 3262|       |
 3263|       |                     reading(key_value);
 3264|       |                     if constexpr (Opts.partial_read) {
 3265|       |                        if (read_count == value.size()) {
 3266|       |                           return;
 3267|       |                        }
 3268|       |                     }
 3269|       |                     if (bool(ctx.error)) [[unlikely]]
 3270|       |                        return;
 3271|       |                  }
 3272|  3.36M|               }
 3273|       |
 3274|       |               // Streaming refill point: after parsing each key-value pair, refill if buffer is low
 3275|       |               if constexpr (has_streaming_state<decltype(ctx)>) {
 3276|       |                  if (ctx.stream.enabled()) {
 3277|       |                     const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 3278|       |                     // Refill when less than 25% of buffer remains to ensure enough space for next element
 3279|       |                     if (ctx.stream.size() - consumed <= ctx.stream.size() / 4 || it >= end) {
 3280|       |                        const char* new_it;
 3281|       |                        const char* new_end;
 3282|       |                        ctx.stream.consume_and_refill(consumed, new_it, new_end);
 3283|       |                        it = new_it;
 3284|       |                        end = new_end;
 3285|       |                        if (it >= end && ctx.stream.at_eof()) {
 3286|       |                           ctx.error = error_code::unexpected_end;
 3287|       |                           return;
 3288|       |                        }
 3289|       |                     }
 3290|       |                  }
 3291|       |               }
 3292|       |
 3293|  3.36M|               if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3293:20): [True: 0, False: 3.36M]
  ------------------
 3294|      0|                  return;
 3295|      0|               }
 3296|  3.36M|            }
 3297|  4.95M|         }
 3298|  4.95M|      }
_ZZN3glz4fromILj10ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEETnNS_14string_literalEXtlNS9_ILm1EEEEERS5_TkNS_10is_contextERNS_7contextERPKcSF_EEvOT1_OT2_OT3_T4_ENKUlvE_clEv:
 2895|  4.95M|            decltype(auto) fields = [&]() -> decltype(auto) {
 2896|       |               if constexpr ((glaze_object_t<T> || reflectable<T>) &&
 2897|       |                             (Opts.error_on_missing_keys || Opts.partial_read)) {
 2898|       |                  return bit_array<num_members>{};
 2899|       |               }
 2900|  4.95M|               else {
 2901|  4.95M|                  return nullptr;
 2902|  4.95M|               }
 2903|  4.95M|            }();
_ZZN3glz4fromILj10ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEETnNS_14string_literalEXtlNS9_ILm1EEEEERS5_TkNS_10is_contextERNS_7contextERPKcSF_EEvOT1_OT2_OT3_T4_ENKUlvE1_clEv:
 2931|  4.95M|               ctx, [&]() -> void* {
 2932|       |                  if constexpr (tracks_include_keys) {
 2933|       |                     return &fields;
 2934|       |                  }
 2935|  4.95M|                  else {
 2936|  4.95M|                     return nullptr;
 2937|  4.95M|                  }
 2938|  4.95M|               }()};
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEETkNS_10is_contextERNS_7contextERPKcSF_EEvOT0_OT1_OT2_T3_:
   49|  3.36M|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  3.36M|         else {
   60|  3.36M|            using V = std::remove_cvref_t<T>;
   61|  3.36M|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  3.36M|                                             end);
   63|  3.36M|         }
   64|  3.36M|      }
_ZN3glz4fromILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERPKcSC_S7_TkNS_10is_contextERNS_7contextEEEvRT2_OT3_OT0_T1_:
  887|  3.36M|      {
  888|       |         if constexpr (check_string_as_number(Opts)) {
  889|       |            auto start = it;
  890|       |            skip_number<Opts>(ctx, it, end);
  891|       |            if (bool(ctx.error)) [[unlikely]] {
  892|       |               return;
  893|       |            }
  894|       |            if (start == it) [[unlikely]] {
  895|       |               ctx.error = error_code::parse_number_failure;
  896|       |               return;
  897|       |            }
  898|       |            value.append(start, size_t(it - start));
  899|       |         }
  900|  3.36M|         else {
  901|  3.36M|            if constexpr (!check_opening_handled(Opts)) {
  902|  3.36M|               if constexpr (!check_ws_handled(Opts)) {
  903|  3.36M|                  if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (903:23): [True: 0, False: 3.36M]
  ------------------
  904|      0|                     return;
  905|      0|                  }
  906|  3.36M|               }
  907|       |
  908|  3.36M|               if (match_invalid_end<'"', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (908:20): [True: 0, False: 3.36M]
  ------------------
  909|      0|                  return;
  910|      0|               }
  911|  3.36M|            }
  912|       |
  913|  3.36M|            if constexpr (not check_raw_string(Opts)) {
  914|  3.36M|               static constexpr auto string_padding_bytes = 8;
  915|       |
  916|       |               // How much buffer has to remain for an eight byte load at the cursor to stay inside
  917|       |               // it. One on a padded input, where the last chunk is free to straddle the end of the
  918|       |               // document, so the byte tails below are unreachable; eight otherwise, which costs the
  919|       |               // final bytes of the buffer their chunked path and nothing else.
  920|  3.36M|               const std::ptrdiff_t scan_min = chunk_min<8>(ctx.padded_input);
  921|       |
  922|  3.36M|               if (size_t(end - it) >= 8) {
  ------------------
  |  Branch (922:20): [True: 3.35M, False: 3.29k]
  ------------------
  923|       |                  // The bound as a pointer, so the loops below spend a compare per chunk rather
  924|       |                  // than a subtract and a compare. Well defined here and nowhere else in this
  925|       |                  // reader: the branch has just established that at least eight bytes remain, and
  926|       |                  // `scan_min` is at most eight.
  927|  3.35M|                  const auto* const chunk_limit = end - scan_min;
  928|       |
  929|  3.35M|                  auto start = it;
  930|  3.35M|                  uint64_t ascii_acc{};
  931|  22.5M|                  while (it <= chunk_limit) {
  ------------------
  |  Branch (931:26): [True: 22.5M, False: 621]
  ------------------
  932|  22.5M|                     uint64_t chunk;
  933|  22.5M|                     std::memcpy(&chunk, it, 8);
  934|       |                     if constexpr (std::endian::native == std::endian::big) {
  935|       |                        chunk = std::byteswap(chunk);
  936|       |                     }
  937|  22.5M|                     ascii_acc |= chunk;
  938|  22.5M|                     const uint64_t test_chars = has_quote(chunk);
  939|  22.5M|                     if (test_chars) {
  ------------------
  |  Branch (939:26): [True: 3.36M, False: 19.1M]
  ------------------
  940|  3.36M|                        it += (countr_zero(test_chars) >> 3);
  941|       |
  942|  3.36M|                        auto* prev = it - 1;
  943|  3.36M|                        while (*prev == '\\') {
  ------------------
  |  Branch (943:32): [True: 8.76k, False: 3.36M]
  ------------------
  944|  8.76k|                           --prev;
  945|  8.76k|                        }
  946|  3.36M|                        if (size_t(it - prev) % 2) {
  ------------------
  |  Branch (946:29): [True: 3.35M, False: 3.28k]
  ------------------
  947|  3.35M|                           goto continue_decode;
  948|  3.35M|                        }
  949|  3.28k|                        ++it; // skip the escaped quote
  950|  3.28k|                     }
  951|  19.1M|                     else {
  952|  19.1M|                        it += 8;
  953|  19.1M|                     }
  954|  22.5M|                  }
  955|       |
  956|  1.18k|                  while (it[-1] == '\\') [[unlikely]] {
  ------------------
  |  Branch (956:26): [True: 560, False: 621]
  ------------------
  957|       |                     // if we ended on an escape character then we need to rewind
  958|       |                     // because we lost our context
  959|    560|                     --it;
  960|    560|                  }
  961|       |
  962|       |                  // The byte-wise tail keeps feeding the accumulator: it has to cover every byte of
  963|       |                  // the string, or a non-ASCII byte reached here would be waved through unvalidated.
  964|  1.63k|                  for (; it < end; ++it) {
  ------------------
  |  Branch (964:26): [True: 1.63k, False: 0]
  ------------------
  965|  1.63k|                     ascii_acc |= uint8_t(*it);
  966|  1.63k|                     if (*it == '"') {
  ------------------
  |  Branch (966:26): [True: 645, False: 987]
  ------------------
  967|    645|                        auto* prev = it - 1;
  968|  1.06k|                        while (*prev == '\\') {
  ------------------
  |  Branch (968:32): [True: 422, False: 645]
  ------------------
  969|    422|                           --prev;
  970|    422|                        }
  971|    645|                        if (size_t(it - prev) % 2) {
  ------------------
  |  Branch (971:29): [True: 621, False: 24]
  ------------------
  972|    621|                           goto continue_decode;
  973|    621|                        }
  974|    645|                     }
  975|  1.63k|                  }
  976|       |
  977|      0|                  ctx.error = error_code::unexpected_end;
  978|      0|                  return;
  979|       |
  980|  3.35M|               continue_decode:
  981|       |
  982|  3.35M|                  if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]] {
  ------------------
  |  Branch (982:23): [True: 0, False: 3.35M]
  ------------------
  983|      0|                     return;
  984|      0|                  }
  985|       |
  986|  3.35M|                  auto n = size_t(it - start);
  987|       |
  988|       |                  // The padding lets the chunked copy below run up to the closing quote. Skip it when it
  989|       |                  // would be the only reason to allocate, as for a string that fits the small string
  990|       |                  // buffer but not with eight bytes to spare.
  991|  3.35M|                  bool pad = true;
  992|  3.35M|                  if constexpr (requires { value.capacity(); }) {
  993|  3.35M|                     const auto capacity = size_t(value.capacity());
  994|  3.35M|                     pad = capacity >= n + string_padding_bytes || capacity < n;
  ------------------
  |  Branch (994:28): [True: 3.33M, False: 22.6k]
  |  Branch (994:68): [True: 9.94k, False: 12.6k]
  ------------------
  995|  3.35M|                  }
  996|  3.35M|                  resize_unfilled(value, pad ? n + string_padding_bytes : n);
  ------------------
  |  Branch (996:42): [True: 3.34M, False: 12.6k]
  ------------------
  997|       |
  998|  3.35M|                  auto* p = value.data();
  999|       |
 1000|       |                  // An error below returns with the tail of `value` still unwritten. Leave the size at
 1001|       |                  // what was actually written rather than at the padded length, which resize_unfilled
 1002|       |                  // did not fill.
 1003|  3.35M|                  auto* const written_begin = p;
 1004|       |
 1005|       |                  // Without the padding, copy a chunk only while eight bytes remain before the quote.
 1006|       |                  // Unescaping never puts the output ahead of the input, so no store lands past the end.
 1007|  3.35M|                  const auto* const copy_end = pad ? it : it - (std::min)(n, size_t(7));
  ------------------
  |  Branch (1007:48): [True: 3.34M, False: 12.6k]
  ------------------
 1008|       |
 1009|       |                  // Copy eight bytes at a time for as long as eight bytes are there to read, then
 1010|       |                  // finish the span below. The chunked form reads past the character it is looking
 1011|       |                  // at, so on an unpadded buffer it has to stop short of the end; splitting it this
 1012|       |                  // way keeps it for the body of every string rather than giving it up whenever the
 1013|       |                  // string happens to finish near the end of the buffer -- which, for a document
 1014|       |                  // that is itself one string, is every string.
 1015|  25.0M|                  while (start < copy_end && start <= chunk_limit) {
  ------------------
  |  Branch (1015:26): [True: 22.1M, False: 2.94M]
  |  Branch (1015:46): [True: 22.1M, False: 337]
  ------------------
 1016|  22.1M|                     std::memcpy(p, start, 8);
 1017|  22.1M|                     uint64_t swar;
 1018|  22.1M|                     std::memcpy(&swar, p, 8);
 1019|       |                     if constexpr (std::endian::native == std::endian::big) {
 1020|       |                        swar = std::byteswap(swar);
 1021|       |                     }
 1022|       |
 1023|  22.1M|                     constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1024|  22.1M|                     const uint64_t lo7 = swar & lo7_mask;
 1025|  22.1M|                     const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1026|  22.1M|                     const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1027|  22.1M|                     uint64_t next = ~((backslash & less_32) | swar);
 1028|       |
 1029|  22.1M|                     next &= repeat_byte8(0b10000000);
 1030|  22.1M|                     if (next == 0) {
  ------------------
  |  Branch (1030:26): [True: 21.5M, False: 559k]
  ------------------
 1031|  21.5M|                        start += 8;
 1032|  21.5M|                        p += 8;
 1033|  21.5M|                        continue;
 1034|  21.5M|                     }
 1035|       |
 1036|   559k|                     next = countr_zero(next) >> 3;
 1037|   559k|                     start += next;
 1038|   559k|                     if (start >= it) {
  ------------------
  |  Branch (1038:26): [True: 408k, False: 151k]
  ------------------
 1039|   408k|                        break;
 1040|   408k|                     }
 1041|       |
 1042|   151k|                     if ((*start & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1042:26): [True: 0, False: 151k]
  ------------------
 1043|      0|                        ctx.error = error_code::syntax_error;
 1044|      0|                        value.resize(size_t(p - written_begin));
 1045|      0|                        return;
 1046|      0|                     }
 1047|   151k|                     ++start; // skip the escape
 1048|   151k|                     if (*start == 'u') {
  ------------------
  |  Branch (1048:26): [True: 15.4k, False: 135k]
  ------------------
 1049|  15.4k|                        ++start;
 1050|  15.4k|                        p += next;
 1051|  15.4k|                        const auto mark = start;
 1052|  15.4k|                        const auto decoded = handle_unicode_code_point(start, p, end);
 1053|  15.4k|                        if (decoded.written == 0) [[unlikely]] {
  ------------------
  |  Branch (1053:29): [True: 0, False: 15.4k]
  ------------------
 1054|      0|                           ctx.error = decoded.truncated ? error_code::unexpected_end
  ------------------
  |  Branch (1054:40): [True: 0, False: 0]
  ------------------
 1055|      0|                                                         : error_code::unicode_escape_conversion_failure;
 1056|      0|                           value.resize(size_t(p - written_begin));
 1057|      0|                           return;
 1058|      0|                        }
 1059|  15.4k|                        n += decoded.written;
 1060|       |                        // escape + u + unicode code points
 1061|  15.4k|                        n -= 2 + uint32_t(start - mark);
 1062|  15.4k|                     }
 1063|   135k|                     else {
 1064|   135k|                        p += next;
 1065|   135k|                        *p = char_unescape_table[uint8_t(*start)];
 1066|   135k|                        if (*p == 0) [[unlikely]] {
  ------------------
  |  Branch (1066:29): [True: 0, False: 135k]
  ------------------
 1067|      0|                           ctx.error = error_code::invalid_escape;
 1068|      0|                           value.resize(size_t(p - written_begin));
 1069|      0|                           return;
 1070|      0|                        }
 1071|   135k|                        ++p;
 1072|   135k|                        ++start;
 1073|   135k|                        --n;
 1074|   135k|                     }
 1075|   151k|                  }
 1076|       |
 1077|       |                  // Whatever the chunked copy could not reach. `p` and `start` stay in step across
 1078|       |                  // that loop, so this picks up exactly where it stopped.
 1079|  3.40M|                  while (start < it) {
  ------------------
  |  Branch (1079:26): [True: 46.9k, False: 3.35M]
  ------------------
 1080|  46.9k|                     if ((*start & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1080:26): [True: 0, False: 46.9k]
  ------------------
 1081|      0|                        ctx.error = error_code::syntax_error;
 1082|      0|                        value.resize(size_t(p - written_begin));
 1083|      0|                        return;
 1084|      0|                     }
 1085|  46.9k|                     if (*start == '\\') {
  ------------------
  |  Branch (1085:26): [True: 1.55k, False: 45.4k]
  ------------------
 1086|  1.55k|                        ++start; // skip the escape
 1087|  1.55k|                        if (*start == 'u') {
  ------------------
  |  Branch (1087:29): [True: 1.05k, False: 492]
  ------------------
 1088|  1.05k|                           ++start;
 1089|  1.05k|                           const auto mark = start;
 1090|  1.05k|                           const auto decoded = handle_unicode_code_point(start, p, end);
 1091|  1.05k|                           if (decoded.written == 0) [[unlikely]] {
  ------------------
  |  Branch (1091:32): [True: 0, False: 1.05k]
  ------------------
 1092|      0|                              ctx.error = decoded.truncated ? error_code::unexpected_end
  ------------------
  |  Branch (1092:43): [True: 0, False: 0]
  ------------------
 1093|      0|                                                            : error_code::unicode_escape_conversion_failure;
 1094|      0|                              value.resize(size_t(p - written_begin));
 1095|      0|                              return;
 1096|      0|                           }
 1097|  1.05k|                           n += decoded.written;
 1098|  1.05k|                           n -= 2 + uint32_t(start - mark);
 1099|  1.05k|                        }
 1100|    492|                        else {
 1101|    492|                           *p = char_unescape_table[uint8_t(*start)];
 1102|    492|                           if (*p == 0) [[unlikely]] {
  ------------------
  |  Branch (1102:32): [True: 0, False: 492]
  ------------------
 1103|      0|                              ctx.error = error_code::invalid_escape;
 1104|      0|                              value.resize(size_t(p - written_begin));
 1105|      0|                              return;
 1106|      0|                           }
 1107|    492|                           ++p;
 1108|    492|                           ++start;
 1109|    492|                           --n;
 1110|    492|                        }
 1111|  1.55k|                     }
 1112|  45.4k|                     else {
 1113|  45.4k|                        *p = *start;
 1114|  45.4k|                        ++p;
 1115|  45.4k|                        ++start;
 1116|  45.4k|                     }
 1117|  46.9k|                  }
 1118|       |
 1119|  3.35M|                  value.resize(n);
 1120|  3.35M|                  ++it;
 1121|  3.35M|               }
 1122|  3.29k|               else {
 1123|       |                  // For short strings
 1124|       |
 1125|  3.29k|                  std::array<char, 8> buffer{};
 1126|       |
 1127|  3.29k|                  auto* p = buffer.data();
 1128|  3.29k|                  const auto* const utf8_start = it;
 1129|       |
 1130|  5.87k|                  while (it < end) [[likely]] {
  ------------------
  |  Branch (1130:26): [True: 5.87k, False: 0]
  ------------------
 1131|  5.87k|                     *p = *it;
 1132|  5.87k|                     if (*it == '"') {
  ------------------
  |  Branch (1132:26): [True: 3.29k, False: 2.57k]
  ------------------
 1133|  3.29k|                        if (validate_utf8_span<Opts>(ctx, utf8_start, it)) [[unlikely]] {
  ------------------
  |  Branch (1133:29): [True: 0, False: 3.29k]
  ------------------
 1134|      0|                           return;
 1135|      0|                        }
 1136|  3.29k|                        const size_t n = size_t(p - buffer.data());
 1137|  3.29k|#if __has_cpp_attribute(assume) >= 202207L
 1138|  3.29k|                        [[assume(n <= sizeof(buffer))]];
 1139|  3.29k|#endif
 1140|  3.29k|                        value.assign(buffer.data(), n);
 1141|  3.29k|                        ++it;
 1142|       |                        if constexpr (not Opts.null_terminated) {
 1143|       |                           if (it == end) {
 1144|       |                              ctx.error = error_code::end_reached;
 1145|       |                              return;
 1146|       |                           }
 1147|       |                        }
 1148|  3.29k|                        return;
 1149|  3.29k|                     }
 1150|  2.57k|                     else if (*it == '\\') {
  ------------------
  |  Branch (1150:31): [True: 23, False: 2.55k]
  ------------------
 1151|       |                        // Bounded whatever `null_terminated` says: a document cut off inside an
 1152|       |                        // escape has run out of input, and saying so beats blaming the terminator
 1153|       |                        // the cut exposed -- which is what reading on would find, and would report
 1154|       |                        // as a malformed escape.
 1155|     23|                        ++it; // skip the escape
 1156|     23|                        if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1156:29): [True: 0, False: 23]
  ------------------
 1157|      0|                           ctx.error = error_code::unexpected_end;
 1158|      0|                           return;
 1159|      0|                        }
 1160|     23|                        if (*it == 'u') {
  ------------------
  |  Branch (1160:29): [True: 0, False: 23]
  ------------------
 1161|      0|                           ++it;
 1162|      0|                           if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1162:32): [True: 0, False: 0]
  ------------------
 1163|      0|                              ctx.error = error_code::unexpected_end;
 1164|      0|                              return;
 1165|      0|                           }
 1166|      0|                           const auto decoded = handle_unicode_code_point(it, p, end);
 1167|      0|                           if (decoded.written == 0) [[unlikely]] {
  ------------------
  |  Branch (1167:32): [True: 0, False: 0]
  ------------------
 1168|      0|                              ctx.error = decoded.truncated ? error_code::unexpected_end
  ------------------
  |  Branch (1168:43): [True: 0, False: 0]
  ------------------
 1169|      0|                                                            : error_code::unicode_escape_conversion_failure;
 1170|      0|                              return;
 1171|      0|                           }
 1172|      0|                        }
 1173|     23|                        else {
 1174|     23|                           *p = char_unescape_table[uint8_t(*it)];
 1175|     23|                           if (*p == 0) [[unlikely]] {
  ------------------
  |  Branch (1175:32): [True: 0, False: 23]
  ------------------
 1176|      0|                              ctx.error = error_code::invalid_escape;
 1177|      0|                              return;
 1178|      0|                           }
 1179|     23|                           ++p;
 1180|     23|                           ++it;
 1181|     23|                        }
 1182|     23|                     }
 1183|  2.55k|                     else if ((*it & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1183:31): [True: 0, False: 2.55k]
  ------------------
 1184|      0|                        ctx.error = error_code::syntax_error;
 1185|      0|                        return;
 1186|      0|                     }
 1187|  2.55k|                     else {
 1188|  2.55k|                        ++it;
 1189|  2.55k|                        ++p;
 1190|  2.55k|                     }
 1191|  5.87k|                  }
 1192|       |
 1193|      0|                  ctx.error = error_code::unexpected_end;
 1194|      0|               }
 1195|       |            }
 1196|       |            else {
 1197|       |               // raw_string
 1198|       |               auto start = it;
 1199|       |               skip_string_view(ctx, it, end);
 1200|       |               if (bool(ctx.error)) [[unlikely]]
 1201|       |                  return;
 1202|       |
 1203|       |               if (validate_utf8_span<Opts>(ctx, start, it)) [[unlikely]] {
 1204|       |                  return;
 1205|       |               }
 1206|       |
 1207|       |               value.assign(start, size_t(it - start));
 1208|       |               ++it;
 1209|       |            }
 1210|  3.36M|         }
 1211|  3.36M|      }
_ZN3glz14parse_ws_colonITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextENS_7contextERPKcS4_EEbRT0_OT1_T2_:
  159|  3.36M|   {
  160|  3.36M|      if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 3.36M]
  ------------------
  161|      0|         return true;
  162|      0|      }
  163|  3.36M|      if (match_invalid_end<':', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (163:11): [True: 0, False: 3.36M]
  ------------------
  164|      0|         return true;
  165|      0|      }
  166|  3.36M|      if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (166:11): [True: 0, False: 3.36M]
  ------------------
  167|      0|         return true;
  168|      0|      }
  169|  3.36M|      return false;
  170|  3.36M|   }
_ZZN3glz4fromILj10ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEETnNS_14string_literalEXtlNS9_ILm1EEEEERS5_TkNS_10is_contextERNS_7contextERPKcSF_EEvOT1_OT2_OT3_T4_ENKUlOT_E_clIRNSt3__112basic_stringIcNSS_11char_traitsIcEENSS_9allocatorIcEEEEEEDaSP_:
 3189|  3.36M|                  auto reading = [&](auto&& key) {
 3190|       |                     if constexpr (Opts.partial_read) {
 3191|       |                        if (auto element = value.find(key); element != value.end()) {
 3192|       |                           ++read_count;
 3193|       |                           parse<JSON>::op<ws_handled<Opts>()>(element->second, ctx, it, end);
 3194|       |                        }
 3195|       |                        else {
 3196|       |                           skip_value<JSON>::op<Opts>(ctx, it, end);
 3197|       |                        }
 3198|       |                     }
 3199|  3.36M|                     else {
 3200|  3.36M|                        parse<JSON>::op<ws_handled<Opts>()>(value[key], ctx, it, end);
 3201|  3.36M|                     }
 3202|  3.36M|                  };
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_7contextERPKcSC_EEvOT0_OT1_OT2_T3_:
   49|  12.1M|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  12.1M|         else {
   60|  12.1M|            using V = std::remove_cvref_t<T>;
   61|  12.1M|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  12.1M|                                             end);
   63|  12.1M|         }
   64|  12.1M|      }
_ZN3glz4fromILj10ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERS4_TkNS_10is_contextERNS_7contextERPKcSC_EEvOT0_OT1_OT2_T3_:
  150|  12.1M|      {
  151|  12.1M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  152|  12.1M|         from<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  153|  12.1M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  154|  12.1M|      }
_ZN3glz4fromILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERSH_TkNS_10is_contextERNS_7contextERPKcSP_EEvOT0_OT1_OT2_T3_:
 3860|  12.1M|      {
 3861|       |         if constexpr (tagging == variant_tagging_kind::adjacent) {
 3862|       |            read_adjacent<Options>(value, ctx, it, end);
 3863|       |         }
 3864|  12.1M|         else {
 3865|  12.1M|            read_deduced<Options>(value, ctx, it, end);
 3866|  12.1M|         }
 3867|  12.1M|      }
_ZN3glz4fromILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE12read_deducedITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERSH_TkNS_10is_contextERNS_7contextERPKcSP_EEvOT0_OT1_OT2_T3_:
 3871|  12.1M|      {
 3872|  12.1M|         constexpr auto Opts = ws_handled_off<Options>();
 3873|  12.1M|         if constexpr (variant_is_auto_deducible<T>()) {
 3874|       |            if constexpr (not check_ws_handled(Options)) {
 3875|       |               if (skip_ws<Opts>(ctx, it, end)) {
 3876|       |                  return;
 3877|       |               }
 3878|       |            }
 3879|       |
 3880|  12.1M|            switch (*it) {
 3881|      0|            case '\0':
  ------------------
  |  Branch (3881:13): [True: 0, False: 12.1M]
  ------------------
 3882|      0|               ctx.error = error_code::unexpected_end;
 3883|      0|               return;
 3884|  4.94M|            case '{': {
  ------------------
  |  Branch (3884:13): [True: 4.94M, False: 7.19M]
  ------------------
 3885|       |               // This branch consumes the brace itself and hands the object to a reader with
 3886|       |               // `opening_handled`, which therefore does not count the level -- but does release it at
 3887|       |               // the closing brace. So the level is taken here, in both buffer modes, and paid back by
 3888|       |               // the reader below.
 3889|  4.94M|               if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (3889:20): [True: 0, False: 4.94M]
  ------------------
 3890|      0|                  return;
 3891|      0|               }
 3892|       |
 3893|  4.94M|               ++it;
 3894|       |               if constexpr (not Opts.null_terminated) {
 3895|       |                  if (it == end) [[unlikely]] {
 3896|       |                     ctx.error = error_code::unexpected_end;
 3897|       |                     return;
 3898|       |                  }
 3899|       |               }
 3900|  4.94M|               using type_counts = variant_type_count<T>;
 3901|  4.94M|               constexpr auto n_object_candidates = variant_object_candidate_count_v<Opts, T>;
 3902|       |               if constexpr (n_object_candidates < 1) {
 3903|       |                  ctx.error = error_code::no_matching_variant_type;
 3904|       |                  return;
 3905|       |               }
 3906|  4.94M|               else if constexpr (n_object_candidates == 1 && tag_v<T>.empty()) {
 3907|  4.94M|                  constexpr auto first_idx = variant_first_object_candidate_v<Opts, T>;
 3908|  4.94M|                  using V = std::variant_alternative_t<first_idx, T>;
 3909|  4.94M|                  if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (3909:23): [True: 4.89M, False: 53.0k]
  ------------------
 3910|  4.94M|                  parse<JSON>::op<opening_handled<Opts>()>(std::get<V>(value), ctx, it, end);
 3911|  4.94M|                  return;
 3912|       |               }
 3913|       |               else {
 3914|       |                  auto possible_types = bit_array<std::variant_size_v<T>>{}.flip();
 3915|       |                  static constexpr auto& deduction_bits = variant_deduction_bits<T>;
 3916|       |                  static constexpr size_t deduction_key_count = variant_deduction_key_count<T>;
 3917|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<T>.size()>(tag_v<T>);
 3918|       |
 3919|       |                  // Track if we've encountered a tag and what value it had
 3920|       |                  std::optional<size_t> tag_specified_index{};
 3921|       |
 3922|       |                  if (skip_ws<Opts>(ctx, it, end)) {
 3923|       |                     return;
 3924|       |                  }
 3925|       |                  // Once the reader knows which alternative this object holds it may have to read
 3926|       |                  // it again from here. Anchor the position rather than keep the pointer: the scan
 3927|       |                  // below skips values, and a streaming skip refills, which moves the window out
 3928|       |                  // from under a raw pointer (see rewind_anchor).
 3929|       |                  auto start = make_rewind_anchor(ctx, it);
 3930|       |                  bool first_key = true;
 3931|       |                  // Parse bifurcation for tagged variants:
 3932|       |                  //
 3933|       |                  // Without this optimization, tagged variant parsing always uses two passes:
 3934|       |                  //   1. Scan all keys to find the tag (e.g. "type"), skipping values
 3935|       |                  //   2. Reset `it = start` and re-parse the entire object into the resolved type
 3936|       |                  //
 3937|       |                  // When the tag is the first key, the second pass redundantly re-reads every
 3938|       |                  // field that follows it. This lambda avoids that: if the tag was the first key,
 3939|       |                  // it advances past the trailing comma so the object parser picks up at the
 3940|       |                  // second field. If the tag was found later, it falls back to the full re-parse.
 3941|       |                  //
 3942|       |                  // One exception: if the tag name is also a field on the resolved struct
 3943|       |                  // (contains_tag), we must re-parse regardless so the value is stored in
 3944|       |                  // the struct field. This override is applied inside each std::visit lambda.
 3945|       |                  //
 3946|       |                  // Either way the rewind can fail under a streaming read: the window only holds so
 3947|       |                  // much, and an object wider than it has no start left to return to.
 3948|       |                  auto position_after_tag = [&] {
 3949|       |                     if (first_key) {
 3950|       |                        if (*it == ',') ++it; // skip comma; handles tag-only objects where *it == '}'
 3951|       |                        return true;
 3952|       |                     }
 3953|       |                     return start.rewind(ctx, it, end); // tag came later, re-parse from the beginning
 3954|       |                  };
 3955|       |                  // `first_key` also answers "were we reset to the object start", which is what
 3956|       |                  // position_after_tag does for every key but the first.
 3957|       |                  for (; *it != '}'; first_key = false) {
 3958|       |                     if (!first_key) {
 3959|       |                        if (match_invalid_end<',', Opts>(ctx, it, end)) {
 3960|       |                           return;
 3961|       |                        }
 3962|       |                     }
 3963|       |
 3964|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 3965|       |                        return;
 3966|       |                     }
 3967|       |                     if (match_invalid_end<'"', Opts>(ctx, it, end)) {
 3968|       |                        return;
 3969|       |                     }
 3970|       |
 3971|       |                     auto* key_start = it;
 3972|       |                     skip_string_view(ctx, it, end);
 3973|       |                     if (bool(ctx.error)) [[unlikely]]
 3974|       |                        return;
 3975|       |                     if (validate_utf8_span<Opts>(ctx, key_start, it)) [[unlikely]]
 3976|       |                        return;
 3977|       |                     const sv key = {key_start, size_t(it - key_start)};
 3978|       |
 3979|       |                     if (match_invalid_end<'"', Opts>(ctx, it, end)) {
 3980|       |                        return;
 3981|       |                     }
 3982|       |
 3983|       |                     if constexpr (deduction_key_count > 0) {
 3984|       |                        // We first check if a tag is defined and see if the key matches the tag
 3985|       |                        if constexpr (not tag_v<T>.empty()) {
 3986|       |                           if (key == tag_v<T>) {
 3987|       |                              if (parse_ws_colon<Opts>(ctx, it, end)) {
 3988|       |                                 return;
 3989|       |                              }
 3990|       |
 3991|       |                              using id_type = std::decay_t<decltype(ids_v<T>[0])>;
 3992|       |
 3993|       |                              std::conditional_t<std::integral<id_type>, id_type, sv> type_id{};
 3994|       |                              if constexpr (std::integral<id_type>) {
 3995|       |                                 from<JSON, id_type>::template op<ws_handled<Opts>()>(type_id, ctx, it, end);
 3996|       |                              }
 3997|       |                              else {
 3998|       |                                 // The id is turned into an index below and never leaves this
 3999|       |                                 // reader, so the view of the window it borrows cannot outlive it.
 4000|       |                                 parse_transient_string_view<ws_handled<Opts>()>(type_id, ctx, it, end);
 4001|       |                              }
 4002|       |                              if (bool(ctx.error)) [[unlikely]]
 4003|       |                                 return;
 4004|       |                              if (skip_ws<Opts>(ctx, it, end)) {
 4005|       |                                 return;
 4006|       |                              }
 4007|       |                              if (!(*it == ',' || *it == '}')) [[unlikely]] {
 4008|       |                                 ctx.error = error_code::syntax_error;
 4009|       |                                 return;
 4010|       |                              }
 4011|       |
 4012|       |                              size_t type_index;
 4013|       |                              if constexpr (std::integral<id_type>) {
 4014|       |                                 type_index = variant_id_to_index<T>::op(type_id);
 4015|       |                              }
 4016|       |                              else {
 4017|       |                                 type_index = variant_id_to_index<T>::op(
 4018|       |                                    type_id.data(), type_id.data() + type_id.size(), type_id.size());
 4019|       |                              }
 4020|       |                              if (type_index < ids_v<T>.size()) [[likely]] {
 4021|       |                                 // Check if the deduced types include the tag-specified type
 4022|       |                                 // If not, the tag doesn't match the fields
 4023|       |                                 // We're already inside if constexpr (deduction_registry.size()), so we know deduction
 4024|       |                                 // is happening. At this point, possible_types has been narrowed by field deduction.
 4025|       |                                 // Check if the tag-specified type is still possible
 4026|       |                                 const bool type_is_possible = possible_types[type_index];
 4027|       |                                 if (!type_is_possible) {
 4028|       |                                    // Tag specifies a type that doesn't match the fields seen so far
 4029|       |                                    ctx.error = error_code::no_matching_variant_type;
 4030|       |                                    return;
 4031|       |                                 }
 4032|       |
 4033|       |                                 if (!position_after_tag()) return;
 4034|       |                                 tag_specified_index = type_index; // Store the tag-specified type
 4035|       |                                 if (value.index() != type_index) emplace_runtime_variant(value, type_index);
 4036|       |                                 std::visit(
 4037|       |                                    [&](auto&& v) {
 4038|       |                                       using V = std::decay_t<decltype(v)>;
 4039|       |                                       constexpr bool is_object =
 4040|       |                                          (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4041|       |                                       if constexpr (variant_unit_alternative<V>) {
 4042|       |                                          // A unit alternative carries no data; its object holds only the
 4043|       |                                          // discriminator. Consume that body through an empty reflected object so
 4044|       |                                          // unknown-key policy and terminator handling match every other alternative.
 4045|       |                                          detail::variant_unit_body unit_body{};
 4046|       |                                          from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4047|       |                                                                                             tag_literal>(unit_body,
 4048|       |                                                                                                          ctx, it, end);
 4049|       |                                       }
 4050|       |                                       else if constexpr (is_object) {
 4051|       |                                          if constexpr (contains_tag<V, tag_literal>()) {
 4052|       |                                             // tag is a struct field, must re-parse
 4053|       |                                             if (!start.rewind(ctx, it, end)) return;
 4054|       |                                          }
 4055|       |                                          from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it,
 4056|       |                                                                                                           end);
 4057|       |                                       }
 4058|       |                                       else if constexpr (is_memory_object<V>) {
 4059|       |                                          if (!v) {
 4060|       |                                             if constexpr (is_specialization_v<V, std::optional>) {
 4061|       |                                                if constexpr (requires { v.emplace(); }) {
 4062|       |                                                   v.emplace();
 4063|       |                                                }
 4064|       |                                                else {
 4065|       |                                                   v = typename V::value_type{};
 4066|       |                                                }
 4067|       |                                             }
 4068|       |                                             else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4069|       |                                                v = std::make_unique<typename V::element_type>();
 4070|       |                                             else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4071|       |                                                v = std::make_shared<typename V::element_type>();
 4072|       |                                             else if constexpr (constructible<V>) {
 4073|       |                                                v = meta_construct_v<V>();
 4074|       |                                             }
 4075|       |                                             else if constexpr (std::is_pointer_v<V> &&
 4076|       |                                                                can_allocate_raw_pointer<Opts,
 4077|       |                                                                                         std::decay_t<decltype(ctx)>>) {
 4078|       |                                                if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4079|       |                                                   return;
 4080|       |                                                }
 4081|       |                                             }
 4082|       |                                             else {
 4083|       |                                                ctx.error = error_code::invalid_nullable_read;
 4084|       |                                                return;
 4085|       |                                                // Cannot read into unset nullable that is not std::optional,
 4086|       |                                                // std::unique_ptr, or std::shared_ptr
 4087|       |                                             }
 4088|       |                                          }
 4089|       |                                          if constexpr (contains_tag<memory_type<V>, tag_literal>()) {
 4090|       |                                             // tag is a struct field, must re-parse
 4091|       |                                             if (!start.rewind(ctx, it, end)) return;
 4092|       |                                          }
 4093|       |                                          from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(
 4094|       |                                             *v, ctx, it, end);
 4095|       |                                       }
 4096|       |                                       else if constexpr (custom_read<V>) {
 4097|       |                                          // Custom handlers parse the remaining body themselves and do not
 4098|       |                                          // accept the tag template parameter; the tag was already consumed.
 4099|       |                                          // This only works when the tag was the first key. If it came later,
 4100|       |                                          // we were reset to the object start and the custom handler would
 4101|       |                                          // absorb the tag, so error rather than corrupt the value.
 4102|       |                                          if (!first_key) {
 4103|       |                                             ctx.error = error_code::feature_not_supported;
 4104|       |                                             ctx.custom_error_message =
 4105|       |                                                "the tag must be the first key for a custom variant alternative";
 4106|       |                                             return;
 4107|       |                                          }
 4108|       |                                          from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4109|       |                                       }
 4110|       |                                    },
 4111|       |                                    value);
 4112|       |
 4113|       |                                 return; // we've decoded our target type
 4114|       |                              }
 4115|       |                              else [[unlikely]] {
 4116|       |                                 // Check if we have a default type (ids array shorter than variant)
 4117|       |                                 constexpr auto ids_size = ids_v<T>.size();
 4118|       |                                 constexpr auto variant_size = std::variant_size_v<T>;
 4119|       |                                 if constexpr (ids_size < variant_size) {
 4120|       |                                    // Use the first unlabeled type as the default
 4121|       |                                    const auto default_type_index = ids_size;
 4122|       |
 4123|       |                                    if (!position_after_tag()) return;
 4124|       |                                    tag_specified_index = default_type_index; // Store the default type index
 4125|       |                                    if (value.index() != default_type_index)
 4126|       |                                       emplace_runtime_variant(value, default_type_index);
 4127|       |                                    std::visit(
 4128|       |                                       [&](auto&& v) {
 4129|       |                                          using V = std::decay_t<decltype(v)>;
 4130|       |                                          constexpr bool is_object =
 4131|       |                                             (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4132|       |                                          if constexpr (variant_unit_alternative<V>) {
 4133|       |                                             // A unit alternative carries no data; its object holds only the
 4134|       |                                             // discriminator. Consume that body through an empty reflected object so
 4135|       |                                             // unknown-key policy and terminator handling match every other
 4136|       |                                             // alternative.
 4137|       |                                             detail::variant_unit_body unit_body{};
 4138|       |                                             from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4139|       |                                                                                                tag_literal>(
 4140|       |                                                unit_body, ctx, it, end);
 4141|       |                                          }
 4142|       |                                          else if constexpr (is_object) {
 4143|       |                                             if constexpr (contains_tag<V, tag_literal>()) {
 4144|       |                                                // tag is a struct field, must re-parse
 4145|       |                                                if (!start.rewind(ctx, it, end)) return;
 4146|       |                                             }
 4147|       |                                             from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4148|       |                                          }
 4149|       |                                          else if constexpr (is_memory_object<V>) {
 4150|       |                                             if (!v) {
 4151|       |                                                if constexpr (is_specialization_v<V, std::optional>) {
 4152|       |                                                   if constexpr (requires { v.emplace(); }) {
 4153|       |                                                      v.emplace();
 4154|       |                                                   }
 4155|       |                                                   else {
 4156|       |                                                      v = typename V::value_type{};
 4157|       |                                                   }
 4158|       |                                                }
 4159|       |                                                else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4160|       |                                                   v = std::make_unique<typename V::element_type>();
 4161|       |                                                else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4162|       |                                                   v = std::make_shared<typename V::element_type>();
 4163|       |                                                else if constexpr (constructible<V>) {
 4164|       |                                                   v = meta_construct_v<V>();
 4165|       |                                                }
 4166|       |                                                else if constexpr (std::is_pointer_v<V> &&
 4167|       |                                                                   can_allocate_raw_pointer<
 4168|       |                                                                      Opts, std::decay_t<decltype(ctx)>>) {
 4169|       |                                                   if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4170|       |                                                      return;
 4171|       |                                                   }
 4172|       |                                                }
 4173|       |                                                else {
 4174|       |                                                   ctx.error = error_code::invalid_nullable_read;
 4175|       |                                                   return;
 4176|       |                                                }
 4177|       |                                             }
 4178|       |                                             if constexpr (contains_tag<memory_type<V>, tag_literal>()) {
 4179|       |                                                // tag is a struct field, must re-parse
 4180|       |                                                if (!start.rewind(ctx, it, end)) return;
 4181|       |                                             }
 4182|       |                                             from<JSON, memory_type<V>>::template op<opening_handled<Opts>()>(*v, ctx,
 4183|       |                                                                                                              it, end);
 4184|       |                                          }
 4185|       |                                          else if constexpr (custom_read<V>) {
 4186|       |                                             // Custom handlers parse the remaining body themselves; this only
 4187|       |                                             // works when the tag was the first key (see above). If it came
 4188|       |                                             // later we were reset to the object start, so error rather than
 4189|       |                                             // let the custom handler absorb the tag.
 4190|       |                                             if (!first_key) {
 4191|       |                                                ctx.error = error_code::feature_not_supported;
 4192|       |                                                ctx.custom_error_message =
 4193|       |                                                   "the tag must be the first key for a custom variant alternative";
 4194|       |                                                return;
 4195|       |                                             }
 4196|       |                                             from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4197|       |                                          }
 4198|       |                                       },
 4199|       |                                       value);
 4200|       |
 4201|       |                                    return;
 4202|       |                                 }
 4203|       |                                 else {
 4204|       |                                    ctx.error = error_code::no_matching_variant_type;
 4205|       |                                    ctx.custom_error_message = variant_ids_string_v<T>;
 4206|       |                                    return;
 4207|       |                                 }
 4208|       |                              }
 4209|       |                           }
 4210|       |                        }
 4211|       |
 4212|       |                        // Inline decode_hash lookup for variant deduction
 4213|       |                        using deduction_keys_t = keys_wrapper<variant_deduction_keys<T>>;
 4214|       |                        constexpr auto& DeductionHashInfo = hash_info<deduction_keys_t>;
 4215|       |                        const auto deduction_index =
 4216|       |                           decode_hash_with_size<JSON, deduction_keys_t, DeductionHashInfo, DeductionHashInfo.type>::op(
 4217|       |                              key.data(), key.data() + key.size(), key.size());
 4218|       |                        if (deduction_index < deduction_key_count && variant_deduction_keys<T>[deduction_index] == key)
 4219|       |                           [[likely]] {
 4220|       |                           possible_types &= deduction_bits[deduction_index];
 4221|       |                        }
 4222|       |                        else if constexpr (Opts.error_on_unknown_keys) {
 4223|       |                           ctx.error = error_code::unknown_key;
 4224|       |                           return;
 4225|       |                        }
 4226|       |                     }
 4227|       |                     else if constexpr (not tag_v<T>.empty()) {
 4228|       |                        // empty object case for variant, if there are no normal elements
 4229|       |                        if (key == tag_v<T>) {
 4230|       |                           if (parse_ws_colon<Opts>(ctx, it, end)) {
 4231|       |                              return;
 4232|       |                           }
 4233|       |
 4234|       |                           // The id is turned into an index below and never leaves this reader,
 4235|       |                           // so the view of the window it borrows cannot outlive that window.
 4236|       |                           std::string_view type_id{};
 4237|       |                           parse_transient_string_view<ws_handled<Opts>()>(type_id, ctx, it, end);
 4238|       |                           if (bool(ctx.error)) [[unlikely]]
 4239|       |                              return;
 4240|       |                           if (skip_ws<Opts>(ctx, it, end)) {
 4241|       |                              return;
 4242|       |                           }
 4243|       |
 4244|       |                           const auto type_index = variant_id_to_index<T>::op(
 4245|       |                              type_id.data(), type_id.data() + type_id.size(), type_id.size());
 4246|       |                           if (type_index < ids_v<T>.size()) [[likely]] {
 4247|       |                              if (!position_after_tag()) return;
 4248|       |                              tag_specified_index = type_index; // Store the tag-specified type
 4249|       |                              if (value.index() != type_index) emplace_runtime_variant(value, type_index);
 4250|       |                           }
 4251|       |                           else {
 4252|       |                              // Check if we have a default type (ids array shorter than variant)
 4253|       |                              constexpr auto ids_size = ids_v<T>.size();
 4254|       |                              constexpr auto variant_size = std::variant_size_v<T>;
 4255|       |                              if constexpr (ids_size < variant_size) {
 4256|       |                                 // Use the first unlabeled type as the default
 4257|       |                                 if (!position_after_tag()) return;
 4258|       |                                 const auto default_index = ids_size;
 4259|       |                                 tag_specified_index = default_index; // Store the default type index
 4260|       |                                 if (value.index() != default_index) emplace_runtime_variant(value, default_index);
 4261|       |                              }
 4262|       |                              else {
 4263|       |                                 ctx.error = error_code::no_matching_variant_type;
 4264|       |                                 ctx.custom_error_message = variant_ids_string_v<T>;
 4265|       |                                 return;
 4266|       |                              }
 4267|       |                           }
 4268|       |                           // Parse the type (handles tag skipping and unknown keys)
 4269|       |                           std::visit(
 4270|       |                              [&](auto&& v) {
 4271|       |                                 using V = std::decay_t<decltype(v)>;
 4272|       |                                 if constexpr (custom_read<V>) {
 4273|       |                                    // Custom handlers parse the remaining object body themselves and do not
 4274|       |                                    // accept the tag template parameter that reflected objects use to skip an
 4275|       |                                    // interior tag key. That only works when the tag is the first key (it was
 4276|       |                                    // just consumed). If the tag came after other keys, position_after_tag()
 4277|       |                                    // reset us to the object start and the custom handler would absorb the tag
 4278|       |                                    // into its value, so error here rather than corrupt the result.
 4279|       |                                    if (!first_key) {
 4280|       |                                       ctx.error = error_code::feature_not_supported;
 4281|       |                                       ctx.custom_error_message =
 4282|       |                                          "the tag must be the first key for a custom variant alternative";
 4283|       |                                       return;
 4284|       |                                    }
 4285|       |                                    from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4286|       |                                 }
 4287|       |                                 else {
 4288|       |                                    if constexpr (contains_tag<V, tag_literal>()) {
 4289|       |                                       // tag is a struct field, must re-parse
 4290|       |                                       if (!start.rewind(ctx, it, end)) return;
 4291|       |                                    }
 4292|       |                                    from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4293|       |                                 }
 4294|       |                              },
 4295|       |                              value);
 4296|       |                           return;
 4297|       |                        }
 4298|       |                        else if constexpr (Opts.error_on_unknown_keys) {
 4299|       |                           ctx.error = error_code::unknown_key;
 4300|       |                           return;
 4301|       |                        }
 4302|       |                        else {
 4303|       |                           // Skip unknown key's value (non-tag key in empty variant)
 4304|       |                           if (parse_ws_colon<Opts>(ctx, it, end)) {
 4305|       |                              return;
 4306|       |                           }
 4307|       |                           skip_value<JSON>::op<Opts>(ctx, it, end);
 4308|       |                           if (bool(ctx.error)) [[unlikely]]
 4309|       |                              return;
 4310|       |                           resync_window_end(ctx, end); // a streaming skip refills
 4311|       |                           if (skip_ws<Opts>(ctx, it, end)) {
 4312|       |                              return;
 4313|       |                           }
 4314|       |                           continue; // Continue loop to find the tag
 4315|       |                        }
 4316|       |                     }
 4317|       |                     else if constexpr (Opts.error_on_unknown_keys) {
 4318|       |                        ctx.error = error_code::unknown_key;
 4319|       |                        return;
 4320|       |                     }
 4321|       |
 4322|       |                     auto matching_types = possible_types.popcount();
 4323|       |                     if (matching_types == 0) {
 4324|       |                        ctx.error = error_code::no_matching_variant_type;
 4325|       |                        return;
 4326|       |                     }
 4327|       |                     // Only short-circuit for variants without tags
 4328|       |                     else if constexpr (tag_v<T>.empty()) {
 4329|       |                        if (matching_types == 1) {
 4330|       |                           if (!start.rewind(ctx, it, end)) return;
 4331|       |                           const auto type_index = possible_types.countr_zero();
 4332|       |
 4333|       |                           if (value.index() != static_cast<size_t>(type_index))
 4334|       |                              emplace_runtime_variant(value, type_index);
 4335|       |                           std::visit(
 4336|       |                              [&](auto&& v) {
 4337|       |                                 using V = std::decay_t<decltype(v)>;
 4338|       |                                 constexpr bool is_object = (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4339|       |                                 if constexpr (variant_unit_alternative<V>) {
 4340|       |                                    // A unit alternative carries no data; its object holds only the discriminator.
 4341|       |                                    // Consume that body through an empty reflected object so unknown-key policy and
 4342|       |                                    // terminator handling match every other alternative.
 4343|       |                                    detail::variant_unit_body unit_body{};
 4344|       |                                    from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4345|       |                                                                                       tag_literal>(unit_body, ctx, it,
 4346|       |                                                                                                    end);
 4347|       |                                 }
 4348|       |                                 else if constexpr (is_object) {
 4349|       |                                    from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4350|       |                                 }
 4351|       |                                 else if constexpr (is_memory_object<V>) {
 4352|       |                                    if (!v) {
 4353|       |                                       if constexpr (is_specialization_v<V, std::optional>) {
 4354|       |                                          if constexpr (requires { v.emplace(); }) {
 4355|       |                                             v.emplace();
 4356|       |                                          }
 4357|       |                                          else {
 4358|       |                                             v = typename V::value_type{};
 4359|       |                                          }
 4360|       |                                       }
 4361|       |                                       else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4362|       |                                          v = std::make_unique<typename V::element_type>();
 4363|       |                                       else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4364|       |                                          v = std::make_shared<typename V::element_type>();
 4365|       |                                       else if constexpr (constructible<V>) {
 4366|       |                                          v = meta_construct_v<V>();
 4367|       |                                       }
 4368|       |                                       else if constexpr (std::is_pointer_v<V> &&
 4369|       |                                                          can_allocate_raw_pointer<Opts, std::decay_t<decltype(ctx)>>) {
 4370|       |                                          if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4371|       |                                             return;
 4372|       |                                          }
 4373|       |                                       }
 4374|       |                                       else {
 4375|       |                                          ctx.error = error_code::invalid_nullable_read;
 4376|       |                                          return;
 4377|       |                                          // Cannot read into unset nullable that is not std::optional,
 4378|       |                                          // std::unique_ptr, or std::shared_ptr
 4379|       |                                       }
 4380|       |                                    }
 4381|       |                                    from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(
 4382|       |                                       *v, ctx, it, end);
 4383|       |                                 }
 4384|       |                                 else if constexpr (custom_read<V>) {
 4385|       |                                    // Custom handlers parse the remaining body themselves.
 4386|       |                                    from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4387|       |                                 }
 4388|       |                              },
 4389|       |                              value);
 4390|       |
 4391|       |                           return; // we've decoded our target type
 4392|       |                        }
 4393|       |                     }
 4394|       |                     // For tagged variants, continue processing to validate tags
 4395|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 4396|       |                        return;
 4397|       |                     }
 4398|       |
 4399|       |                     skip_value<JSON>::op<Opts>(ctx, it, end);
 4400|       |                     if (bool(ctx.error)) [[unlikely]]
 4401|       |                        return;
 4402|       |                     resync_window_end(ctx, end); // a streaming skip refills
 4403|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 4404|       |                        return;
 4405|       |                     }
 4406|       |                  }
 4407|       |                  // Only apply ambiguous variant resolution if we have multiple object types
 4408|       |                  if constexpr ((type_counts::n_object + type_counts::n_nullable_object) > 1) {
 4409|       |                     // After parsing all keys, check if we have multiple matching types
 4410|       |                     // If so, choose the one with the fewest fields
 4411|       |                     auto final_matching = possible_types.popcount();
 4412|       |                     if (final_matching == 0) {
 4413|       |                        ctx.error = error_code::no_matching_variant_type;
 4414|       |                     }
 4415|       |                     else if (final_matching == 1) {
 4416|       |                        // Single type remains after field deduction
 4417|       |                        const auto type_index = possible_types.countr_zero();
 4418|       |
 4419|       |                        // Validate against tag if one was specified
 4420|       |                        if (tag_specified_index.has_value() &&
 4421|       |                            tag_specified_index.value() != static_cast<size_t>(type_index)) {
 4422|       |                           ctx.error = error_code::no_matching_variant_type;
 4423|       |                           return;
 4424|       |                        }
 4425|       |
 4426|       |                        if (!start.rewind(ctx, it, end)) return;
 4427|       |                        if (value.index() != static_cast<size_t>(type_index))
 4428|       |                           emplace_runtime_variant(value, type_index);
 4429|       |                        std::visit(
 4430|       |                           [&](auto&& v) {
 4431|       |                              using V = std::decay_t<decltype(v)>;
 4432|       |                              constexpr bool is_object = (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4433|       |                              if constexpr (variant_unit_alternative<V>) {
 4434|       |                                 // A unit alternative carries no data; its object holds only the discriminator.
 4435|       |                                 // Consume that body through an empty reflected object so unknown-key policy and
 4436|       |                                 // terminator handling match every other alternative.
 4437|       |                                 detail::variant_unit_body unit_body{};
 4438|       |                                 from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4439|       |                                                                                    tag_literal>(unit_body, ctx, it,
 4440|       |                                                                                                 end);
 4441|       |                              }
 4442|       |                              else if constexpr (is_object) {
 4443|       |                                 from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4444|       |                              }
 4445|       |                              else if constexpr (is_memory_object<V>) {
 4446|       |                                 if (!v) {
 4447|       |                                    if constexpr (is_specialization_v<V, std::optional>) {
 4448|       |                                       if constexpr (requires { v.emplace(); }) {
 4449|       |                                          v.emplace();
 4450|       |                                       }
 4451|       |                                       else {
 4452|       |                                          v = typename V::value_type{};
 4453|       |                                       }
 4454|       |                                    }
 4455|       |                                    else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4456|       |                                       v = std::make_unique<typename V::element_type>();
 4457|       |                                    else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4458|       |                                       v = std::make_shared<typename V::element_type>();
 4459|       |                                    else if constexpr (constructible<V>) {
 4460|       |                                       v = meta_construct_v<V>();
 4461|       |                                    }
 4462|       |                                    else if constexpr (std::is_pointer_v<V> &&
 4463|       |                                                       can_allocate_raw_pointer<Opts, std::decay_t<decltype(ctx)>>) {
 4464|       |                                       if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4465|       |                                          return;
 4466|       |                                       }
 4467|       |                                    }
 4468|       |                                    else {
 4469|       |                                       ctx.error = error_code::invalid_nullable_read;
 4470|       |                                       return;
 4471|       |                                    }
 4472|       |                                 }
 4473|       |                                 from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(*v, ctx,
 4474|       |                                                                                                               it, end);
 4475|       |                              }
 4476|       |                              else if constexpr (custom_read<V>) {
 4477|       |                                 // Custom handlers parse the remaining body themselves.
 4478|       |                                 from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4479|       |                              }
 4480|       |                           },
 4481|       |                           value);
 4482|       |                     }
 4483|       |                     else if (final_matching > 1) {
 4484|       |                        constexpr auto N = std::variant_size_v<T>;
 4485|       |
 4486|       |                        // Compile-time array of field counts for each variant type
 4487|       |                        constexpr auto field_counts = []<size_t... I>(std::index_sequence<I...>) {
 4488|       |                           return std::array<size_t, N> {
 4489|       |                              ([]<size_t J = I>() -> size_t {
 4490|       |                                 using V = std::decay_t<std::variant_alternative_t<J, T>>;
 4491|       |                                 if constexpr (glaze_object_t<V> || reflectable<V>) {
 4492|       |                                    return reflect<V>::size;
 4493|       |                                 }
 4494|       |                                 else if constexpr (is_memory_object<V>) {
 4495|       |                                    using X = memory_type<V>;
 4496|       |                                    if constexpr (glaze_object_t<X> || reflectable<X>) {
 4497|       |                                       return reflect<X>::size;
 4498|       |                                    }
 4499|       |                                    else {
 4500|       |                                       return (std::numeric_limits<size_t>::max)();
 4501|       |                                    }
 4502|       |                                 }
 4503|       |                                 else {
 4504|       |                                    return (std::numeric_limits<size_t>::max)();
 4505|       |                                 }
 4506|       |                              }.template operator()<I>())...
 4507|       |                           };
 4508|       |                        }(std::make_index_sequence<N>{});
 4509|       |
 4510|       |                        // Find the type with minimum field count among the possible types
 4511|       |                        size_t min_fields = (std::numeric_limits<size_t>::max)();
 4512|       |                        size_t chosen_index = N; // Invalid index initially
 4513|       |
 4514|       |                        for (size_t i = 0; i < N; ++i) {
 4515|       |                           if (possible_types[i] && field_counts[i] < min_fields) {
 4516|       |                              min_fields = field_counts[i];
 4517|       |                              chosen_index = i;
 4518|       |                           }
 4519|       |                        }
 4520|       |
 4521|       |                        if (chosen_index < N) {
 4522|       |                           // Validate against tag if one was specified
 4523|       |                           if (tag_specified_index.has_value() && tag_specified_index.value() != chosen_index) {
 4524|       |                              ctx.error = error_code::no_matching_variant_type;
 4525|       |                              return;
 4526|       |                           }
 4527|       |
 4528|       |                           if (!start.rewind(ctx, it, end)) return;
 4529|       |                           if (value.index() != chosen_index) emplace_runtime_variant(value, chosen_index);
 4530|       |                           std::visit(
 4531|       |                              [&](auto&& v) {
 4532|       |                                 using V = std::decay_t<decltype(v)>;
 4533|       |                                 constexpr bool is_object = (glaze_object_t<V> || reflectable<V>) && not custom_read<V>;
 4534|       |                                 if constexpr (variant_unit_alternative<V>) {
 4535|       |                                    // A unit alternative carries no data; its object holds only the discriminator.
 4536|       |                                    // Consume that body through an empty reflected object so unknown-key policy and
 4537|       |                                    // terminator handling match every other alternative.
 4538|       |                                    detail::variant_unit_body unit_body{};
 4539|       |                                    from<JSON, detail::variant_unit_body>::template op<opening_handled<Opts>(),
 4540|       |                                                                                       tag_literal>(unit_body, ctx, it,
 4541|       |                                                                                                    end);
 4542|       |                                 }
 4543|       |                                 else if constexpr (is_object) {
 4544|       |                                    from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it, end);
 4545|       |                                 }
 4546|       |                                 else if constexpr (is_memory_object<V>) {
 4547|       |                                    if (!v) {
 4548|       |                                       if constexpr (is_specialization_v<V, std::optional>) {
 4549|       |                                          if constexpr (requires { v.emplace(); }) {
 4550|       |                                             v.emplace();
 4551|       |                                          }
 4552|       |                                          else {
 4553|       |                                             v = typename V::value_type{};
 4554|       |                                          }
 4555|       |                                       }
 4556|       |                                       else if constexpr (is_specialization_v<V, std::unique_ptr>)
 4557|       |                                          v = std::make_unique<typename V::element_type>();
 4558|       |                                       else if constexpr (is_specialization_v<V, std::shared_ptr>)
 4559|       |                                          v = std::make_shared<typename V::element_type>();
 4560|       |                                       else if constexpr (constructible<V>) {
 4561|       |                                          v = meta_construct_v<V>();
 4562|       |                                       }
 4563|       |                                       else if constexpr (std::is_pointer_v<V> &&
 4564|       |                                                          can_allocate_raw_pointer<Opts, std::decay_t<decltype(ctx)>>) {
 4565|       |                                          if (!try_allocate_raw_pointer<Opts>(v, ctx)) {
 4566|       |                                             return;
 4567|       |                                          }
 4568|       |                                       }
 4569|       |                                       else {
 4570|       |                                          ctx.error = error_code::invalid_nullable_read;
 4571|       |                                          return;
 4572|       |                                       }
 4573|       |                                    }
 4574|       |                                    from<JSON, memory_type<V>>::template op<opening_handled<Opts>(), tag_literal>(
 4575|       |                                       *v, ctx, it, end);
 4576|       |                                 }
 4577|       |                                 else if constexpr (custom_read<V>) {
 4578|       |                                    // Custom handlers parse the remaining body themselves.
 4579|       |                                    from<JSON, V>::template op<opening_handled<Opts>()>(v, ctx, it, end);
 4580|       |                                 }
 4581|       |                              },
 4582|       |                              value);
 4583|       |                        }
 4584|       |                        else {
 4585|       |                           ctx.error = error_code::no_matching_variant_type;
 4586|       |                        }
 4587|       |                     }
 4588|       |                  }
 4589|       |                  else {
 4590|       |                     // For variants with 0 or 1 object types, use the original error handling
 4591|       |                     ctx.error = error_code::no_matching_variant_type;
 4592|       |                  }
 4593|       |               }
 4594|      0|               break;
 4595|  4.94M|            }
 4596|  1.66M|            case '[':
  ------------------
  |  Branch (4596:13): [True: 1.66M, False: 10.4M]
  ------------------
 4597|       |               // As with '{' above: the array reader each alternative goes through counts the level.
 4598|  1.66M|               process_variant_alternatives<T, is_variant_array>::template op<Opts>(value, ctx, it, end);
 4599|  1.66M|               break;
 4600|   902k|            case '"': {
  ------------------
  |  Branch (4600:13): [True: 902k, False: 11.2M]
  ------------------
 4601|   902k|               process_variant_alternatives<T, is_variant_str>::template op<Opts>(value, ctx, it, end);
 4602|   902k|               break;
 4603|  4.94M|            }
 4604|   243k|            case 't':
  ------------------
  |  Branch (4604:13): [True: 243k, False: 11.8M]
  ------------------
 4605|  1.37M|            case 'f': {
  ------------------
  |  Branch (4605:13): [True: 1.12M, False: 11.0M]
  ------------------
 4606|  1.37M|               process_variant_alternatives<T, is_variant_bool>::template op<Opts>(value, ctx, it, end);
 4607|  1.37M|               break;
 4608|   243k|            }
 4609|   202k|            case 'n':
  ------------------
  |  Branch (4609:13): [True: 202k, False: 11.9M]
  ------------------
 4610|       |               if constexpr (variant_count_v<T, is_variant_null> == 0) {
 4611|       |                  ctx.error = error_code::no_matching_variant_type;
 4612|       |               }
 4613|   202k|               else {
 4614|   202k|                  constexpr auto first_idx = variant_first_index_v<T, is_variant_null>;
 4615|   202k|                  using V = std::variant_alternative_t<first_idx, T>;
 4616|   202k|                  if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (4616:23): [True: 481, False: 201k]
  ------------------
 4617|   202k|                  match<"null", Opts>(ctx, it, end);
 4618|   202k|               }
 4619|   202k|               break;
 4620|  3.05M|            default: {
  ------------------
  |  Branch (4620:13): [True: 3.05M, False: 9.08M]
  ------------------
 4621|       |               // Not bool, string, object, or array so must be number or null
 4622|  3.05M|               process_variant_alternatives<T, is_variant_num>::template op<Opts>(value, ctx, it, end);
 4623|  3.05M|            }
 4624|  12.1M|            }
 4625|       |         }
 4626|       |         else {
 4627|       |            // For non-auto-deducible variants, try each type until one succeeds
 4628|       |            constexpr auto N = std::variant_size_v<T>;
 4629|       |            bool parsed = false;
 4630|       |            bool exhausted = false; // speculation budget spent; see charge_speculation
 4631|       |
 4632|       |            for_each<N>([&]<size_t I>() {
 4633|       |               if (parsed || exhausted || variant_alternative_exhausted(ctx)) return;
 4634|       |
 4635|       |               auto copy_it = it;
 4636|       |               // A rejected alternative may have bailed out inside a container, which leaves its
 4637|       |               // nesting level counted (see enter_depth), so the depth rewinds with the iterator.
 4638|       |               const auto copy_depth = ctx.depth;
 4639|       |
 4640|       |               // Try parsing as this type
 4641|       |               if (value.index() != I) {
 4642|       |                  emplace_runtime_variant(value, I);
 4643|       |               }
 4644|       |
 4645|       |               std::visit([&](auto&& v) { parse<JSON>::op<Options>(v, ctx, it, end); }, value);
 4646|       |               if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 4647|       |                  exhausted = true; // only rejected attempts are charged; see charge_speculation
 4648|       |               }
 4649|       |
 4650|       |               if (!bool(ctx.error)) {
 4651|       |                  parsed = true;
 4652|       |               }
 4653|       |               else if constexpr (not Options.null_terminated) {
 4654|       |                  // In non-null-terminated mode, if we hit end_reached after advancing the iterator,
 4655|       |                  // it means we successfully parsed the value but couldn't skip trailing whitespace
 4656|       |                  if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 4657|       |                     // We advanced the iterator, so we did parse something -- unless what advanced it
 4658|       |                     // was an abandoned attempt, which is what a spent speculation budget means.
 4659|       |                     parsed = true;
 4660|       |                     ctx.error = error_code::none;
 4661|       |                  }
 4662|       |                  else {
 4663|       |                     // Reset for next attempt (unless this is the last type)
 4664|       |                     it = copy_it;
 4665|       |                     rewind_depth<Options>(ctx, copy_depth);
 4666|       |                     if constexpr (I + 1 < N) {
 4667|       |                        if (not exhausted && not variant_alternative_exhausted(ctx)) {
 4668|       |                           ctx.error = error_code::none; // Clear error for next attempt
 4669|       |                        }
 4670|       |                     }
 4671|       |                  }
 4672|       |               }
 4673|       |               else {
 4674|       |                  // Reset for next attempt (unless this is the last type)
 4675|       |                  it = copy_it;
 4676|       |                  rewind_depth<Options>(ctx, copy_depth);
 4677|       |                  if constexpr (I + 1 < N) {
 4678|       |                     if (not exhausted && not variant_alternative_exhausted(ctx)) {
 4679|       |                        ctx.error = error_code::none; // Clear error for next attempt
 4680|       |                     }
 4681|       |                  }
 4682|       |               }
 4683|       |            });
 4684|       |         }
 4685|  12.1M|      }
_ZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_:
 3520|  1.66M|      {
 3521|  1.66M|         constexpr auto category_count = variant_count_v<Variant, Trait>;
 3522|       |
 3523|       |         if constexpr (category_count == 0) {
 3524|       |            ctx.error = error_code::no_matching_variant_type;
 3525|       |         }
 3526|  1.66M|         else {
 3527|  1.66M|            constexpr auto N = std::variant_size_v<Variant>;
 3528|  1.66M|            constexpr auto const_count = variant_filtered_count_v<Variant, Trait, true>;
 3529|  1.66M|            constexpr auto non_const_count = variant_filtered_count_v<Variant, Trait, false>;
 3530|       |
 3531|  1.66M|            bool found_match{};
 3532|       |            // Set when the speculative parsing budget runs out; see charge_speculation. An ambiguous
 3533|       |            // nest re-parses the same subtree per alternative at every level, which is exponential,
 3534|       |            // so the budget stops it and the failure already in hand is reported.
 3535|  1.66M|            bool exhausted{};
 3536|       |
 3537|       |            // First pass: const glaze types in this category
 3538|       |            if constexpr (const_count > 0) {
 3539|       |               for_each<N>([&]<size_t I>() {
 3540|       |                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3541|       |                     return;
 3542|       |                  }
 3543|       |                  using V = std::variant_alternative_t<I, Variant>;
 3544|       |                  if constexpr (Trait<V>::value && glaze_const_value_t<V>) {
 3545|       |                     // run time substitute to compare to const value
 3546|       |                     std::remove_const_t<std::remove_pointer_t<std::remove_const_t<meta_wrapper_t<V>>>> substitute{};
 3547|       |                     auto copy_it{it};
 3548|       |                     // A rejected alternative may have bailed out inside a container, which leaves its
 3549|       |                     // nesting level counted (see enter_depth). Rewind the depth with the iterator so
 3550|       |                     // trying N alternatives cannot spend N levels of the recursion budget.
 3551|       |                     const auto copy_depth{ctx.depth};
 3552|       |                     parse<JSON>::op<ws_handled<Options>()>(substitute, ctx, it, end);
 3553|       |                     static constexpr auto const_value{*meta_wrapper_v<V>};
 3554|       |                     if (substitute == const_value) {
 3555|       |                        found_match = true;
 3556|       |                        if (!std::holds_alternative<V>(value)) {
 3557|       |                           value = V{};
 3558|       |                        }
 3559|       |                     }
 3560|       |                     else {
 3561|       |                        // Rejected: charge the bytes it parsed before we rewind. See charge_speculation.
 3562|       |                        if (!charge_speculation(ctx, size_t(it - copy_it))) {
 3563|       |                           exhausted = true;
 3564|       |                        }
 3565|       |                        if constexpr (not Options.null_terminated) {
 3566|       |                           if (ctx.error == error_code::end_reached && not exhausted) {
 3567|       |                              ctx.error = error_code::none;
 3568|       |                           }
 3569|       |                        }
 3570|       |                        it = copy_it;
 3571|       |                        rewind_depth<Options>(ctx, copy_depth);
 3572|       |                     }
 3573|       |                  }
 3574|       |               });
 3575|       |               if (found_match) {
 3576|       |                  return;
 3577|       |               }
 3578|       |            }
 3579|       |
 3580|       |            // Second pass: non-const types in this category
 3581|  1.66M|            if constexpr (non_const_count > 0) {
 3582|       |               // Track position within matching types for "is last" check.
 3583|       |               // We iterate over all variant indices but only process matching types,
 3584|       |               // so we need runtime tracking (vs the old tuple-based approach where
 3585|       |               // the loop index directly corresponded to position in filtered set).
 3586|       |               // This has negligible cost: one increment per matching type.
 3587|  1.66M|               size_t non_const_idx = 0;
 3588|       |
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3591|  1.66M|                     return;
 3592|  1.66M|                  }
 3593|  1.66M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|  1.66M|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|  1.66M|                     auto copy_it{it};
 3596|  1.66M|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|  1.66M|                     if (!std::holds_alternative<V>(value)) {
 3598|  1.66M|                        value = V{};
 3599|  1.66M|                     }
 3600|  1.66M|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|  1.66M|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|  1.66M|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|  1.66M|                     }
 3604|  1.66M|                     if (!bool(ctx.error)) {
 3605|  1.66M|                        found_match = true;
 3606|  1.66M|                     }
 3607|  1.66M|                     else if constexpr (not Options.null_terminated) {
 3608|  1.66M|                        constexpr bool is_complete_type =
 3609|  1.66M|                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|  1.66M|                        if constexpr (is_complete_type) {
 3612|  1.66M|                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|  1.66M|                              found_match = true;
 3614|  1.66M|                              ctx.error = error_code::none;
 3615|  1.66M|                           }
 3616|  1.66M|                           else {
 3617|  1.66M|                              it = copy_it;
 3618|  1.66M|                              rewind_depth<Options>(ctx, copy_depth);
 3619|  1.66M|                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|  1.66M|                                  not variant_alternative_exhausted(ctx)) {
 3621|  1.66M|                                 ctx.error = error_code::none;
 3622|  1.66M|                              }
 3623|  1.66M|                           }
 3624|  1.66M|                        }
 3625|  1.66M|                        else {
 3626|  1.66M|                           it = copy_it;
 3627|  1.66M|                           rewind_depth<Options>(ctx, copy_depth);
 3628|  1.66M|                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|  1.66M|                               not variant_alternative_exhausted(ctx)) {
 3630|  1.66M|                              ctx.error = error_code::none;
 3631|  1.66M|                           }
 3632|  1.66M|                        }
 3633|  1.66M|                     }
 3634|  1.66M|                     else {
 3635|  1.66M|                        it = copy_it;
 3636|  1.66M|                        rewind_depth<Options>(ctx, copy_depth);
 3637|  1.66M|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|  1.66M|                            not variant_alternative_exhausted(ctx)) {
 3639|  1.66M|                           ctx.error = error_code::none;
 3640|  1.66M|                        }
 3641|  1.66M|                     }
 3642|  1.66M|                     ++non_const_idx;
 3643|  1.66M|                  }
 3644|  1.66M|               });
 3645|  1.66M|               if (!found_match) {
  ------------------
  |  Branch (3645:20): [True: 1.11k, False: 1.66M]
  ------------------
 3646|  1.11k|                  if constexpr (non_const_count == 1) {
 3647|       |                     // Keep the specific error from the single type we tried
 3648|       |                  }
 3649|       |                  else if (not exhausted && not variant_alternative_exhausted(ctx)) {
 3650|       |                     // Over-nested input is not a failure of the alternative set; keep saying so.
 3651|       |                     ctx.error = error_code::no_matching_variant_type;
 3652|       |                  }
 3653|  1.11k|               }
 3654|       |            }
 3655|       |            else {
 3656|       |               ctx.error = error_code::no_matching_variant_type;
 3657|       |            }
 3658|  1.66M|         }
 3659|  1.66M|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm0EEEDav:
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.66M]
  |  Branch (3590:38): [True: 0, False: 1.66M]
  |  Branch (3590:51): [True: 0, False: 1.66M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.66M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.66M|               });
_ZN3glz29variant_alternative_exhaustedITkNS_10is_contextENS_7contextEEEbRT_:
 3509|  22.6M|   {
 3510|  22.6M|      return ctx.error == error_code::exceeded_max_recursive_depth;
 3511|  22.6M|   }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm1EEEDav:
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.66M]
  |  Branch (3590:38): [True: 0, False: 1.66M]
  |  Branch (3590:51): [True: 0, False: 1.66M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.66M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.66M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm2EEEDav:
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.66M]
  |  Branch (3590:38): [True: 0, False: 1.66M]
  |  Branch (3590:51): [True: 0, False: 1.66M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.66M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.66M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm3EEEDav:
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.66M]
  |  Branch (3590:38): [True: 0, False: 1.66M]
  |  Branch (3590:51): [True: 0, False: 1.66M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.66M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.66M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm4EEEDav:
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.66M]
  |  Branch (3590:38): [True: 0, False: 1.66M]
  |  Branch (3590:51): [True: 0, False: 1.66M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.66M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|  1.66M|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|  1.66M|                     auto copy_it{it};
 3596|  1.66M|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|  1.66M|                     if (!std::holds_alternative<V>(value)) {
  ------------------
  |  Branch (3597:26): [True: 1.02M, False: 640k]
  ------------------
 3598|  1.02M|                        value = V{};
 3599|  1.02M|                     }
 3600|  1.66M|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|  1.66M|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
  ------------------
  |  Branch (3601:26): [True: 1.11k, False: 1.66M]
  |  Branch (3601:45): [True: 0, False: 1.11k]
  ------------------
 3602|      0|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|      0|                     }
 3604|  1.66M|                     if (!bool(ctx.error)) {
  ------------------
  |  Branch (3604:26): [True: 1.66M, False: 1.11k]
  ------------------
 3605|  1.66M|                        found_match = true;
 3606|  1.66M|                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|  1.11k|                     else {
 3635|  1.11k|                        it = copy_it;
 3636|  1.11k|                        rewind_depth<Options>(ctx, copy_depth);
 3637|  1.11k|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
  ------------------
  |  Branch (3637:29): [True: 0, False: 1.11k]
  |  Branch (3637:68): [True: 0, False: 0]
  ------------------
 3638|      0|                            not variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3638:29): [True: 0, False: 0]
  ------------------
 3639|      0|                           ctx.error = error_code::none;
 3640|      0|                        }
 3641|  1.11k|                     }
 3642|  1.66M|                     ++non_const_idx;
 3643|  1.66M|                  }
 3644|  1.66M|               });
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEETkNS_10is_contextERNS_7contextERPKcSH_EEvOT0_OT1_OT2_T3_:
   49|  1.66M|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  1.66M|         else {
   60|  1.66M|            using V = std::remove_cvref_t<T>;
   61|  1.66M|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  1.66M|                                             end);
   63|  1.66M|         }
   64|  1.66M|      }
_ZN3glz4fromILj10ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERS9_TkNS_10is_contextERNS_7contextERPKcSH_EEvOT0_OT1_OT2_T3_:
 2050|  1.66M|      {
 2051|  1.66M|         constexpr auto Opts = ws_handled_off<Options>();
 2052|       |         if constexpr (!check_ws_handled(Options)) {
 2053|       |            if (skip_ws<Opts>(ctx, it, end)) {
 2054|       |               return;
 2055|       |            }
 2056|       |         }
 2057|       |
 2058|  1.66M|         if (match_invalid_end<'[', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2058:14): [True: 0, False: 1.66M]
  ------------------
 2059|      0|            return;
 2060|      0|         }
 2061|       |         // one nesting level (see enter_depth): counted in both modes so the limit binds,
 2062|       |         // released at each syntactic close below
 2063|  1.66M|         if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (2063:14): [True: 0, False: 1.66M]
  ------------------
 2064|      0|            return;
 2065|      0|         }
 2066|       |
 2067|  1.66M|         const auto ws_start = it;
 2068|  1.66M|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2068:14): [True: 0, False: 1.66M]
  ------------------
 2069|      0|            return;
 2070|      0|         }
 2071|       |
 2072|  1.66M|         if (*it == ']') {
  ------------------
  |  Branch (2072:14): [True: 941k, False: 727k]
  ------------------
 2073|   941k|            --ctx.depth;
 2074|   941k|            ++it;
 2075|   941k|            if constexpr ((resizable<T> || is_inplace_vector<T>) && not check_append_arrays(Opts)) {
 2076|   941k|               value.clear();
 2077|       |
 2078|       |               if constexpr (check_shrink_to_fit(Opts) && has_shrink_to_fit<T>) {
 2079|       |                  value.shrink_to_fit();
 2080|       |               }
 2081|   941k|            }
 2082|   941k|            return;
 2083|   941k|         }
 2084|       |
 2085|   727k|         const size_t ws_size = size_t(it - ws_start);
 2086|       |
 2087|   727k|         static constexpr bool should_append = (resizable<T> || is_inplace_vector<T>) && check_append_arrays(Opts);
  ------------------
  |  Branch (2087:49): [True: 727k, Folded]
  |  Branch (2087:65): [Folded, False: 0]
  |  Branch (2087:90): [Folded, False: 0]
  ------------------
 2088|   727k|         if constexpr (not should_append) {
 2089|   727k|            const auto n = value.size();
 2090|       |
 2091|   727k|            auto value_it = value.begin();
 2092|       |
 2093|   761k|            for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (2093:32): [True: 286k, False: 474k]
  ------------------
 2094|   286k|               parse<JSON>::op<ws_handled<Opts>()>(*value_it++, ctx, it, end);
 2095|   286k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2095:20): [True: 32, False: 286k]
  ------------------
 2096|     32|                  return;
 2097|   286k|               if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2097:20): [True: 0, False: 286k]
  ------------------
 2098|      0|                  return;
 2099|      0|               }
 2100|   286k|               if (*it == ',') {
  ------------------
  |  Branch (2100:20): [True: 33.8k, False: 252k]
  ------------------
 2101|  33.8k|                  ++it;
 2102|       |
 2103|       |                  if constexpr (!Opts.minified && !Opts.comments) {
 2104|       |                     if (ws_size && ws_size < size_t(end - it)) {
 2105|       |                        skip_matching_ws(ws_start, it, ws_size);
 2106|       |                     }
 2107|       |                  }
 2108|       |
 2109|  33.8k|                  if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2109:23): [True: 0, False: 33.8k]
  ------------------
 2110|      0|                     return;
 2111|      0|                  }
 2112|  33.8k|               }
 2113|   252k|               else if (*it == ']') {
  ------------------
  |  Branch (2113:25): [True: 252k, False: 0]
  ------------------
 2114|   252k|                  --ctx.depth;
 2115|   252k|                  ++it;
 2116|   252k|                  if constexpr (erasable<T>) {
 2117|   252k|                     value.erase(value_it,
 2118|   252k|                                 value.end()); // use erase rather than resize for non-default constructible elements
 2119|       |
 2120|       |                     if constexpr (check_shrink_to_fit(Opts) && has_shrink_to_fit<T>) {
 2121|       |                        value.shrink_to_fit();
 2122|       |                     }
 2123|   252k|                  }
 2124|   252k|                  return;
 2125|   252k|               }
 2126|      0|               else [[unlikely]] {
 2127|      0|                  ctx.error = error_code::expected_bracket;
 2128|      0|                  return;
 2129|      0|               }
 2130|   286k|            }
 2131|   727k|         }
 2132|       |
 2133|       |         if constexpr (Opts.partial_read) {
 2134|       |            // partial_read stops early on a success path, so give the level back like the
 2135|       |            // syntactic-close paths do; otherwise it accumulates across reads sharing a context.
 2136|       |            --ctx.depth;
 2137|       |            return;
 2138|       |         }
 2139|   727k|         else {
 2140|       |            // growing
 2141|   727k|            if constexpr (emplace_backable<T> || has_try_emplace_back<T>) {
 2142|  8.74M|               while (it < end) {
  ------------------
  |  Branch (2142:23): [True: 8.49M, False: 252k]
  ------------------
 2143|       |                  // Streaming refill point: at start of each iteration, ensure buffer has data
 2144|       |                  if constexpr (has_streaming_state<decltype(ctx)>) {
 2145|       |                     if (ctx.stream.enabled()) {
 2146|       |                        const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 2147|       |                        const size_t remaining = ctx.stream.size() - consumed;
 2148|       |                        // Refill when less than half of buffer remains to ensure space for next element
 2149|       |                        if (remaining <= ctx.stream.size() / 2 || it >= end) {
 2150|       |                           const char* new_it;
 2151|       |                           const char* new_end;
 2152|       |                           ctx.stream.consume_and_refill(consumed, new_it, new_end);
 2153|       |                           it = new_it;
 2154|       |                           end = new_end;
 2155|       |                           if (it >= end && ctx.stream.at_eof()) {
 2156|       |                              break; // No more data, exit loop normally
 2157|       |                           }
 2158|       |                        }
 2159|       |                     }
 2160|       |                  }
 2161|       |
 2162|       |                  if constexpr (has_try_emplace_back<T>) {
 2163|       |                     if (value.try_emplace_back())
 2164|       |                        parse<JSON>::op<ws_handled<Opts>()>(value.back(), ctx, it, end);
 2165|       |                     else
 2166|       |                        ctx.error = error_code::exceeded_static_array_size;
 2167|       |                  }
 2168|  8.49M|                  else {
 2169|  8.49M|                     parse<JSON>::op<ws_handled<Opts>()>(value.emplace_back(), ctx, it, end);
 2170|  8.49M|                  }
 2171|       |
 2172|  8.49M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2172:23): [True: 1.08k, False: 8.48M]
  ------------------
 2173|  1.08k|                     return;
 2174|       |
 2175|       |                  // Streaming refill point: after parsing each element, refill if buffer is low
 2176|       |                  if constexpr (has_streaming_state<decltype(ctx)>) {
 2177|       |                     if (ctx.stream.enabled()) {
 2178|       |                        const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 2179|       |                        // Refill when less than 25% of buffer remains to ensure enough space for next element
 2180|       |                        if (ctx.stream.size() - consumed <= ctx.stream.size() / 4 || it >= end) {
 2181|       |                           const char* new_it;
 2182|       |                           const char* new_end;
 2183|       |                           ctx.stream.consume_and_refill(consumed, new_it, new_end);
 2184|       |                           it = new_it;
 2185|       |                           end = new_end;
 2186|       |                           if (it >= end && ctx.stream.at_eof()) {
 2187|       |                              ctx.error = error_code::unexpected_end;
 2188|       |                              return;
 2189|       |                           }
 2190|       |                        }
 2191|       |                     }
 2192|       |                  }
 2193|       |
 2194|  8.48M|                  if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2194:23): [True: 0, False: 8.48M]
  ------------------
 2195|      0|                     return;
 2196|      0|                  }
 2197|  8.48M|                  if (*it == ',') [[likely]] {
  ------------------
  |  Branch (2197:23): [True: 8.01M, False: 473k]
  ------------------
 2198|  8.01M|                     ++it;
 2199|       |
 2200|       |                     if constexpr (!Opts.minified && !Opts.comments) {
 2201|       |                        if (ws_size && ws_size < size_t(end - it)) {
 2202|       |                           skip_matching_ws(ws_start, it, ws_size);
 2203|       |                        }
 2204|       |                     }
 2205|       |
 2206|  8.01M|                     if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2206:26): [True: 0, False: 8.01M]
  ------------------
 2207|      0|                        return;
 2208|      0|                     }
 2209|  8.01M|                  }
 2210|   473k|                  else if (*it == ']') {
  ------------------
  |  Branch (2210:28): [True: 473k, False: 0]
  ------------------
 2211|   473k|                     --ctx.depth;
 2212|   473k|                     ++it;
 2213|       |                     if constexpr (check_shrink_to_fit(Opts) && has_shrink_to_fit<T>) {
 2214|       |                        value.shrink_to_fit();
 2215|       |                     }
 2216|   473k|                     return;
 2217|   473k|                  }
 2218|      0|                  else [[unlikely]] {
 2219|      0|                     ctx.error = error_code::expected_bracket;
 2220|      0|                     return;
 2221|      0|                  }
 2222|  8.48M|               }
 2223|       |
 2224|       |               // A valid array always returns from inside the loop upon reaching ']'.
 2225|       |               // For a null-terminated buffer the loop can only exit here by falling
 2226|       |               // through when `it` reaches the terminator without a closing bracket,
 2227|       |               // which means the input was truncated (e.g. "[", "[1," or "[1,2,").
 2228|       |               // Non-null-terminated buffers surface this through skip_ws/depth
 2229|       |               // tracking (or the streaming refill break), so this guard is limited
 2230|       |               // to the null-terminated case.
 2231|   252k|               if constexpr (Opts.null_terminated) {
 2232|   252k|                  ctx.error = error_code::unexpected_end;
 2233|   252k|               }
 2234|       |            }
 2235|       |            else {
 2236|       |               ctx.error = error_code::exceeded_static_array_size;
 2237|       |            }
 2238|   727k|         }
 2239|   727k|      }
_ZN3glz12rewind_depthITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextENS_7contextEEEvRT0_j:
 3492|  2.19k|   {
 3493|  2.19k|      if (ctx.error == error_code::exceeded_max_recursive_depth) [[unlikely]] {
  ------------------
  |  Branch (3493:11): [True: 0, False: 2.19k]
  ------------------
 3494|      0|         return;
 3495|      0|      }
 3496|  2.19k|      if constexpr (Opts.null_terminated) {
 3497|  2.19k|         ctx.depth = depth;
 3498|       |      }
 3499|       |      else {
 3500|       |         if (ctx.error != error_code::end_reached && ctx.error != error_code::unexpected_end) {
 3501|       |            ctx.depth = depth;
 3502|       |         }
 3503|       |      }
 3504|  2.19k|   }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm5EEEDav:
 3589|  1.66M|               for_each<N>([&]<size_t I>() {
 3590|  1.66M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 1.66M, False: 1.11k]
  |  Branch (3590:38): [True: 0, False: 1.11k]
  |  Branch (3590:51): [True: 0, False: 1.11k]
  ------------------
 3591|  1.66M|                     return;
 3592|  1.66M|                  }
 3593|  1.11k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.11k|               });
_ZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_:
 3520|   904k|      {
 3521|   904k|         constexpr auto category_count = variant_count_v<Variant, Trait>;
 3522|       |
 3523|       |         if constexpr (category_count == 0) {
 3524|       |            ctx.error = error_code::no_matching_variant_type;
 3525|       |         }
 3526|   904k|         else {
 3527|   904k|            constexpr auto N = std::variant_size_v<Variant>;
 3528|   904k|            constexpr auto const_count = variant_filtered_count_v<Variant, Trait, true>;
 3529|   904k|            constexpr auto non_const_count = variant_filtered_count_v<Variant, Trait, false>;
 3530|       |
 3531|   904k|            bool found_match{};
 3532|       |            // Set when the speculative parsing budget runs out; see charge_speculation. An ambiguous
 3533|       |            // nest re-parses the same subtree per alternative at every level, which is exponential,
 3534|       |            // so the budget stops it and the failure already in hand is reported.
 3535|   904k|            bool exhausted{};
 3536|       |
 3537|       |            // First pass: const glaze types in this category
 3538|       |            if constexpr (const_count > 0) {
 3539|       |               for_each<N>([&]<size_t I>() {
 3540|       |                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3541|       |                     return;
 3542|       |                  }
 3543|       |                  using V = std::variant_alternative_t<I, Variant>;
 3544|       |                  if constexpr (Trait<V>::value && glaze_const_value_t<V>) {
 3545|       |                     // run time substitute to compare to const value
 3546|       |                     std::remove_const_t<std::remove_pointer_t<std::remove_const_t<meta_wrapper_t<V>>>> substitute{};
 3547|       |                     auto copy_it{it};
 3548|       |                     // A rejected alternative may have bailed out inside a container, which leaves its
 3549|       |                     // nesting level counted (see enter_depth). Rewind the depth with the iterator so
 3550|       |                     // trying N alternatives cannot spend N levels of the recursion budget.
 3551|       |                     const auto copy_depth{ctx.depth};
 3552|       |                     parse<JSON>::op<ws_handled<Options>()>(substitute, ctx, it, end);
 3553|       |                     static constexpr auto const_value{*meta_wrapper_v<V>};
 3554|       |                     if (substitute == const_value) {
 3555|       |                        found_match = true;
 3556|       |                        if (!std::holds_alternative<V>(value)) {
 3557|       |                           value = V{};
 3558|       |                        }
 3559|       |                     }
 3560|       |                     else {
 3561|       |                        // Rejected: charge the bytes it parsed before we rewind. See charge_speculation.
 3562|       |                        if (!charge_speculation(ctx, size_t(it - copy_it))) {
 3563|       |                           exhausted = true;
 3564|       |                        }
 3565|       |                        if constexpr (not Options.null_terminated) {
 3566|       |                           if (ctx.error == error_code::end_reached && not exhausted) {
 3567|       |                              ctx.error = error_code::none;
 3568|       |                           }
 3569|       |                        }
 3570|       |                        it = copy_it;
 3571|       |                        rewind_depth<Options>(ctx, copy_depth);
 3572|       |                     }
 3573|       |                  }
 3574|       |               });
 3575|       |               if (found_match) {
 3576|       |                  return;
 3577|       |               }
 3578|       |            }
 3579|       |
 3580|       |            // Second pass: non-const types in this category
 3581|   904k|            if constexpr (non_const_count > 0) {
 3582|       |               // Track position within matching types for "is last" check.
 3583|       |               // We iterate over all variant indices but only process matching types,
 3584|       |               // so we need runtime tracking (vs the old tuple-based approach where
 3585|       |               // the loop index directly corresponded to position in filtered set).
 3586|       |               // This has negligible cost: one increment per matching type.
 3587|   904k|               size_t non_const_idx = 0;
 3588|       |
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3591|   904k|                     return;
 3592|   904k|                  }
 3593|   904k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|   904k|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|   904k|                     auto copy_it{it};
 3596|   904k|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|   904k|                     if (!std::holds_alternative<V>(value)) {
 3598|   904k|                        value = V{};
 3599|   904k|                     }
 3600|   904k|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|   904k|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|   904k|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|   904k|                     }
 3604|   904k|                     if (!bool(ctx.error)) {
 3605|   904k|                        found_match = true;
 3606|   904k|                     }
 3607|   904k|                     else if constexpr (not Options.null_terminated) {
 3608|   904k|                        constexpr bool is_complete_type =
 3609|   904k|                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|   904k|                        if constexpr (is_complete_type) {
 3612|   904k|                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|   904k|                              found_match = true;
 3614|   904k|                              ctx.error = error_code::none;
 3615|   904k|                           }
 3616|   904k|                           else {
 3617|   904k|                              it = copy_it;
 3618|   904k|                              rewind_depth<Options>(ctx, copy_depth);
 3619|   904k|                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|   904k|                                  not variant_alternative_exhausted(ctx)) {
 3621|   904k|                                 ctx.error = error_code::none;
 3622|   904k|                              }
 3623|   904k|                           }
 3624|   904k|                        }
 3625|   904k|                        else {
 3626|   904k|                           it = copy_it;
 3627|   904k|                           rewind_depth<Options>(ctx, copy_depth);
 3628|   904k|                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|   904k|                               not variant_alternative_exhausted(ctx)) {
 3630|   904k|                              ctx.error = error_code::none;
 3631|   904k|                           }
 3632|   904k|                        }
 3633|   904k|                     }
 3634|   904k|                     else {
 3635|   904k|                        it = copy_it;
 3636|   904k|                        rewind_depth<Options>(ctx, copy_depth);
 3637|   904k|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|   904k|                            not variant_alternative_exhausted(ctx)) {
 3639|   904k|                           ctx.error = error_code::none;
 3640|   904k|                        }
 3641|   904k|                     }
 3642|   904k|                     ++non_const_idx;
 3643|   904k|                  }
 3644|   904k|               });
 3645|   904k|               if (!found_match) {
  ------------------
  |  Branch (3645:20): [True: 0, False: 904k]
  ------------------
 3646|      0|                  if constexpr (non_const_count == 1) {
 3647|       |                     // Keep the specific error from the single type we tried
 3648|       |                  }
 3649|       |                  else if (not exhausted && not variant_alternative_exhausted(ctx)) {
 3650|       |                     // Over-nested input is not a failure of the alternative set; keep saying so.
 3651|       |                     ctx.error = error_code::no_matching_variant_type;
 3652|       |                  }
 3653|      0|               }
 3654|       |            }
 3655|       |            else {
 3656|       |               ctx.error = error_code::no_matching_variant_type;
 3657|       |            }
 3658|   904k|         }
 3659|   904k|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm0EEEDav:
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 904k]
  |  Branch (3590:38): [True: 0, False: 904k]
  |  Branch (3590:51): [True: 0, False: 904k]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|   904k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|   904k|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm1EEEDav:
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 904k]
  |  Branch (3590:38): [True: 0, False: 904k]
  |  Branch (3590:51): [True: 0, False: 904k]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|   904k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|   904k|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm2EEEDav:
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 904k]
  |  Branch (3590:38): [True: 0, False: 904k]
  |  Branch (3590:51): [True: 0, False: 904k]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|   904k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|   904k|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|   904k|                     auto copy_it{it};
 3596|   904k|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|   904k|                     if (!std::holds_alternative<V>(value)) {
  ------------------
  |  Branch (3597:26): [True: 657k, False: 247k]
  ------------------
 3598|   657k|                        value = V{};
 3599|   657k|                     }
 3600|   904k|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|   904k|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
  ------------------
  |  Branch (3601:26): [True: 0, False: 904k]
  |  Branch (3601:45): [True: 0, False: 0]
  ------------------
 3602|      0|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|      0|                     }
 3604|   904k|                     if (!bool(ctx.error)) {
  ------------------
  |  Branch (3604:26): [True: 904k, False: 0]
  ------------------
 3605|   904k|                        found_match = true;
 3606|   904k|                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|      0|                     else {
 3635|      0|                        it = copy_it;
 3636|      0|                        rewind_depth<Options>(ctx, copy_depth);
 3637|      0|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
  ------------------
  |  Branch (3637:29): [True: 0, False: 0]
  |  Branch (3637:68): [True: 0, False: 0]
  ------------------
 3638|      0|                            not variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3638:29): [True: 0, False: 0]
  ------------------
 3639|      0|                           ctx.error = error_code::none;
 3640|      0|                        }
 3641|      0|                     }
 3642|   904k|                     ++non_const_idx;
 3643|   904k|                  }
 3644|   904k|               });
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEETkNS_10is_contextERNS_7contextERPKcSF_EEvOT0_OT1_OT2_T3_:
   49|   904k|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|   904k|         else {
   60|   904k|            using V = std::remove_cvref_t<T>;
   61|   904k|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|   904k|                                             end);
   63|   904k|         }
   64|   904k|      }
_ZN3glz4fromILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERPKcSC_S7_TkNS_10is_contextERNS_7contextEEEvRT2_OT3_OT0_T1_:
  887|   905k|      {
  888|       |         if constexpr (check_string_as_number(Opts)) {
  889|       |            auto start = it;
  890|       |            skip_number<Opts>(ctx, it, end);
  891|       |            if (bool(ctx.error)) [[unlikely]] {
  892|       |               return;
  893|       |            }
  894|       |            if (start == it) [[unlikely]] {
  895|       |               ctx.error = error_code::parse_number_failure;
  896|       |               return;
  897|       |            }
  898|       |            value.append(start, size_t(it - start));
  899|       |         }
  900|   905k|         else {
  901|   905k|            if constexpr (!check_opening_handled(Opts)) {
  902|       |               if constexpr (!check_ws_handled(Opts)) {
  903|       |                  if (skip_ws<Opts>(ctx, it, end)) {
  904|       |                     return;
  905|       |                  }
  906|       |               }
  907|       |
  908|   905k|               if (match_invalid_end<'"', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (908:20): [True: 93, False: 905k]
  ------------------
  909|     93|                  return;
  910|     93|               }
  911|   905k|            }
  912|       |
  913|   905k|            if constexpr (not check_raw_string(Opts)) {
  914|   905k|               static constexpr auto string_padding_bytes = 8;
  915|       |
  916|       |               // How much buffer has to remain for an eight byte load at the cursor to stay inside
  917|       |               // it. One on a padded input, where the last chunk is free to straddle the end of the
  918|       |               // document, so the byte tails below are unreachable; eight otherwise, which costs the
  919|       |               // final bytes of the buffer their chunked path and nothing else.
  920|   905k|               const std::ptrdiff_t scan_min = chunk_min<8>(ctx.padded_input);
  921|       |
  922|   905k|               if (size_t(end - it) >= 8) {
  ------------------
  |  Branch (922:20): [True: 901k, False: 3.90k]
  ------------------
  923|       |                  // The bound as a pointer, so the loops below spend a compare per chunk rather
  924|       |                  // than a subtract and a compare. Well defined here and nowhere else in this
  925|       |                  // reader: the branch has just established that at least eight bytes remain, and
  926|       |                  // `scan_min` is at most eight.
  927|   901k|                  const auto* const chunk_limit = end - scan_min;
  928|       |
  929|   901k|                  auto start = it;
  930|   901k|                  uint64_t ascii_acc{};
  931|  2.29M|                  while (it <= chunk_limit) {
  ------------------
  |  Branch (931:26): [True: 2.29M, False: 1.05k]
  ------------------
  932|  2.29M|                     uint64_t chunk;
  933|  2.29M|                     std::memcpy(&chunk, it, 8);
  934|       |                     if constexpr (std::endian::native == std::endian::big) {
  935|       |                        chunk = std::byteswap(chunk);
  936|       |                     }
  937|  2.29M|                     ascii_acc |= chunk;
  938|  2.29M|                     const uint64_t test_chars = has_quote(chunk);
  939|  2.29M|                     if (test_chars) {
  ------------------
  |  Branch (939:26): [True: 904k, False: 1.39M]
  ------------------
  940|   904k|                        it += (countr_zero(test_chars) >> 3);
  941|       |
  942|   904k|                        auto* prev = it - 1;
  943|   933k|                        while (*prev == '\\') {
  ------------------
  |  Branch (943:32): [True: 28.6k, False: 904k]
  ------------------
  944|  28.6k|                           --prev;
  945|  28.6k|                        }
  946|   904k|                        if (size_t(it - prev) % 2) {
  ------------------
  |  Branch (946:29): [True: 900k, False: 3.80k]
  ------------------
  947|   900k|                           goto continue_decode;
  948|   900k|                        }
  949|  3.80k|                        ++it; // skip the escaped quote
  950|  3.80k|                     }
  951|  1.39M|                     else {
  952|  1.39M|                        it += 8;
  953|  1.39M|                     }
  954|  2.29M|                  }
  955|       |
  956|  2.95k|                  while (it[-1] == '\\') [[unlikely]] {
  ------------------
  |  Branch (956:26): [True: 1.89k, False: 1.05k]
  ------------------
  957|       |                     // if we ended on an escape character then we need to rewind
  958|       |                     // because we lost our context
  959|  1.89k|                     --it;
  960|  1.89k|                  }
  961|       |
  962|       |                  // The byte-wise tail keeps feeding the accumulator: it has to cover every byte of
  963|       |                  // the string, or a non-ASCII byte reached here would be waved through unvalidated.
  964|  5.34k|                  for (; it < end; ++it) {
  ------------------
  |  Branch (964:26): [True: 5.33k, False: 4]
  ------------------
  965|  5.33k|                     ascii_acc |= uint8_t(*it);
  966|  5.33k|                     if (*it == '"') {
  ------------------
  |  Branch (966:26): [True: 1.09k, False: 4.24k]
  ------------------
  967|  1.09k|                        auto* prev = it - 1;
  968|  2.48k|                        while (*prev == '\\') {
  ------------------
  |  Branch (968:32): [True: 1.38k, False: 1.09k]
  ------------------
  969|  1.38k|                           --prev;
  970|  1.38k|                        }
  971|  1.09k|                        if (size_t(it - prev) % 2) {
  ------------------
  |  Branch (971:29): [True: 1.05k, False: 42]
  ------------------
  972|  1.05k|                           goto continue_decode;
  973|  1.05k|                        }
  974|  1.09k|                     }
  975|  5.33k|                  }
  976|       |
  977|      4|                  ctx.error = error_code::unexpected_end;
  978|      4|                  return;
  979|       |
  980|   901k|               continue_decode:
  981|       |
  982|   901k|                  if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]] {
  ------------------
  |  Branch (982:23): [True: 29, False: 901k]
  ------------------
  983|     29|                     return;
  984|     29|                  }
  985|       |
  986|   901k|                  auto n = size_t(it - start);
  987|       |
  988|       |                  // The padding lets the chunked copy below run up to the closing quote. Skip it when it
  989|       |                  // would be the only reason to allocate, as for a string that fits the small string
  990|       |                  // buffer but not with eight bytes to spare.
  991|   901k|                  bool pad = true;
  992|   901k|                  if constexpr (requires { value.capacity(); }) {
  993|   901k|                     const auto capacity = size_t(value.capacity());
  994|   901k|                     pad = capacity >= n + string_padding_bytes || capacity < n;
  ------------------
  |  Branch (994:28): [True: 883k, False: 18.5k]
  |  Branch (994:68): [True: 11.9k, False: 6.66k]
  ------------------
  995|   901k|                  }
  996|   901k|                  resize_unfilled(value, pad ? n + string_padding_bytes : n);
  ------------------
  |  Branch (996:42): [True: 894k, False: 6.66k]
  ------------------
  997|       |
  998|   901k|                  auto* p = value.data();
  999|       |
 1000|       |                  // An error below returns with the tail of `value` still unwritten. Leave the size at
 1001|       |                  // what was actually written rather than at the padded length, which resize_unfilled
 1002|       |                  // did not fill.
 1003|   901k|                  auto* const written_begin = p;
 1004|       |
 1005|       |                  // Without the padding, copy a chunk only while eight bytes remain before the quote.
 1006|       |                  // Unescaping never puts the output ahead of the input, so no store lands past the end.
 1007|   901k|                  const auto* const copy_end = pad ? it : it - (std::min)(n, size_t(7));
  ------------------
  |  Branch (1007:48): [True: 894k, False: 6.66k]
  ------------------
 1008|       |
 1009|       |                  // Copy eight bytes at a time for as long as eight bytes are there to read, then
 1010|       |                  // finish the span below. The chunked form reads past the character it is looking
 1011|       |                  // at, so on an unpadded buffer it has to stop short of the end; splitting it this
 1012|       |                  // way keeps it for the body of every string rather than giving it up whenever the
 1013|       |                  // string happens to finish near the end of the buffer -- which, for a document
 1014|       |                  // that is itself one string, is every string.
 1015|  2.04M|                  while (start < copy_end && start <= chunk_limit) {
  ------------------
  |  Branch (1015:26): [True: 1.26M, False: 780k]
  |  Branch (1015:46): [True: 1.26M, False: 692]
  ------------------
 1016|  1.26M|                     std::memcpy(p, start, 8);
 1017|  1.26M|                     uint64_t swar;
 1018|  1.26M|                     std::memcpy(&swar, p, 8);
 1019|       |                     if constexpr (std::endian::native == std::endian::big) {
 1020|       |                        swar = std::byteswap(swar);
 1021|       |                     }
 1022|       |
 1023|  1.26M|                     constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1024|  1.26M|                     const uint64_t lo7 = swar & lo7_mask;
 1025|  1.26M|                     const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1026|  1.26M|                     const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1027|  1.26M|                     uint64_t next = ~((backslash & less_32) | swar);
 1028|       |
 1029|  1.26M|                     next &= repeat_byte8(0b10000000);
 1030|  1.26M|                     if (next == 0) {
  ------------------
  |  Branch (1030:26): [True: 1.09M, False: 167k]
  ------------------
 1031|  1.09M|                        start += 8;
 1032|  1.09M|                        p += 8;
 1033|  1.09M|                        continue;
 1034|  1.09M|                     }
 1035|       |
 1036|   167k|                     next = countr_zero(next) >> 3;
 1037|   167k|                     start += next;
 1038|   167k|                     if (start >= it) {
  ------------------
  |  Branch (1038:26): [True: 120k, False: 47.5k]
  ------------------
 1039|   120k|                        break;
 1040|   120k|                     }
 1041|       |
 1042|  47.5k|                     if ((*start & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1042:26): [True: 28, False: 47.5k]
  ------------------
 1043|     28|                        ctx.error = error_code::syntax_error;
 1044|     28|                        value.resize(size_t(p - written_begin));
 1045|     28|                        return;
 1046|     28|                     }
 1047|  47.5k|                     ++start; // skip the escape
 1048|  47.5k|                     if (*start == 'u') {
  ------------------
  |  Branch (1048:26): [True: 8.07k, False: 39.4k]
  ------------------
 1049|  8.07k|                        ++start;
 1050|  8.07k|                        p += next;
 1051|  8.07k|                        const auto mark = start;
 1052|  8.07k|                        const auto decoded = handle_unicode_code_point(start, p, end);
 1053|  8.07k|                        if (decoded.written == 0) [[unlikely]] {
  ------------------
  |  Branch (1053:29): [True: 41, False: 8.03k]
  ------------------
 1054|     41|                           ctx.error = decoded.truncated ? error_code::unexpected_end
  ------------------
  |  Branch (1054:40): [True: 0, False: 41]
  ------------------
 1055|     41|                                                         : error_code::unicode_escape_conversion_failure;
 1056|     41|                           value.resize(size_t(p - written_begin));
 1057|     41|                           return;
 1058|     41|                        }
 1059|  8.03k|                        n += decoded.written;
 1060|       |                        // escape + u + unicode code points
 1061|  8.03k|                        n -= 2 + uint32_t(start - mark);
 1062|  8.03k|                     }
 1063|  39.4k|                     else {
 1064|  39.4k|                        p += next;
 1065|  39.4k|                        *p = char_unescape_table[uint8_t(*start)];
 1066|  39.4k|                        if (*p == 0) [[unlikely]] {
  ------------------
  |  Branch (1066:29): [True: 3, False: 39.4k]
  ------------------
 1067|      3|                           ctx.error = error_code::invalid_escape;
 1068|      3|                           value.resize(size_t(p - written_begin));
 1069|      3|                           return;
 1070|      3|                        }
 1071|  39.4k|                        ++p;
 1072|  39.4k|                        ++start;
 1073|  39.4k|                        --n;
 1074|  39.4k|                     }
 1075|  47.5k|                  }
 1076|       |
 1077|       |                  // Whatever the chunked copy could not reach. `p` and `start` stay in step across
 1078|       |                  // that loop, so this picks up exactly where it stopped.
 1079|   918k|                  while (start < it) {
  ------------------
  |  Branch (1079:26): [True: 16.7k, False: 901k]
  ------------------
 1080|  16.7k|                     if ((*start & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1080:26): [True: 6, False: 16.7k]
  ------------------
 1081|      6|                        ctx.error = error_code::syntax_error;
 1082|      6|                        value.resize(size_t(p - written_begin));
 1083|      6|                        return;
 1084|      6|                     }
 1085|  16.7k|                     if (*start == '\\') {
  ------------------
  |  Branch (1085:26): [True: 4.96k, False: 11.7k]
  ------------------
 1086|  4.96k|                        ++start; // skip the escape
 1087|  4.96k|                        if (*start == 'u') {
  ------------------
  |  Branch (1087:29): [True: 2.70k, False: 2.26k]
  ------------------
 1088|  2.70k|                           ++start;
 1089|  2.70k|                           const auto mark = start;
 1090|  2.70k|                           const auto decoded = handle_unicode_code_point(start, p, end);
 1091|  2.70k|                           if (decoded.written == 0) [[unlikely]] {
  ------------------
  |  Branch (1091:32): [True: 35, False: 2.66k]
  ------------------
 1092|     35|                              ctx.error = decoded.truncated ? error_code::unexpected_end
  ------------------
  |  Branch (1092:43): [True: 0, False: 35]
  ------------------
 1093|     35|                                                            : error_code::unicode_escape_conversion_failure;
 1094|     35|                              value.resize(size_t(p - written_begin));
 1095|     35|                              return;
 1096|     35|                           }
 1097|  2.66k|                           n += decoded.written;
 1098|  2.66k|                           n -= 2 + uint32_t(start - mark);
 1099|  2.66k|                        }
 1100|  2.26k|                        else {
 1101|  2.26k|                           *p = char_unescape_table[uint8_t(*start)];
 1102|  2.26k|                           if (*p == 0) [[unlikely]] {
  ------------------
  |  Branch (1102:32): [True: 5, False: 2.26k]
  ------------------
 1103|      5|                              ctx.error = error_code::invalid_escape;
 1104|      5|                              value.resize(size_t(p - written_begin));
 1105|      5|                              return;
 1106|      5|                           }
 1107|  2.26k|                           ++p;
 1108|  2.26k|                           ++start;
 1109|  2.26k|                           --n;
 1110|  2.26k|                        }
 1111|  4.96k|                     }
 1112|  11.7k|                     else {
 1113|  11.7k|                        *p = *start;
 1114|  11.7k|                        ++p;
 1115|  11.7k|                        ++start;
 1116|  11.7k|                     }
 1117|  16.7k|                  }
 1118|       |
 1119|   901k|                  value.resize(n);
 1120|   901k|                  ++it;
 1121|   901k|               }
 1122|  3.90k|               else {
 1123|       |                  // For short strings
 1124|       |
 1125|  3.90k|                  std::array<char, 8> buffer{};
 1126|       |
 1127|  3.90k|                  auto* p = buffer.data();
 1128|  3.90k|                  const auto* const utf8_start = it;
 1129|       |
 1130|  7.89k|                  while (it < end) [[likely]] {
  ------------------
  |  Branch (1130:26): [True: 7.79k, False: 101]
  ------------------
 1131|  7.79k|                     *p = *it;
 1132|  7.79k|                     if (*it == '"') {
  ------------------
  |  Branch (1132:26): [True: 3.78k, False: 4.01k]
  ------------------
 1133|  3.78k|                        if (validate_utf8_span<Opts>(ctx, utf8_start, it)) [[unlikely]] {
  ------------------
  |  Branch (1133:29): [True: 28, False: 3.75k]
  ------------------
 1134|     28|                           return;
 1135|     28|                        }
 1136|  3.75k|                        const size_t n = size_t(p - buffer.data());
 1137|  3.75k|#if __has_cpp_attribute(assume) >= 202207L
 1138|  3.75k|                        [[assume(n <= sizeof(buffer))]];
 1139|  3.75k|#endif
 1140|  3.75k|                        value.assign(buffer.data(), n);
 1141|  3.75k|                        ++it;
 1142|       |                        if constexpr (not Opts.null_terminated) {
 1143|       |                           if (it == end) {
 1144|       |                              ctx.error = error_code::end_reached;
 1145|       |                              return;
 1146|       |                           }
 1147|       |                        }
 1148|  3.75k|                        return;
 1149|  3.78k|                     }
 1150|  4.01k|                     else if (*it == '\\') {
  ------------------
  |  Branch (1150:31): [True: 1.84k, False: 2.16k]
  ------------------
 1151|       |                        // Bounded whatever `null_terminated` says: a document cut off inside an
 1152|       |                        // escape has run out of input, and saying so beats blaming the terminator
 1153|       |                        // the cut exposed -- which is what reading on would find, and would report
 1154|       |                        // as a malformed escape.
 1155|  1.84k|                        ++it; // skip the escape
 1156|  1.84k|                        if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1156:29): [True: 1, False: 1.84k]
  ------------------
 1157|      1|                           ctx.error = error_code::unexpected_end;
 1158|      1|                           return;
 1159|      1|                        }
 1160|  1.84k|                        if (*it == 'u') {
  ------------------
  |  Branch (1160:29): [True: 165, False: 1.68k]
  ------------------
 1161|    165|                           ++it;
 1162|    165|                           if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1162:32): [True: 1, False: 164]
  ------------------
 1163|      1|                              ctx.error = error_code::unexpected_end;
 1164|      1|                              return;
 1165|      1|                           }
 1166|    164|                           const auto decoded = handle_unicode_code_point(it, p, end);
 1167|    164|                           if (decoded.written == 0) [[unlikely]] {
  ------------------
  |  Branch (1167:32): [True: 16, False: 148]
  ------------------
 1168|     16|                              ctx.error = decoded.truncated ? error_code::unexpected_end
  ------------------
  |  Branch (1168:43): [True: 8, False: 8]
  ------------------
 1169|     16|                                                            : error_code::unicode_escape_conversion_failure;
 1170|     16|                              return;
 1171|     16|                           }
 1172|    164|                        }
 1173|  1.68k|                        else {
 1174|  1.68k|                           *p = char_unescape_table[uint8_t(*it)];
 1175|  1.68k|                           if (*p == 0) [[unlikely]] {
  ------------------
  |  Branch (1175:32): [True: 1, False: 1.67k]
  ------------------
 1176|      1|                              ctx.error = error_code::invalid_escape;
 1177|      1|                              return;
 1178|      1|                           }
 1179|  1.67k|                           ++p;
 1180|  1.67k|                           ++it;
 1181|  1.67k|                        }
 1182|  1.84k|                     }
 1183|  2.16k|                     else if ((*it & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1183:31): [True: 1, False: 2.16k]
  ------------------
 1184|      1|                        ctx.error = error_code::syntax_error;
 1185|      1|                        return;
 1186|      1|                     }
 1187|  2.16k|                     else {
 1188|  2.16k|                        ++it;
 1189|  2.16k|                        ++p;
 1190|  2.16k|                     }
 1191|  7.79k|                  }
 1192|       |
 1193|    101|                  ctx.error = error_code::unexpected_end;
 1194|    101|               }
 1195|       |            }
 1196|       |            else {
 1197|       |               // raw_string
 1198|       |               auto start = it;
 1199|       |               skip_string_view(ctx, it, end);
 1200|       |               if (bool(ctx.error)) [[unlikely]]
 1201|       |                  return;
 1202|       |
 1203|       |               if (validate_utf8_span<Opts>(ctx, start, it)) [[unlikely]] {
 1204|       |                  return;
 1205|       |               }
 1206|       |
 1207|       |               value.assign(start, size_t(it - start));
 1208|       |               ++it;
 1209|       |            }
 1210|   905k|         }
 1211|   905k|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm3EEEDav:
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 904k, False: 0]
  |  Branch (3590:38): [True: 0, False: 0]
  |  Branch (3590:51): [True: 0, False: 0]
  ------------------
 3591|   904k|                     return;
 3592|   904k|                  }
 3593|      0|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|      0|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm4EEEDav:
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 904k, False: 0]
  |  Branch (3590:38): [True: 0, False: 0]
  |  Branch (3590:51): [True: 0, False: 0]
  ------------------
 3591|   904k|                     return;
 3592|   904k|                  }
 3593|      0|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|      0|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm5EEEDav:
 3589|   904k|               for_each<N>([&]<size_t I>() {
 3590|   904k|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 904k, False: 0]
  |  Branch (3590:38): [True: 0, False: 0]
  |  Branch (3590:51): [True: 0, False: 0]
  ------------------
 3591|   904k|                     return;
 3592|   904k|                  }
 3593|      0|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|      0|               });
_ZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_:
 3520|  1.37M|      {
 3521|  1.37M|         constexpr auto category_count = variant_count_v<Variant, Trait>;
 3522|       |
 3523|       |         if constexpr (category_count == 0) {
 3524|       |            ctx.error = error_code::no_matching_variant_type;
 3525|       |         }
 3526|  1.37M|         else {
 3527|  1.37M|            constexpr auto N = std::variant_size_v<Variant>;
 3528|  1.37M|            constexpr auto const_count = variant_filtered_count_v<Variant, Trait, true>;
 3529|  1.37M|            constexpr auto non_const_count = variant_filtered_count_v<Variant, Trait, false>;
 3530|       |
 3531|  1.37M|            bool found_match{};
 3532|       |            // Set when the speculative parsing budget runs out; see charge_speculation. An ambiguous
 3533|       |            // nest re-parses the same subtree per alternative at every level, which is exponential,
 3534|       |            // so the budget stops it and the failure already in hand is reported.
 3535|  1.37M|            bool exhausted{};
 3536|       |
 3537|       |            // First pass: const glaze types in this category
 3538|       |            if constexpr (const_count > 0) {
 3539|       |               for_each<N>([&]<size_t I>() {
 3540|       |                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3541|       |                     return;
 3542|       |                  }
 3543|       |                  using V = std::variant_alternative_t<I, Variant>;
 3544|       |                  if constexpr (Trait<V>::value && glaze_const_value_t<V>) {
 3545|       |                     // run time substitute to compare to const value
 3546|       |                     std::remove_const_t<std::remove_pointer_t<std::remove_const_t<meta_wrapper_t<V>>>> substitute{};
 3547|       |                     auto copy_it{it};
 3548|       |                     // A rejected alternative may have bailed out inside a container, which leaves its
 3549|       |                     // nesting level counted (see enter_depth). Rewind the depth with the iterator so
 3550|       |                     // trying N alternatives cannot spend N levels of the recursion budget.
 3551|       |                     const auto copy_depth{ctx.depth};
 3552|       |                     parse<JSON>::op<ws_handled<Options>()>(substitute, ctx, it, end);
 3553|       |                     static constexpr auto const_value{*meta_wrapper_v<V>};
 3554|       |                     if (substitute == const_value) {
 3555|       |                        found_match = true;
 3556|       |                        if (!std::holds_alternative<V>(value)) {
 3557|       |                           value = V{};
 3558|       |                        }
 3559|       |                     }
 3560|       |                     else {
 3561|       |                        // Rejected: charge the bytes it parsed before we rewind. See charge_speculation.
 3562|       |                        if (!charge_speculation(ctx, size_t(it - copy_it))) {
 3563|       |                           exhausted = true;
 3564|       |                        }
 3565|       |                        if constexpr (not Options.null_terminated) {
 3566|       |                           if (ctx.error == error_code::end_reached && not exhausted) {
 3567|       |                              ctx.error = error_code::none;
 3568|       |                           }
 3569|       |                        }
 3570|       |                        it = copy_it;
 3571|       |                        rewind_depth<Options>(ctx, copy_depth);
 3572|       |                     }
 3573|       |                  }
 3574|       |               });
 3575|       |               if (found_match) {
 3576|       |                  return;
 3577|       |               }
 3578|       |            }
 3579|       |
 3580|       |            // Second pass: non-const types in this category
 3581|  1.37M|            if constexpr (non_const_count > 0) {
 3582|       |               // Track position within matching types for "is last" check.
 3583|       |               // We iterate over all variant indices but only process matching types,
 3584|       |               // so we need runtime tracking (vs the old tuple-based approach where
 3585|       |               // the loop index directly corresponded to position in filtered set).
 3586|       |               // This has negligible cost: one increment per matching type.
 3587|  1.37M|               size_t non_const_idx = 0;
 3588|       |
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3591|  1.37M|                     return;
 3592|  1.37M|                  }
 3593|  1.37M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|  1.37M|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|  1.37M|                     auto copy_it{it};
 3596|  1.37M|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|  1.37M|                     if (!std::holds_alternative<V>(value)) {
 3598|  1.37M|                        value = V{};
 3599|  1.37M|                     }
 3600|  1.37M|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|  1.37M|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|  1.37M|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|  1.37M|                     }
 3604|  1.37M|                     if (!bool(ctx.error)) {
 3605|  1.37M|                        found_match = true;
 3606|  1.37M|                     }
 3607|  1.37M|                     else if constexpr (not Options.null_terminated) {
 3608|  1.37M|                        constexpr bool is_complete_type =
 3609|  1.37M|                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|  1.37M|                        if constexpr (is_complete_type) {
 3612|  1.37M|                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|  1.37M|                              found_match = true;
 3614|  1.37M|                              ctx.error = error_code::none;
 3615|  1.37M|                           }
 3616|  1.37M|                           else {
 3617|  1.37M|                              it = copy_it;
 3618|  1.37M|                              rewind_depth<Options>(ctx, copy_depth);
 3619|  1.37M|                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|  1.37M|                                  not variant_alternative_exhausted(ctx)) {
 3621|  1.37M|                                 ctx.error = error_code::none;
 3622|  1.37M|                              }
 3623|  1.37M|                           }
 3624|  1.37M|                        }
 3625|  1.37M|                        else {
 3626|  1.37M|                           it = copy_it;
 3627|  1.37M|                           rewind_depth<Options>(ctx, copy_depth);
 3628|  1.37M|                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|  1.37M|                               not variant_alternative_exhausted(ctx)) {
 3630|  1.37M|                              ctx.error = error_code::none;
 3631|  1.37M|                           }
 3632|  1.37M|                        }
 3633|  1.37M|                     }
 3634|  1.37M|                     else {
 3635|  1.37M|                        it = copy_it;
 3636|  1.37M|                        rewind_depth<Options>(ctx, copy_depth);
 3637|  1.37M|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|  1.37M|                            not variant_alternative_exhausted(ctx)) {
 3639|  1.37M|                           ctx.error = error_code::none;
 3640|  1.37M|                        }
 3641|  1.37M|                     }
 3642|  1.37M|                     ++non_const_idx;
 3643|  1.37M|                  }
 3644|  1.37M|               });
 3645|  1.37M|               if (!found_match) {
  ------------------
  |  Branch (3645:20): [True: 0, False: 1.37M]
  ------------------
 3646|      0|                  if constexpr (non_const_count == 1) {
 3647|       |                     // Keep the specific error from the single type we tried
 3648|       |                  }
 3649|       |                  else if (not exhausted && not variant_alternative_exhausted(ctx)) {
 3650|       |                     // Over-nested input is not a failure of the alternative set; keep saying so.
 3651|       |                     ctx.error = error_code::no_matching_variant_type;
 3652|       |                  }
 3653|      0|               }
 3654|       |            }
 3655|       |            else {
 3656|       |               ctx.error = error_code::no_matching_variant_type;
 3657|       |            }
 3658|  1.37M|         }
 3659|  1.37M|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm0EEEDav:
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.37M]
  |  Branch (3590:38): [True: 0, False: 1.37M]
  |  Branch (3590:51): [True: 0, False: 1.37M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.37M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.37M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm1EEEDav:
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.37M]
  |  Branch (3590:38): [True: 0, False: 1.37M]
  |  Branch (3590:51): [True: 0, False: 1.37M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.37M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.37M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm2EEEDav:
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.37M]
  |  Branch (3590:38): [True: 0, False: 1.37M]
  |  Branch (3590:51): [True: 0, False: 1.37M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.37M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.37M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm3EEEDav:
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 1.37M]
  |  Branch (3590:38): [True: 0, False: 1.37M]
  |  Branch (3590:51): [True: 0, False: 1.37M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  1.37M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|  1.37M|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|  1.37M|                     auto copy_it{it};
 3596|  1.37M|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|  1.37M|                     if (!std::holds_alternative<V>(value)) {
  ------------------
  |  Branch (3597:26): [True: 1.37M, False: 1.40k]
  ------------------
 3598|  1.37M|                        value = V{};
 3599|  1.37M|                     }
 3600|  1.37M|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|  1.37M|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
  ------------------
  |  Branch (3601:26): [True: 0, False: 1.37M]
  |  Branch (3601:45): [True: 0, False: 0]
  ------------------
 3602|      0|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|      0|                     }
 3604|  1.37M|                     if (!bool(ctx.error)) {
  ------------------
  |  Branch (3604:26): [True: 1.37M, False: 0]
  ------------------
 3605|  1.37M|                        found_match = true;
 3606|  1.37M|                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|      0|                     else {
 3635|      0|                        it = copy_it;
 3636|      0|                        rewind_depth<Options>(ctx, copy_depth);
 3637|      0|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
  ------------------
  |  Branch (3637:29): [True: 0, False: 0]
  |  Branch (3637:68): [True: 0, False: 0]
  ------------------
 3638|      0|                            not variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3638:29): [True: 0, False: 0]
  ------------------
 3639|      0|                           ctx.error = error_code::none;
 3640|      0|                        }
 3641|      0|                     }
 3642|  1.37M|                     ++non_const_idx;
 3643|  1.37M|                  }
 3644|  1.37M|               });
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERbTkNS_10is_contextERNS_7contextERPKcS8_EEvOT0_OT1_OT2_T3_:
   49|  1.37M|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  1.37M|         else {
   60|  1.37M|            using V = std::remove_cvref_t<T>;
   61|  1.37M|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  1.37M|                                             end);
   63|  1.37M|         }
   64|  1.37M|      }
_ZN3glz4fromILj10EbE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEETkNS_6bool_tERbTkNS_10is_contextERNS_7contextERPKcS8_EEvOT0_OT1_OT2_T3_:
  667|  1.37M|      {
  668|       |         if constexpr (check_quoted_num(Opts)) {
  669|       |            if (skip_ws<Opts>(ctx, it, end)) {
  670|       |               return;
  671|       |            }
  672|       |            if (match_invalid_end<'"', Opts>(ctx, it, end)) {
  673|       |               return;
  674|       |            }
  675|       |         }
  676|       |
  677|       |         if constexpr (!check_ws_handled(Opts)) {
  678|       |            if (skip_ws<Opts>(ctx, it, end)) {
  679|       |               return;
  680|       |            }
  681|       |         }
  682|       |
  683|       |         if constexpr (check_bools_as_numbers(Opts)) {
  684|       |            if (*it == '1') {
  685|       |               value = true;
  686|       |               ++it;
  687|       |            }
  688|       |            else if (*it == '0') {
  689|       |               value = false;
  690|       |               ++it;
  691|       |            }
  692|       |            else {
  693|       |               ctx.error = error_code::syntax_error;
  694|       |               return;
  695|       |            }
  696|       |         }
  697|  1.37M|         else {
  698|  1.37M|            if (end - it < 4) [[unlikely]] {
  ------------------
  |  Branch (698:17): [True: 0, False: 1.37M]
  ------------------
  699|      0|               ctx.error = error_code::expected_true_or_false;
  700|      0|               return;
  701|      0|            }
  702|       |
  703|  1.37M|            uint32_t c;
  704|  1.37M|            static constexpr uint32_t u_true = 0b01100101'01110101'01110010'01110100;
  705|  1.37M|            static constexpr uint32_t u_fals = 0b01110011'01101100'01100001'01100110;
  706|  1.37M|            std::memcpy(&c, it, 4);
  707|       |            if constexpr (std::endian::native == std::endian::big) {
  708|       |               c = std::byteswap(c);
  709|       |            }
  710|  1.37M|            it += 4;
  711|  1.37M|            if (c == u_true) {
  ------------------
  |  Branch (711:17): [True: 243k, False: 1.12M]
  ------------------
  712|   243k|               value = true;
  713|   243k|            }
  714|  1.12M|            else if (it == end) [[unlikely]] {
  ------------------
  |  Branch (714:22): [True: 0, False: 1.12M]
  ------------------
  715|      0|               ctx.error = error_code::unexpected_end;
  716|      0|               return;
  717|      0|            }
  718|  1.12M|            else {
  719|  1.12M|               if (c == u_fals && (*it == 'e')) [[likely]] {
  ------------------
  |  Branch (719:20): [True: 1.12M, False: 0]
  |  Branch (719:35): [True: 1.12M, False: 0]
  ------------------
  720|  1.12M|                  value = false;
  721|  1.12M|                  ++it;
  722|  1.12M|               }
  723|      0|               else [[unlikely]] {
  724|      0|                  ctx.error = error_code::expected_true_or_false;
  725|      0|                  return;
  726|      0|               }
  727|  1.12M|            }
  728|  1.37M|         }
  729|       |
  730|       |         if constexpr (check_quoted_num(Opts)) {
  731|       |            if constexpr (not Opts.null_terminated) {
  732|       |               if (it == end) [[unlikely]] {
  733|       |                  ctx.error = error_code::unexpected_end;
  734|       |                  return;
  735|       |               }
  736|       |            }
  737|       |            if (match<'"'>(ctx, it)) {
  738|       |               return;
  739|       |            }
  740|       |            if constexpr (not Opts.null_terminated) {
  741|       |               if (it == end) {
  742|       |                  ctx.error = error_code::end_reached;
  743|       |                  return;
  744|       |               }
  745|       |            }
  746|       |         }
  747|  1.37M|         else {
  748|       |            if constexpr (not Opts.null_terminated) {
  749|       |               if (it == end) {
  750|       |                  ctx.error = error_code::end_reached;
  751|       |                  return;
  752|       |               }
  753|       |            }
  754|  1.37M|         }
  755|  1.37M|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm4EEEDav:
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 1.37M, False: 0]
  |  Branch (3590:38): [True: 0, False: 0]
  |  Branch (3590:51): [True: 0, False: 0]
  ------------------
 3591|  1.37M|                     return;
 3592|  1.37M|                  }
 3593|      0|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|      0|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm5EEEDav:
 3589|  1.37M|               for_each<N>([&]<size_t I>() {
 3590|  1.37M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 1.37M, False: 0]
  |  Branch (3590:38): [True: 0, False: 0]
  |  Branch (3590:51): [True: 0, False: 0]
  ------------------
 3591|  1.37M|                     return;
 3592|  1.37M|                  }
 3593|      0|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|      0|               });
_ZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_:
 3520|  3.06M|      {
 3521|  3.06M|         constexpr auto category_count = variant_count_v<Variant, Trait>;
 3522|       |
 3523|       |         if constexpr (category_count == 0) {
 3524|       |            ctx.error = error_code::no_matching_variant_type;
 3525|       |         }
 3526|  3.06M|         else {
 3527|  3.06M|            constexpr auto N = std::variant_size_v<Variant>;
 3528|  3.06M|            constexpr auto const_count = variant_filtered_count_v<Variant, Trait, true>;
 3529|  3.06M|            constexpr auto non_const_count = variant_filtered_count_v<Variant, Trait, false>;
 3530|       |
 3531|  3.06M|            bool found_match{};
 3532|       |            // Set when the speculative parsing budget runs out; see charge_speculation. An ambiguous
 3533|       |            // nest re-parses the same subtree per alternative at every level, which is exponential,
 3534|       |            // so the budget stops it and the failure already in hand is reported.
 3535|  3.06M|            bool exhausted{};
 3536|       |
 3537|       |            // First pass: const glaze types in this category
 3538|       |            if constexpr (const_count > 0) {
 3539|       |               for_each<N>([&]<size_t I>() {
 3540|       |                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3541|       |                     return;
 3542|       |                  }
 3543|       |                  using V = std::variant_alternative_t<I, Variant>;
 3544|       |                  if constexpr (Trait<V>::value && glaze_const_value_t<V>) {
 3545|       |                     // run time substitute to compare to const value
 3546|       |                     std::remove_const_t<std::remove_pointer_t<std::remove_const_t<meta_wrapper_t<V>>>> substitute{};
 3547|       |                     auto copy_it{it};
 3548|       |                     // A rejected alternative may have bailed out inside a container, which leaves its
 3549|       |                     // nesting level counted (see enter_depth). Rewind the depth with the iterator so
 3550|       |                     // trying N alternatives cannot spend N levels of the recursion budget.
 3551|       |                     const auto copy_depth{ctx.depth};
 3552|       |                     parse<JSON>::op<ws_handled<Options>()>(substitute, ctx, it, end);
 3553|       |                     static constexpr auto const_value{*meta_wrapper_v<V>};
 3554|       |                     if (substitute == const_value) {
 3555|       |                        found_match = true;
 3556|       |                        if (!std::holds_alternative<V>(value)) {
 3557|       |                           value = V{};
 3558|       |                        }
 3559|       |                     }
 3560|       |                     else {
 3561|       |                        // Rejected: charge the bytes it parsed before we rewind. See charge_speculation.
 3562|       |                        if (!charge_speculation(ctx, size_t(it - copy_it))) {
 3563|       |                           exhausted = true;
 3564|       |                        }
 3565|       |                        if constexpr (not Options.null_terminated) {
 3566|       |                           if (ctx.error == error_code::end_reached && not exhausted) {
 3567|       |                              ctx.error = error_code::none;
 3568|       |                           }
 3569|       |                        }
 3570|       |                        it = copy_it;
 3571|       |                        rewind_depth<Options>(ctx, copy_depth);
 3572|       |                     }
 3573|       |                  }
 3574|       |               });
 3575|       |               if (found_match) {
 3576|       |                  return;
 3577|       |               }
 3578|       |            }
 3579|       |
 3580|       |            // Second pass: non-const types in this category
 3581|  3.06M|            if constexpr (non_const_count > 0) {
 3582|       |               // Track position within matching types for "is last" check.
 3583|       |               // We iterate over all variant indices but only process matching types,
 3584|       |               // so we need runtime tracking (vs the old tuple-based approach where
 3585|       |               // the loop index directly corresponded to position in filtered set).
 3586|       |               // This has negligible cost: one increment per matching type.
 3587|  3.06M|               size_t non_const_idx = 0;
 3588|       |
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
 3591|  3.06M|                     return;
 3592|  3.06M|                  }
 3593|  3.06M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|  3.06M|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|  3.06M|                     auto copy_it{it};
 3596|  3.06M|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|  3.06M|                     if (!std::holds_alternative<V>(value)) {
 3598|  3.06M|                        value = V{};
 3599|  3.06M|                     }
 3600|  3.06M|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|  3.06M|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|  3.06M|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|  3.06M|                     }
 3604|  3.06M|                     if (!bool(ctx.error)) {
 3605|  3.06M|                        found_match = true;
 3606|  3.06M|                     }
 3607|  3.06M|                     else if constexpr (not Options.null_terminated) {
 3608|  3.06M|                        constexpr bool is_complete_type =
 3609|  3.06M|                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|  3.06M|                        if constexpr (is_complete_type) {
 3612|  3.06M|                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|  3.06M|                              found_match = true;
 3614|  3.06M|                              ctx.error = error_code::none;
 3615|  3.06M|                           }
 3616|  3.06M|                           else {
 3617|  3.06M|                              it = copy_it;
 3618|  3.06M|                              rewind_depth<Options>(ctx, copy_depth);
 3619|  3.06M|                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|  3.06M|                                  not variant_alternative_exhausted(ctx)) {
 3621|  3.06M|                                 ctx.error = error_code::none;
 3622|  3.06M|                              }
 3623|  3.06M|                           }
 3624|  3.06M|                        }
 3625|  3.06M|                        else {
 3626|  3.06M|                           it = copy_it;
 3627|  3.06M|                           rewind_depth<Options>(ctx, copy_depth);
 3628|  3.06M|                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|  3.06M|                               not variant_alternative_exhausted(ctx)) {
 3630|  3.06M|                              ctx.error = error_code::none;
 3631|  3.06M|                           }
 3632|  3.06M|                        }
 3633|  3.06M|                     }
 3634|  3.06M|                     else {
 3635|  3.06M|                        it = copy_it;
 3636|  3.06M|                        rewind_depth<Options>(ctx, copy_depth);
 3637|  3.06M|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|  3.06M|                            not variant_alternative_exhausted(ctx)) {
 3639|  3.06M|                           ctx.error = error_code::none;
 3640|  3.06M|                        }
 3641|  3.06M|                     }
 3642|  3.06M|                     ++non_const_idx;
 3643|  3.06M|                  }
 3644|  3.06M|               });
 3645|  3.06M|               if (!found_match) {
  ------------------
  |  Branch (3645:20): [True: 1.07k, False: 3.06M]
  ------------------
 3646|  1.07k|                  if constexpr (non_const_count == 1) {
 3647|       |                     // Keep the specific error from the single type we tried
 3648|       |                  }
 3649|       |                  else if (not exhausted && not variant_alternative_exhausted(ctx)) {
 3650|       |                     // Over-nested input is not a failure of the alternative set; keep saying so.
 3651|       |                     ctx.error = error_code::no_matching_variant_type;
 3652|       |                  }
 3653|  1.07k|               }
 3654|       |            }
 3655|       |            else {
 3656|       |               ctx.error = error_code::no_matching_variant_type;
 3657|       |            }
 3658|  3.06M|         }
 3659|  3.06M|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm0EEEDav:
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 3.06M]
  |  Branch (3590:38): [True: 0, False: 3.06M]
  |  Branch (3590:51): [True: 0, False: 3.06M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  3.06M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  3.06M|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm1EEEDav:
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 0, False: 3.06M]
  |  Branch (3590:38): [True: 0, False: 3.06M]
  |  Branch (3590:51): [True: 0, False: 3.06M]
  ------------------
 3591|      0|                     return;
 3592|      0|                  }
 3593|  3.06M|                  using V = std::variant_alternative_t<I, Variant>;
 3594|  3.06M|                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|  3.06M|                     auto copy_it{it};
 3596|  3.06M|                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|  3.06M|                     if (!std::holds_alternative<V>(value)) {
  ------------------
  |  Branch (3597:26): [True: 2.36M, False: 700k]
  ------------------
 3598|  2.36M|                        value = V{};
 3599|  2.36M|                     }
 3600|  3.06M|                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|  3.06M|                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
  ------------------
  |  Branch (3601:26): [True: 1.07k, False: 3.06M]
  |  Branch (3601:45): [True: 0, False: 1.07k]
  ------------------
 3602|      0|                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|      0|                     }
 3604|  3.06M|                     if (!bool(ctx.error)) {
  ------------------
  |  Branch (3604:26): [True: 3.06M, False: 1.07k]
  ------------------
 3605|  3.06M|                        found_match = true;
 3606|  3.06M|                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|  1.07k|                     else {
 3635|  1.07k|                        it = copy_it;
 3636|  1.07k|                        rewind_depth<Options>(ctx, copy_depth);
 3637|  1.07k|                        if (non_const_idx + 1 < non_const_count && not exhausted &&
  ------------------
  |  Branch (3637:29): [True: 0, False: 1.07k]
  |  Branch (3637:68): [True: 0, False: 0]
  ------------------
 3638|      0|                            not variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3638:29): [True: 0, False: 0]
  ------------------
 3639|      0|                           ctx.error = error_code::none;
 3640|      0|                        }
 3641|  1.07k|                     }
 3642|  3.06M|                     ++non_const_idx;
 3643|  3.06M|                  }
 3644|  3.06M|               });
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERdTkNS_10is_contextERNS_7contextERPKcS8_EEvOT0_OT1_OT2_T3_:
   49|  3.06M|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  3.06M|         else {
   60|  3.06M|            using V = std::remove_cvref_t<T>;
   61|  3.06M|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  3.06M|                                             end);
   63|  3.06M|         }
   64|  3.06M|      }
_ZN3glz4fromILj10EdE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERPKcRdTkNS_10is_contextERNS_7contextES5_EEvOT1_OT2_OT0_T3_:
  763|  3.07M|      {
  764|       |         if constexpr (check_quoted_num(Opts)) {
  765|       |            if (skip_ws<Opts>(ctx, it, end)) {
  766|       |               return;
  767|       |            }
  768|       |            if (match_invalid_end<'"', Opts>(ctx, it, end)) {
  769|       |               return;
  770|       |            }
  771|       |         }
  772|       |
  773|       |         if constexpr (!check_ws_handled(Opts)) {
  774|       |            if (skip_ws<Opts>(ctx, it, end)) {
  775|       |               return;
  776|       |            }
  777|       |         }
  778|       |
  779|  3.07M|         using V = std::decay_t<decltype(value)>;
  780|       |         if constexpr (int_t<V>) {
  781|       |            static_assert(sizeof(*it) == sizeof(char));
  782|       |
  783|       |            if constexpr (Opts.null_terminated) {
  784|       |               if (not glz::atoi(value, it)) [[unlikely]] {
  785|       |                  ctx.error = error_code::parse_number_failure;
  786|       |                  return;
  787|       |               }
  788|       |            }
  789|       |            else {
  790|       |               if (not glz::atoi(value, it, end)) [[unlikely]] {
  791|       |                  ctx.error = error_code::parse_number_failure;
  792|       |                  return;
  793|       |               }
  794|       |            }
  795|       |         }
  796|  3.07M|         else {
  797|       |// float128_t requires std::from_chars for floating-point, unavailable on older Apple platforms (iOS < 16.3)
  798|  3.07M|#if !defined(_LIBCPP_VERSION) || defined(_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT)
  799|       |            if constexpr (is_float128<V>) {
  800|       |               auto [ptr, ec] = std::from_chars(it, end, value);
  801|       |               if (ec != std::errc()) {
  802|       |                  ctx.error = error_code::parse_number_failure;
  803|       |                  return;
  804|       |               }
  805|       |               it = ptr;
  806|       |            }
  807|       |            else
  808|       |#endif
  809|  3.07M|            {
  810|       |               if constexpr (std::is_volatile_v<std::remove_reference_t<decltype(value)>>) {
  811|       |                  // Hardware may interact with value changes, so we parse into a temporary and assign in one
  812|       |                  // place
  813|       |                  V temp;
  814|       |                  if constexpr (is_size_optimized(Opts)) {
  815|       |                     auto [ptr, ec] = simple_float::from_chars<Opts.null_terminated>(it, end, temp);
  816|       |                     if (ec != std::errc{}) [[unlikely]] {
  817|       |                        ctx.error = error_code::parse_number_failure;
  818|       |                        return;
  819|       |                     }
  820|       |                     it = ptr;
  821|       |                  }
  822|       |                  else {
  823|       |                     auto [ptr, ec] = glz::from_chars<Opts.null_terminated>(it, end, temp);
  824|       |                     if (ec != std::errc()) [[unlikely]] {
  825|       |                        ctx.error = error_code::parse_number_failure;
  826|       |                        return;
  827|       |                     }
  828|       |                     it = ptr;
  829|       |                  }
  830|       |                  value = temp;
  831|       |               }
  832|  3.07M|               else {
  833|       |                  if constexpr (is_size_optimized(Opts)) {
  834|       |                     auto [ptr, ec] = simple_float::from_chars<Opts.null_terminated>(it, end, value);
  835|       |                     if (ec != std::errc{}) [[unlikely]] {
  836|       |                        ctx.error = error_code::parse_number_failure;
  837|       |                        return;
  838|       |                     }
  839|       |                     it = ptr;
  840|       |                  }
  841|  3.07M|                  else {
  842|  3.07M|                     auto [ptr, ec] = glz::from_chars<Opts.null_terminated>(it, end, value);
  843|  3.07M|                     if (ec != std::errc()) [[unlikely]] {
  ------------------
  |  Branch (843:26): [True: 1.22k, False: 3.07M]
  ------------------
  844|  1.22k|                        ctx.error = error_code::parse_number_failure;
  845|  1.22k|                        return;
  846|  1.22k|                     }
  847|  3.07M|                     it = ptr;
  848|  3.07M|                  }
  849|  3.07M|               }
  850|  3.07M|            }
  851|  3.07M|         }
  852|       |
  853|       |         if constexpr (check_quoted_num(Opts)) {
  854|       |            if constexpr (not Opts.null_terminated) {
  855|       |               if (it == end) [[unlikely]] {
  856|       |                  ctx.error = error_code::unexpected_end;
  857|       |                  return;
  858|       |               }
  859|       |            }
  860|       |            if (match<'"'>(ctx, it)) {
  861|       |               return;
  862|       |            }
  863|       |            if constexpr (not Opts.null_terminated) {
  864|       |               if (it == end) {
  865|       |                  ctx.error = error_code::end_reached;
  866|       |                  return;
  867|       |               }
  868|       |            }
  869|       |         }
  870|  3.07M|         else {
  871|       |            if constexpr (not Opts.null_terminated) {
  872|       |               if (it == end) {
  873|       |                  ctx.error = error_code::end_reached;
  874|       |                  return;
  875|       |               }
  876|       |            }
  877|  3.07M|         }
  878|  3.07M|      }
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm2EEEDav:
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 3.06M, False: 1.07k]
  |  Branch (3590:38): [True: 0, False: 1.07k]
  |  Branch (3590:51): [True: 0, False: 1.07k]
  ------------------
 3591|  3.06M|                     return;
 3592|  3.06M|                  }
 3593|  1.07k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.07k|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm3EEEDav:
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 3.06M, False: 1.07k]
  |  Branch (3590:38): [True: 0, False: 1.07k]
  |  Branch (3590:51): [True: 0, False: 1.07k]
  ------------------
 3591|  3.06M|                     return;
 3592|  3.06M|                  }
 3593|  1.07k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.07k|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm4EEEDav:
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 3.06M, False: 1.07k]
  |  Branch (3590:38): [True: 0, False: 1.07k]
  |  Branch (3590:51): [True: 0, False: 1.07k]
  ------------------
 3591|  3.06M|                     return;
 3592|  3.06M|                  }
 3593|  1.07k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.07k|               });
_ZZN3glz28process_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSH_TkNS_10is_contextERNS_7contextERPKcSQ_EEvOT0_OT1_OT2_T3_ENKUlTnmvE_clILm5EEEDav:
 3589|  3.06M|               for_each<N>([&]<size_t I>() {
 3590|  3.06M|                  if (found_match || exhausted || variant_alternative_exhausted(ctx)) {
  ------------------
  |  Branch (3590:23): [True: 3.06M, False: 1.07k]
  |  Branch (3590:38): [True: 0, False: 1.07k]
  |  Branch (3590:51): [True: 0, False: 1.07k]
  ------------------
 3591|  3.06M|                     return;
 3592|  3.06M|                  }
 3593|  1.07k|                  using V = std::variant_alternative_t<I, Variant>;
 3594|       |                  if constexpr (Trait<V>::value && !glaze_const_value_t<V>) {
 3595|       |                     auto copy_it{it};
 3596|       |                     const auto copy_depth{ctx.depth}; // rewound with `it`; see the note above
 3597|       |                     if (!std::holds_alternative<V>(value)) {
 3598|       |                        value = V{};
 3599|       |                     }
 3600|       |                     parse<JSON>::op<ws_handled<Options>()>(std::get<V>(value), ctx, it, end);
 3601|       |                     if (bool(ctx.error) && !charge_speculation(ctx, size_t(it - copy_it))) {
 3602|       |                        exhausted = true; // only rejected attempts are charged; see charge_speculation
 3603|       |                     }
 3604|       |                     if (!bool(ctx.error)) {
 3605|       |                        found_match = true;
 3606|       |                     }
 3607|       |                     else if constexpr (not Options.null_terminated) {
 3608|       |                        constexpr bool is_complete_type =
 3609|       |                           num_t<V> || bool_t<V> || string_t<V> || std::is_enum_v<V> || tuple_t<V> || is_std_tuple<V>;
 3610|       |
 3611|       |                        if constexpr (is_complete_type) {
 3612|       |                           if (ctx.error == error_code::end_reached && it > copy_it && not speculation_exhausted(ctx)) {
 3613|       |                              found_match = true;
 3614|       |                              ctx.error = error_code::none;
 3615|       |                           }
 3616|       |                           else {
 3617|       |                              it = copy_it;
 3618|       |                              rewind_depth<Options>(ctx, copy_depth);
 3619|       |                              if (non_const_idx + 1 < non_const_count && not exhausted &&
 3620|       |                                  not variant_alternative_exhausted(ctx)) {
 3621|       |                                 ctx.error = error_code::none;
 3622|       |                              }
 3623|       |                           }
 3624|       |                        }
 3625|       |                        else {
 3626|       |                           it = copy_it;
 3627|       |                           rewind_depth<Options>(ctx, copy_depth);
 3628|       |                           if (non_const_idx + 1 < non_const_count && not exhausted &&
 3629|       |                               not variant_alternative_exhausted(ctx)) {
 3630|       |                              ctx.error = error_code::none;
 3631|       |                           }
 3632|       |                        }
 3633|       |                     }
 3634|       |                     else {
 3635|       |                        it = copy_it;
 3636|       |                        rewind_depth<Options>(ctx, copy_depth);
 3637|       |                        if (non_const_idx + 1 < non_const_count && not exhausted &&
 3638|       |                            not variant_alternative_exhausted(ctx)) {
 3639|       |                           ctx.error = error_code::none;
 3640|       |                        }
 3641|       |                     }
 3642|       |                     ++non_const_idx;
 3643|       |                  }
 3644|  1.07k|               });
_ZN3glz10read_jsoncITkNS_14read_supportedIL_ZNS_4JSONEEEE9my_structTkNS_9is_bufferENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEEENS3_8expectedIT_NS_9error_ctxEEEOT0_:
 5104|  17.0k|   {
 5105|  17.0k|      T value{};
 5106|  17.0k|      context ctx{};
 5107|  17.0k|      const error_ctx ec = read<opts{.comments = true}>(value, std::forward<Buffer>(buffer), ctx);
 5108|  17.0k|      if (ec) {
  ------------------
  |  Branch (5108:11): [True: 16.6k, False: 404]
  ------------------
 5109|  16.6k|         return unexpected<error_ctx>(ec);
 5110|  16.6k|      }
 5111|    404|      return value;
 5112|  17.0k|   }
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEER9my_structTkNS_10is_contextERNS_7contextERPKcS9_EEvOT0_OT1_OT2_T3_:
   49|  17.0k|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  17.0k|         else {
   60|  17.0k|            using V = std::remove_cvref_t<T>;
   61|  17.0k|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  17.0k|                                             end);
   63|  17.0k|         }
   64|  17.0k|      }
_ZN3glz4fromILj10E9my_structE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnNS_14string_literalEXtlNS5_ILm1EEEEERS1_TkNS_10is_contextERNS_7contextERPKcSB_EEvOT1_OT2_OT3_T4_:
 2791|  17.0k|      {
 2792|  17.0k|         static constexpr auto num_members = reflect<T>::size;
 2793|       |
 2794|  17.0k|         static constexpr auto Opts = opening_handled_off<ws_handled_off<Options>()>();
 2795|  17.0k|         if constexpr (!check_opening_handled(Options)) {
 2796|  17.0k|            if constexpr (!check_ws_handled(Options)) {
 2797|  17.0k|               if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2797:20): [True: 51, False: 17.0k]
  ------------------
 2798|     51|                  return;
 2799|     51|               }
 2800|  17.0k|            }
 2801|  17.0k|            if (match_invalid_end<'{', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2801:17): [True: 7.16k, False: 9.90k]
  ------------------
 2802|  7.16k|               return;
 2803|  7.16k|            }
 2804|       |            if constexpr (not Opts.null_terminated) {
 2805|       |               if (it == end) [[unlikely]] {
 2806|       |                  ctx.error = error_code::unexpected_end;
 2807|       |                  return;
 2808|       |               }
 2809|       |            }
 2810|       |            // one nesting level (see enter_depth): counted in both modes so the limit binds,
 2811|       |            // released at each syntactic close below
 2812|  9.90k|            if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (2812:17): [True: 0, False: 9.90k]
  ------------------
 2813|      0|               return;
 2814|      0|            }
 2815|  9.90k|         }
 2816|  9.90k|         const auto ws_start = it;
 2817|  17.0k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2817:14): [True: 57, False: 17.0k]
  ------------------
 2818|     57|            return;
 2819|     57|         }
 2820|  17.0k|         const size_t ws_size = size_t(it - ws_start);
 2821|       |
 2822|       |         if constexpr ((glaze_object_t<T> || reflectable<T>) && num_members == 0 && Opts.error_on_unknown_keys) {
 2823|       |            if constexpr (not tag.sv().empty()) {
 2824|       |               if (*it == '"') {
 2825|       |                  ++it;
 2826|       |                  if constexpr (not Opts.null_terminated) {
 2827|       |                     if (it == end) [[unlikely]] {
 2828|       |                        ctx.error = error_code::unexpected_end;
 2829|       |                        return;
 2830|       |                     }
 2831|       |                  }
 2832|       |
 2833|       |                  const auto start = it;
 2834|       |                  skip_string_view(ctx, it, end);
 2835|       |                  if (bool(ctx.error)) [[unlikely]]
 2836|       |                     return;
 2837|       |                  if (validate_utf8_span<Opts>(ctx, start, it)) [[unlikely]]
 2838|       |                     return;
 2839|       |                  const sv key{start, size_t(it - start)};
 2840|       |                  ++it;
 2841|       |                  if constexpr (not Opts.null_terminated) {
 2842|       |                     if (it == end) [[unlikely]] {
 2843|       |                        ctx.error = error_code::unexpected_end;
 2844|       |                        return;
 2845|       |                     }
 2846|       |                  }
 2847|       |
 2848|       |                  if (key == tag.sv()) {
 2849|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 2850|       |                        return;
 2851|       |                     }
 2852|       |
 2853|       |                     parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
 2854|       |                     if (bool(ctx.error)) [[unlikely]]
 2855|       |                        return;
 2856|       |
 2857|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 2858|       |                        return;
 2859|       |                     }
 2860|       |                  }
 2861|       |                  else {
 2862|       |                     ctx.error = error_code::unknown_key;
 2863|       |                     return;
 2864|       |                  }
 2865|       |               }
 2866|       |            }
 2867|       |
 2868|       |            if (*it == '}') [[likely]] {
 2869|       |               --ctx.depth;
 2870|       |               if constexpr (glaze_object_t<T> || reflectable<T>) {
 2871|       |                  if constexpr (has_self_constraint_v<T> && !check_skip_self_constraint(Opts)) {
 2872|       |                     auto wrapper = self_constraint_v<T>(value);
 2873|       |                     from<JSON, decltype(wrapper)>::template op<ws_handled<Opts>()>(wrapper, ctx, it, end);
 2874|       |                     if (bool(ctx.error)) {
 2875|       |                        return;
 2876|       |                     }
 2877|       |                  }
 2878|       |               }
 2879|       |               ++it;
 2880|       |               if constexpr (not Opts.null_terminated) {
 2881|       |                  if (it == end) {
 2882|       |                     ctx.error = error_code::end_reached;
 2883|       |                     return;
 2884|       |                  }
 2885|       |               }
 2886|       |               if constexpr (Opts.partial_read) {
 2887|       |                  ctx.error = error_code::partial_read_complete;
 2888|       |               }
 2889|       |               return;
 2890|       |            }
 2891|       |            ctx.error = error_code::unknown_key;
 2892|       |            return;
 2893|       |         }
 2894|  17.0k|         else {
 2895|  17.0k|            decltype(auto) fields = [&]() -> decltype(auto) {
 2896|  17.0k|               if constexpr ((glaze_object_t<T> || reflectable<T>) &&
 2897|  17.0k|                             (Opts.error_on_missing_keys || Opts.partial_read)) {
 2898|  17.0k|                  return bit_array<num_members>{};
 2899|  17.0k|               }
 2900|  17.0k|               else {
 2901|  17.0k|                  return nullptr;
 2902|  17.0k|               }
 2903|  17.0k|            }();
 2904|       |
 2905|       |            // A file include merges an external document into this object, so with
 2906|       |            // error_on_missing_keys the keys have to be counted across both documents (see
 2907|       |            // context::key_bits). While this object parses, its bits are published for its
 2908|       |            // includer members to hand down; and if this parse is itself an included document,
 2909|       |            // it claims the bits of the object that included us and merges into them at the
 2910|       |            // closing brace instead of running a check of its own.
 2911|  17.0k|            static constexpr bool tracks_include_keys = [] {
 2912|       |               // Nested so that reflecting over the members is only asked for when it can matter
 2913|  17.0k|               if constexpr ((glaze_object_t<T> || reflectable<T>) && Opts.error_on_missing_keys) {
 2914|  17.0k|                  return has_includer_member<T>;
 2915|  17.0k|               }
 2916|  17.0k|               else {
 2917|  17.0k|                  return false;
 2918|  17.0k|               }
 2919|  17.0k|            }();
 2920|  17.0k|            [[maybe_unused]] bit_array<num_members>* include_bits{};
 2921|       |            if constexpr (tracks_include_keys) {
 2922|       |               if (ctx.include_key_type == &include_key_tag<T>) {
 2923|       |                  include_bits = static_cast<bit_array<num_members>*>(ctx.include_key_bits);
 2924|       |                  ctx.include_key_bits = nullptr;
 2925|       |                  ctx.include_key_type = nullptr;
 2926|       |               }
 2927|       |            }
 2928|  17.0k|            [[maybe_unused]] const std::conditional_t<tracks_include_keys,
 2929|  17.0k|                                                      key_bits_scope<std::remove_reference_t<decltype(ctx)>>,
 2930|  17.0k|                                                      inert_key_bits_scope> published_bits{
 2931|  17.0k|               ctx, [&]() -> void* {
 2932|  17.0k|                  if constexpr (tracks_include_keys) {
 2933|  17.0k|                     return &fields;
 2934|  17.0k|                  }
 2935|  17.0k|                  else {
 2936|  17.0k|                     return nullptr;
 2937|  17.0k|                  }
 2938|  17.0k|               }()};
 2939|       |
 2940|  17.0k|            size_t read_count{}; // for partial_read
 2941|       |
 2942|  17.0k|            bool first = true;
 2943|  48.3k|            while (true) {
  ------------------
  |  Branch (2943:20): [True: 33.0k, Folded]
  ------------------
 2944|       |               if constexpr ((glaze_object_t<T> || reflectable<T>) && Opts.partial_read) {
 2945|       |                  static constexpr bit_array<num_members> all_fields = [] {
 2946|       |                     bit_array<num_members> arr{};
 2947|       |                     for (size_t i = 0; i < num_members; ++i) {
 2948|       |                        arr[i] = true;
 2949|       |                     }
 2950|       |                     return arr;
 2951|       |                  }();
 2952|       |
 2953|       |                  if ((all_fields & fields) == all_fields) {
 2954|       |                     ctx.error = error_code::partial_read_complete;
 2955|       |                     --ctx.depth; // as above: an early success still closes this level
 2956|       |                     return;
 2957|       |                  }
 2958|       |               }
 2959|       |
 2960|       |               // Streaming refill point: at start of each iteration, ensure buffer has data
 2961|       |               if constexpr (has_streaming_state<decltype(ctx)>) {
 2962|       |                  if (ctx.stream.enabled()) {
 2963|       |                     const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 2964|       |                     const size_t remaining = ctx.stream.size() - consumed;
 2965|       |                     // Refill when less than half of buffer remains to ensure space for next key-value pair
 2966|       |                     if (remaining <= ctx.stream.size() / 2 || it >= end) {
 2967|       |                        const char* new_it;
 2968|       |                        const char* new_end;
 2969|       |                        ctx.stream.consume_and_refill(consumed, new_it, new_end);
 2970|       |                        it = new_it;
 2971|       |                        end = new_end;
 2972|       |                        if (it >= end && ctx.stream.at_eof()) {
 2973|       |                           ctx.error = error_code::unexpected_end;
 2974|       |                           return;
 2975|       |                        }
 2976|       |                     }
 2977|       |                  }
 2978|       |               }
 2979|       |
 2980|  33.0k|               if (*it == '}') {
  ------------------
  |  Branch (2980:20): [True: 404, False: 32.6k]
  ------------------
 2981|    404|                  --ctx.depth;
 2982|       |                  if constexpr ((glaze_object_t<T> || reflectable<T>) && Opts.error_on_missing_keys) {
 2983|       |                     const bool defer_to_includer = [&] {
 2984|       |                        if constexpr (tracks_include_keys) {
 2985|       |                           if (include_bits) {
 2986|       |                              // An included document is a fragment: hand the keys it supplied to
 2987|       |                              // the object that included it, which checks the union of both.
 2988|       |                              *include_bits |= fields;
 2989|       |                              return true;
 2990|       |                           }
 2991|       |                        }
 2992|       |                        return false;
 2993|       |                     }();
 2994|       |                     constexpr auto req_fields = required_fields<T, Opts>();
 2995|       |                     if (not defer_to_includer && (req_fields & fields) != req_fields) {
 2996|       |                        for (size_t i = 0; i < num_members; ++i) {
 2997|       |                           if (not fields[i] && req_fields[i]) {
 2998|       |                              ctx.custom_error_message = reflect<T>::keys[i];
 2999|       |                              // We just return the first missing key in order to avoid heap allocations
 3000|       |                              break;
 3001|       |                           }
 3002|       |                        }
 3003|       |
 3004|       |                        ctx.error = error_code::missing_key;
 3005|       |                        return;
 3006|       |                     }
 3007|       |                  }
 3008|    404|                  if constexpr (glaze_object_t<T> || reflectable<T>) {
 3009|       |                     if constexpr (has_self_constraint_v<T> && !check_skip_self_constraint(Opts)) {
 3010|       |                        auto wrapper = self_constraint_v<T>(value);
 3011|       |                        from<JSON, decltype(wrapper)>::template op<ws_handled<Opts>()>(wrapper, ctx, it, end);
 3012|       |                        if (bool(ctx.error)) {
 3013|       |                           return;
 3014|       |                        }
 3015|       |                     }
 3016|    404|                  }
 3017|    404|                  ++it; // Increment after checking for missing keys so errors are within buffer bounds
 3018|       |                  if constexpr (not Opts.null_terminated) {
 3019|       |                     if (it == end) {
 3020|       |                        ctx.error = error_code::end_reached;
 3021|       |                        return;
 3022|       |                     }
 3023|       |                  }
 3024|    404|                  return;
 3025|    404|               }
 3026|  32.6k|               else if (first) {
  ------------------
  |  Branch (3026:25): [True: 9.71k, False: 22.9k]
  ------------------
 3027|  9.71k|                  first = false;
 3028|  9.71k|               }
 3029|  22.9k|               else {
 3030|  22.9k|                  if (match_invalid_end<',', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3030:23): [True: 1.21k, False: 21.6k]
  ------------------
 3031|  1.21k|                     return;
 3032|  1.21k|                  }
 3033|       |                  if constexpr (not Opts.null_terminated) {
 3034|       |                     if (it == end) [[unlikely]] {
 3035|       |                        ctx.error = error_code::unexpected_end;
 3036|       |                        return;
 3037|       |                     }
 3038|       |                  }
 3039|       |
 3040|       |                  if constexpr ((not Opts.minified) && (num_members > 1 || not Opts.error_on_unknown_keys) &&
 3041|       |                                (!Opts.comments)) {
 3042|       |                     if (ws_size && ws_size < size_t(end - it)) {
 3043|       |                        skip_matching_ws(ws_start, it, ws_size);
 3044|       |                     }
 3045|       |                  }
 3046|       |
 3047|  21.6k|                  if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3047:23): [True: 33, False: 21.6k]
  ------------------
 3048|     33|                     return;
 3049|     33|                  }
 3050|  21.6k|               }
 3051|       |
 3052|  31.3k|               constexpr auto reflection_type = glaze_object_t<T> || reflectable<T>;
  ------------------
  |  Branch (3052:49): [Folded, False: 0]
  |  Branch (3052:70): [True: 0, Folded]
  ------------------
 3053|       |
 3054|       |               if constexpr (reflection_type && (num_members == 0)) {
 3055|       |                  if constexpr (Opts.error_on_unknown_keys) {
 3056|       |                     static_assert(false_v<T>, "This should be unreachable");
 3057|       |                  }
 3058|       |                  else {
 3059|       |                     if (match_invalid_end<'"', Opts>(ctx, it, end)) {
 3060|       |                        return;
 3061|       |                     }
 3062|       |
 3063|       |                     // parsing to an empty object, but at this point the JSON presents keys
 3064|       |
 3065|       |                     // Unknown key handler does not unescape keys. Unknown escaped keys are
 3066|       |                     // handled by the user.
 3067|       |
 3068|       |                     const auto start = it;
 3069|       |                     uint64_t ascii_acc{};
 3070|       |                     skip_string_view(ctx, it, end, ascii_acc);
 3071|       |                     if (bool(ctx.error)) [[unlikely]]
 3072|       |                        return;
 3073|       |                     if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]]
 3074|       |                        return;
 3075|       |                     const sv key{start, size_t(it - start)};
 3076|       |                     ++it;
 3077|       |                     if constexpr (not Opts.null_terminated) {
 3078|       |                        if (it == end) [[unlikely]] {
 3079|       |                           ctx.error = error_code::unexpected_end;
 3080|       |                           return;
 3081|       |                        }
 3082|       |                     }
 3083|       |
 3084|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3085|       |                        return;
 3086|       |                     }
 3087|       |
 3088|       |                     // Check if this key is the variant tag that should be skipped
 3089|       |                     if constexpr (not tag.sv().empty()) {
 3090|       |                        if (key == tag.sv()) {
 3091|       |                           // Skip the tag value
 3092|       |                           skip_value<JSON>::op<Opts>(ctx, it, end);
 3093|       |                           if (bool(ctx.error)) [[unlikely]]
 3094|       |                              return;
 3095|       |                           resync_window_end(ctx, end); // a streaming skip refills
 3096|       |                           if (skip_ws<Opts>(ctx, it, end)) {
 3097|       |                              return;
 3098|       |                           }
 3099|       |                           continue;
 3100|       |                        }
 3101|       |                     }
 3102|       |
 3103|       |                     parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
 3104|       |                     if (bool(ctx.error)) [[unlikely]]
 3105|       |                        return;
 3106|       |                     if constexpr (not Opts.null_terminated) {
 3107|       |                        if (it == end) [[unlikely]] {
 3108|       |                           ctx.error = error_code::unexpected_end;
 3109|       |                           return;
 3110|       |                        }
 3111|       |                     }
 3112|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 3113|       |                        return;
 3114|       |                     }
 3115|       |                  }
 3116|       |               }
 3117|  31.3k|               else if constexpr (reflection_type) {
 3118|  31.3k|                  static_assert(bool(hash_info<T>.type));
 3119|       |
 3120|  31.3k|                  if (*it != '"') [[unlikely]] {
  ------------------
  |  Branch (3120:23): [True: 154, False: 31.2k]
  ------------------
 3121|    154|                     ctx.error = error_code::expected_quote;
 3122|    154|                     return;
 3123|    154|                  }
 3124|  31.2k|                  ++it;
 3125|       |                  if constexpr (not Opts.null_terminated) {
 3126|       |                     if (it == end) [[unlikely]] {
 3127|       |                        ctx.error = error_code::unexpected_end;
 3128|       |                        return;
 3129|       |                     }
 3130|       |                  }
 3131|       |
 3132|       |                  if constexpr (not tag.sv().empty() && not contains_tag<T, tag>()) {
 3133|       |                     // For tagged variants we first check to see if the key matches the tag
 3134|       |                     // We only need to do this if the tag is not part of the keys
 3135|       |
 3136|       |                     const auto start = it;
 3137|       |                     uint64_t ascii_acc{};
 3138|       |                     skip_string_view(ctx, it, end, ascii_acc);
 3139|       |                     if (bool(ctx.error)) [[unlikely]]
 3140|       |                        return;
 3141|       |                     if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]]
 3142|       |                        return;
 3143|       |                     const sv key{start, size_t(it - start)};
 3144|       |                     ++it;
 3145|       |                     if constexpr (not Opts.null_terminated) {
 3146|       |                        if (it == end) [[unlikely]] {
 3147|       |                           ctx.error = error_code::unexpected_end;
 3148|       |                           return;
 3149|       |                        }
 3150|       |                     }
 3151|       |
 3152|       |                     if (key == tag.sv()) {
 3153|       |                        if (parse_ws_colon<Opts>(ctx, it, end)) {
 3154|       |                           return;
 3155|       |                        }
 3156|       |
 3157|       |                        parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
 3158|       |                        if (bool(ctx.error)) [[unlikely]]
 3159|       |                           return;
 3160|       |
 3161|       |                        if (skip_ws<Opts>(ctx, it, end)) {
 3162|       |                           return;
 3163|       |                        }
 3164|       |                        continue;
 3165|       |                     }
 3166|       |                     else {
 3167|       |                        it = start; // reset the iterator
 3168|       |                     }
 3169|       |                  }
 3170|       |
 3171|       |                  if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
 3172|       |                     size_t index = num_members;
 3173|       |                     parse_and_invoke<Opts, T>(value, ctx, it, end, index);
 3174|       |                     if (bool(ctx.error)) [[unlikely]]
 3175|       |                        return;
 3176|       |                     if (index < num_members) {
 3177|       |                        fields[index] = true;
 3178|       |                     }
 3179|       |                  }
 3180|  31.2k|                  else {
 3181|  31.2k|                     parse_and_invoke<Opts, T>(value, ctx, it, end);
 3182|  31.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3182:26): [True: 7.95k, False: 23.2k]
  ------------------
 3183|  7.95k|                        return;
 3184|  31.2k|                  }
 3185|       |               }
 3186|       |               else {
 3187|       |                  // For types like std::map, std::unordered_map
 3188|       |
 3189|       |                  auto reading = [&](auto&& key) {
 3190|       |                     if constexpr (Opts.partial_read) {
 3191|       |                        if (auto element = value.find(key); element != value.end()) {
 3192|       |                           ++read_count;
 3193|       |                           parse<JSON>::op<ws_handled<Opts>()>(element->second, ctx, it, end);
 3194|       |                        }
 3195|       |                        else {
 3196|       |                           skip_value<JSON>::op<Opts>(ctx, it, end);
 3197|       |                        }
 3198|       |                     }
 3199|       |                     else {
 3200|       |                        parse<JSON>::op<ws_handled<Opts>()>(value[key], ctx, it, end);
 3201|       |                     }
 3202|       |                  };
 3203|       |
 3204|       |                  // using Key = std::conditional_t<heterogeneous_map<T>, sv, typename T::key_type>;
 3205|       |                  using Key = typename T::key_type;
 3206|       |                  if constexpr (std::is_same_v<Key, std::string>) {
 3207|       |                     ctx.scratch.clear();
 3208|       |                     parse<JSON>::op<Opts>(ctx.scratch, ctx, it, end);
 3209|       |                     if (bool(ctx.error)) [[unlikely]]
 3210|       |                        return;
 3211|       |
 3212|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3213|       |                        return;
 3214|       |                     }
 3215|       |
 3216|       |                     reading(ctx.scratch);
 3217|       |                     if constexpr (Opts.partial_read) {
 3218|       |                        if (read_count == value.size()) {
 3219|       |                           return;
 3220|       |                        }
 3221|       |                     }
 3222|       |                     if (bool(ctx.error)) [[unlikely]]
 3223|       |                        return;
 3224|       |                  }
 3225|       |                  else if constexpr (str_t<Key>) {
 3226|       |                     Key key;
 3227|       |                     parse<JSON>::op<Opts>(key, ctx, it, end);
 3228|       |                     if (bool(ctx.error)) [[unlikely]]
 3229|       |                        return;
 3230|       |
 3231|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3232|       |                        return;
 3233|       |                     }
 3234|       |
 3235|       |                     reading(key);
 3236|       |                     if constexpr (Opts.partial_read) {
 3237|       |                        if (read_count == value.size()) {
 3238|       |                           return;
 3239|       |                        }
 3240|       |                     }
 3241|       |                     if (bool(ctx.error)) [[unlikely]]
 3242|       |                        return;
 3243|       |                  }
 3244|       |                  else {
 3245|       |                     Key key_value{};
 3246|       |                     if constexpr (is_named_enum<Key> || mimics_str_t<Key>) {
 3247|       |                        parse<JSON>::op<Opts>(key_value, ctx, it, end);
 3248|       |                     }
 3249|       |                     else if constexpr (std::is_arithmetic_v<Key>) {
 3250|       |                        // prefer over quoted_t below to avoid double parsing of quoted_t
 3251|       |                        parse<JSON>::op<opt_true<Opts, quoted_num_opt_tag{}>>(key_value, ctx, it, end);
 3252|       |                     }
 3253|       |                     else {
 3254|       |                        parse<JSON>::op<opt_false<Opts, raw_string_opt_tag{}>>(quoted_t<Key>{key_value}, ctx, it, end);
 3255|       |                     }
 3256|       |                     if (bool(ctx.error)) [[unlikely]]
 3257|       |                        return;
 3258|       |
 3259|       |                     if (parse_ws_colon<Opts>(ctx, it, end)) {
 3260|       |                        return;
 3261|       |                     }
 3262|       |
 3263|       |                     reading(key_value);
 3264|       |                     if constexpr (Opts.partial_read) {
 3265|       |                        if (read_count == value.size()) {
 3266|       |                           return;
 3267|       |                        }
 3268|       |                     }
 3269|       |                     if (bool(ctx.error)) [[unlikely]]
 3270|       |                        return;
 3271|       |                  }
 3272|       |               }
 3273|       |
 3274|       |               // Streaming refill point: after parsing each key-value pair, refill if buffer is low
 3275|       |               if constexpr (has_streaming_state<decltype(ctx)>) {
 3276|       |                  if (ctx.stream.enabled()) {
 3277|       |                     const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 3278|       |                     // Refill when less than 25% of buffer remains to ensure enough space for next element
 3279|       |                     if (ctx.stream.size() - consumed <= ctx.stream.size() / 4 || it >= end) {
 3280|       |                        const char* new_it;
 3281|       |                        const char* new_end;
 3282|       |                        ctx.stream.consume_and_refill(consumed, new_it, new_end);
 3283|       |                        it = new_it;
 3284|       |                        end = new_end;
 3285|       |                        if (it >= end && ctx.stream.at_eof()) {
 3286|       |                           ctx.error = error_code::unexpected_end;
 3287|       |                           return;
 3288|       |                        }
 3289|       |                     }
 3290|       |                  }
 3291|       |               }
 3292|       |
 3293|  31.3k|               if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (3293:20): [True: 41, False: 31.3k]
  ------------------
 3294|     41|                  return;
 3295|     41|               }
 3296|  31.3k|            }
 3297|  17.0k|         }
 3298|  17.0k|      }
_ZZN3glz4fromILj10E9my_structE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnNS_14string_literalEXtlNS5_ILm1EEEEERS1_TkNS_10is_contextERNS_7contextERPKcSB_EEvOT1_OT2_OT3_T4_ENKUlvE_clEv:
 2895|  9.79k|            decltype(auto) fields = [&]() -> decltype(auto) {
 2896|       |               if constexpr ((glaze_object_t<T> || reflectable<T>) &&
 2897|       |                             (Opts.error_on_missing_keys || Opts.partial_read)) {
 2898|       |                  return bit_array<num_members>{};
 2899|       |               }
 2900|  9.79k|               else {
 2901|  9.79k|                  return nullptr;
 2902|  9.79k|               }
 2903|  9.79k|            }();
_ZZN3glz4fromILj10E9my_structE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnNS_14string_literalEXtlNS5_ILm1EEEEERS1_TkNS_10is_contextERNS_7contextERPKcSB_EEvOT1_OT2_OT3_T4_ENKUlvE1_clEv:
 2931|  9.79k|               ctx, [&]() -> void* {
 2932|       |                  if constexpr (tracks_include_keys) {
 2933|       |                     return &fields;
 2934|       |                  }
 2935|  9.79k|                  else {
 2936|  9.79k|                     return nullptr;
 2937|  9.79k|                  }
 2938|  9.79k|               }()};
_ZN3glz16parse_and_invokeITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT1_OT3_OT4_OT5_DpOT2_:
  382|  31.2k|   {
  383|  31.2k|      constexpr auto N = reflect<T>::size;
  384|       |
  385|       |      if constexpr (N == 1) {
  386|       |         decode_index<Opts, T, 0>(value, ctx, it, end, selected_index...);
  387|       |      }
  388|       |      else if constexpr (check_linear_search(Opts)) {
  389|       |         // Linear search path
  390|       |         auto key_start = it;
  391|       |         const auto index = decode_linear<T>(ctx, it, end);
  392|       |         if (bool(ctx.error)) [[unlikely]]
  393|       |            return;
  394|       |
  395|       |         if (index >= N) [[unlikely]] {
  396|       |            if constexpr (Opts.error_on_unknown_keys) {
  397|       |               ctx.error = error_code::unknown_key;
  398|       |               return;
  399|       |            }
  400|       |            else {
  401|       |               // it sits one past the closing quote, so the raw key spans [key_start, it - 1)
  402|       |               if (validate_utf8_span<Opts>(ctx, key_start, it - 1)) [[unlikely]] {
  403|       |                  return;
  404|       |               }
  405|       |               const sv key{key_start, size_t(it - key_start - 1)};
  406|       |               if constexpr (not Opts.null_terminated) {
  407|       |                  if (it == end) [[unlikely]] {
  408|       |                     ctx.error = error_code::unexpected_end;
  409|       |                     return;
  410|       |                  }
  411|       |               }
  412|       |               if (parse_ws_colon<Opts>(ctx, it, end)) {
  413|       |                  return;
  414|       |               }
  415|       |               parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
  416|       |               return;
  417|       |            }
  418|       |         }
  419|       |
  420|       |         if constexpr (not Opts.null_terminated) {
  421|       |            if (it == end) [[unlikely]] {
  422|       |               ctx.error = error_code::unexpected_end;
  423|       |               return;
  424|       |            }
  425|       |         }
  426|       |         if (skip_ws<Opts>(ctx, it, end)) {
  427|       |            return;
  428|       |         }
  429|       |         if (match_invalid_end<':', Opts>(ctx, it, end)) {
  430|       |            return;
  431|       |         }
  432|       |         if (skip_ws<Opts>(ctx, it, end)) {
  433|       |            return;
  434|       |         }
  435|       |
  436|       |         // Fold expression dispatch - avoids jump table overhead for smaller binary size.
  437|       |         // For linear_search, pass Opts through to the field parser to avoid duplicate template
  438|       |         // instantiations; the whitespace before the value has already been skipped either way.
  439|       |         [&]<size_t... Is>(std::index_sequence<Is...>) {
  440|       |            (void)(((index == Is ? (decode_field_value<Opts, Opts, T, Is>(value, ctx, it, end, selected_index...), true)
  441|       |                                 : false) ||
  442|       |                    ...));
  443|       |         }(std::make_index_sequence<N>{});
  444|       |      }
  445|  31.2k|      else {
  446|       |         // Hash-based lookup
  447|  31.2k|         constexpr auto& HashInfo = hash_info<T>;
  448|  31.2k|         constexpr auto type = HashInfo.type;
  449|  31.2k|         static_assert(bool(type), "invalid hash algorithm");
  450|       |
  451|  31.2k|         const auto index = decode_hash<JSON, T, HashInfo, HashInfo.type>::op(it, end);
  452|       |
  453|  31.2k|         if (index >= N) [[unlikely]] {
  ------------------
  |  Branch (453:14): [True: 4.36k, False: 26.8k]
  ------------------
  454|  4.36k|            if constexpr (Opts.error_on_unknown_keys) {
  455|  4.36k|               ctx.error = error_code::unknown_key;
  456|  4.36k|               return;
  457|       |            }
  458|       |            else {
  459|       |               auto start = it;
  460|       |               skip_string_view(ctx, it, end);
  461|       |               if (bool(ctx.error)) [[unlikely]]
  462|       |                  return;
  463|       |               if (validate_utf8_span<Opts>(ctx, start, it)) [[unlikely]]
  464|       |                  return;
  465|       |               const sv key = {start, size_t(it - start)};
  466|       |               ++it; // skip the quote
  467|       |               if constexpr (not Opts.null_terminated) {
  468|       |                  if (it == end) [[unlikely]] {
  469|       |                     ctx.error = error_code::unexpected_end;
  470|       |                     return;
  471|       |                  }
  472|       |               }
  473|       |               if (parse_ws_colon<Opts>(ctx, it, end)) {
  474|       |                  return;
  475|       |               }
  476|       |               parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
  477|       |               return;
  478|       |            }
  479|  4.36k|         }
  480|       |
  481|       |         if constexpr (N == 2) {
  482|       |            if (index == 0) {
  483|       |               decode_index<Opts, T, 0>(value, ctx, it, end, selected_index...);
  484|       |            }
  485|       |            else {
  486|       |               decode_index<Opts, T, 1>(value, ctx, it, end, selected_index...);
  487|       |            }
  488|       |         }
  489|  31.2k|         else {
  490|  31.2k|            visit<N>([&]<size_t I>() { decode_index<Opts, T, I>(value, ctx, it, end, selected_index...); }, index);
  491|  31.2k|         }
  492|  31.2k|      }
  493|  31.2k|   }
_ZZN3glz16parse_and_invokeITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT1_OT3_OT4_OT5_DpOT2_ENKUlTnmvE_clILm0EEEDav:
  490|  7.97k|            visit<N>([&]<size_t I>() { decode_index<Opts, T, I>(value, ctx, it, end, selected_index...); }, index);
_ZN3glz12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm0ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT2_OT4_OT5_OT6_DpOT3_:
  312|  7.97k|   {
  313|  7.97k|      static constexpr auto Key = get<I>(reflect<T>::keys);
  314|  7.97k|      static constexpr auto KeyWithEndQuote = join_v<Key, chars<"\"">>;
  315|  7.97k|      static constexpr auto Length = KeyWithEndQuote.size();
  316|       |
  317|       |      // Compared as a count rather than by forming `it + Length` first: a pointer past one-past-the-end
  318|       |      // is undefined even when it is never dereferenced, and a key near the end of a short buffer
  319|       |      // reaches this with fewer than `Length` bytes left. Signed, so a cursor that has overshot
  320|       |      // `end` does not read as room.
  321|  7.97k|      if (((end - it) > std::ptrdiff_t(Length)) && comparitor<KeyWithEndQuote>(it)) [[likely]] {
  ------------------
  |  Branch (321:11): [True: 7.97k, False: 5]
  |  Branch (321:52): [True: 7.93k, False: 40]
  ------------------
  322|  7.93k|         it += Length;
  323|       |         if constexpr (not Opts.null_terminated) {
  324|       |            if (it == end) [[unlikely]] {
  325|       |               ctx.error = error_code::unexpected_end;
  326|       |               return;
  327|       |            }
  328|       |         }
  329|       |
  330|  7.93k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (330:14): [True: 31, False: 7.89k]
  ------------------
  331|     31|            return;
  332|     31|         }
  333|  7.89k|         if (match_invalid_end<':', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (333:14): [True: 67, False: 7.83k]
  ------------------
  334|     67|            return;
  335|     67|         }
  336|  7.83k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (336:14): [True: 39, False: 7.79k]
  ------------------
  337|     39|            return;
  338|     39|         }
  339|       |
  340|       |         // The hash path has already consumed the whitespace before the value
  341|  7.79k|         decode_field_value<Opts, ws_handled<Opts>(), T, I>(value, ctx, it, end, selected_index...);
  342|  7.79k|      }
  343|     45|      else [[unlikely]] {
  344|     45|         decode_index_unknown_key<Opts, T>(value, ctx, it, end);
  345|     45|      }
  346|  7.97k|   }
_ZN3glz18decode_field_valueITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnDaXtlS1_Lj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEE9my_structLm0ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT1_E11reflectableIS9_EEEvOT3_OT5_OT6_OT7_DpOT4_:
  246|  7.79k|   {
  247|       |      // Check for null value skipping on read
  248|       |      if constexpr (check_skip_null_members_on_read(Opts)) {
  249|       |         if (*it == 'n') {
  250|       |            ++it;
  251|       |            if constexpr (not Opts.null_terminated) {
  252|       |               if (it == end) [[unlikely]] {
  253|       |                  ctx.error = error_code::unexpected_end;
  254|       |                  return;
  255|       |               }
  256|       |            }
  257|       |            match<"ull", Opts>(ctx, it, end);
  258|       |            if (bool(ctx.error)) [[unlikely]]
  259|       |               return;
  260|       |            // Successfully matched "null", skip it
  261|       |            if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  262|       |               ((selected_index = I), ...); // Mark as handled even if skipped
  263|       |            }
  264|       |            return;
  265|       |         }
  266|       |      }
  267|       |
  268|       |      if constexpr (skipped_by_meta<T, I, operation::parse>) {
  269|       |         skip_value<JSON>::op<Opts>(ctx, it, end);
  270|       |         if (bool(ctx.error)) [[unlikely]]
  271|       |            return; // Propagate error from skip_value
  272|       |      }
  273|  7.79k|      else {
  274|  7.79k|         using V = refl_t<T, I>;
  275|       |
  276|       |         if constexpr (const_value_v<V>) {
  277|       |            if constexpr (check_error_on_const_read(Opts)) {
  278|       |               ctx.error = error_code::attempt_const_read;
  279|       |            }
  280|       |            else {
  281|       |               // do not read anything into the const value
  282|       |               skip_value<JSON>::op<Opts>(ctx, it, end);
  283|       |            }
  284|       |         }
  285|       |         else if constexpr (is_function_ptr_or_ref<V>) {
  286|       |            // Function pointers cannot be deserialized from JSON.
  287|       |            // When write_function_pointers is enabled the writer emits a type-name string,
  288|       |            // but there is nothing meaningful to reconstruct on read — just skip the value.
  289|       |            // When write_function_pointers is off the key is never written, so this branch
  290|       |            // is unreachable in that case.
  291|       |            skip_value<JSON>::op<Opts>(ctx, it, end);
  292|       |         }
  293|       |         else if constexpr (glaze_object_t<T>) {
  294|       |            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(reflect<T>::values)),
  295|       |                                                                       ctx, it, end);
  296|       |         }
  297|  7.79k|         else {
  298|  7.79k|            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(to_tie(value))), ctx,
  299|  7.79k|                                                                       it, end);
  300|  7.79k|         }
  301|  7.79k|      }
  302|       |
  303|       |      // The key was present and handled, even when the value itself was skipped
  304|       |      if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  305|       |         ((selected_index = I), ...);
  306|       |      }
  307|  7.79k|   }
_ZN3glz4fromILj10EiE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERPKcRiTkNS_10is_contextERNS_7contextES5_EEvOT1_OT2_OT0_T3_:
  763|  7.79k|      {
  764|       |         if constexpr (check_quoted_num(Opts)) {
  765|       |            if (skip_ws<Opts>(ctx, it, end)) {
  766|       |               return;
  767|       |            }
  768|       |            if (match_invalid_end<'"', Opts>(ctx, it, end)) {
  769|       |               return;
  770|       |            }
  771|       |         }
  772|       |
  773|       |         if constexpr (!check_ws_handled(Opts)) {
  774|       |            if (skip_ws<Opts>(ctx, it, end)) {
  775|       |               return;
  776|       |            }
  777|       |         }
  778|       |
  779|  7.79k|         using V = std::decay_t<decltype(value)>;
  780|  7.79k|         if constexpr (int_t<V>) {
  781|  7.79k|            static_assert(sizeof(*it) == sizeof(char));
  782|       |
  783|  7.79k|            if constexpr (Opts.null_terminated) {
  784|  7.79k|               if (not glz::atoi(value, it)) [[unlikely]] {
  ------------------
  |  Branch (784:20): [True: 319, False: 7.47k]
  ------------------
  785|    319|                  ctx.error = error_code::parse_number_failure;
  786|    319|                  return;
  787|    319|               }
  788|       |            }
  789|       |            else {
  790|       |               if (not glz::atoi(value, it, end)) [[unlikely]] {
  791|       |                  ctx.error = error_code::parse_number_failure;
  792|       |                  return;
  793|       |               }
  794|       |            }
  795|       |         }
  796|       |         else {
  797|       |// float128_t requires std::from_chars for floating-point, unavailable on older Apple platforms (iOS < 16.3)
  798|       |#if !defined(_LIBCPP_VERSION) || defined(_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT)
  799|       |            if constexpr (is_float128<V>) {
  800|       |               auto [ptr, ec] = std::from_chars(it, end, value);
  801|       |               if (ec != std::errc()) {
  802|       |                  ctx.error = error_code::parse_number_failure;
  803|       |                  return;
  804|       |               }
  805|       |               it = ptr;
  806|       |            }
  807|       |            else
  808|       |#endif
  809|       |            {
  810|       |               if constexpr (std::is_volatile_v<std::remove_reference_t<decltype(value)>>) {
  811|       |                  // Hardware may interact with value changes, so we parse into a temporary and assign in one
  812|       |                  // place
  813|       |                  V temp;
  814|       |                  if constexpr (is_size_optimized(Opts)) {
  815|       |                     auto [ptr, ec] = simple_float::from_chars<Opts.null_terminated>(it, end, temp);
  816|       |                     if (ec != std::errc{}) [[unlikely]] {
  817|       |                        ctx.error = error_code::parse_number_failure;
  818|       |                        return;
  819|       |                     }
  820|       |                     it = ptr;
  821|       |                  }
  822|       |                  else {
  823|       |                     auto [ptr, ec] = glz::from_chars<Opts.null_terminated>(it, end, temp);
  824|       |                     if (ec != std::errc()) [[unlikely]] {
  825|       |                        ctx.error = error_code::parse_number_failure;
  826|       |                        return;
  827|       |                     }
  828|       |                     it = ptr;
  829|       |                  }
  830|       |                  value = temp;
  831|       |               }
  832|       |               else {
  833|       |                  if constexpr (is_size_optimized(Opts)) {
  834|       |                     auto [ptr, ec] = simple_float::from_chars<Opts.null_terminated>(it, end, value);
  835|       |                     if (ec != std::errc{}) [[unlikely]] {
  836|       |                        ctx.error = error_code::parse_number_failure;
  837|       |                        return;
  838|       |                     }
  839|       |                     it = ptr;
  840|       |                  }
  841|       |                  else {
  842|       |                     auto [ptr, ec] = glz::from_chars<Opts.null_terminated>(it, end, value);
  843|       |                     if (ec != std::errc()) [[unlikely]] {
  844|       |                        ctx.error = error_code::parse_number_failure;
  845|       |                        return;
  846|       |                     }
  847|       |                     it = ptr;
  848|       |                  }
  849|       |               }
  850|       |            }
  851|       |         }
  852|       |
  853|       |         if constexpr (check_quoted_num(Opts)) {
  854|       |            if constexpr (not Opts.null_terminated) {
  855|       |               if (it == end) [[unlikely]] {
  856|       |                  ctx.error = error_code::unexpected_end;
  857|       |                  return;
  858|       |               }
  859|       |            }
  860|       |            if (match<'"'>(ctx, it)) {
  861|       |               return;
  862|       |            }
  863|       |            if constexpr (not Opts.null_terminated) {
  864|       |               if (it == end) {
  865|       |                  ctx.error = error_code::end_reached;
  866|       |                  return;
  867|       |               }
  868|       |            }
  869|       |         }
  870|  7.79k|         else {
  871|       |            if constexpr (not Opts.null_terminated) {
  872|       |               if (it == end) {
  873|       |                  ctx.error = error_code::end_reached;
  874|       |                  return;
  875|       |               }
  876|       |            }
  877|  7.79k|         }
  878|  7.79k|      }
_ZN3glz24decode_index_unknown_keyITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS2_TkNS_10is_contextERNS_7contextERPKcS7_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT1_OT2_OT3_T4_:
  177|  1.16k|   {
  178|  1.16k|      if constexpr (Opts.error_on_unknown_keys) {
  179|  1.16k|         ctx.error = error_code::unknown_key;
  180|       |      }
  181|       |      else {
  182|       |         auto* start = it;
  183|       |         uint64_t ascii_acc{};
  184|       |         skip_string_view(ctx, it, end, ascii_acc);
  185|       |         if (bool(ctx.error)) [[unlikely]]
  186|       |            return;
  187|       |         if (validate_utf8_span<Opts>(ctx, start, it, ascii_acc)) [[unlikely]]
  188|       |            return;
  189|       |         const sv key = {start, size_t(it - start)};
  190|       |         ++it;
  191|       |         if constexpr (not Opts.null_terminated) {
  192|       |            if (it == end) [[unlikely]] {
  193|       |               ctx.error = error_code::unexpected_end;
  194|       |               return;
  195|       |            }
  196|       |         }
  197|       |
  198|       |         if (parse_ws_colon<Opts>(ctx, it, end)) {
  199|       |            return;
  200|       |         }
  201|       |
  202|       |         parse<JSON>::handle_unknown<Opts>(key, value, ctx, it, end);
  203|       |      }
  204|  1.16k|   }
_ZZN3glz16parse_and_invokeITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT1_OT3_OT4_OT5_DpOT2_ENKUlTnmvE_clILm1EEEDav:
  490|  8.93k|            visit<N>([&]<size_t I>() { decode_index<Opts, T, I>(value, ctx, it, end, selected_index...); }, index);
_ZN3glz12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm1ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT2_OT4_OT5_OT6_DpOT3_:
  312|  8.93k|   {
  313|  8.93k|      static constexpr auto Key = get<I>(reflect<T>::keys);
  314|  8.93k|      static constexpr auto KeyWithEndQuote = join_v<Key, chars<"\"">>;
  315|  8.93k|      static constexpr auto Length = KeyWithEndQuote.size();
  316|       |
  317|       |      // Compared as a count rather than by forming `it + Length` first: a pointer past one-past-the-end
  318|       |      // is undefined even when it is never dereferenced, and a key near the end of a short buffer
  319|       |      // reaches this with fewer than `Length` bytes left. Signed, so a cursor that has overshot
  320|       |      // `end` does not read as room.
  321|  8.93k|      if (((end - it) > std::ptrdiff_t(Length)) && comparitor<KeyWithEndQuote>(it)) [[likely]] {
  ------------------
  |  Branch (321:11): [True: 8.93k, False: 4]
  |  Branch (321:52): [True: 8.78k, False: 148]
  ------------------
  322|  8.78k|         it += Length;
  323|       |         if constexpr (not Opts.null_terminated) {
  324|       |            if (it == end) [[unlikely]] {
  325|       |               ctx.error = error_code::unexpected_end;
  326|       |               return;
  327|       |            }
  328|       |         }
  329|       |
  330|  8.78k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (330:14): [True: 39, False: 8.74k]
  ------------------
  331|     39|            return;
  332|     39|         }
  333|  8.74k|         if (match_invalid_end<':', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (333:14): [True: 68, False: 8.67k]
  ------------------
  334|     68|            return;
  335|     68|         }
  336|  8.67k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (336:14): [True: 26, False: 8.65k]
  ------------------
  337|     26|            return;
  338|     26|         }
  339|       |
  340|       |         // The hash path has already consumed the whitespace before the value
  341|  8.65k|         decode_field_value<Opts, ws_handled<Opts>(), T, I>(value, ctx, it, end, selected_index...);
  342|  8.65k|      }
  343|    152|      else [[unlikely]] {
  344|    152|         decode_index_unknown_key<Opts, T>(value, ctx, it, end);
  345|    152|      }
  346|  8.93k|   }
_ZN3glz18decode_field_valueITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnDaXtlS1_Lj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEE9my_structLm1ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT1_E11reflectableIS9_EEEvOT3_OT5_OT6_OT7_DpOT4_:
  246|  8.65k|   {
  247|       |      // Check for null value skipping on read
  248|       |      if constexpr (check_skip_null_members_on_read(Opts)) {
  249|       |         if (*it == 'n') {
  250|       |            ++it;
  251|       |            if constexpr (not Opts.null_terminated) {
  252|       |               if (it == end) [[unlikely]] {
  253|       |                  ctx.error = error_code::unexpected_end;
  254|       |                  return;
  255|       |               }
  256|       |            }
  257|       |            match<"ull", Opts>(ctx, it, end);
  258|       |            if (bool(ctx.error)) [[unlikely]]
  259|       |               return;
  260|       |            // Successfully matched "null", skip it
  261|       |            if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  262|       |               ((selected_index = I), ...); // Mark as handled even if skipped
  263|       |            }
  264|       |            return;
  265|       |         }
  266|       |      }
  267|       |
  268|       |      if constexpr (skipped_by_meta<T, I, operation::parse>) {
  269|       |         skip_value<JSON>::op<Opts>(ctx, it, end);
  270|       |         if (bool(ctx.error)) [[unlikely]]
  271|       |            return; // Propagate error from skip_value
  272|       |      }
  273|  8.65k|      else {
  274|  8.65k|         using V = refl_t<T, I>;
  275|       |
  276|       |         if constexpr (const_value_v<V>) {
  277|       |            if constexpr (check_error_on_const_read(Opts)) {
  278|       |               ctx.error = error_code::attempt_const_read;
  279|       |            }
  280|       |            else {
  281|       |               // do not read anything into the const value
  282|       |               skip_value<JSON>::op<Opts>(ctx, it, end);
  283|       |            }
  284|       |         }
  285|       |         else if constexpr (is_function_ptr_or_ref<V>) {
  286|       |            // Function pointers cannot be deserialized from JSON.
  287|       |            // When write_function_pointers is enabled the writer emits a type-name string,
  288|       |            // but there is nothing meaningful to reconstruct on read — just skip the value.
  289|       |            // When write_function_pointers is off the key is never written, so this branch
  290|       |            // is unreachable in that case.
  291|       |            skip_value<JSON>::op<Opts>(ctx, it, end);
  292|       |         }
  293|       |         else if constexpr (glaze_object_t<T>) {
  294|       |            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(reflect<T>::values)),
  295|       |                                                                       ctx, it, end);
  296|       |         }
  297|  8.65k|         else {
  298|  8.65k|            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(to_tie(value))), ctx,
  299|  8.65k|                                                                       it, end);
  300|  8.65k|         }
  301|  8.65k|      }
  302|       |
  303|       |      // The key was present and handled, even when the value itself was skipped
  304|       |      if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  305|       |         ((selected_index = I), ...);
  306|       |      }
  307|  8.65k|   }
_ZZN3glz16parse_and_invokeITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT1_OT3_OT4_OT5_DpOT2_ENKUlTnmvE_clILm2EEEDav:
  490|  2.28k|            visit<N>([&]<size_t I>() { decode_index<Opts, T, I>(value, ctx, it, end, selected_index...); }, index);
_ZN3glz12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm2ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT2_OT4_OT5_OT6_DpOT3_:
  312|  2.28k|   {
  313|  2.28k|      static constexpr auto Key = get<I>(reflect<T>::keys);
  314|  2.28k|      static constexpr auto KeyWithEndQuote = join_v<Key, chars<"\"">>;
  315|  2.28k|      static constexpr auto Length = KeyWithEndQuote.size();
  316|       |
  317|       |      // Compared as a count rather than by forming `it + Length` first: a pointer past one-past-the-end
  318|       |      // is undefined even when it is never dereferenced, and a key near the end of a short buffer
  319|       |      // reaches this with fewer than `Length` bytes left. Signed, so a cursor that has overshot
  320|       |      // `end` does not read as room.
  321|  2.28k|      if (((end - it) > std::ptrdiff_t(Length)) && comparitor<KeyWithEndQuote>(it)) [[likely]] {
  ------------------
  |  Branch (321:11): [True: 2.27k, False: 14]
  |  Branch (321:52): [True: 1.45k, False: 819]
  ------------------
  322|  1.45k|         it += Length;
  323|       |         if constexpr (not Opts.null_terminated) {
  324|       |            if (it == end) [[unlikely]] {
  325|       |               ctx.error = error_code::unexpected_end;
  326|       |               return;
  327|       |            }
  328|       |         }
  329|       |
  330|  1.45k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (330:14): [True: 24, False: 1.43k]
  ------------------
  331|     24|            return;
  332|     24|         }
  333|  1.43k|         if (match_invalid_end<':', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (333:14): [True: 56, False: 1.37k]
  ------------------
  334|     56|            return;
  335|     56|         }
  336|  1.37k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (336:14): [True: 26, False: 1.35k]
  ------------------
  337|     26|            return;
  338|     26|         }
  339|       |
  340|       |         // The hash path has already consumed the whitespace before the value
  341|  1.35k|         decode_field_value<Opts, ws_handled<Opts>(), T, I>(value, ctx, it, end, selected_index...);
  342|  1.35k|      }
  343|    833|      else [[unlikely]] {
  344|    833|         decode_index_unknown_key<Opts, T>(value, ctx, it, end);
  345|    833|      }
  346|  2.28k|   }
_ZN3glz18decode_field_valueITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnDaXtlS1_Lj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEE9my_structLm2ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT1_E11reflectableIS9_EEEvOT3_OT5_OT6_OT7_DpOT4_:
  246|  1.35k|   {
  247|       |      // Check for null value skipping on read
  248|       |      if constexpr (check_skip_null_members_on_read(Opts)) {
  249|       |         if (*it == 'n') {
  250|       |            ++it;
  251|       |            if constexpr (not Opts.null_terminated) {
  252|       |               if (it == end) [[unlikely]] {
  253|       |                  ctx.error = error_code::unexpected_end;
  254|       |                  return;
  255|       |               }
  256|       |            }
  257|       |            match<"ull", Opts>(ctx, it, end);
  258|       |            if (bool(ctx.error)) [[unlikely]]
  259|       |               return;
  260|       |            // Successfully matched "null", skip it
  261|       |            if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  262|       |               ((selected_index = I), ...); // Mark as handled even if skipped
  263|       |            }
  264|       |            return;
  265|       |         }
  266|       |      }
  267|       |
  268|       |      if constexpr (skipped_by_meta<T, I, operation::parse>) {
  269|       |         skip_value<JSON>::op<Opts>(ctx, it, end);
  270|       |         if (bool(ctx.error)) [[unlikely]]
  271|       |            return; // Propagate error from skip_value
  272|       |      }
  273|  1.35k|      else {
  274|  1.35k|         using V = refl_t<T, I>;
  275|       |
  276|       |         if constexpr (const_value_v<V>) {
  277|       |            if constexpr (check_error_on_const_read(Opts)) {
  278|       |               ctx.error = error_code::attempt_const_read;
  279|       |            }
  280|       |            else {
  281|       |               // do not read anything into the const value
  282|       |               skip_value<JSON>::op<Opts>(ctx, it, end);
  283|       |            }
  284|       |         }
  285|       |         else if constexpr (is_function_ptr_or_ref<V>) {
  286|       |            // Function pointers cannot be deserialized from JSON.
  287|       |            // When write_function_pointers is enabled the writer emits a type-name string,
  288|       |            // but there is nothing meaningful to reconstruct on read — just skip the value.
  289|       |            // When write_function_pointers is off the key is never written, so this branch
  290|       |            // is unreachable in that case.
  291|       |            skip_value<JSON>::op<Opts>(ctx, it, end);
  292|       |         }
  293|       |         else if constexpr (glaze_object_t<T>) {
  294|       |            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(reflect<T>::values)),
  295|       |                                                                       ctx, it, end);
  296|       |         }
  297|  1.35k|         else {
  298|  1.35k|            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(to_tie(value))), ctx,
  299|  1.35k|                                                                       it, end);
  300|  1.35k|         }
  301|  1.35k|      }
  302|       |
  303|       |      // The key was present and handled, even when the value itself was skipped
  304|       |      if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  305|       |         ((selected_index = I), ...);
  306|       |      }
  307|  1.35k|   }
_ZZN3glz16parse_and_invokeITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT1_OT3_OT4_OT5_DpOT2_ENKUlTnmvE_clILm3EEEDav:
  490|  7.64k|            visit<N>([&]<size_t I>() { decode_index<Opts, T, I>(value, ctx, it, end, selected_index...); }, index);
_ZN3glz12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm3ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT0_E11reflectableIS9_EEEvOT2_OT4_OT5_OT6_DpOT3_:
  312|  7.64k|   {
  313|  7.64k|      static constexpr auto Key = get<I>(reflect<T>::keys);
  314|  7.64k|      static constexpr auto KeyWithEndQuote = join_v<Key, chars<"\"">>;
  315|  7.64k|      static constexpr auto Length = KeyWithEndQuote.size();
  316|       |
  317|       |      // Compared as a count rather than by forming `it + Length` first: a pointer past one-past-the-end
  318|       |      // is undefined even when it is never dereferenced, and a key near the end of a short buffer
  319|       |      // reaches this with fewer than `Length` bytes left. Signed, so a cursor that has overshot
  320|       |      // `end` does not read as room.
  321|  7.64k|      if (((end - it) > std::ptrdiff_t(Length)) && comparitor<KeyWithEndQuote>(it)) [[likely]] {
  ------------------
  |  Branch (321:11): [True: 7.63k, False: 7]
  |  Branch (321:52): [True: 7.50k, False: 129]
  ------------------
  322|  7.50k|         it += Length;
  323|       |         if constexpr (not Opts.null_terminated) {
  324|       |            if (it == end) [[unlikely]] {
  325|       |               ctx.error = error_code::unexpected_end;
  326|       |               return;
  327|       |            }
  328|       |         }
  329|       |
  330|  7.50k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (330:14): [True: 40, False: 7.46k]
  ------------------
  331|     40|            return;
  332|     40|         }
  333|  7.46k|         if (match_invalid_end<':', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (333:14): [True: 66, False: 7.40k]
  ------------------
  334|     66|            return;
  335|     66|         }
  336|  7.40k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (336:14): [True: 49, False: 7.35k]
  ------------------
  337|     49|            return;
  338|     49|         }
  339|       |
  340|       |         // The hash path has already consumed the whitespace before the value
  341|  7.35k|         decode_field_value<Opts, ws_handled<Opts>(), T, I>(value, ctx, it, end, selected_index...);
  342|  7.35k|      }
  343|    136|      else [[unlikely]] {
  344|    136|         decode_index_unknown_key<Opts, T>(value, ctx, it, end);
  345|    136|      }
  346|  7.64k|   }
_ZN3glz18decode_field_valueITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETnDaXtlS1_Lj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEE9my_structLm3ERS2_JETkNS_10is_contextERNS_7contextERPKcS8_Qoo14glaze_object_tIT1_E11reflectableIS9_EEEvOT3_OT5_OT6_OT7_DpOT4_:
  246|  7.35k|   {
  247|       |      // Check for null value skipping on read
  248|       |      if constexpr (check_skip_null_members_on_read(Opts)) {
  249|       |         if (*it == 'n') {
  250|       |            ++it;
  251|       |            if constexpr (not Opts.null_terminated) {
  252|       |               if (it == end) [[unlikely]] {
  253|       |                  ctx.error = error_code::unexpected_end;
  254|       |                  return;
  255|       |               }
  256|       |            }
  257|       |            match<"ull", Opts>(ctx, it, end);
  258|       |            if (bool(ctx.error)) [[unlikely]]
  259|       |               return;
  260|       |            // Successfully matched "null", skip it
  261|       |            if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  262|       |               ((selected_index = I), ...); // Mark as handled even if skipped
  263|       |            }
  264|       |            return;
  265|       |         }
  266|       |      }
  267|       |
  268|       |      if constexpr (skipped_by_meta<T, I, operation::parse>) {
  269|       |         skip_value<JSON>::op<Opts>(ctx, it, end);
  270|       |         if (bool(ctx.error)) [[unlikely]]
  271|       |            return; // Propagate error from skip_value
  272|       |      }
  273|  7.35k|      else {
  274|  7.35k|         using V = refl_t<T, I>;
  275|       |
  276|       |         if constexpr (const_value_v<V>) {
  277|       |            if constexpr (check_error_on_const_read(Opts)) {
  278|       |               ctx.error = error_code::attempt_const_read;
  279|       |            }
  280|       |            else {
  281|       |               // do not read anything into the const value
  282|       |               skip_value<JSON>::op<Opts>(ctx, it, end);
  283|       |            }
  284|       |         }
  285|       |         else if constexpr (is_function_ptr_or_ref<V>) {
  286|       |            // Function pointers cannot be deserialized from JSON.
  287|       |            // When write_function_pointers is enabled the writer emits a type-name string,
  288|       |            // but there is nothing meaningful to reconstruct on read — just skip the value.
  289|       |            // When write_function_pointers is off the key is never written, so this branch
  290|       |            // is unreachable in that case.
  291|       |            skip_value<JSON>::op<Opts>(ctx, it, end);
  292|       |         }
  293|       |         else if constexpr (glaze_object_t<T>) {
  294|       |            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(reflect<T>::values)),
  295|       |                                                                       ctx, it, end);
  296|       |         }
  297|  7.35k|         else {
  298|  7.35k|            from<JSON, std::remove_cvref_t<V>>::template op<FieldOpts>(get_member(value, get<I>(to_tie(value))), ctx,
  299|  7.35k|                                                                       it, end);
  300|  7.35k|         }
  301|  7.35k|      }
  302|       |
  303|       |      // The key was present and handled, even when the value itself was skipped
  304|       |      if constexpr (Opts.error_on_missing_keys || Opts.partial_read) {
  305|       |         ((selected_index = I), ...);
  306|       |      }
  307|  7.35k|   }
_ZN3glz4fromILj10ENSt3__15arrayImLm3EEEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERS3_TkNS_10is_contextERNS_7contextERPKcSB_EEvOT0_OT1_OT2_T3_:
 2050|  7.35k|      {
 2051|  7.35k|         constexpr auto Opts = ws_handled_off<Options>();
 2052|       |         if constexpr (!check_ws_handled(Options)) {
 2053|       |            if (skip_ws<Opts>(ctx, it, end)) {
 2054|       |               return;
 2055|       |            }
 2056|       |         }
 2057|       |
 2058|  7.35k|         if (match_invalid_end<'[', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2058:14): [True: 67, False: 7.28k]
  ------------------
 2059|     67|            return;
 2060|     67|         }
 2061|       |         // one nesting level (see enter_depth): counted in both modes so the limit binds,
 2062|       |         // released at each syntactic close below
 2063|  7.28k|         if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (2063:14): [True: 0, False: 7.28k]
  ------------------
 2064|      0|            return;
 2065|      0|         }
 2066|       |
 2067|  7.28k|         const auto ws_start = it;
 2068|  7.28k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2068:14): [True: 38, False: 7.24k]
  ------------------
 2069|     38|            return;
 2070|     38|         }
 2071|       |
 2072|  7.24k|         if (*it == ']') {
  ------------------
  |  Branch (2072:14): [True: 1.06k, False: 6.18k]
  ------------------
 2073|  1.06k|            --ctx.depth;
 2074|  1.06k|            ++it;
 2075|       |            if constexpr ((resizable<T> || is_inplace_vector<T>) && not check_append_arrays(Opts)) {
 2076|       |               value.clear();
 2077|       |
 2078|       |               if constexpr (check_shrink_to_fit(Opts) && has_shrink_to_fit<T>) {
 2079|       |                  value.shrink_to_fit();
 2080|       |               }
 2081|       |            }
 2082|  1.06k|            return;
 2083|  1.06k|         }
 2084|       |
 2085|  6.18k|         const size_t ws_size = size_t(it - ws_start);
 2086|       |
 2087|  6.18k|         static constexpr bool should_append = (resizable<T> || is_inplace_vector<T>) && check_append_arrays(Opts);
  ------------------
  |  Branch (2087:49): [Folded, False: 0]
  |  Branch (2087:65): [Folded, False: 0]
  |  Branch (2087:90): [Folded, False: 0]
  ------------------
 2088|  6.18k|         if constexpr (not should_append) {
 2089|  6.18k|            const auto n = value.size();
 2090|       |
 2091|  6.18k|            auto value_it = value.begin();
 2092|       |
 2093|  13.7k|            for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (2093:32): [True: 13.7k, False: 13]
  ------------------
 2094|  13.7k|               parse<JSON>::op<ws_handled<Opts>()>(*value_it++, ctx, it, end);
 2095|  13.7k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2095:20): [True: 441, False: 13.3k]
  ------------------
 2096|    441|                  return;
 2097|  13.3k|               if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2097:20): [True: 41, False: 13.2k]
  ------------------
 2098|     41|                  return;
 2099|     41|               }
 2100|  13.2k|               if (*it == ',') {
  ------------------
  |  Branch (2100:20): [True: 7.61k, False: 5.66k]
  ------------------
 2101|  7.61k|                  ++it;
 2102|       |
 2103|       |                  if constexpr (!Opts.minified && !Opts.comments) {
 2104|       |                     if (ws_size && ws_size < size_t(end - it)) {
 2105|       |                        skip_matching_ws(ws_start, it, ws_size);
 2106|       |                     }
 2107|       |                  }
 2108|       |
 2109|  7.61k|                  if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (2109:23): [True: 26, False: 7.59k]
  ------------------
 2110|     26|                     return;
 2111|     26|                  }
 2112|  7.61k|               }
 2113|  5.66k|               else if (*it == ']') {
  ------------------
  |  Branch (2113:25): [True: 5.17k, False: 491]
  ------------------
 2114|  5.17k|                  --ctx.depth;
 2115|  5.17k|                  ++it;
 2116|       |                  if constexpr (erasable<T>) {
 2117|       |                     value.erase(value_it,
 2118|       |                                 value.end()); // use erase rather than resize for non-default constructible elements
 2119|       |
 2120|       |                     if constexpr (check_shrink_to_fit(Opts) && has_shrink_to_fit<T>) {
 2121|       |                        value.shrink_to_fit();
 2122|       |                     }
 2123|       |                  }
 2124|  5.17k|                  return;
 2125|  5.17k|               }
 2126|    491|               else [[unlikely]] {
 2127|    491|                  ctx.error = error_code::expected_bracket;
 2128|    491|                  return;
 2129|    491|               }
 2130|  13.2k|            }
 2131|  6.18k|         }
 2132|       |
 2133|       |         if constexpr (Opts.partial_read) {
 2134|       |            // partial_read stops early on a success path, so give the level back like the
 2135|       |            // syntactic-close paths do; otherwise it accumulates across reads sharing a context.
 2136|       |            --ctx.depth;
 2137|       |            return;
 2138|       |         }
 2139|  6.18k|         else {
 2140|       |            // growing
 2141|       |            if constexpr (emplace_backable<T> || has_try_emplace_back<T>) {
 2142|       |               while (it < end) {
 2143|       |                  // Streaming refill point: at start of each iteration, ensure buffer has data
 2144|       |                  if constexpr (has_streaming_state<decltype(ctx)>) {
 2145|       |                     if (ctx.stream.enabled()) {
 2146|       |                        const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 2147|       |                        const size_t remaining = ctx.stream.size() - consumed;
 2148|       |                        // Refill when less than half of buffer remains to ensure space for next element
 2149|       |                        if (remaining <= ctx.stream.size() / 2 || it >= end) {
 2150|       |                           const char* new_it;
 2151|       |                           const char* new_end;
 2152|       |                           ctx.stream.consume_and_refill(consumed, new_it, new_end);
 2153|       |                           it = new_it;
 2154|       |                           end = new_end;
 2155|       |                           if (it >= end && ctx.stream.at_eof()) {
 2156|       |                              break; // No more data, exit loop normally
 2157|       |                           }
 2158|       |                        }
 2159|       |                     }
 2160|       |                  }
 2161|       |
 2162|       |                  if constexpr (has_try_emplace_back<T>) {
 2163|       |                     if (value.try_emplace_back())
 2164|       |                        parse<JSON>::op<ws_handled<Opts>()>(value.back(), ctx, it, end);
 2165|       |                     else
 2166|       |                        ctx.error = error_code::exceeded_static_array_size;
 2167|       |                  }
 2168|       |                  else {
 2169|       |                     parse<JSON>::op<ws_handled<Opts>()>(value.emplace_back(), ctx, it, end);
 2170|       |                  }
 2171|       |
 2172|       |                  if (bool(ctx.error)) [[unlikely]]
 2173|       |                     return;
 2174|       |
 2175|       |                  // Streaming refill point: after parsing each element, refill if buffer is low
 2176|       |                  if constexpr (has_streaming_state<decltype(ctx)>) {
 2177|       |                     if (ctx.stream.enabled()) {
 2178|       |                        const size_t consumed = static_cast<size_t>(it - ctx.stream.data());
 2179|       |                        // Refill when less than 25% of buffer remains to ensure enough space for next element
 2180|       |                        if (ctx.stream.size() - consumed <= ctx.stream.size() / 4 || it >= end) {
 2181|       |                           const char* new_it;
 2182|       |                           const char* new_end;
 2183|       |                           ctx.stream.consume_and_refill(consumed, new_it, new_end);
 2184|       |                           it = new_it;
 2185|       |                           end = new_end;
 2186|       |                           if (it >= end && ctx.stream.at_eof()) {
 2187|       |                              ctx.error = error_code::unexpected_end;
 2188|       |                              return;
 2189|       |                           }
 2190|       |                        }
 2191|       |                     }
 2192|       |                  }
 2193|       |
 2194|       |                  if (skip_ws<Opts>(ctx, it, end)) {
 2195|       |                     return;
 2196|       |                  }
 2197|       |                  if (*it == ',') [[likely]] {
 2198|       |                     ++it;
 2199|       |
 2200|       |                     if constexpr (!Opts.minified && !Opts.comments) {
 2201|       |                        if (ws_size && ws_size < size_t(end - it)) {
 2202|       |                           skip_matching_ws(ws_start, it, ws_size);
 2203|       |                        }
 2204|       |                     }
 2205|       |
 2206|       |                     if (skip_ws<Opts>(ctx, it, end)) {
 2207|       |                        return;
 2208|       |                     }
 2209|       |                  }
 2210|       |                  else if (*it == ']') {
 2211|       |                     --ctx.depth;
 2212|       |                     ++it;
 2213|       |                     if constexpr (check_shrink_to_fit(Opts) && has_shrink_to_fit<T>) {
 2214|       |                        value.shrink_to_fit();
 2215|       |                     }
 2216|       |                     return;
 2217|       |                  }
 2218|       |                  else [[unlikely]] {
 2219|       |                     ctx.error = error_code::expected_bracket;
 2220|       |                     return;
 2221|       |                  }
 2222|       |               }
 2223|       |
 2224|       |               // A valid array always returns from inside the loop upon reaching ']'.
 2225|       |               // For a null-terminated buffer the loop can only exit here by falling
 2226|       |               // through when `it` reaches the terminator without a closing bracket,
 2227|       |               // which means the input was truncated (e.g. "[", "[1," or "[1,2,").
 2228|       |               // Non-null-terminated buffers surface this through skip_ws/depth
 2229|       |               // tracking (or the streaming refill break), so this guard is limited
 2230|       |               // to the null-terminated case.
 2231|       |               if constexpr (Opts.null_terminated) {
 2232|       |                  ctx.error = error_code::unexpected_end;
 2233|       |               }
 2234|       |            }
 2235|  6.18k|            else {
 2236|  6.18k|               ctx.error = error_code::exceeded_static_array_size;
 2237|  6.18k|            }
 2238|  6.18k|         }
 2239|  6.18k|      }
_ZN3glz5parseILj10EE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERmTkNS_10is_contextERNS_7contextERPKcS8_EEvOT0_OT1_OT2_T3_:
   49|  13.7k|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  13.7k|         else {
   60|  13.7k|            using V = std::remove_cvref_t<T>;
   61|  13.7k|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  13.7k|                                             end);
   63|  13.7k|         }
   64|  13.7k|      }
_ZN3glz4fromILj10EmE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEERPKcRmTkNS_10is_contextERNS_7contextES5_EEvOT1_OT2_OT0_T3_:
  763|  13.7k|      {
  764|       |         if constexpr (check_quoted_num(Opts)) {
  765|       |            if (skip_ws<Opts>(ctx, it, end)) {
  766|       |               return;
  767|       |            }
  768|       |            if (match_invalid_end<'"', Opts>(ctx, it, end)) {
  769|       |               return;
  770|       |            }
  771|       |         }
  772|       |
  773|       |         if constexpr (!check_ws_handled(Opts)) {
  774|       |            if (skip_ws<Opts>(ctx, it, end)) {
  775|       |               return;
  776|       |            }
  777|       |         }
  778|       |
  779|  13.7k|         using V = std::decay_t<decltype(value)>;
  780|  13.7k|         if constexpr (int_t<V>) {
  781|  13.7k|            static_assert(sizeof(*it) == sizeof(char));
  782|       |
  783|  13.7k|            if constexpr (Opts.null_terminated) {
  784|  13.7k|               if (not glz::atoi(value, it)) [[unlikely]] {
  ------------------
  |  Branch (784:20): [True: 441, False: 13.3k]
  ------------------
  785|    441|                  ctx.error = error_code::parse_number_failure;
  786|    441|                  return;
  787|    441|               }
  788|       |            }
  789|       |            else {
  790|       |               if (not glz::atoi(value, it, end)) [[unlikely]] {
  791|       |                  ctx.error = error_code::parse_number_failure;
  792|       |                  return;
  793|       |               }
  794|       |            }
  795|       |         }
  796|       |         else {
  797|       |// float128_t requires std::from_chars for floating-point, unavailable on older Apple platforms (iOS < 16.3)
  798|       |#if !defined(_LIBCPP_VERSION) || defined(_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT)
  799|       |            if constexpr (is_float128<V>) {
  800|       |               auto [ptr, ec] = std::from_chars(it, end, value);
  801|       |               if (ec != std::errc()) {
  802|       |                  ctx.error = error_code::parse_number_failure;
  803|       |                  return;
  804|       |               }
  805|       |               it = ptr;
  806|       |            }
  807|       |            else
  808|       |#endif
  809|       |            {
  810|       |               if constexpr (std::is_volatile_v<std::remove_reference_t<decltype(value)>>) {
  811|       |                  // Hardware may interact with value changes, so we parse into a temporary and assign in one
  812|       |                  // place
  813|       |                  V temp;
  814|       |                  if constexpr (is_size_optimized(Opts)) {
  815|       |                     auto [ptr, ec] = simple_float::from_chars<Opts.null_terminated>(it, end, temp);
  816|       |                     if (ec != std::errc{}) [[unlikely]] {
  817|       |                        ctx.error = error_code::parse_number_failure;
  818|       |                        return;
  819|       |                     }
  820|       |                     it = ptr;
  821|       |                  }
  822|       |                  else {
  823|       |                     auto [ptr, ec] = glz::from_chars<Opts.null_terminated>(it, end, temp);
  824|       |                     if (ec != std::errc()) [[unlikely]] {
  825|       |                        ctx.error = error_code::parse_number_failure;
  826|       |                        return;
  827|       |                     }
  828|       |                     it = ptr;
  829|       |                  }
  830|       |                  value = temp;
  831|       |               }
  832|       |               else {
  833|       |                  if constexpr (is_size_optimized(Opts)) {
  834|       |                     auto [ptr, ec] = simple_float::from_chars<Opts.null_terminated>(it, end, value);
  835|       |                     if (ec != std::errc{}) [[unlikely]] {
  836|       |                        ctx.error = error_code::parse_number_failure;
  837|       |                        return;
  838|       |                     }
  839|       |                     it = ptr;
  840|       |                  }
  841|       |                  else {
  842|       |                     auto [ptr, ec] = glz::from_chars<Opts.null_terminated>(it, end, value);
  843|       |                     if (ec != std::errc()) [[unlikely]] {
  844|       |                        ctx.error = error_code::parse_number_failure;
  845|       |                        return;
  846|       |                     }
  847|       |                     it = ptr;
  848|       |                  }
  849|       |               }
  850|       |            }
  851|       |         }
  852|       |
  853|       |         if constexpr (check_quoted_num(Opts)) {
  854|       |            if constexpr (not Opts.null_terminated) {
  855|       |               if (it == end) [[unlikely]] {
  856|       |                  ctx.error = error_code::unexpected_end;
  857|       |                  return;
  858|       |               }
  859|       |            }
  860|       |            if (match<'"'>(ctx, it)) {
  861|       |               return;
  862|       |            }
  863|       |            if constexpr (not Opts.null_terminated) {
  864|       |               if (it == end) {
  865|       |                  ctx.error = error_code::end_reached;
  866|       |                  return;
  867|       |               }
  868|       |            }
  869|       |         }
  870|  13.7k|         else {
  871|       |            if constexpr (not Opts.null_terminated) {
  872|       |               if (it == end) {
  873|       |                  ctx.error = error_code::end_reached;
  874|       |                  return;
  875|       |               }
  876|       |            }
  877|  13.7k|         }
  878|  13.7k|      }
_ZN3glz14validate_jsoncITkNS_9is_bufferERKNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEENS_9error_ctxEOT_:
 5047|  17.0k|   {
 5048|  17.0k|      context ctx{};
 5049|  17.0k|      glz::skip skip_value{};
 5050|  17.0k|      return read<opts_validate{{opts{.comments = true}}}>(skip_value, std::forward<Buffer>(buffer), ctx);
 5051|  17.0k|   }
_ZN3glz5parseILj10EE2opITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEERNS_4skipETkNS_10is_contextERNS_7contextERPKcSA_EEvOT0_OT1_OT2_T3_:
   49|  17.0k|      {
   50|       |         if constexpr (const_value_v<T>) {
   51|       |            if constexpr (check_error_on_const_read(Opts)) {
   52|       |               ctx.error = error_code::attempt_const_read;
   53|       |            }
   54|       |            else {
   55|       |               // do not read anything into the const value
   56|       |               skip_value<JSON>::op<Opts>(std::forward<Ctx>(ctx), std::forward<It0>(it), end);
   57|       |            }
   58|       |         }
   59|  17.0k|         else {
   60|  17.0k|            using V = std::remove_cvref_t<T>;
   61|  17.0k|            from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
   62|  17.0k|                                             end);
   63|  17.0k|         }
   64|  17.0k|      }
_ZN3glz4fromILj10ENS_4skipEE2opITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEERS1_TkNS_10is_contextERNS_7contextEJRPKcSB_EEEvOT0_OT1_DpOT2_:
  570|  17.0k|      {
  571|  17.0k|         skip_value<JSON>::op<Opts>(ctx, args...);
  572|  17.0k|      }
_ZN3glz10read_jsoncITkNS_14read_supportedIL_ZNS_4JSONEEEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_9is_bufferERKNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEENS_9error_ctxERT_OT0_:
 5097|  9.97k|   {
 5098|  9.97k|      context ctx{};
 5099|  9.97k|      return read<opts{.comments = true}>(value, std::forward<Buffer>(buffer), ctx);
 5100|  9.97k|   }

_ZN3glz10skip_valueILj10EE2opITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS8_QcvbdtT_8commentsEEvOT0_OT1_T2_:
  444|  4.19M|   {
  445|  4.19M|      using namespace glz::detail;
  446|       |
  447|  4.19M|      if constexpr (not check_ws_handled(Opts)) {
  448|  4.19M|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (448:14): [True: 51, False: 4.19M]
  ------------------
  449|     51|            return;
  450|     51|         }
  451|  4.19M|      }
  452|  4.19M|      switch (*it) {
  453|  1.69M|      case '{': {
  ------------------
  |  Branch (453:7): [True: 1.69M, False: 2.49M]
  ------------------
  454|  1.69M|         skip_object<Opts>(ctx, it, end);
  455|  1.69M|         break;
  456|      0|      }
  457|   579k|      case '[': {
  ------------------
  |  Branch (457:7): [True: 579k, False: 3.61M]
  ------------------
  458|   579k|         skip_array<Opts>(ctx, it, end);
  459|   579k|         break;
  460|      0|      }
  461|   315k|      case '"': {
  ------------------
  |  Branch (461:7): [True: 315k, False: 3.87M]
  ------------------
  462|   315k|         skip_string<Opts>(ctx, it, end);
  463|   315k|         break;
  464|      0|      }
  465|      0|      case '/': {
  ------------------
  |  Branch (465:7): [True: 0, False: 4.19M]
  ------------------
  466|      0|         skip_comment(ctx, it, end);
  467|      0|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (467:14): [True: 0, False: 0]
  ------------------
  468|      0|            return;
  469|      0|         break;
  470|      0|      }
  471|  69.1k|      case 'n': {
  ------------------
  |  Branch (471:7): [True: 69.1k, False: 4.12M]
  ------------------
  472|  69.1k|         ++it;
  473|  69.1k|         match<"ull", Opts>(ctx, it, end);
  474|  69.1k|         break;
  475|      0|      }
  476|   385k|      case 'f': {
  ------------------
  |  Branch (476:7): [True: 385k, False: 3.80M]
  ------------------
  477|   385k|         ++it;
  478|   385k|         match<"alse", Opts>(ctx, it, end);
  479|   385k|         break;
  480|      0|      }
  481|  81.3k|      case 't': {
  ------------------
  |  Branch (481:7): [True: 81.3k, False: 4.11M]
  ------------------
  482|  81.3k|         ++it;
  483|  81.3k|         match<"rue", Opts>(ctx, it, end);
  484|  81.3k|         break;
  485|      0|      }
  486|    622|      case '\0': {
  ------------------
  |  Branch (486:7): [True: 622, False: 4.19M]
  ------------------
  487|    622|         ctx.error = error_code::unexpected_end;
  488|    622|         break;
  489|      0|      }
  490|  1.06M|      default: {
  ------------------
  |  Branch (490:7): [True: 1.06M, False: 3.12M]
  ------------------
  491|  1.06M|         skip_number<Opts>(ctx, it, end);
  492|  1.06M|      }
  493|  4.19M|      }
  494|  4.19M|   }
_ZN3glz11skip_objectITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS6_EEvOT0_OT1_T2_:
   29|  1.69M|   {
   30|       |      if constexpr (!check_validate_skipped(Opts)) {
   31|       |         ++it;
   32|       |         if constexpr (not Opts.null_terminated) {
   33|       |            if (it == end) [[unlikely]] {
   34|       |               ctx.error = error_code::unexpected_end;
   35|       |               return;
   36|       |            }
   37|       |         }
   38|       |         skip_until_closed<Opts, '{', '}'>(ctx, it, end);
   39|       |      }
   40|  1.69M|      else {
   41|       |         // one nesting level (see enter_depth): counted in both modes so the limit binds,
   42|       |         // released at each syntactic close below
   43|  1.69M|         if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (43:14): [True: 1, False: 1.69M]
  ------------------
   44|      1|            return;
   45|      1|         }
   46|  1.69M|         ++it;
   47|       |         if constexpr (not Opts.null_terminated) {
   48|       |            if (it == end) [[unlikely]] {
   49|       |               ctx.error = error_code::unexpected_end;
   50|       |               return;
   51|       |            }
   52|       |         }
   53|  1.69M|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (53:14): [True: 59, False: 1.69M]
  ------------------
   54|     59|            return;
   55|     59|         }
   56|  1.69M|         if (*it == '}') {
  ------------------
  |  Branch (56:14): [True: 1.63M, False: 56.2k]
  ------------------
   57|  1.63M|            --ctx.depth;
   58|  1.63M|            ++it;
   59|       |            if constexpr (not Opts.null_terminated) {
   60|       |               if (it == end) {
   61|       |                  ctx.error = error_code::end_reached;
   62|       |                  return;
   63|       |               }
   64|       |            }
   65|  1.63M|            return;
   66|  1.63M|         }
   67|  1.17M|         while (true) {
  ------------------
  |  Branch (67:17): [True: 1.17M, Folded]
  ------------------
   68|  1.17M|            if (*it != '"') {
  ------------------
  |  Branch (68:17): [True: 205, False: 1.17M]
  ------------------
   69|    205|               ctx.error = error_code::syntax_error;
   70|    205|               return;
   71|    205|            }
   72|  1.17M|            skip_string<Opts>(ctx, it, end);
   73|  1.17M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (73:17): [True: 374, False: 1.17M]
  ------------------
   74|    374|               return;
   75|  1.17M|            if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (75:17): [True: 176, False: 1.17M]
  ------------------
   76|    176|               return;
   77|    176|            }
   78|  1.17M|            if (match_invalid_end<':', Opts>(ctx, it, end)) {
  ------------------
  |  Branch (78:17): [True: 462, False: 1.17M]
  ------------------
   79|    462|               return;
   80|    462|            }
   81|  1.17M|            if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (81:17): [True: 167, False: 1.17M]
  ------------------
   82|    167|               return;
   83|    167|            }
   84|  1.17M|            skip_value<JSON>::op<Opts>(ctx, it, end);
   85|  1.17M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (85:17): [True: 2.96k, False: 1.17M]
  ------------------
   86|  2.96k|               return;
   87|  1.17M|            if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (87:17): [True: 68, False: 1.17M]
  ------------------
   88|     68|               return;
   89|     68|            }
   90|  1.17M|            if (*it != ',') break;
  ------------------
  |  Branch (90:17): [True: 51.7k, False: 1.12M]
  ------------------
   91|  1.12M|            ++it;
   92|       |            if constexpr (not Opts.null_terminated) {
   93|       |               if (it == end) [[unlikely]] {
   94|       |                  ctx.error = error_code::unexpected_end;
   95|       |                  return;
   96|       |               }
   97|       |            }
   98|  1.12M|            if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (98:17): [True: 58, False: 1.12M]
  ------------------
   99|     58|               return;
  100|     58|            }
  101|  1.12M|         }
  102|  51.7k|         match<'}'>(ctx, it);
  103|  51.7k|         --ctx.depth;
  104|       |         if constexpr (not Opts.null_terminated) {
  105|       |            if (it == end) {
  106|       |               ctx.error = error_code::end_reached;
  107|       |               return;
  108|       |            }
  109|       |         }
  110|  51.7k|      }
  111|  1.69M|   }
_ZN3glz10skip_arrayITnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS6_QooeqdtT_6formatL_ZNS_4JSONEEeqdtT_6formatL_ZNS_6NDJSONEEEEvOT0_OT1_T2_:
  116|   579k|   {
  117|       |      if constexpr (!check_validate_skipped(Opts)) {
  118|       |         ++it;
  119|       |         if constexpr (not Opts.null_terminated) {
  120|       |            if (it == end) [[unlikely]] {
  121|       |               ctx.error = error_code::unexpected_end;
  122|       |               return;
  123|       |            }
  124|       |         }
  125|       |         skip_until_closed<Opts, '[', ']'>(ctx, it, end);
  126|       |      }
  127|   579k|      else {
  128|       |         // one nesting level (see enter_depth): counted in both modes so the limit binds,
  129|       |         // released at each syntactic close below
  130|   579k|         if (enter_depth(ctx)) [[unlikely]] {
  ------------------
  |  Branch (130:14): [True: 2, False: 579k]
  ------------------
  131|      2|            return;
  132|      2|         }
  133|   579k|         ++it;
  134|       |         if constexpr (not Opts.null_terminated) {
  135|       |            if (it == end) [[unlikely]] {
  136|       |               ctx.error = error_code::unexpected_end;
  137|       |               return;
  138|       |            }
  139|       |         }
  140|   579k|         if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (140:14): [True: 87, False: 579k]
  ------------------
  141|     87|            return;
  142|     87|         }
  143|   579k|         if (*it == ']') {
  ------------------
  |  Branch (143:14): [True: 320k, False: 258k]
  ------------------
  144|   320k|            --ctx.depth;
  145|   320k|            ++it;
  146|       |            if constexpr (not Opts.null_terminated) {
  147|       |               if (it == end) {
  148|       |                  ctx.error = error_code::end_reached;
  149|       |                  return;
  150|       |               }
  151|       |            }
  152|   320k|            return;
  153|   320k|         }
  154|  3.00M|         while (true) {
  ------------------
  |  Branch (154:17): [True: 3.00M, Folded]
  ------------------
  155|  3.00M|            skip_value<JSON>::op<Opts>(ctx, it, end);
  156|  3.00M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (156:17): [True: 3.49k, False: 2.99M]
  ------------------
  157|  3.49k|               return;
  158|  2.99M|            if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (158:17): [True: 81, False: 2.99M]
  ------------------
  159|     81|               return;
  160|     81|            }
  161|  2.99M|            if (*it != ',') break;
  ------------------
  |  Branch (161:17): [True: 254k, False: 2.74M]
  ------------------
  162|  2.74M|            ++it;
  163|       |            if constexpr (not Opts.null_terminated) {
  164|       |               if (it == end) [[unlikely]] {
  165|       |                  ctx.error = error_code::unexpected_end;
  166|       |                  return;
  167|       |               }
  168|       |            }
  169|  2.74M|            if (skip_ws<Opts>(ctx, it, end)) {
  ------------------
  |  Branch (169:17): [True: 72, False: 2.74M]
  ------------------
  170|     72|               return;
  171|     72|            }
  172|  2.74M|         }
  173|   254k|         match<']'>(ctx, it);
  174|   254k|         --ctx.depth;
  175|       |         if constexpr (not Opts.null_terminated) {
  176|       |            if (it == end) {
  177|       |               ctx.error = error_code::end_reached;
  178|       |               return;
  179|       |            }
  180|       |         }
  181|   254k|      }
  182|   579k|   }

_ZN3glz10write_jsonITkNS_15write_supportedIL_ZNS_4JSONEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferERNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEENS_9error_ctxEOT_OT0_:
 2831|  26.7k|   {
 2832|  26.7k|      return write<opts{}>(std::forward<T>(value), std::forward<Buffer>(buffer));
 2833|  26.7k|   }
_ZN3glz2toILj10ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_7contextERNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERmEEvOT0_OT1_OT2_OT3_:
  525|  9.80M|      {
  526|  9.80M|         using V = std::remove_cvref_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  527|  9.80M|         to<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  528|  9.80M|                                        std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
  529|  9.80M|      }
_ZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
 1955|  9.80M|      {
 1956|       |         // Adjacent tagging needs no per-alternative dispatch: the discriminator and the value are
 1957|       |         // written side by side whatever the alternative is. The visit below still instantiates in
 1958|       |         // that mode (`if constexpr` does not discard the statements after it), but both of its
 1959|       |         // tagged branches are compile-time dead there and the runtime `return` keeps it unreached.
 1960|       |         if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::adjacent) {
 1961|       |            write_adjacent<Opts>(value, ctx, b, ix);
 1962|       |            return;
 1963|       |         }
 1964|  9.80M|         std::visit(
 1965|  9.80M|            [&](auto&& val) {
 1966|  9.80M|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|  9.80M|               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|  9.80M|                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|  9.80M|                  if (missing_id(value, ctx)) {
 1980|  9.80M|                     return;
 1981|  9.80M|                  }
 1982|  9.80M|                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|  9.80M|                  if constexpr (Opts.prettify) {
 1984|  9.80M|                     dump("{\n", b, ix);
 1985|  9.80M|                     ctx.depth += check_indentation_width(Opts);
 1986|  9.80M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|  9.80M|                     dump('"', b, ix);
 1988|  9.80M|                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|  9.80M|                     if constexpr (std::integral<id_type>) {
 1990|  9.80M|                        dump("\": ", b, ix);
 1991|  9.80M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|  9.80M|                     }
 1993|  9.80M|                     else {
 1994|  9.80M|                        dump("\": \"", b, ix);
 1995|  9.80M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|  9.80M|                        dump('"', b, ix);
 1997|  9.80M|                     }
 1998|  9.80M|                     const auto pos_after_tag = ix;
 1999|  9.80M|                     dump(",\n", b, ix);
 2000|  9.80M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|  9.80M|                     const auto pos_body_start = ix;
 2002|  9.80M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|  9.80M|                     if (ix == pos_body_start) {
 2004|  9.80M|                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|  9.80M|                     }
 2006|  9.80M|                     ctx.depth -= check_indentation_width(Opts);
 2007|  9.80M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|  9.80M|                        return;
 2009|  9.80M|                     }
 2010|  9.80M|                     std::memcpy(&b[ix], "\n", 1);
 2011|  9.80M|                     ++ix;
 2012|  9.80M|                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|  9.80M|                     ix += ctx.depth;
 2014|  9.80M|                     std::memcpy(&b[ix], "}", 1);
 2015|  9.80M|                     ++ix;
 2016|  9.80M|                  }
 2017|  9.80M|                  else {
 2018|  9.80M|                     dump("{\"", b, ix);
 2019|  9.80M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|  9.80M|                     if constexpr (std::integral<id_type>) {
 2021|  9.80M|                        dump("\":", b, ix);
 2022|  9.80M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|  9.80M|                     }
 2024|  9.80M|                     else {
 2025|  9.80M|                        dump("\":\"", b, ix);
 2026|  9.80M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|  9.80M|                        dump('"', b, ix);
 2028|  9.80M|                     }
 2029|  9.80M|                     const auto pos_after_tag = ix;
 2030|  9.80M|                     dump(',', b, ix);
 2031|  9.80M|                     const auto pos_body_start = ix;
 2032|  9.80M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|  9.80M|                     if (ix == pos_body_start) {
 2034|  9.80M|                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|  9.80M|                     }
 2036|  9.80M|                     dump('}', b, ix);
 2037|  9.80M|                  }
 2038|  9.80M|               }
 2039|  9.80M|               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|  9.80M|                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|  9.80M|                  if (missing_id(value, ctx)) {
 2044|  9.80M|                     return;
 2045|  9.80M|                  }
 2046|  9.80M|                  if constexpr (Opts.prettify) {
 2047|  9.80M|                     dump("{\n", b, ix);
 2048|  9.80M|                     ctx.depth += check_indentation_width(Opts);
 2049|  9.80M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|  9.80M|                     dump('"', b, ix);
 2051|  9.80M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|  9.80M|                     dump("\": ", b, ix);
 2053|  9.80M|                     write_id<Opts>(value, ctx, b, ix);
 2054|  9.80M|                     ctx.depth -= check_indentation_width(Opts);
 2055|  9.80M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|  9.80M|                        return;
 2057|  9.80M|                     }
 2058|  9.80M|                     std::memcpy(&b[ix], "\n", 1);
 2059|  9.80M|                     ++ix;
 2060|  9.80M|                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|  9.80M|                     ix += ctx.depth;
 2062|  9.80M|                     std::memcpy(&b[ix], "}", 1);
 2063|  9.80M|                     ++ix;
 2064|  9.80M|                  }
 2065|  9.80M|                  else {
 2066|  9.80M|                     dump("{\"", b, ix);
 2067|  9.80M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|  9.80M|                     dump("\":", b, ix);
 2069|  9.80M|                     write_id<Opts>(value, ctx, b, ix);
 2070|  9.80M|                     dump('}', b, ix);
 2071|  9.80M|                  }
 2072|  9.80M|               }
 2073|  9.80M|               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|  9.80M|                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|  9.80M|                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|  9.80M|                  if (missing_id(value, ctx)) {
 2081|  9.80M|                     return;
 2082|  9.80M|                  }
 2083|  9.80M|                  constexpr auto N = []() {
 2084|  9.80M|                     if constexpr (is_memory_object<V>) {
 2085|  9.80M|                        return reflect<memory_type<V>>::size;
 2086|  9.80M|                     }
 2087|  9.80M|                     else {
 2088|  9.80M|                        return reflect<V>::size;
 2089|  9.80M|                     }
 2090|  9.80M|                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|  9.80M|                  if constexpr (Opts.prettify) {
 2094|  9.80M|                     dump("{\n", b, ix);
 2095|  9.80M|                     ctx.depth += check_indentation_width(Opts);
 2096|  9.80M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|  9.80M|                     dump('"', b, ix);
 2098|  9.80M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|  9.80M|                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|  9.80M|                     if constexpr (std::integral<id_type>) {
 2103|  9.80M|                        dump("\": ", b, ix);
 2104|  9.80M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|  9.80M|                        if constexpr (N > 0) {
 2106|  9.80M|                           dump(",\n", b, ix);
 2107|  9.80M|                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|  9.80M|                        }
 2109|  9.80M|                     }
 2110|  9.80M|                     else {
 2111|  9.80M|                        dump("\": \"", b, ix);
 2112|  9.80M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|  9.80M|                        if constexpr (N == 0) {
 2114|  9.80M|                           dump('"', b, ix);
 2115|  9.80M|                        }
 2116|  9.80M|                        else {
 2117|  9.80M|                           dump("\",\n", b, ix);
 2118|  9.80M|                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|  9.80M|                        }
 2120|  9.80M|                     }
 2121|  9.80M|                  }
 2122|  9.80M|                  else {
 2123|  9.80M|                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|  9.80M|                     dump("{\"", b, ix);
 2126|  9.80M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|  9.80M|                     if constexpr (std::integral<id_type>) {
 2129|  9.80M|                        dump("\":", b, ix);
 2130|  9.80M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|  9.80M|                        if constexpr (N > 0) {
 2132|  9.80M|                           dump(',', b, ix);
 2133|  9.80M|                        }
 2134|  9.80M|                     }
 2135|  9.80M|                     else {
 2136|  9.80M|                        dump("\":\"", b, ix);
 2137|  9.80M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|  9.80M|                        if constexpr (N == 0) {
 2139|  9.80M|                           dump('"', b, ix);
 2140|  9.80M|                        }
 2141|  9.80M|                        else {
 2142|  9.80M|                           dump("\",", b, ix);
 2143|  9.80M|                        }
 2144|  9.80M|                     }
 2145|  9.80M|                  }
 2146|  9.80M|                  if constexpr (is_memory_object<V>) {
 2147|  9.80M|                     if (!val) [[unlikely]] {
 2148|  9.80M|                        ctx.error = error_code::invalid_variant_object;
 2149|  9.80M|                        return;
 2150|  9.80M|                     }
 2151|  9.80M|                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|  9.80M|                  }
 2153|  9.80M|                  else {
 2154|  9.80M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|  9.80M|                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|  9.80M|                  if constexpr (Opts.skip_null_members) {
 2158|  9.80M|                     if (b[ix - 1] == ',') {
 2159|  9.80M|                        --ix;
 2160|  9.80M|                     }
 2161|  9.80M|                  }
 2162|       |
 2163|  9.80M|                  if constexpr (Opts.prettify) {
 2164|  9.80M|                     ctx.depth -= check_indentation_width(Opts);
 2165|  9.80M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|  9.80M|                        return;
 2167|  9.80M|                     }
 2168|  9.80M|                     std::memcpy(&b[ix], "\n", 1);
 2169|  9.80M|                     ++ix;
 2170|  9.80M|                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|  9.80M|                     ix += ctx.depth;
 2172|  9.80M|                     std::memcpy(&b[ix], "}", 1);
 2173|  9.80M|                     ++ix;
 2174|  9.80M|                  }
 2175|  9.80M|                  else {
 2176|  9.80M|                     dump('}', b, ix);
 2177|  9.80M|                  }
 2178|  9.80M|               }
 2179|  9.80M|               else {
 2180|  9.80M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  9.80M|               }
 2182|  9.80M|            },
 2183|  9.80M|            value);
 2184|  9.80M|      }
_ZZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlOT_E_clIRDnEEDaSY_:
 1965|   200k|            [&](auto&& val) {
 1966|   200k|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|       |                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|       |                  if (missing_id(value, ctx)) {
 1980|       |                     return;
 1981|       |                  }
 1982|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|       |                  if constexpr (Opts.prettify) {
 1984|       |                     dump("{\n", b, ix);
 1985|       |                     ctx.depth += check_indentation_width(Opts);
 1986|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|       |                     dump('"', b, ix);
 1988|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|       |                     if constexpr (std::integral<id_type>) {
 1990|       |                        dump("\": ", b, ix);
 1991|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|       |                     }
 1993|       |                     else {
 1994|       |                        dump("\": \"", b, ix);
 1995|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|       |                        dump('"', b, ix);
 1997|       |                     }
 1998|       |                     const auto pos_after_tag = ix;
 1999|       |                     dump(",\n", b, ix);
 2000|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|       |                     const auto pos_body_start = ix;
 2002|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|       |                     if (ix == pos_body_start) {
 2004|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|       |                     }
 2006|       |                     ctx.depth -= check_indentation_width(Opts);
 2007|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|       |                        return;
 2009|       |                     }
 2010|       |                     std::memcpy(&b[ix], "\n", 1);
 2011|       |                     ++ix;
 2012|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|       |                     ix += ctx.depth;
 2014|       |                     std::memcpy(&b[ix], "}", 1);
 2015|       |                     ++ix;
 2016|       |                  }
 2017|       |                  else {
 2018|       |                     dump("{\"", b, ix);
 2019|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|       |                     if constexpr (std::integral<id_type>) {
 2021|       |                        dump("\":", b, ix);
 2022|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|       |                     }
 2024|       |                     else {
 2025|       |                        dump("\":\"", b, ix);
 2026|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|       |                        dump('"', b, ix);
 2028|       |                     }
 2029|       |                     const auto pos_after_tag = ix;
 2030|       |                     dump(',', b, ix);
 2031|       |                     const auto pos_body_start = ix;
 2032|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|       |                     if (ix == pos_body_start) {
 2034|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|       |                     }
 2036|       |                     dump('}', b, ix);
 2037|       |                  }
 2038|       |               }
 2039|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|       |                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|       |                  if (missing_id(value, ctx)) {
 2044|       |                     return;
 2045|       |                  }
 2046|       |                  if constexpr (Opts.prettify) {
 2047|       |                     dump("{\n", b, ix);
 2048|       |                     ctx.depth += check_indentation_width(Opts);
 2049|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|       |                     dump('"', b, ix);
 2051|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|       |                     dump("\": ", b, ix);
 2053|       |                     write_id<Opts>(value, ctx, b, ix);
 2054|       |                     ctx.depth -= check_indentation_width(Opts);
 2055|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|       |                        return;
 2057|       |                     }
 2058|       |                     std::memcpy(&b[ix], "\n", 1);
 2059|       |                     ++ix;
 2060|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|       |                     ix += ctx.depth;
 2062|       |                     std::memcpy(&b[ix], "}", 1);
 2063|       |                     ++ix;
 2064|       |                  }
 2065|       |                  else {
 2066|       |                     dump("{\"", b, ix);
 2067|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|       |                     dump("\":", b, ix);
 2069|       |                     write_id<Opts>(value, ctx, b, ix);
 2070|       |                     dump('}', b, ix);
 2071|       |                  }
 2072|       |               }
 2073|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|       |                  if (missing_id(value, ctx)) {
 2081|       |                     return;
 2082|       |                  }
 2083|       |                  constexpr auto N = []() {
 2084|       |                     if constexpr (is_memory_object<V>) {
 2085|       |                        return reflect<memory_type<V>>::size;
 2086|       |                     }
 2087|       |                     else {
 2088|       |                        return reflect<V>::size;
 2089|       |                     }
 2090|       |                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|       |                  if constexpr (Opts.prettify) {
 2094|       |                     dump("{\n", b, ix);
 2095|       |                     ctx.depth += check_indentation_width(Opts);
 2096|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|       |                     dump('"', b, ix);
 2098|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|       |                     if constexpr (std::integral<id_type>) {
 2103|       |                        dump("\": ", b, ix);
 2104|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|       |                        if constexpr (N > 0) {
 2106|       |                           dump(",\n", b, ix);
 2107|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|       |                        }
 2109|       |                     }
 2110|       |                     else {
 2111|       |                        dump("\": \"", b, ix);
 2112|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|       |                        if constexpr (N == 0) {
 2114|       |                           dump('"', b, ix);
 2115|       |                        }
 2116|       |                        else {
 2117|       |                           dump("\",\n", b, ix);
 2118|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|       |                        }
 2120|       |                     }
 2121|       |                  }
 2122|       |                  else {
 2123|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|       |                     dump("{\"", b, ix);
 2126|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|       |                     if constexpr (std::integral<id_type>) {
 2129|       |                        dump("\":", b, ix);
 2130|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|       |                        if constexpr (N > 0) {
 2132|       |                           dump(',', b, ix);
 2133|       |                        }
 2134|       |                     }
 2135|       |                     else {
 2136|       |                        dump("\":\"", b, ix);
 2137|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|       |                        if constexpr (N == 0) {
 2139|       |                           dump('"', b, ix);
 2140|       |                        }
 2141|       |                        else {
 2142|       |                           dump("\",", b, ix);
 2143|       |                        }
 2144|       |                     }
 2145|       |                  }
 2146|       |                  if constexpr (is_memory_object<V>) {
 2147|       |                     if (!val) [[unlikely]] {
 2148|       |                        ctx.error = error_code::invalid_variant_object;
 2149|       |                        return;
 2150|       |                     }
 2151|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|       |                  }
 2153|       |                  else {
 2154|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|       |                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|       |                  if constexpr (Opts.skip_null_members) {
 2158|       |                     if (b[ix - 1] == ',') {
 2159|       |                        --ix;
 2160|       |                     }
 2161|       |                  }
 2162|       |
 2163|       |                  if constexpr (Opts.prettify) {
 2164|       |                     ctx.depth -= check_indentation_width(Opts);
 2165|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|       |                        return;
 2167|       |                     }
 2168|       |                     std::memcpy(&b[ix], "\n", 1);
 2169|       |                     ++ix;
 2170|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|       |                     ix += ctx.depth;
 2172|       |                     std::memcpy(&b[ix], "}", 1);
 2173|       |                     ++ix;
 2174|       |                  }
 2175|       |                  else {
 2176|       |                     dump('}', b, ix);
 2177|       |                  }
 2178|       |               }
 2179|   200k|               else {
 2180|   200k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|   200k|               }
 2182|   200k|            },
_ZN3glz2toILj10EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERDnTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
 1849|   200k|      {
 1850|   200k|         if constexpr (not check_write_unchecked(Opts)) {
 1851|   200k|            if (!ensure_space(ctx, b, ix + 4)) [[unlikely]] {
  ------------------
  |  Branch (1851:17): [True: 0, False: 200k]
  ------------------
 1852|      0|               return;
 1853|      0|            }
 1854|   200k|         }
 1855|       |         if constexpr (std::endian::native == std::endian::big) {
 1856|       |            static constexpr char null_v[] = "null";
 1857|       |            std::memcpy(&b[ix], null_v, 4);
 1858|       |         }
 1859|   200k|         else {
 1860|   200k|            static constexpr uint32_t null_v = 1819047278;
 1861|   200k|            std::memcpy(&b[ix], &null_v, 4);
 1862|   200k|         }
 1863|   200k|         ix += 4;
 1864|   200k|      }
_ZZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlOT_E_clIRdEEDaSY_:
 1965|  2.11M|            [&](auto&& val) {
 1966|  2.11M|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|       |                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|       |                  if (missing_id(value, ctx)) {
 1980|       |                     return;
 1981|       |                  }
 1982|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|       |                  if constexpr (Opts.prettify) {
 1984|       |                     dump("{\n", b, ix);
 1985|       |                     ctx.depth += check_indentation_width(Opts);
 1986|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|       |                     dump('"', b, ix);
 1988|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|       |                     if constexpr (std::integral<id_type>) {
 1990|       |                        dump("\": ", b, ix);
 1991|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|       |                     }
 1993|       |                     else {
 1994|       |                        dump("\": \"", b, ix);
 1995|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|       |                        dump('"', b, ix);
 1997|       |                     }
 1998|       |                     const auto pos_after_tag = ix;
 1999|       |                     dump(",\n", b, ix);
 2000|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|       |                     const auto pos_body_start = ix;
 2002|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|       |                     if (ix == pos_body_start) {
 2004|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|       |                     }
 2006|       |                     ctx.depth -= check_indentation_width(Opts);
 2007|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|       |                        return;
 2009|       |                     }
 2010|       |                     std::memcpy(&b[ix], "\n", 1);
 2011|       |                     ++ix;
 2012|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|       |                     ix += ctx.depth;
 2014|       |                     std::memcpy(&b[ix], "}", 1);
 2015|       |                     ++ix;
 2016|       |                  }
 2017|       |                  else {
 2018|       |                     dump("{\"", b, ix);
 2019|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|       |                     if constexpr (std::integral<id_type>) {
 2021|       |                        dump("\":", b, ix);
 2022|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|       |                     }
 2024|       |                     else {
 2025|       |                        dump("\":\"", b, ix);
 2026|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|       |                        dump('"', b, ix);
 2028|       |                     }
 2029|       |                     const auto pos_after_tag = ix;
 2030|       |                     dump(',', b, ix);
 2031|       |                     const auto pos_body_start = ix;
 2032|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|       |                     if (ix == pos_body_start) {
 2034|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|       |                     }
 2036|       |                     dump('}', b, ix);
 2037|       |                  }
 2038|       |               }
 2039|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|       |                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|       |                  if (missing_id(value, ctx)) {
 2044|       |                     return;
 2045|       |                  }
 2046|       |                  if constexpr (Opts.prettify) {
 2047|       |                     dump("{\n", b, ix);
 2048|       |                     ctx.depth += check_indentation_width(Opts);
 2049|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|       |                     dump('"', b, ix);
 2051|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|       |                     dump("\": ", b, ix);
 2053|       |                     write_id<Opts>(value, ctx, b, ix);
 2054|       |                     ctx.depth -= check_indentation_width(Opts);
 2055|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|       |                        return;
 2057|       |                     }
 2058|       |                     std::memcpy(&b[ix], "\n", 1);
 2059|       |                     ++ix;
 2060|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|       |                     ix += ctx.depth;
 2062|       |                     std::memcpy(&b[ix], "}", 1);
 2063|       |                     ++ix;
 2064|       |                  }
 2065|       |                  else {
 2066|       |                     dump("{\"", b, ix);
 2067|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|       |                     dump("\":", b, ix);
 2069|       |                     write_id<Opts>(value, ctx, b, ix);
 2070|       |                     dump('}', b, ix);
 2071|       |                  }
 2072|       |               }
 2073|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|       |                  if (missing_id(value, ctx)) {
 2081|       |                     return;
 2082|       |                  }
 2083|       |                  constexpr auto N = []() {
 2084|       |                     if constexpr (is_memory_object<V>) {
 2085|       |                        return reflect<memory_type<V>>::size;
 2086|       |                     }
 2087|       |                     else {
 2088|       |                        return reflect<V>::size;
 2089|       |                     }
 2090|       |                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|       |                  if constexpr (Opts.prettify) {
 2094|       |                     dump("{\n", b, ix);
 2095|       |                     ctx.depth += check_indentation_width(Opts);
 2096|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|       |                     dump('"', b, ix);
 2098|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|       |                     if constexpr (std::integral<id_type>) {
 2103|       |                        dump("\": ", b, ix);
 2104|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|       |                        if constexpr (N > 0) {
 2106|       |                           dump(",\n", b, ix);
 2107|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|       |                        }
 2109|       |                     }
 2110|       |                     else {
 2111|       |                        dump("\": \"", b, ix);
 2112|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|       |                        if constexpr (N == 0) {
 2114|       |                           dump('"', b, ix);
 2115|       |                        }
 2116|       |                        else {
 2117|       |                           dump("\",\n", b, ix);
 2118|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|       |                        }
 2120|       |                     }
 2121|       |                  }
 2122|       |                  else {
 2123|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|       |                     dump("{\"", b, ix);
 2126|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|       |                     if constexpr (std::integral<id_type>) {
 2129|       |                        dump("\":", b, ix);
 2130|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|       |                        if constexpr (N > 0) {
 2132|       |                           dump(',', b, ix);
 2133|       |                        }
 2134|       |                     }
 2135|       |                     else {
 2136|       |                        dump("\":\"", b, ix);
 2137|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|       |                        if constexpr (N == 0) {
 2139|       |                           dump('"', b, ix);
 2140|       |                        }
 2141|       |                        else {
 2142|       |                           dump("\",", b, ix);
 2143|       |                        }
 2144|       |                     }
 2145|       |                  }
 2146|       |                  if constexpr (is_memory_object<V>) {
 2147|       |                     if (!val) [[unlikely]] {
 2148|       |                        ctx.error = error_code::invalid_variant_object;
 2149|       |                        return;
 2150|       |                     }
 2151|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|       |                  }
 2153|       |                  else {
 2154|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|       |                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|       |                  if constexpr (Opts.skip_null_members) {
 2158|       |                     if (b[ix - 1] == ',') {
 2159|       |                        --ix;
 2160|       |                     }
 2161|       |                  }
 2162|       |
 2163|       |                  if constexpr (Opts.prettify) {
 2164|       |                     ctx.depth -= check_indentation_width(Opts);
 2165|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|       |                        return;
 2167|       |                     }
 2168|       |                     std::memcpy(&b[ix], "\n", 1);
 2169|       |                     ++ix;
 2170|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|       |                     ix += ctx.depth;
 2172|       |                     std::memcpy(&b[ix], "}", 1);
 2173|       |                     ++ix;
 2174|       |                  }
 2175|       |                  else {
 2176|       |                     dump('}', b, ix);
 2177|       |                  }
 2178|       |               }
 2179|  2.11M|               else {
 2180|  2.11M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  2.11M|               }
 2182|  2.11M|            },
_ZN3glz2toILj10EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERdTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  814|  2.11M|      {
  815|  2.11M|         if constexpr (not check_write_unchecked(Opts)) {
  816|  2.11M|            static_assert(required_padding<T>());
  817|  2.11M|            if (!ensure_space(ctx, b, ix + required_padding<T>())) [[unlikely]] {
  ------------------
  |  Branch (817:17): [True: 0, False: 2.11M]
  ------------------
  818|      0|               return;
  819|      0|            }
  820|  2.11M|         }
  821|       |
  822|  2.11M|         static constexpr auto O = write_unchecked_on<Opts>();
  823|       |
  824|       |         if constexpr (check_quoted_num(Opts)) {
  825|       |            std::memcpy(&b[ix], "\"", 1);
  826|       |            ++ix;
  827|       |            write_chars::op<O>(value, ctx, b, ix);
  828|       |            std::memcpy(&b[ix], "\"", 1);
  829|       |            ++ix;
  830|       |         }
  831|  2.11M|         else {
  832|  2.11M|            write_chars::op<O>(value, ctx, b, ix);
  833|  2.11M|         }
  834|  2.11M|      }
_ZN3glz16required_paddingIdEEmv:
  538|  2.11M|   {
  539|  2.11M|      constexpr auto value = []() -> size_t {
  540|  2.11M|         if constexpr (boolean_like<T>) {
  541|  2.11M|            return 8;
  542|  2.11M|         }
  543|  2.11M|         else if constexpr (num_t<T>) {
  544|  2.11M|            if constexpr (std::floating_point<T>) {
  545|  2.11M|               if constexpr (sizeof(T) > 8) {
  546|  2.11M|                  return 64;
  547|  2.11M|               }
  548|  2.11M|               else if constexpr (sizeof(T) > 4) {
  549|       |                  // zmij scratch + 4 for optional quotes and trailing comma.
  550|  2.11M|                  return zmij::double_buffer_size + 4;
  551|  2.11M|               }
  552|  2.11M|               else {
  553|  2.11M|                  return zmij::float_buffer_size + 4;
  554|  2.11M|               }
  555|  2.11M|            }
  556|  2.11M|            else if constexpr (sizeof(T) > 4) {
  557|  2.11M|               return 24;
  558|  2.11M|            }
  559|  2.11M|            else if constexpr (sizeof(T) > 2) {
  560|  2.11M|               return 16;
  561|  2.11M|            }
  562|  2.11M|            else {
  563|  2.11M|               return 8;
  564|  2.11M|            }
  565|  2.11M|         }
  566|  2.11M|         else if constexpr (nullable_like<T>) {
  567|  2.11M|            if constexpr (has_value_type<T>) {
  568|  2.11M|               return required_padding<typename T::value_type>();
  569|  2.11M|            }
  570|  2.11M|            else if constexpr (has_element_type<T>) {
  571|  2.11M|               return required_padding<typename T::element_type>();
  572|  2.11M|            }
  573|  2.11M|            else {
  574|  2.11M|               return 0;
  575|  2.11M|            }
  576|  2.11M|         }
  577|  2.11M|         else if constexpr (always_null_t<T>) {
  578|  2.11M|            return 8;
  579|  2.11M|         }
  580|  2.11M|         else {
  581|  2.11M|            return 0;
  582|  2.11M|         }
  583|  2.11M|      }();
  584|       |
  585|       |      if constexpr (value >= (write_padding_bytes - 16)) {
  586|       |         // we always require 16 bytes available from write_padding_bytes
  587|       |         // for opening and closing characters
  588|       |         return 0;
  589|       |      }
  590|  2.11M|      return value;
  591|  2.11M|   }
_ZZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlOT_E_clISL_EEDaSY_:
 1965|   588k|            [&](auto&& val) {
 1966|   588k|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|       |                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|       |                  if (missing_id(value, ctx)) {
 1980|       |                     return;
 1981|       |                  }
 1982|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|       |                  if constexpr (Opts.prettify) {
 1984|       |                     dump("{\n", b, ix);
 1985|       |                     ctx.depth += check_indentation_width(Opts);
 1986|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|       |                     dump('"', b, ix);
 1988|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|       |                     if constexpr (std::integral<id_type>) {
 1990|       |                        dump("\": ", b, ix);
 1991|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|       |                     }
 1993|       |                     else {
 1994|       |                        dump("\": \"", b, ix);
 1995|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|       |                        dump('"', b, ix);
 1997|       |                     }
 1998|       |                     const auto pos_after_tag = ix;
 1999|       |                     dump(",\n", b, ix);
 2000|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|       |                     const auto pos_body_start = ix;
 2002|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|       |                     if (ix == pos_body_start) {
 2004|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|       |                     }
 2006|       |                     ctx.depth -= check_indentation_width(Opts);
 2007|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|       |                        return;
 2009|       |                     }
 2010|       |                     std::memcpy(&b[ix], "\n", 1);
 2011|       |                     ++ix;
 2012|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|       |                     ix += ctx.depth;
 2014|       |                     std::memcpy(&b[ix], "}", 1);
 2015|       |                     ++ix;
 2016|       |                  }
 2017|       |                  else {
 2018|       |                     dump("{\"", b, ix);
 2019|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|       |                     if constexpr (std::integral<id_type>) {
 2021|       |                        dump("\":", b, ix);
 2022|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|       |                     }
 2024|       |                     else {
 2025|       |                        dump("\":\"", b, ix);
 2026|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|       |                        dump('"', b, ix);
 2028|       |                     }
 2029|       |                     const auto pos_after_tag = ix;
 2030|       |                     dump(',', b, ix);
 2031|       |                     const auto pos_body_start = ix;
 2032|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|       |                     if (ix == pos_body_start) {
 2034|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|       |                     }
 2036|       |                     dump('}', b, ix);
 2037|       |                  }
 2038|       |               }
 2039|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|       |                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|       |                  if (missing_id(value, ctx)) {
 2044|       |                     return;
 2045|       |                  }
 2046|       |                  if constexpr (Opts.prettify) {
 2047|       |                     dump("{\n", b, ix);
 2048|       |                     ctx.depth += check_indentation_width(Opts);
 2049|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|       |                     dump('"', b, ix);
 2051|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|       |                     dump("\": ", b, ix);
 2053|       |                     write_id<Opts>(value, ctx, b, ix);
 2054|       |                     ctx.depth -= check_indentation_width(Opts);
 2055|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|       |                        return;
 2057|       |                     }
 2058|       |                     std::memcpy(&b[ix], "\n", 1);
 2059|       |                     ++ix;
 2060|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|       |                     ix += ctx.depth;
 2062|       |                     std::memcpy(&b[ix], "}", 1);
 2063|       |                     ++ix;
 2064|       |                  }
 2065|       |                  else {
 2066|       |                     dump("{\"", b, ix);
 2067|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|       |                     dump("\":", b, ix);
 2069|       |                     write_id<Opts>(value, ctx, b, ix);
 2070|       |                     dump('}', b, ix);
 2071|       |                  }
 2072|       |               }
 2073|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|       |                  if (missing_id(value, ctx)) {
 2081|       |                     return;
 2082|       |                  }
 2083|       |                  constexpr auto N = []() {
 2084|       |                     if constexpr (is_memory_object<V>) {
 2085|       |                        return reflect<memory_type<V>>::size;
 2086|       |                     }
 2087|       |                     else {
 2088|       |                        return reflect<V>::size;
 2089|       |                     }
 2090|       |                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|       |                  if constexpr (Opts.prettify) {
 2094|       |                     dump("{\n", b, ix);
 2095|       |                     ctx.depth += check_indentation_width(Opts);
 2096|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|       |                     dump('"', b, ix);
 2098|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|       |                     if constexpr (std::integral<id_type>) {
 2103|       |                        dump("\": ", b, ix);
 2104|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|       |                        if constexpr (N > 0) {
 2106|       |                           dump(",\n", b, ix);
 2107|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|       |                        }
 2109|       |                     }
 2110|       |                     else {
 2111|       |                        dump("\": \"", b, ix);
 2112|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|       |                        if constexpr (N == 0) {
 2114|       |                           dump('"', b, ix);
 2115|       |                        }
 2116|       |                        else {
 2117|       |                           dump("\",\n", b, ix);
 2118|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|       |                        }
 2120|       |                     }
 2121|       |                  }
 2122|       |                  else {
 2123|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|       |                     dump("{\"", b, ix);
 2126|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|       |                     if constexpr (std::integral<id_type>) {
 2129|       |                        dump("\":", b, ix);
 2130|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|       |                        if constexpr (N > 0) {
 2132|       |                           dump(',', b, ix);
 2133|       |                        }
 2134|       |                     }
 2135|       |                     else {
 2136|       |                        dump("\":\"", b, ix);
 2137|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|       |                        if constexpr (N == 0) {
 2139|       |                           dump('"', b, ix);
 2140|       |                        }
 2141|       |                        else {
 2142|       |                           dump("\",", b, ix);
 2143|       |                        }
 2144|       |                     }
 2145|       |                  }
 2146|       |                  if constexpr (is_memory_object<V>) {
 2147|       |                     if (!val) [[unlikely]] {
 2148|       |                        ctx.error = error_code::invalid_variant_object;
 2149|       |                        return;
 2150|       |                     }
 2151|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|       |                  }
 2153|       |                  else {
 2154|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|       |                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|       |                  if constexpr (Opts.skip_null_members) {
 2158|       |                     if (b[ix - 1] == ',') {
 2159|       |                        --ix;
 2160|       |                     }
 2161|       |                  }
 2162|       |
 2163|       |                  if constexpr (Opts.prettify) {
 2164|       |                     ctx.depth -= check_indentation_width(Opts);
 2165|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|       |                        return;
 2167|       |                     }
 2168|       |                     std::memcpy(&b[ix], "\n", 1);
 2169|       |                     ++ix;
 2170|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|       |                     ix += ctx.depth;
 2172|       |                     std::memcpy(&b[ix], "}", 1);
 2173|       |                     ++ix;
 2174|       |                  }
 2175|       |                  else {
 2176|       |                     dump('}', b, ix);
 2177|       |                  }
 2178|       |               }
 2179|   588k|               else {
 2180|   588k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|   588k|               }
 2182|   588k|            },
_ZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  845|   588k|      {
  846|       |         if constexpr (check_string_as_number(Opts)) {
  847|       |            const sv str = [&]() -> const sv {
  848|       |               if constexpr (array_char_t<T>) {
  849|       |                  const auto* start = value.data();
  850|       |                  const auto* end = static_cast<const char*>(std::memchr(start, '\0', value.size()));
  851|       |                  return sv{start, end ? size_t(end - start) : value.size()};
  852|       |               }
  853|       |               else if constexpr (u8str_t<T>) {
  854|       |                  return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  855|       |               }
  856|       |               else {
  857|       |                  return str_view<T>(value);
  858|       |               }
  859|       |            }();
  860|       |            if (!ensure_space(ctx, b, ix + str.size() + write_padding_bytes)) [[unlikely]] {
  861|       |               return;
  862|       |            }
  863|       |            dump_maybe_empty<false>(str, b, ix);
  864|       |         }
  865|       |         else if constexpr (char_t<T>) {
  866|       |            if constexpr (check_unquoted(Opts)) {
  867|       |               dump(value, b, ix);
  868|       |            }
  869|       |            else {
  870|       |               // 8 bytes is enough for quotes and escaped character (worst case: \uXXXX = 6 + 2 quotes)
  871|       |               if (!ensure_space(ctx, b, ix + 8)) [[unlikely]] {
  872|       |                  return;
  873|       |               }
  874|       |
  875|       |               std::memcpy(&b[ix], "\"", 1);
  876|       |               ++ix;
  877|       |               if (const auto escaped = char_escape_table[uint8_t(value)]; escaped) {
  878|       |                  std::memcpy(&b[ix], &escaped, 2);
  879|       |                  ix += 2;
  880|       |               }
  881|       |               else if (value == '\0') {
  882|       |                  // null character treated as empty string
  883|       |               }
  884|       |               else if constexpr (check_escape_control_characters(Opts)) {
  885|       |                  if (uint8_t(value) < 0x20) {
  886|       |                     // Write as \uXXXX format
  887|       |                     char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
  888|       |                     constexpr char hex_digits[] = "0123456789ABCDEF";
  889|       |                     unicode_escape[4] = hex_digits[(value >> 4) & 0xF];
  890|       |                     unicode_escape[5] = hex_digits[value & 0xF];
  891|       |                     std::memcpy(&b[ix], unicode_escape, 6);
  892|       |                     ix += 6;
  893|       |                  }
  894|       |                  else {
  895|       |                     std::memcpy(&b[ix], &value, 1);
  896|       |                     ++ix;
  897|       |                  }
  898|       |               }
  899|       |               else {
  900|       |                  if constexpr (check_reject_control_characters(Opts)) {
  901|       |                     if (uint8_t(value) < 0x20) [[unlikely]] {
  902|       |                        ctx.error = error_code::invalid_control_character;
  903|       |                     }
  904|       |                  }
  905|       |                  std::memcpy(&b[ix], &value, 1);
  906|       |                  ++ix;
  907|       |               }
  908|       |               std::memcpy(&b[ix], "\"", 1);
  909|       |               ++ix;
  910|       |            }
  911|       |         }
  912|   588k|         else {
  913|       |            if constexpr (check_raw_string(Opts)) {
  914|       |               const sv str = [&]() -> const sv {
  915|       |                  if constexpr (u8str_t<T>) {
  916|       |                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  917|       |                  }
  918|       |                  else {
  919|       |                     return str_view<T>(value);
  920|       |                  }
  921|       |               }();
  922|       |
  923|       |               // We need space for quotes and the string length: 2 + n.
  924|       |               // Use +8 for extra buffer
  925|       |               if (!ensure_space(ctx, b, ix + 8 + str.size())) [[unlikely]] {
  926|       |                  return;
  927|       |               }
  928|       |               // now we don't have to check writing
  929|       |
  930|       |               if constexpr (not check_unquoted(Opts)) {
  931|       |                  std::memcpy(&b[ix], "\"", 1);
  932|       |                  ++ix;
  933|       |               }
  934|       |               if (str.size()) [[likely]] {
  935|       |                  const auto n = str.size();
  936|       |                  std::memcpy(&b[ix], str.data(), n);
  937|       |                  ix += n;
  938|       |               }
  939|       |               if constexpr (not check_unquoted(Opts)) {
  940|       |                  std::memcpy(&b[ix], "\"", 1);
  941|       |                  ++ix;
  942|       |               }
  943|       |            }
  944|   588k|            else {
  945|   588k|               const sv str = [&]() -> const sv {
  946|   588k|                  if constexpr (array_char_t<T>) {
  947|   588k|                     return sv{value.data(), value.size()};
  948|   588k|                  }
  949|   588k|                  else if constexpr (u8str_t<T>) {
  950|   588k|                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|   588k|                  }
  952|   588k|                  else {
  953|   588k|                     return str_view<T>(value);
  954|   588k|                  }
  955|   588k|               }();
  956|   588k|               const auto n = str.size();
  957|       |
  958|       |               // In the case n == 0 we need two characters for quotes.
  959|       |               // For each individual character we need room for two characters to handle escapes.
  960|       |               // When using Unicode escapes, we might need up to 6 characters (\uXXXX) per character
  961|       |               if constexpr (check_escape_control_characters(Opts)) {
  962|       |                  if constexpr (has_bounded_capacity<B>) {
  963|       |                     // 6 bytes per character is a ceiling only a string of nothing but control
  964|       |                     // characters reaches. A resizable buffer merely over-allocates against it,
  965|       |                     // but a fixed buffer has nowhere to grow, so the ceiling would reject output
  966|       |                     // that fits. Measuring the string answers exactly, at the cost of a pass over
  967|       |                     // it, so bracket the measurement between two O(1) bounds and only pay it when
  968|       |                     // the answer is still in doubt: the ceiling fitting means yes, and the floor
  969|       |                     // of one byte per character not fitting means no.
  970|       |                     const size_t capacity = buffer_traits<std::remove_cvref_t<B>>::capacity(b);
  971|       |                     size_t required = ix + 10 + 6 * n;
  972|       |                     if (required > capacity) [[unlikely]] {
  973|       |                        required = ix + 10 + n;
  974|       |                        if (required <= capacity) {
  975|       |                           required = ix + 10 + detail::escaped_string_size(str);
  976|       |                        }
  977|       |                     }
  978|       |                     if (!ensure_space(ctx, b, required)) [[unlikely]] {
  979|       |                        return;
  980|       |                     }
  981|       |                  }
  982|       |                  // We need 2 + 6 * n characters in the worst case (all control chars)
  983|       |                  else if (!ensure_space(ctx, b, ix + 10 + 6 * n)) [[unlikely]] {
  984|       |                     return;
  985|       |                  }
  986|       |               }
  987|   588k|               else {
  988|       |                  // Using the original sizing
  989|   588k|                  if (!ensure_space(ctx, b, ix + 10 + 2 * n)) [[unlikely]] {
  ------------------
  |  Branch (989:23): [True: 0, False: 588k]
  ------------------
  990|      0|                     return;
  991|      0|                  }
  992|   588k|               }
  993|       |               // now we don't have to check writing
  994|       |
  995|       |               if constexpr (check_unquoted(Opts)) {
  996|       |                  if (n) {
  997|       |                     std::memcpy(&b[ix], str.data(), n);
  998|       |                     ix += n;
  999|       |                  }
 1000|       |               }
 1001|   588k|               else {
 1002|   588k|                  std::memcpy(&b[ix], "\"", 1);
 1003|   588k|                  ++ix;
 1004|       |
 1005|   588k|                  const auto* c = str.data();
 1006|   588k|                  const auto* const e = c + n;
 1007|   588k|                  const auto start = &b[ix];
 1008|   588k|                  auto data = start;
 1009|       |
 1010|       |                  // By default we don't escape control characters for performance. Invalid JSON characters
 1011|       |                  // result in null characters in the output, making the JSON invalid — these would then be
 1012|       |                  // detected upon reading. Enable the `escape_control_characters` option to properly escape
 1013|       |                  // control characters (0x00–0x1F) as \uXXXX sequences.
 1014|       |
 1015|       |                  // Escape handler: writes the escaped form of *c into data, advances both pointers
 1016|   588k|                  auto write_escape = [&]() {
 1017|   588k|                     if constexpr (check_escape_control_characters(Opts)) {
 1018|   588k|                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|   588k|                           std::memcpy(data, &escaped, 2);
 1020|   588k|                           data += 2;
 1021|   588k|                        }
 1022|   588k|                        else {
 1023|   588k|                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|   588k|                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|   588k|                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|   588k|                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|   588k|                           std::memcpy(data, unicode_escape, 6);
 1028|   588k|                           data += 6;
 1029|   588k|                        }
 1030|   588k|                     }
 1031|   588k|                     else {
 1032|   588k|                        if constexpr (check_reject_control_characters(Opts)) {
 1033|       |                           // A control character with no two-character escape cannot be written
 1034|       |                           // without \uXXXX. The table entry is zero, so the memcpy below would
 1035|       |                           // put two NULs where one byte was. Flag it and let the loop finish:
 1036|       |                           // returning early here would leave c un-advanced and the SIMD scan
 1037|       |                           // would find the same byte forever. The output is abandoned anyway.
 1038|   588k|                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|   588k|                              ctx.error = error_code::invalid_control_character;
 1040|   588k|                           }
 1041|   588k|                        }
 1042|   588k|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|   588k|                        data += 2;
 1044|   588k|                     }
 1045|   588k|                     ++c;
 1046|   588k|                  };
 1047|       |
 1048|       |                  // Adding a helper here means adding a branch to string_escape_simd() in
 1049|       |                  // simd/backends.hpp, which names the widest one this cascade invokes, and a row
 1050|       |                  // to known_builds in tests/json_test/utf8_validation_test.cpp, which checks it.
 1051|       |#if defined(GLZ_USE_AVX2)
 1052|       |                  detail::avx2_string_escape(c, e, data, n, write_escape);
 1053|       |#endif
 1054|   588k|#if defined(GLZ_USE_SSE2)
 1055|   588k|                  detail::sse2_string_escape(c, e, data, n, write_escape);
 1056|       |#elif defined(GLZ_USE_NEON)
 1057|       |                  detail::neon_string_escape(c, e, data, n, write_escape);
 1058|       |#endif
 1059|       |
 1060|       |                  // SWAR: 8 bytes at a time
 1061|   588k|                  if (n > 7) {
  ------------------
  |  Branch (1061:23): [True: 121k, False: 466k]
  ------------------
 1062|   251k|                     for (const auto end_m7 = e - 7; c < end_m7;) {
  ------------------
  |  Branch (1062:54): [True: 130k, False: 121k]
  ------------------
 1063|   130k|                        std::memcpy(data, c, 8);
 1064|   130k|                        uint64_t swar;
 1065|   130k|                        std::memcpy(&swar, c, 8);
 1066|       |                        if constexpr (std::endian::native == std::endian::big) {
 1067|       |                           swar = std::byteswap(swar);
 1068|       |                        }
 1069|       |
 1070|   130k|                        constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1071|   130k|                        const uint64_t lo7 = swar & lo7_mask;
 1072|   130k|                        const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1073|   130k|                        const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1074|   130k|                        const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1075|   130k|                        uint64_t next = ~((quote & backslash & less_32) | swar);
 1076|       |
 1077|   130k|                        next &= repeat_byte8(0b10000000);
 1078|   130k|                        if (next == 0) {
  ------------------
  |  Branch (1078:29): [True: 111k, False: 18.0k]
  ------------------
 1079|   111k|                           data += 8;
 1080|   111k|                           c += 8;
 1081|   111k|                           continue;
 1082|   111k|                        }
 1083|       |
 1084|  18.0k|                        const auto length = (countr_zero(next) >> 3);
 1085|  18.0k|                        c += length;
 1086|  18.0k|                        data += length;
 1087|  18.0k|                        write_escape();
 1088|  18.0k|                     }
 1089|   121k|                  }
 1090|       |
 1091|       |                  // Scalar tail
 1092|  1.09M|                  for (; c < e; ++c) {
  ------------------
  |  Branch (1092:26): [True: 508k, False: 588k]
  ------------------
 1093|   508k|                     if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
  ------------------
  |  Branch (1093:79): [True: 16.8k, False: 491k]
  ------------------
 1094|  16.8k|                        std::memcpy(data, &escaped, 2);
 1095|  16.8k|                        data += 2;
 1096|  16.8k|                     }
 1097|       |                     else if constexpr (check_escape_control_characters(Opts)) {
 1098|       |                        if (uint8_t(*c) < 0x20) {
 1099|       |                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1100|       |                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1101|       |                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1102|       |                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1103|       |                           std::memcpy(data, unicode_escape, 6);
 1104|       |                           data += 6;
 1105|       |                        }
 1106|       |                        else {
 1107|       |                           std::memcpy(data, c, 1);
 1108|       |                           ++data;
 1109|       |                        }
 1110|       |                     }
 1111|   491k|                     else {
 1112|       |                        if constexpr (check_reject_control_characters(Opts)) {
 1113|       |                           if (uint8_t(*c) < 0x20) [[unlikely]] {
 1114|       |                              ctx.error = error_code::invalid_control_character;
 1115|       |                           }
 1116|       |                        }
 1117|   491k|                        std::memcpy(data, c, 1);
 1118|   491k|                        ++data;
 1119|   491k|                     }
 1120|   508k|                  }
 1121|       |
 1122|   588k|                  ix += size_t(data - start);
 1123|       |
 1124|   588k|                  std::memcpy(&b[ix], "\"", 1);
 1125|   588k|                  ++ix;
 1126|   588k|               }
 1127|   588k|            }
 1128|   588k|         }
 1129|   588k|      }
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE_clEv:
  945|   588k|               const sv str = [&]() -> const sv {
  946|       |                  if constexpr (array_char_t<T>) {
  947|       |                     return sv{value.data(), value.size()};
  948|       |                  }
  949|       |                  else if constexpr (u8str_t<T>) {
  950|       |                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|       |                  }
  952|   588k|                  else {
  953|   588k|                     return str_view<T>(value);
  954|   588k|                  }
  955|   588k|               }();
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE0_clEv:
 1016|  26.7k|                  auto write_escape = [&]() {
 1017|       |                     if constexpr (check_escape_control_characters(Opts)) {
 1018|       |                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|       |                           std::memcpy(data, &escaped, 2);
 1020|       |                           data += 2;
 1021|       |                        }
 1022|       |                        else {
 1023|       |                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|       |                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|       |                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|       |                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|       |                           std::memcpy(data, unicode_escape, 6);
 1028|       |                           data += 6;
 1029|       |                        }
 1030|       |                     }
 1031|  26.7k|                     else {
 1032|       |                        if constexpr (check_reject_control_characters(Opts)) {
 1033|       |                           // A control character with no two-character escape cannot be written
 1034|       |                           // without \uXXXX. The table entry is zero, so the memcpy below would
 1035|       |                           // put two NULs where one byte was. Flag it and let the loop finish:
 1036|       |                           // returning early here would leave c un-advanced and the SIMD scan
 1037|       |                           // would find the same byte forever. The output is abandoned anyway.
 1038|       |                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|       |                              ctx.error = error_code::invalid_control_character;
 1040|       |                           }
 1041|       |                        }
 1042|  26.7k|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  26.7k|                        data += 2;
 1044|  26.7k|                     }
 1045|  26.7k|                     ++c;
 1046|  26.7k|                  };
_ZZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlOT_E_clIRbEEDaSY_:
 1965|  1.37M|            [&](auto&& val) {
 1966|  1.37M|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|       |                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|       |                  if (missing_id(value, ctx)) {
 1980|       |                     return;
 1981|       |                  }
 1982|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|       |                  if constexpr (Opts.prettify) {
 1984|       |                     dump("{\n", b, ix);
 1985|       |                     ctx.depth += check_indentation_width(Opts);
 1986|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|       |                     dump('"', b, ix);
 1988|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|       |                     if constexpr (std::integral<id_type>) {
 1990|       |                        dump("\": ", b, ix);
 1991|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|       |                     }
 1993|       |                     else {
 1994|       |                        dump("\": \"", b, ix);
 1995|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|       |                        dump('"', b, ix);
 1997|       |                     }
 1998|       |                     const auto pos_after_tag = ix;
 1999|       |                     dump(",\n", b, ix);
 2000|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|       |                     const auto pos_body_start = ix;
 2002|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|       |                     if (ix == pos_body_start) {
 2004|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|       |                     }
 2006|       |                     ctx.depth -= check_indentation_width(Opts);
 2007|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|       |                        return;
 2009|       |                     }
 2010|       |                     std::memcpy(&b[ix], "\n", 1);
 2011|       |                     ++ix;
 2012|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|       |                     ix += ctx.depth;
 2014|       |                     std::memcpy(&b[ix], "}", 1);
 2015|       |                     ++ix;
 2016|       |                  }
 2017|       |                  else {
 2018|       |                     dump("{\"", b, ix);
 2019|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|       |                     if constexpr (std::integral<id_type>) {
 2021|       |                        dump("\":", b, ix);
 2022|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|       |                     }
 2024|       |                     else {
 2025|       |                        dump("\":\"", b, ix);
 2026|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|       |                        dump('"', b, ix);
 2028|       |                     }
 2029|       |                     const auto pos_after_tag = ix;
 2030|       |                     dump(',', b, ix);
 2031|       |                     const auto pos_body_start = ix;
 2032|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|       |                     if (ix == pos_body_start) {
 2034|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|       |                     }
 2036|       |                     dump('}', b, ix);
 2037|       |                  }
 2038|       |               }
 2039|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|       |                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|       |                  if (missing_id(value, ctx)) {
 2044|       |                     return;
 2045|       |                  }
 2046|       |                  if constexpr (Opts.prettify) {
 2047|       |                     dump("{\n", b, ix);
 2048|       |                     ctx.depth += check_indentation_width(Opts);
 2049|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|       |                     dump('"', b, ix);
 2051|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|       |                     dump("\": ", b, ix);
 2053|       |                     write_id<Opts>(value, ctx, b, ix);
 2054|       |                     ctx.depth -= check_indentation_width(Opts);
 2055|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|       |                        return;
 2057|       |                     }
 2058|       |                     std::memcpy(&b[ix], "\n", 1);
 2059|       |                     ++ix;
 2060|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|       |                     ix += ctx.depth;
 2062|       |                     std::memcpy(&b[ix], "}", 1);
 2063|       |                     ++ix;
 2064|       |                  }
 2065|       |                  else {
 2066|       |                     dump("{\"", b, ix);
 2067|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|       |                     dump("\":", b, ix);
 2069|       |                     write_id<Opts>(value, ctx, b, ix);
 2070|       |                     dump('}', b, ix);
 2071|       |                  }
 2072|       |               }
 2073|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|       |                  if (missing_id(value, ctx)) {
 2081|       |                     return;
 2082|       |                  }
 2083|       |                  constexpr auto N = []() {
 2084|       |                     if constexpr (is_memory_object<V>) {
 2085|       |                        return reflect<memory_type<V>>::size;
 2086|       |                     }
 2087|       |                     else {
 2088|       |                        return reflect<V>::size;
 2089|       |                     }
 2090|       |                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|       |                  if constexpr (Opts.prettify) {
 2094|       |                     dump("{\n", b, ix);
 2095|       |                     ctx.depth += check_indentation_width(Opts);
 2096|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|       |                     dump('"', b, ix);
 2098|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|       |                     if constexpr (std::integral<id_type>) {
 2103|       |                        dump("\": ", b, ix);
 2104|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|       |                        if constexpr (N > 0) {
 2106|       |                           dump(",\n", b, ix);
 2107|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|       |                        }
 2109|       |                     }
 2110|       |                     else {
 2111|       |                        dump("\": \"", b, ix);
 2112|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|       |                        if constexpr (N == 0) {
 2114|       |                           dump('"', b, ix);
 2115|       |                        }
 2116|       |                        else {
 2117|       |                           dump("\",\n", b, ix);
 2118|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|       |                        }
 2120|       |                     }
 2121|       |                  }
 2122|       |                  else {
 2123|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|       |                     dump("{\"", b, ix);
 2126|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|       |                     if constexpr (std::integral<id_type>) {
 2129|       |                        dump("\":", b, ix);
 2130|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|       |                        if constexpr (N > 0) {
 2132|       |                           dump(',', b, ix);
 2133|       |                        }
 2134|       |                     }
 2135|       |                     else {
 2136|       |                        dump("\":\"", b, ix);
 2137|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|       |                        if constexpr (N == 0) {
 2139|       |                           dump('"', b, ix);
 2140|       |                        }
 2141|       |                        else {
 2142|       |                           dump("\",", b, ix);
 2143|       |                        }
 2144|       |                     }
 2145|       |                  }
 2146|       |                  if constexpr (is_memory_object<V>) {
 2147|       |                     if (!val) [[unlikely]] {
 2148|       |                        ctx.error = error_code::invalid_variant_object;
 2149|       |                        return;
 2150|       |                     }
 2151|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|       |                  }
 2153|       |                  else {
 2154|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|       |                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|       |                  if constexpr (Opts.skip_null_members) {
 2158|       |                     if (b[ix - 1] == ',') {
 2159|       |                        --ix;
 2160|       |                     }
 2161|       |                  }
 2162|       |
 2163|       |                  if constexpr (Opts.prettify) {
 2164|       |                     ctx.depth -= check_indentation_width(Opts);
 2165|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|       |                        return;
 2167|       |                     }
 2168|       |                     std::memcpy(&b[ix], "\n", 1);
 2169|       |                     ++ix;
 2170|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|       |                     ix += ctx.depth;
 2172|       |                     std::memcpy(&b[ix], "}", 1);
 2173|       |                     ++ix;
 2174|       |                  }
 2175|       |                  else {
 2176|       |                     dump('}', b, ix);
 2177|       |                  }
 2178|       |               }
 2179|  1.37M|               else {
 2180|  1.37M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  1.37M|               }
 2182|  1.37M|            },
_ZN3glz2toILj10EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmEEvbOT1_OT0_RT2_:
  777|  1.37M|      {
  778|  1.37M|         static constexpr auto checked = not check_write_unchecked(Opts);
  779|  1.37M|         if constexpr (checked) {
  780|  1.37M|            if (!ensure_space(ctx, b, ix + 8)) [[unlikely]] {
  ------------------
  |  Branch (780:17): [True: 0, False: 1.37M]
  ------------------
  781|      0|               return;
  782|      0|            }
  783|  1.37M|         }
  784|       |
  785|       |         if constexpr (check_bools_as_numbers(Opts)) {
  786|       |            if (value) {
  787|       |               std::memcpy(&b[ix], "1", 1);
  788|       |            }
  789|       |            else {
  790|       |               std::memcpy(&b[ix], "0", 1);
  791|       |            }
  792|       |            ++ix;
  793|       |         }
  794|  1.37M|         else {
  795|  1.37M|            if (value) {
  ------------------
  |  Branch (795:17): [True: 242k, False: 1.12M]
  ------------------
  796|   242k|               std::memcpy(&b[ix], "true", 4);
  797|   242k|               ix += 4;
  798|   242k|            }
  799|  1.12M|            else {
  800|  1.12M|               std::memcpy(&b[ix], "false", 5);
  801|  1.12M|               ix += 5;
  802|  1.12M|            }
  803|  1.37M|         }
  804|  1.37M|      }
_ZZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlOT_E_clIRSF_EEDaSY_:
 1965|   649k|            [&](auto&& val) {
 1966|   649k|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|       |                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|       |                  if (missing_id(value, ctx)) {
 1980|       |                     return;
 1981|       |                  }
 1982|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|       |                  if constexpr (Opts.prettify) {
 1984|       |                     dump("{\n", b, ix);
 1985|       |                     ctx.depth += check_indentation_width(Opts);
 1986|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|       |                     dump('"', b, ix);
 1988|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|       |                     if constexpr (std::integral<id_type>) {
 1990|       |                        dump("\": ", b, ix);
 1991|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|       |                     }
 1993|       |                     else {
 1994|       |                        dump("\": \"", b, ix);
 1995|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|       |                        dump('"', b, ix);
 1997|       |                     }
 1998|       |                     const auto pos_after_tag = ix;
 1999|       |                     dump(",\n", b, ix);
 2000|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|       |                     const auto pos_body_start = ix;
 2002|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|       |                     if (ix == pos_body_start) {
 2004|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|       |                     }
 2006|       |                     ctx.depth -= check_indentation_width(Opts);
 2007|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|       |                        return;
 2009|       |                     }
 2010|       |                     std::memcpy(&b[ix], "\n", 1);
 2011|       |                     ++ix;
 2012|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|       |                     ix += ctx.depth;
 2014|       |                     std::memcpy(&b[ix], "}", 1);
 2015|       |                     ++ix;
 2016|       |                  }
 2017|       |                  else {
 2018|       |                     dump("{\"", b, ix);
 2019|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|       |                     if constexpr (std::integral<id_type>) {
 2021|       |                        dump("\":", b, ix);
 2022|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|       |                     }
 2024|       |                     else {
 2025|       |                        dump("\":\"", b, ix);
 2026|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|       |                        dump('"', b, ix);
 2028|       |                     }
 2029|       |                     const auto pos_after_tag = ix;
 2030|       |                     dump(',', b, ix);
 2031|       |                     const auto pos_body_start = ix;
 2032|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|       |                     if (ix == pos_body_start) {
 2034|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|       |                     }
 2036|       |                     dump('}', b, ix);
 2037|       |                  }
 2038|       |               }
 2039|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|       |                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|       |                  if (missing_id(value, ctx)) {
 2044|       |                     return;
 2045|       |                  }
 2046|       |                  if constexpr (Opts.prettify) {
 2047|       |                     dump("{\n", b, ix);
 2048|       |                     ctx.depth += check_indentation_width(Opts);
 2049|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|       |                     dump('"', b, ix);
 2051|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|       |                     dump("\": ", b, ix);
 2053|       |                     write_id<Opts>(value, ctx, b, ix);
 2054|       |                     ctx.depth -= check_indentation_width(Opts);
 2055|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|       |                        return;
 2057|       |                     }
 2058|       |                     std::memcpy(&b[ix], "\n", 1);
 2059|       |                     ++ix;
 2060|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|       |                     ix += ctx.depth;
 2062|       |                     std::memcpy(&b[ix], "}", 1);
 2063|       |                     ++ix;
 2064|       |                  }
 2065|       |                  else {
 2066|       |                     dump("{\"", b, ix);
 2067|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|       |                     dump("\":", b, ix);
 2069|       |                     write_id<Opts>(value, ctx, b, ix);
 2070|       |                     dump('}', b, ix);
 2071|       |                  }
 2072|       |               }
 2073|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|       |                  if (missing_id(value, ctx)) {
 2081|       |                     return;
 2082|       |                  }
 2083|       |                  constexpr auto N = []() {
 2084|       |                     if constexpr (is_memory_object<V>) {
 2085|       |                        return reflect<memory_type<V>>::size;
 2086|       |                     }
 2087|       |                     else {
 2088|       |                        return reflect<V>::size;
 2089|       |                     }
 2090|       |                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|       |                  if constexpr (Opts.prettify) {
 2094|       |                     dump("{\n", b, ix);
 2095|       |                     ctx.depth += check_indentation_width(Opts);
 2096|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|       |                     dump('"', b, ix);
 2098|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|       |                     if constexpr (std::integral<id_type>) {
 2103|       |                        dump("\": ", b, ix);
 2104|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|       |                        if constexpr (N > 0) {
 2106|       |                           dump(",\n", b, ix);
 2107|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|       |                        }
 2109|       |                     }
 2110|       |                     else {
 2111|       |                        dump("\": \"", b, ix);
 2112|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|       |                        if constexpr (N == 0) {
 2114|       |                           dump('"', b, ix);
 2115|       |                        }
 2116|       |                        else {
 2117|       |                           dump("\",\n", b, ix);
 2118|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|       |                        }
 2120|       |                     }
 2121|       |                  }
 2122|       |                  else {
 2123|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|       |                     dump("{\"", b, ix);
 2126|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|       |                     if constexpr (std::integral<id_type>) {
 2129|       |                        dump("\":", b, ix);
 2130|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|       |                        if constexpr (N > 0) {
 2132|       |                           dump(',', b, ix);
 2133|       |                        }
 2134|       |                     }
 2135|       |                     else {
 2136|       |                        dump("\":\"", b, ix);
 2137|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|       |                        if constexpr (N == 0) {
 2139|       |                           dump('"', b, ix);
 2140|       |                        }
 2141|       |                        else {
 2142|       |                           dump("\",", b, ix);
 2143|       |                        }
 2144|       |                     }
 2145|       |                  }
 2146|       |                  if constexpr (is_memory_object<V>) {
 2147|       |                     if (!val) [[unlikely]] {
 2148|       |                        ctx.error = error_code::invalid_variant_object;
 2149|       |                        return;
 2150|       |                     }
 2151|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|       |                  }
 2153|       |                  else {
 2154|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|       |                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|       |                  if constexpr (Opts.skip_null_members) {
 2158|       |                     if (b[ix - 1] == ',') {
 2159|       |                        --ix;
 2160|       |                     }
 2161|       |                  }
 2162|       |
 2163|       |                  if constexpr (Opts.prettify) {
 2164|       |                     ctx.depth -= check_indentation_width(Opts);
 2165|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|       |                        return;
 2167|       |                     }
 2168|       |                     std::memcpy(&b[ix], "\n", 1);
 2169|       |                     ++ix;
 2170|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|       |                     ix += ctx.depth;
 2172|       |                     std::memcpy(&b[ix], "}", 1);
 2173|       |                     ++ix;
 2174|       |                  }
 2175|       |                  else {
 2176|       |                     dump('}', b, ix);
 2177|       |                  }
 2178|       |               }
 2179|   649k|               else {
 2180|   649k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|   649k|               }
 2182|   649k|            },
_ZN3glz2toILj10ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNS1_12basic_stringIcNS1_11char_traitsIcEENS7_IcEEEERS9_TkNS_10is_contextERNS_7contextEmQaa16writable_array_tIT_EquL_ZNS0_ILj10ESM_E14map_like_arrayEEeqcl17check_concatenateTL0__ELb0ELb1EEEvOT1_OT2_OT0_RT3_:
 1435|   649k|      {
 1436|   649k|         if (empty_range(value)) {
  ------------------
  |  Branch (1436:14): [True: 289k, False: 359k]
  ------------------
 1437|   289k|            dump("[]", b, ix);
 1438|   289k|         }
 1439|   359k|         else {
 1440|       |            // For bounded buffers, skip pre-allocation path since value_padding is for SIMD, not actual size
 1441|       |            if constexpr (has_size<T> && array_padding_known<T> && !has_bounded_capacity<B>) {
 1442|       |               const auto n = value.size();
 1443|       |
 1444|       |               static constexpr auto value_padding = []() -> size_t {
 1445|       |                  if constexpr (required_padding<typename T::value_type>() > 0)
 1446|       |                     return required_padding<typename T::value_type>();
 1447|       |                  else
 1448|       |                     return fixed_padding<typename T::value_type>;
 1449|       |               }();
 1450|       |
 1451|       |               if constexpr (Opts.prettify) {
 1452|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1453|       |                     ctx.depth += check_indentation_width(Opts);
 1454|       |                  }
 1455|       |
 1456|       |                  // add space for '\n' and ',' characters for each element, hence `+ 2`
 1457|       |                  // use n + 1 because we put the end array character after the last element with whitespace
 1458|       |                  if (!ensure_space(ctx, b, ix + (n + 1) * (value_padding + ctx.depth + 2) + write_padding_bytes))
 1459|       |                     [[unlikely]] {
 1460|       |                     return;
 1461|       |                  }
 1462|       |
 1463|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1464|       |                     std::memcpy(&b[ix], "[\n", 2);
 1465|       |                     ix += 2;
 1466|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1467|       |                     ix += ctx.depth;
 1468|       |                  }
 1469|       |                  else {
 1470|       |                     std::memcpy(&b[ix], "[", 1);
 1471|       |                     ++ix;
 1472|       |                  }
 1473|       |               }
 1474|       |               else {
 1475|       |                  static constexpr auto comma_padding = 1;
 1476|       |                  if (!ensure_space(ctx, b, ix + n * (value_padding + comma_padding) + write_padding_bytes))
 1477|       |                     [[unlikely]] {
 1478|       |                     return;
 1479|       |                  }
 1480|       |                  std::memcpy(&b[ix], "[", 1);
 1481|       |                  ++ix;
 1482|       |               }
 1483|       |
 1484|       |               auto it = std::begin(value);
 1485|       |               using val_t = std::remove_cvref_t<decltype(*it)>;
 1486|       |               to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1487|       |
 1488|       |               ++it;
 1489|       |               for (const auto fin = std::end(value); it != fin; ++it) {
 1490|       |                  if constexpr (Opts.prettify) {
 1491|       |                     if constexpr (check_new_lines_in_arrays(Opts)) {
 1492|       |                        std::memcpy(&b[ix], ",\n", 2);
 1493|       |                        ix += 2;
 1494|       |                        fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1495|       |                        ix += ctx.depth;
 1496|       |                     }
 1497|       |                     else {
 1498|       |                        std::memcpy(&b[ix], ", ", 2);
 1499|       |                        ix += 2;
 1500|       |                     }
 1501|       |                  }
 1502|       |                  else {
 1503|       |                     std::memcpy(&b[ix], ",", 1);
 1504|       |                     ++ix;
 1505|       |                  }
 1506|       |                  if constexpr (is_output_streaming<B>) {
 1507|       |                     flush_buffer(b, ix);
 1508|       |                  }
 1509|       |
 1510|       |                  to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1511|       |               }
 1512|       |               if constexpr (Opts.prettify && check_new_lines_in_arrays(Opts)) {
 1513|       |                  ctx.depth -= check_indentation_width(Opts);
 1514|       |                  std::memcpy(&b[ix], "\n", 1);
 1515|       |                  ++ix;
 1516|       |                  fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1517|       |                  ix += ctx.depth;
 1518|       |               }
 1519|       |
 1520|       |               std::memcpy(&b[ix], "]", 1);
 1521|       |               ++ix;
 1522|       |            }
 1523|   359k|            else {
 1524|       |               // we either can't get the size (std::forward_list) or we cannot compute the allocation size
 1525|       |
 1526|       |               if constexpr (Opts.prettify) {
 1527|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1528|       |                     ctx.depth += check_indentation_width(Opts);
 1529|       |                  }
 1530|       |
 1531|       |                  if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1532|       |                     return;
 1533|       |                  }
 1534|       |
 1535|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1536|       |                     std::memcpy(&b[ix], "[\n", 2);
 1537|       |                     ix += 2;
 1538|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1539|       |                     ix += ctx.depth;
 1540|       |                  }
 1541|       |                  else {
 1542|       |                     std::memcpy(&b[ix], "[", 1);
 1543|       |                     ++ix;
 1544|       |                  }
 1545|       |               }
 1546|   359k|               else {
 1547|   359k|                  if (!ensure_space(ctx, b, ix + write_padding_bytes)) [[unlikely]] {
  ------------------
  |  Branch (1547:23): [True: 0, False: 359k]
  ------------------
 1548|      0|                     return;
 1549|      0|                  }
 1550|   359k|                  std::memcpy(&b[ix], "[", 1);
 1551|   359k|                  ++ix;
 1552|   359k|               }
 1553|       |
 1554|      0|               auto it = std::begin(value);
 1555|   359k|               using val_t = std::remove_cvref_t<decltype(*it)>;
 1556|       |               if constexpr (required_padding<val_t>()) {
 1557|       |                  to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1558|       |               }
 1559|   359k|               else {
 1560|   359k|                  to<JSON, val_t>::template op<Opts>(*it, ctx, b, ix);
 1561|   359k|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1561:23): [True: 0, False: 359k]
  ------------------
 1562|      0|                     return;
 1563|      0|                  }
 1564|   359k|               }
 1565|       |
 1566|   359k|               ++it;
 1567|  8.36M|               for (const auto fin = std::end(value); it != fin; ++it) {
  ------------------
  |  Branch (1567:55): [True: 8.00M, False: 359k]
  ------------------
 1568|       |                  if constexpr (required_padding<val_t>()) {
 1569|       |                     if constexpr (Opts.prettify) {
 1570|       |                        if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1571|       |                           return;
 1572|       |                        }
 1573|       |                     }
 1574|       |                     else {
 1575|       |                        if (!ensure_space(ctx, b, ix + write_padding_bytes)) [[unlikely]] {
 1576|       |                           return;
 1577|       |                        }
 1578|       |                     }
 1579|       |
 1580|       |                     if constexpr (Opts.prettify) {
 1581|       |                        if constexpr (check_new_lines_in_arrays(Opts)) {
 1582|       |                           std::memcpy(&b[ix], ",\n", 2);
 1583|       |                           ix += 2;
 1584|       |                           fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1585|       |                           ix += ctx.depth;
 1586|       |                        }
 1587|       |                        else {
 1588|       |                           std::memcpy(&b[ix], ", ", 2);
 1589|       |                           ix += 2;
 1590|       |                        }
 1591|       |                     }
 1592|       |                     else {
 1593|       |                        std::memcpy(&b[ix], ",", 1);
 1594|       |                        ++ix;
 1595|       |                     }
 1596|       |                     if constexpr (is_output_streaming<B>) {
 1597|       |                        flush_buffer(b, ix);
 1598|       |                     }
 1599|       |
 1600|       |                     to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1601|       |                  }
 1602|  8.00M|                  else {
 1603|  8.00M|                     write_array_entry_separator<Opts>(ctx, b, ix);
 1604|  8.00M|                     to<JSON, val_t>::template op<Opts>(*it, ctx, b, ix);
 1605|  8.00M|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1605:26): [True: 0, False: 8.00M]
  ------------------
 1606|      0|                        return;
 1607|      0|                     }
 1608|  8.00M|                  }
 1609|  8.00M|               }
 1610|       |               if constexpr (Opts.prettify && check_new_lines_in_arrays(Opts)) {
 1611|       |                  ctx.depth -= check_indentation_width(Opts);
 1612|       |                  dump_newline_indent(check_indentation_char(Opts), ctx.depth, b, ix);
 1613|       |               }
 1614|       |
 1615|   359k|               dump(']', b, ix);
 1616|   359k|            }
 1617|   359k|         }
 1618|   649k|      }
_ZN3glz27write_array_entry_separatorITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEELb1ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmEEvOT2_OT1_RT3_:
 1362|  8.00M|   {
 1363|       |      if constexpr (Opts.prettify) {
 1364|       |         if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1365|       |            return;
 1366|       |         }
 1367|       |         if constexpr (check_new_lines_in_arrays(Opts)) {
 1368|       |            std::memcpy(&b[ix], ",\n", 2);
 1369|       |            ix += 2;
 1370|       |            fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1371|       |            ix += ctx.depth;
 1372|       |         }
 1373|       |         else {
 1374|       |            std::memcpy(&b[ix], ", ", 2);
 1375|       |            ix += 2;
 1376|       |         }
 1377|       |      }
 1378|  8.00M|      else {
 1379|  8.00M|         if constexpr (minified_check) {
 1380|  8.00M|            if (!ensure_space(ctx, b, ix + 1)) [[unlikely]] {
  ------------------
  |  Branch (1380:17): [True: 0, False: 8.00M]
  ------------------
 1381|      0|               return;
 1382|      0|            }
 1383|  8.00M|         }
 1384|  8.00M|         std::memcpy(&b[ix], ",", 1);
 1385|  8.00M|         ++ix;
 1386|  8.00M|      }
 1387|       |      if constexpr (is_output_streaming<B>) {
 1388|       |         flush_buffer(b, ix);
 1389|       |      }
 1390|  8.00M|   }
_ZZN3glz2toILj10ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS8_RSH_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlOT_E_clIRSG_EEDaSY_:
 1965|  4.88M|            [&](auto&& val) {
 1966|  4.88M|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|       |                             custom_write<V>) {
 1970|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1971|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1972|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1973|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1974|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1975|       |                  //
 1976|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1977|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1978|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1979|       |                  if (missing_id(value, ctx)) {
 1980|       |                     return;
 1981|       |                  }
 1982|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|       |                  if constexpr (Opts.prettify) {
 1984|       |                     dump("{\n", b, ix);
 1985|       |                     ctx.depth += check_indentation_width(Opts);
 1986|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|       |                     dump('"', b, ix);
 1988|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|       |                     if constexpr (std::integral<id_type>) {
 1990|       |                        dump("\": ", b, ix);
 1991|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|       |                     }
 1993|       |                     else {
 1994|       |                        dump("\": \"", b, ix);
 1995|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|       |                        dump('"', b, ix);
 1997|       |                     }
 1998|       |                     const auto pos_after_tag = ix;
 1999|       |                     dump(",\n", b, ix);
 2000|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|       |                     const auto pos_body_start = ix;
 2002|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|       |                     if (ix == pos_body_start) {
 2004|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|       |                     }
 2006|       |                     ctx.depth -= check_indentation_width(Opts);
 2007|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|       |                        return;
 2009|       |                     }
 2010|       |                     std::memcpy(&b[ix], "\n", 1);
 2011|       |                     ++ix;
 2012|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|       |                     ix += ctx.depth;
 2014|       |                     std::memcpy(&b[ix], "}", 1);
 2015|       |                     ++ix;
 2016|       |                  }
 2017|       |                  else {
 2018|       |                     dump("{\"", b, ix);
 2019|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|       |                     if constexpr (std::integral<id_type>) {
 2021|       |                        dump("\":", b, ix);
 2022|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|       |                     }
 2024|       |                     else {
 2025|       |                        dump("\":\"", b, ix);
 2026|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|       |                        dump('"', b, ix);
 2028|       |                     }
 2029|       |                     const auto pos_after_tag = ix;
 2030|       |                     dump(',', b, ix);
 2031|       |                     const auto pos_body_start = ix;
 2032|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|       |                     if (ix == pos_body_start) {
 2034|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|       |                     }
 2036|       |                     dump('}', b, ix);
 2037|       |                  }
 2038|       |               }
 2039|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|       |                                  variant_unit_alternative<V>) {
 2041|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2042|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2043|       |                  if (missing_id(value, ctx)) {
 2044|       |                     return;
 2045|       |                  }
 2046|       |                  if constexpr (Opts.prettify) {
 2047|       |                     dump("{\n", b, ix);
 2048|       |                     ctx.depth += check_indentation_width(Opts);
 2049|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|       |                     dump('"', b, ix);
 2051|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|       |                     dump("\": ", b, ix);
 2053|       |                     write_id<Opts>(value, ctx, b, ix);
 2054|       |                     ctx.depth -= check_indentation_width(Opts);
 2055|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|       |                        return;
 2057|       |                     }
 2058|       |                     std::memcpy(&b[ix], "\n", 1);
 2059|       |                     ++ix;
 2060|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|       |                     ix += ctx.depth;
 2062|       |                     std::memcpy(&b[ix], "}", 1);
 2063|       |                     ++ix;
 2064|       |                  }
 2065|       |                  else {
 2066|       |                     dump("{\"", b, ix);
 2067|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|       |                     dump("\":", b, ix);
 2069|       |                     write_id<Opts>(value, ctx, b, ix);
 2070|       |                     dump('}', b, ix);
 2071|       |                  }
 2072|       |               }
 2073|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2076|       |                  // An alternative that declares a member named like the discriminator carries the
 2077|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2078|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2079|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2080|       |                  if (missing_id(value, ctx)) {
 2081|       |                     return;
 2082|       |                  }
 2083|       |                  constexpr auto N = []() {
 2084|       |                     if constexpr (is_memory_object<V>) {
 2085|       |                        return reflect<memory_type<V>>::size;
 2086|       |                     }
 2087|       |                     else {
 2088|       |                        return reflect<V>::size;
 2089|       |                     }
 2090|       |                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|       |                  if constexpr (Opts.prettify) {
 2094|       |                     dump("{\n", b, ix);
 2095|       |                     ctx.depth += check_indentation_width(Opts);
 2096|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|       |                     dump('"', b, ix);
 2098|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|       |                     if constexpr (std::integral<id_type>) {
 2103|       |                        dump("\": ", b, ix);
 2104|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|       |                        if constexpr (N > 0) {
 2106|       |                           dump(",\n", b, ix);
 2107|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|       |                        }
 2109|       |                     }
 2110|       |                     else {
 2111|       |                        dump("\": \"", b, ix);
 2112|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|       |                        if constexpr (N == 0) {
 2114|       |                           dump('"', b, ix);
 2115|       |                        }
 2116|       |                        else {
 2117|       |                           dump("\",\n", b, ix);
 2118|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|       |                        }
 2120|       |                     }
 2121|       |                  }
 2122|       |                  else {
 2123|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|       |                     dump("{\"", b, ix);
 2126|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|       |                     if constexpr (std::integral<id_type>) {
 2129|       |                        dump("\":", b, ix);
 2130|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|       |                        if constexpr (N > 0) {
 2132|       |                           dump(',', b, ix);
 2133|       |                        }
 2134|       |                     }
 2135|       |                     else {
 2136|       |                        dump("\":\"", b, ix);
 2137|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|       |                        if constexpr (N == 0) {
 2139|       |                           dump('"', b, ix);
 2140|       |                        }
 2141|       |                        else {
 2142|       |                           dump("\",", b, ix);
 2143|       |                        }
 2144|       |                     }
 2145|       |                  }
 2146|       |                  if constexpr (is_memory_object<V>) {
 2147|       |                     if (!val) [[unlikely]] {
 2148|       |                        ctx.error = error_code::invalid_variant_object;
 2149|       |                        return;
 2150|       |                     }
 2151|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|       |                  }
 2153|       |                  else {
 2154|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|       |                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|       |                  if constexpr (Opts.skip_null_members) {
 2158|       |                     if (b[ix - 1] == ',') {
 2159|       |                        --ix;
 2160|       |                     }
 2161|       |                  }
 2162|       |
 2163|       |                  if constexpr (Opts.prettify) {
 2164|       |                     ctx.depth -= check_indentation_width(Opts);
 2165|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|       |                        return;
 2167|       |                     }
 2168|       |                     std::memcpy(&b[ix], "\n", 1);
 2169|       |                     ++ix;
 2170|       |                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|       |                     ix += ctx.depth;
 2172|       |                     std::memcpy(&b[ix], "}", 1);
 2173|       |                     ++ix;
 2174|       |                  }
 2175|       |                  else {
 2176|       |                     dump('}', b, ix);
 2177|       |                  }
 2178|       |               }
 2179|  4.88M|               else {
 2180|  4.88M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  4.88M|               }
 2182|  4.88M|            },
_ZN3glz2toILj10ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEERS5_TkNS_10is_contextERNS_7contextEmQoo14writable_map_tIT_EaaL_ZNS0_ILj10ESK_E14map_like_arrayEEeqcl17check_concatenateTL0__ELb1EEEvOT1_OT2_OT0_RT3_:
 1623|  4.88M|      {
 1624|  4.88M|         if constexpr (not check_opening_handled(Opts)) {
 1625|  4.88M|            dump('{', b, ix);
 1626|  4.88M|         }
 1627|       |
 1628|  4.88M|         if (!empty_range(value)) {
  ------------------
  |  Branch (1628:14): [True: 82.6k, False: 4.80M]
  ------------------
 1629|  82.6k|            if constexpr (!check_opening_handled(Opts)) {
 1630|       |               if constexpr (Opts.prettify) {
 1631|       |                  ctx.depth += check_indentation_width(Opts);
 1632|       |                  if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1633|       |                     return;
 1634|       |                  }
 1635|       |                  std::memcpy(&b[ix], "\n", 1);
 1636|       |                  ++ix;
 1637|       |                  fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1638|       |                  ix += ctx.depth;
 1639|       |               }
 1640|  82.6k|            }
 1641|       |
 1642|  82.6k|            using val_t = detail::iterator_second_type<T>; // the type of value in each [key, value] pair
 1643|  82.6k|            if constexpr (!never_written<Opts, val_t>) {
 1644|       |               if constexpr (null_t<val_t> && Opts.skip_null_members) {
 1645|       |                  auto write_first_entry = [&](auto&& it) {
 1646|       |                     auto&& [key, entry_val] = *it;
 1647|       |                     if (skip_member<Opts>(entry_val)) {
 1648|       |                        return true;
 1649|       |                     }
 1650|       |                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1651|       |                     return bool(ctx.error);
 1652|       |                  };
 1653|       |
 1654|       |                  auto it = std::begin(value);
 1655|       |                  bool first = write_first_entry(it);
 1656|       |                  if (bool(ctx.error)) [[unlikely]] {
 1657|       |                     return;
 1658|       |                  }
 1659|       |                  ++it;
 1660|       |                  for (const auto end = std::end(value); it != end; ++it) {
 1661|       |                     auto&& [key, entry_val] = *it;
 1662|       |                     if (skip_member<Opts>(entry_val)) {
 1663|       |                        continue;
 1664|       |                     }
 1665|       |
 1666|       |                     // When Opts.skip_null_members, *any* entry may be skipped, meaning separator dumping must be
 1667|       |                     // conditional for every entry.
 1668|       |                     // Alternatively, write separator after each entry except last but then branch is permanent
 1669|       |                     if (not first) {
 1670|       |                        write_object_entry_separator<Opts>(ctx, b, ix);
 1671|       |                     }
 1672|       |
 1673|       |                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1674|       |                     if (bool(ctx.error)) [[unlikely]] {
 1675|       |                        return;
 1676|       |                     }
 1677|       |
 1678|       |                     first = false;
 1679|       |                  }
 1680|       |               }
 1681|  82.6k|               else {
 1682|  82.6k|                  auto write_first_entry = [&](auto&& it) {
 1683|  82.6k|                     auto&& [key, entry_val] = *it;
 1684|  82.6k|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1685|  82.6k|                  };
 1686|       |
 1687|  82.6k|                  auto it = std::begin(value);
 1688|  82.6k|                  write_first_entry(it);
 1689|  82.6k|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1689:23): [True: 0, False: 82.6k]
  ------------------
 1690|      0|                     return;
 1691|      0|                  }
 1692|  82.6k|                  ++it;
 1693|  1.41M|                  for (const auto end = std::end(value); it != end; ++it) {
  ------------------
  |  Branch (1693:58): [True: 1.33M, False: 82.6k]
  ------------------
 1694|  1.33M|                     auto&& [key, entry_val] = *it;
 1695|  1.33M|                     write_object_entry_separator<Opts>(ctx, b, ix);
 1696|  1.33M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1697|  1.33M|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1697:26): [True: 0, False: 1.33M]
  ------------------
 1698|      0|                        return;
 1699|      0|                     }
 1700|  1.33M|                  }
 1701|  82.6k|               }
 1702|  82.6k|            }
 1703|       |
 1704|  82.6k|            if constexpr (!check_closing_handled(Opts)) {
 1705|       |               if constexpr (Opts.prettify) {
 1706|       |                  ctx.depth -= check_indentation_width(Opts);
 1707|       |                  if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1708|       |                     return;
 1709|       |                  }
 1710|       |                  std::memcpy(&b[ix], "\n", 1);
 1711|       |                  ++ix;
 1712|       |                  fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 1713|       |                  ix += ctx.depth;
 1714|       |               }
 1715|  82.6k|            }
 1716|  82.6k|         }
 1717|       |
 1718|  4.88M|         if constexpr (!check_closing_handled(Opts)) {
 1719|  4.88M|            dump('}', b, ix);
 1720|  4.88M|         }
 1721|  4.88M|      }
_ZZN3glz2toILj10ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEERS5_TkNS_10is_contextERNS_7contextEmQoo14writable_map_tIT_EaaL_ZNS0_ILj10ESK_E14map_like_arrayEEeqcl17check_concatenateTL0__ELb1EEEvOT1_OT2_OT0_RT3_ENKUlOSK_E_clIRPNS9_4pairISF_S4_EEEEDaSU_:
 1682|  82.6k|                  auto write_first_entry = [&](auto&& it) {
 1683|  82.6k|                     auto&& [key, entry_val] = *it;
 1684|  82.6k|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1685|  82.6k|                  };
_ZN3glz28write_object_entry_separatorITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEELb1ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmQooeqdtT_6formatL_ZNS_4JSONEEeqdtT_6formatL_ZNS_6NDJSONEEEEvOT2_OT1_RT3_:
  158|  1.33M|   {
  159|       |      if constexpr (Opts.prettify) {
  160|       |         if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
  161|       |            return;
  162|       |         }
  163|       |         std::memcpy(&b[ix], ",\n", 2);
  164|       |         ix += 2;
  165|       |         fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
  166|       |         ix += ctx.depth;
  167|       |      }
  168|  1.33M|      else {
  169|  1.33M|         if constexpr (minified_check) {
  170|  1.33M|            if (!ensure_space(ctx, b, ix + 1)) [[unlikely]] {
  ------------------
  |  Branch (170:17): [True: 0, False: 1.33M]
  ------------------
  171|      0|               return;
  172|      0|            }
  173|  1.33M|         }
  174|  1.33M|         std::memcpy(&b[ix], ",", 1);
  175|  1.33M|         ++ix;
  176|  1.33M|      }
  177|       |      if constexpr (is_output_streaming<B>) {
  178|       |         flush_buffer(b, ix);
  179|       |      }
  180|  1.33M|   }
_ZN3glz18write_pair_contentITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextENS_7contextERS8_mEEvRKT0_OT1_RT2_OT3_RT4_:
 1395|  1.41M|   {
 1396|       |      if constexpr (str_t<Key> || char_t<Key> || is_named_enum<Key> || mimics_str_t<Key> || custom_str_t<Key> ||
 1397|  1.41M|                    check_quoted_num(Opts)) {
 1398|  1.41M|         to<JSON, core_t<Key>>::template op<Opts>(key, ctx, b, ix);
 1399|       |      }
 1400|       |      else if constexpr (num_t<Key>) {
 1401|       |         serialize<JSON>::op<opt_true<Opts, quoted_num_opt_tag{}>>(key, ctx, b, ix);
 1402|       |      }
 1403|       |      else {
 1404|       |         serialize<JSON>::op<opt_false<Opts, raw_string_opt_tag{}>>(quoted_t<const Key>{key}, ctx, b, ix);
 1405|       |      }
 1406|  1.41M|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1406:11): [True: 0, False: 1.41M]
  ------------------
 1407|      0|         return;
 1408|      0|      }
 1409|       |      if constexpr (Opts.prettify) {
 1410|       |         dump(": ", b, ix);
 1411|       |      }
 1412|  1.41M|      else {
 1413|  1.41M|         dump(':', b, ix);
 1414|  1.41M|      }
 1415|       |
 1416|  1.41M|      using V = core_t<decltype(value)>;
 1417|  1.41M|      to<JSON, V>::template op<opening_and_closing_handled_off<Opts>()>(value, ctx, b, ix);
 1418|  1.41M|   }
_ZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  845|  1.41M|      {
  846|       |         if constexpr (check_string_as_number(Opts)) {
  847|       |            const sv str = [&]() -> const sv {
  848|       |               if constexpr (array_char_t<T>) {
  849|       |                  const auto* start = value.data();
  850|       |                  const auto* end = static_cast<const char*>(std::memchr(start, '\0', value.size()));
  851|       |                  return sv{start, end ? size_t(end - start) : value.size()};
  852|       |               }
  853|       |               else if constexpr (u8str_t<T>) {
  854|       |                  return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  855|       |               }
  856|       |               else {
  857|       |                  return str_view<T>(value);
  858|       |               }
  859|       |            }();
  860|       |            if (!ensure_space(ctx, b, ix + str.size() + write_padding_bytes)) [[unlikely]] {
  861|       |               return;
  862|       |            }
  863|       |            dump_maybe_empty<false>(str, b, ix);
  864|       |         }
  865|       |         else if constexpr (char_t<T>) {
  866|       |            if constexpr (check_unquoted(Opts)) {
  867|       |               dump(value, b, ix);
  868|       |            }
  869|       |            else {
  870|       |               // 8 bytes is enough for quotes and escaped character (worst case: \uXXXX = 6 + 2 quotes)
  871|       |               if (!ensure_space(ctx, b, ix + 8)) [[unlikely]] {
  872|       |                  return;
  873|       |               }
  874|       |
  875|       |               std::memcpy(&b[ix], "\"", 1);
  876|       |               ++ix;
  877|       |               if (const auto escaped = char_escape_table[uint8_t(value)]; escaped) {
  878|       |                  std::memcpy(&b[ix], &escaped, 2);
  879|       |                  ix += 2;
  880|       |               }
  881|       |               else if (value == '\0') {
  882|       |                  // null character treated as empty string
  883|       |               }
  884|       |               else if constexpr (check_escape_control_characters(Opts)) {
  885|       |                  if (uint8_t(value) < 0x20) {
  886|       |                     // Write as \uXXXX format
  887|       |                     char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
  888|       |                     constexpr char hex_digits[] = "0123456789ABCDEF";
  889|       |                     unicode_escape[4] = hex_digits[(value >> 4) & 0xF];
  890|       |                     unicode_escape[5] = hex_digits[value & 0xF];
  891|       |                     std::memcpy(&b[ix], unicode_escape, 6);
  892|       |                     ix += 6;
  893|       |                  }
  894|       |                  else {
  895|       |                     std::memcpy(&b[ix], &value, 1);
  896|       |                     ++ix;
  897|       |                  }
  898|       |               }
  899|       |               else {
  900|       |                  if constexpr (check_reject_control_characters(Opts)) {
  901|       |                     if (uint8_t(value) < 0x20) [[unlikely]] {
  902|       |                        ctx.error = error_code::invalid_control_character;
  903|       |                     }
  904|       |                  }
  905|       |                  std::memcpy(&b[ix], &value, 1);
  906|       |                  ++ix;
  907|       |               }
  908|       |               std::memcpy(&b[ix], "\"", 1);
  909|       |               ++ix;
  910|       |            }
  911|       |         }
  912|  1.41M|         else {
  913|       |            if constexpr (check_raw_string(Opts)) {
  914|       |               const sv str = [&]() -> const sv {
  915|       |                  if constexpr (u8str_t<T>) {
  916|       |                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  917|       |                  }
  918|       |                  else {
  919|       |                     return str_view<T>(value);
  920|       |                  }
  921|       |               }();
  922|       |
  923|       |               // We need space for quotes and the string length: 2 + n.
  924|       |               // Use +8 for extra buffer
  925|       |               if (!ensure_space(ctx, b, ix + 8 + str.size())) [[unlikely]] {
  926|       |                  return;
  927|       |               }
  928|       |               // now we don't have to check writing
  929|       |
  930|       |               if constexpr (not check_unquoted(Opts)) {
  931|       |                  std::memcpy(&b[ix], "\"", 1);
  932|       |                  ++ix;
  933|       |               }
  934|       |               if (str.size()) [[likely]] {
  935|       |                  const auto n = str.size();
  936|       |                  std::memcpy(&b[ix], str.data(), n);
  937|       |                  ix += n;
  938|       |               }
  939|       |               if constexpr (not check_unquoted(Opts)) {
  940|       |                  std::memcpy(&b[ix], "\"", 1);
  941|       |                  ++ix;
  942|       |               }
  943|       |            }
  944|  1.41M|            else {
  945|  1.41M|               const sv str = [&]() -> const sv {
  946|  1.41M|                  if constexpr (array_char_t<T>) {
  947|  1.41M|                     return sv{value.data(), value.size()};
  948|  1.41M|                  }
  949|  1.41M|                  else if constexpr (u8str_t<T>) {
  950|  1.41M|                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|  1.41M|                  }
  952|  1.41M|                  else {
  953|  1.41M|                     return str_view<T>(value);
  954|  1.41M|                  }
  955|  1.41M|               }();
  956|  1.41M|               const auto n = str.size();
  957|       |
  958|       |               // In the case n == 0 we need two characters for quotes.
  959|       |               // For each individual character we need room for two characters to handle escapes.
  960|       |               // When using Unicode escapes, we might need up to 6 characters (\uXXXX) per character
  961|       |               if constexpr (check_escape_control_characters(Opts)) {
  962|       |                  if constexpr (has_bounded_capacity<B>) {
  963|       |                     // 6 bytes per character is a ceiling only a string of nothing but control
  964|       |                     // characters reaches. A resizable buffer merely over-allocates against it,
  965|       |                     // but a fixed buffer has nowhere to grow, so the ceiling would reject output
  966|       |                     // that fits. Measuring the string answers exactly, at the cost of a pass over
  967|       |                     // it, so bracket the measurement between two O(1) bounds and only pay it when
  968|       |                     // the answer is still in doubt: the ceiling fitting means yes, and the floor
  969|       |                     // of one byte per character not fitting means no.
  970|       |                     const size_t capacity = buffer_traits<std::remove_cvref_t<B>>::capacity(b);
  971|       |                     size_t required = ix + 10 + 6 * n;
  972|       |                     if (required > capacity) [[unlikely]] {
  973|       |                        required = ix + 10 + n;
  974|       |                        if (required <= capacity) {
  975|       |                           required = ix + 10 + detail::escaped_string_size(str);
  976|       |                        }
  977|       |                     }
  978|       |                     if (!ensure_space(ctx, b, required)) [[unlikely]] {
  979|       |                        return;
  980|       |                     }
  981|       |                  }
  982|       |                  // We need 2 + 6 * n characters in the worst case (all control chars)
  983|       |                  else if (!ensure_space(ctx, b, ix + 10 + 6 * n)) [[unlikely]] {
  984|       |                     return;
  985|       |                  }
  986|       |               }
  987|  1.41M|               else {
  988|       |                  // Using the original sizing
  989|  1.41M|                  if (!ensure_space(ctx, b, ix + 10 + 2 * n)) [[unlikely]] {
  ------------------
  |  Branch (989:23): [True: 0, False: 1.41M]
  ------------------
  990|      0|                     return;
  991|      0|                  }
  992|  1.41M|               }
  993|       |               // now we don't have to check writing
  994|       |
  995|       |               if constexpr (check_unquoted(Opts)) {
  996|       |                  if (n) {
  997|       |                     std::memcpy(&b[ix], str.data(), n);
  998|       |                     ix += n;
  999|       |                  }
 1000|       |               }
 1001|  1.41M|               else {
 1002|  1.41M|                  std::memcpy(&b[ix], "\"", 1);
 1003|  1.41M|                  ++ix;
 1004|       |
 1005|  1.41M|                  const auto* c = str.data();
 1006|  1.41M|                  const auto* const e = c + n;
 1007|  1.41M|                  const auto start = &b[ix];
 1008|  1.41M|                  auto data = start;
 1009|       |
 1010|       |                  // By default we don't escape control characters for performance. Invalid JSON characters
 1011|       |                  // result in null characters in the output, making the JSON invalid — these would then be
 1012|       |                  // detected upon reading. Enable the `escape_control_characters` option to properly escape
 1013|       |                  // control characters (0x00–0x1F) as \uXXXX sequences.
 1014|       |
 1015|       |                  // Escape handler: writes the escaped form of *c into data, advances both pointers
 1016|  1.41M|                  auto write_escape = [&]() {
 1017|  1.41M|                     if constexpr (check_escape_control_characters(Opts)) {
 1018|  1.41M|                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|  1.41M|                           std::memcpy(data, &escaped, 2);
 1020|  1.41M|                           data += 2;
 1021|  1.41M|                        }
 1022|  1.41M|                        else {
 1023|  1.41M|                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|  1.41M|                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|  1.41M|                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|  1.41M|                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|  1.41M|                           std::memcpy(data, unicode_escape, 6);
 1028|  1.41M|                           data += 6;
 1029|  1.41M|                        }
 1030|  1.41M|                     }
 1031|  1.41M|                     else {
 1032|  1.41M|                        if constexpr (check_reject_control_characters(Opts)) {
 1033|       |                           // A control character with no two-character escape cannot be written
 1034|       |                           // without \uXXXX. The table entry is zero, so the memcpy below would
 1035|       |                           // put two NULs where one byte was. Flag it and let the loop finish:
 1036|       |                           // returning early here would leave c un-advanced and the SIMD scan
 1037|       |                           // would find the same byte forever. The output is abandoned anyway.
 1038|  1.41M|                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|  1.41M|                              ctx.error = error_code::invalid_control_character;
 1040|  1.41M|                           }
 1041|  1.41M|                        }
 1042|  1.41M|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  1.41M|                        data += 2;
 1044|  1.41M|                     }
 1045|  1.41M|                     ++c;
 1046|  1.41M|                  };
 1047|       |
 1048|       |                  // Adding a helper here means adding a branch to string_escape_simd() in
 1049|       |                  // simd/backends.hpp, which names the widest one this cascade invokes, and a row
 1050|       |                  // to known_builds in tests/json_test/utf8_validation_test.cpp, which checks it.
 1051|       |#if defined(GLZ_USE_AVX2)
 1052|       |                  detail::avx2_string_escape(c, e, data, n, write_escape);
 1053|       |#endif
 1054|  1.41M|#if defined(GLZ_USE_SSE2)
 1055|  1.41M|                  detail::sse2_string_escape(c, e, data, n, write_escape);
 1056|       |#elif defined(GLZ_USE_NEON)
 1057|       |                  detail::neon_string_escape(c, e, data, n, write_escape);
 1058|       |#endif
 1059|       |
 1060|       |                  // SWAR: 8 bytes at a time
 1061|  1.41M|                  if (n > 7) {
  ------------------
  |  Branch (1061:23): [True: 929k, False: 489k]
  ------------------
 1062|  1.45M|                     for (const auto end_m7 = e - 7; c < end_m7;) {
  ------------------
  |  Branch (1062:54): [True: 530k, False: 929k]
  ------------------
 1063|   530k|                        std::memcpy(data, c, 8);
 1064|   530k|                        uint64_t swar;
 1065|   530k|                        std::memcpy(&swar, c, 8);
 1066|       |                        if constexpr (std::endian::native == std::endian::big) {
 1067|       |                           swar = std::byteswap(swar);
 1068|       |                        }
 1069|       |
 1070|   530k|                        constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1071|   530k|                        const uint64_t lo7 = swar & lo7_mask;
 1072|   530k|                        const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1073|   530k|                        const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1074|   530k|                        const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1075|   530k|                        uint64_t next = ~((quote & backslash & less_32) | swar);
 1076|       |
 1077|   530k|                        next &= repeat_byte8(0b10000000);
 1078|   530k|                        if (next == 0) {
  ------------------
  |  Branch (1078:29): [True: 527k, False: 3.27k]
  ------------------
 1079|   527k|                           data += 8;
 1080|   527k|                           c += 8;
 1081|   527k|                           continue;
 1082|   527k|                        }
 1083|       |
 1084|  3.27k|                        const auto length = (countr_zero(next) >> 3);
 1085|  3.27k|                        c += length;
 1086|  3.27k|                        data += length;
 1087|  3.27k|                        write_escape();
 1088|  3.27k|                     }
 1089|   929k|                  }
 1090|       |
 1091|       |                  // Scalar tail
 1092|  6.27M|                  for (; c < e; ++c) {
  ------------------
  |  Branch (1092:26): [True: 4.85M, False: 1.41M]
  ------------------
 1093|  4.85M|                     if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
  ------------------
  |  Branch (1093:79): [True: 9.63k, False: 4.84M]
  ------------------
 1094|  9.63k|                        std::memcpy(data, &escaped, 2);
 1095|  9.63k|                        data += 2;
 1096|  9.63k|                     }
 1097|       |                     else if constexpr (check_escape_control_characters(Opts)) {
 1098|       |                        if (uint8_t(*c) < 0x20) {
 1099|       |                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1100|       |                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1101|       |                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1102|       |                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1103|       |                           std::memcpy(data, unicode_escape, 6);
 1104|       |                           data += 6;
 1105|       |                        }
 1106|       |                        else {
 1107|       |                           std::memcpy(data, c, 1);
 1108|       |                           ++data;
 1109|       |                        }
 1110|       |                     }
 1111|  4.84M|                     else {
 1112|       |                        if constexpr (check_reject_control_characters(Opts)) {
 1113|       |                           if (uint8_t(*c) < 0x20) [[unlikely]] {
 1114|       |                              ctx.error = error_code::invalid_control_character;
 1115|       |                           }
 1116|       |                        }
 1117|  4.84M|                        std::memcpy(data, c, 1);
 1118|  4.84M|                        ++data;
 1119|  4.84M|                     }
 1120|  4.85M|                  }
 1121|       |
 1122|  1.41M|                  ix += size_t(data - start);
 1123|       |
 1124|  1.41M|                  std::memcpy(&b[ix], "\"", 1);
 1125|  1.41M|                  ++ix;
 1126|  1.41M|               }
 1127|  1.41M|            }
 1128|  1.41M|         }
 1129|  1.41M|      }
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE_clEv:
  945|  1.41M|               const sv str = [&]() -> const sv {
  946|       |                  if constexpr (array_char_t<T>) {
  947|       |                     return sv{value.data(), value.size()};
  948|       |                  }
  949|       |                  else if constexpr (u8str_t<T>) {
  950|       |                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|       |                  }
  952|  1.41M|                  else {
  953|  1.41M|                     return str_view<T>(value);
  954|  1.41M|                  }
  955|  1.41M|               }();
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE0_clEv:
 1016|  16.3k|                  auto write_escape = [&]() {
 1017|       |                     if constexpr (check_escape_control_characters(Opts)) {
 1018|       |                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|       |                           std::memcpy(data, &escaped, 2);
 1020|       |                           data += 2;
 1021|       |                        }
 1022|       |                        else {
 1023|       |                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|       |                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|       |                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|       |                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|       |                           std::memcpy(data, unicode_escape, 6);
 1028|       |                           data += 6;
 1029|       |                        }
 1030|       |                     }
 1031|  16.3k|                     else {
 1032|       |                        if constexpr (check_reject_control_characters(Opts)) {
 1033|       |                           // A control character with no two-character escape cannot be written
 1034|       |                           // without \uXXXX. The table entry is zero, so the memcpy below would
 1035|       |                           // put two NULs where one byte was. Flag it and let the loop finish:
 1036|       |                           // returning early here would leave c un-advanced and the SIMD scan
 1037|       |                           // would find the same byte forever. The output is abandoned anyway.
 1038|       |                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|       |                              ctx.error = error_code::invalid_control_character;
 1040|       |                           }
 1041|       |                        }
 1042|  16.3k|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  16.3k|                        data += 2;
 1044|  16.3k|                     }
 1045|  16.3k|                     ++c;
 1046|  16.3k|                  };

_ZN3glz6to_tieIR9my_structLm4EQleT0_L_ZNS_6detail25max_pure_reflection_countEEEEDcOT_:
  137|  25.1k|   {
  138|       |      if constexpr (N == 0) {
  139|       |         return tuple{};
  140|       |      }
  141|       |      else if constexpr (N == 1) {
  142|       |         auto& [p] = t;
  143|       |         return glz::tie(p);
  144|       |      }
  145|       |      else if constexpr (N == 2) {
  146|       |         auto& [p0, p1] = t;
  147|       |         return glz::tie(p0, p1);
  148|       |      }
  149|       |      else if constexpr (N == 3) {
  150|       |         auto& [p0, p1, p2] = t;
  151|       |         return glz::tie(p0, p1, p2);
  152|       |      }
  153|  25.1k|      else if constexpr (N == 4) {
  154|  25.1k|         auto& [p0, p1, p2, p3] = t;
  155|  25.1k|         return glz::tie(p0, p1, p2, p3);
  156|       |      }
  157|       |      else if constexpr (N == 5) {
  158|       |         auto& [p0, p1, p2, p3, p4] = t;
  159|       |         return glz::tie(p0, p1, p2, p3, p4);
  160|       |      }
  161|       |      else if constexpr (N == 6) {
  162|       |         auto& [p0, p1, p2, p3, p4, p5] = t;
  163|       |         return glz::tie(p0, p1, p2, p3, p4, p5);
  164|       |      }
  165|       |      else if constexpr (N == 7) {
  166|       |         auto& [p0, p1, p2, p3, p4, p5, p6] = t;
  167|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6);
  168|       |      }
  169|       |      else if constexpr (N == 8) {
  170|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7] = t;
  171|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7);
  172|       |      }
  173|       |      else if constexpr (N == 9) {
  174|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8] = t;
  175|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8);
  176|       |      }
  177|       |      else if constexpr (N == 10) {
  178|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9] = t;
  179|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
  180|       |      }
  181|       |      else if constexpr (N == 11) {
  182|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10] = t;
  183|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
  184|       |      }
  185|       |      else if constexpr (N == 12) {
  186|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11] = t;
  187|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
  188|       |      }
  189|       |      else if constexpr (N == 13) {
  190|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12] = t;
  191|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
  192|       |      }
  193|       |      else if constexpr (N == 14) {
  194|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13] = t;
  195|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);
  196|       |      }
  197|       |      else if constexpr (N == 15) {
  198|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14] = t;
  199|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);
  200|       |      }
  201|       |      else if constexpr (N == 16) {
  202|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15] = t;
  203|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15);
  204|       |      }
  205|       |      else if constexpr (N == 17) {
  206|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16] = t;
  207|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16);
  208|       |      }
  209|       |      else if constexpr (N == 18) {
  210|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = t;
  211|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17);
  212|       |      }
  213|       |      else if constexpr (N == 19) {
  214|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18] = t;
  215|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18);
  216|       |      }
  217|       |      else if constexpr (N == 20) {
  218|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19] = t;
  219|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19);
  220|       |      }
  221|       |      else if constexpr (N == 21) {
  222|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20] = t;
  223|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20);
  224|       |      }
  225|       |      else if constexpr (N == 22) {
  226|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21] = t;
  227|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  228|       |                         p21);
  229|       |      }
  230|       |      else if constexpr (N == 23) {
  231|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21,
  232|       |                p22] = t;
  233|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  234|       |                         p21, p22);
  235|       |      }
  236|       |      else if constexpr (N == 24) {
  237|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  238|       |                p23] = t;
  239|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  240|       |                         p21, p22, p23);
  241|       |      }
  242|       |      else if constexpr (N == 25) {
  243|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  244|       |                p23, p24] = t;
  245|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  246|       |                         p21, p22, p23, p24);
  247|       |      }
  248|       |      else if constexpr (N == 26) {
  249|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  250|       |                p23, p24, p25] = t;
  251|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  252|       |                         p21, p22, p23, p24, p25);
  253|       |      }
  254|       |      else if constexpr (N == 27) {
  255|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  256|       |                p23, p24, p25, p26] = t;
  257|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  258|       |                         p21, p22, p23, p24, p25, p26);
  259|       |      }
  260|       |      else if constexpr (N == 28) {
  261|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  262|       |                p23, p24, p25, p26, p27] = t;
  263|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  264|       |                         p21, p22, p23, p24, p25, p26, p27);
  265|       |      }
  266|       |      else if constexpr (N == 29) {
  267|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  268|       |                p23, p24, p25, p26, p27, p28] = t;
  269|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  270|       |                         p21, p22, p23, p24, p25, p26, p27, p28);
  271|       |      }
  272|       |      else if constexpr (N == 30) {
  273|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  274|       |                p23, p24, p25, p26, p27, p28, p29] = t;
  275|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  276|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29);
  277|       |      }
  278|       |      else if constexpr (N == 31) {
  279|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  280|       |                p23, p24, p25, p26, p27, p28, p29, p30] = t;
  281|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  282|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30);
  283|       |      }
  284|       |      else if constexpr (N == 32) {
  285|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  286|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31] = t;
  287|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  288|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31);
  289|       |      }
  290|       |      else if constexpr (N == 33) {
  291|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  292|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32] = t;
  293|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  294|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32);
  295|       |      }
  296|       |      else if constexpr (N == 34) {
  297|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  298|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33] = t;
  299|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  300|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33);
  301|       |      }
  302|       |      else if constexpr (N == 35) {
  303|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  304|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34] = t;
  305|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  306|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34);
  307|       |      }
  308|       |      else if constexpr (N == 36) {
  309|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  310|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35] = t;
  311|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  312|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35);
  313|       |      }
  314|       |      else if constexpr (N == 37) {
  315|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  316|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36] = t;
  317|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  318|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36);
  319|       |      }
  320|       |      else if constexpr (N == 38) {
  321|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  322|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37] = t;
  323|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  324|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37);
  325|       |      }
  326|       |      else if constexpr (N == 39) {
  327|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  328|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38] = t;
  329|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  330|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38);
  331|       |      }
  332|       |      else if constexpr (N == 40) {
  333|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  334|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39] = t;
  335|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  336|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39);
  337|       |      }
  338|       |      else if constexpr (N == 41) {
  339|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  340|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40] = t;
  341|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  342|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  343|       |                         p40);
  344|       |      }
  345|       |      else if constexpr (N == 42) {
  346|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  347|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41] = t;
  348|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  349|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  350|       |                         p40, p41);
  351|       |      }
  352|       |      else if constexpr (N == 43) {
  353|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  354|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42] = t;
  355|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  356|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  357|       |                         p40, p41, p42);
  358|       |      }
  359|       |      else if constexpr (N == 44) {
  360|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  361|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42,
  362|       |                p43] = t;
  363|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  364|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  365|       |                         p40, p41, p42, p43);
  366|       |      }
  367|       |      else if constexpr (N == 45) {
  368|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  369|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  370|       |                p44] = t;
  371|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  372|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  373|       |                         p40, p41, p42, p43, p44);
  374|       |      }
  375|       |      else if constexpr (N == 46) {
  376|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  377|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  378|       |                p44, p45] = t;
  379|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  380|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  381|       |                         p40, p41, p42, p43, p44, p45);
  382|       |      }
  383|       |      else if constexpr (N == 47) {
  384|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  385|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  386|       |                p44, p45, p46] = t;
  387|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  388|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  389|       |                         p40, p41, p42, p43, p44, p45, p46);
  390|       |      }
  391|       |      else if constexpr (N == 48) {
  392|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  393|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  394|       |                p44, p45, p46, p47] = t;
  395|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  396|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  397|       |                         p40, p41, p42, p43, p44, p45, p46, p47);
  398|       |      }
  399|       |      else if constexpr (N == 49) {
  400|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  401|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  402|       |                p44, p45, p46, p47, p48] = t;
  403|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  404|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  405|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48);
  406|       |      }
  407|       |      else if constexpr (N == 50) {
  408|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  409|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  410|       |                p44, p45, p46, p47, p48, p49] = t;
  411|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  412|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  413|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49);
  414|       |      }
  415|       |      else if constexpr (N == 51) {
  416|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  417|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  418|       |                p44, p45, p46, p47, p48, p49, p50] = t;
  419|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  420|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  421|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50);
  422|       |      }
  423|       |      else if constexpr (N == 52) {
  424|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  425|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  426|       |                p44, p45, p46, p47, p48, p49, p50, p51] = t;
  427|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  428|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  429|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51);
  430|       |      }
  431|       |      else if constexpr (N == 53) {
  432|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  433|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  434|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52] = t;
  435|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  436|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  437|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52);
  438|       |      }
  439|       |      else if constexpr (N == 54) {
  440|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  441|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  442|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53] = t;
  443|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  444|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  445|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53);
  446|       |      }
  447|       |      else if constexpr (N == 55) {
  448|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  449|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  450|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54] = t;
  451|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  452|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  453|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54);
  454|       |      }
  455|       |      else if constexpr (N == 56) {
  456|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  457|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  458|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55] = t;
  459|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  460|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  461|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55);
  462|       |      }
  463|       |      else if constexpr (N == 57) {
  464|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  465|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  466|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56] = t;
  467|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  468|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  469|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56);
  470|       |      }
  471|       |      else if constexpr (N == 58) {
  472|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  473|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  474|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57] = t;
  475|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  476|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  477|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57);
  478|       |      }
  479|       |      else if constexpr (N == 59) {
  480|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  481|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  482|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58] = t;
  483|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  484|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  485|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58);
  486|       |      }
  487|       |      else if constexpr (N == 60) {
  488|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  489|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  490|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59] = t;
  491|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  492|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  493|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  494|       |                         p59);
  495|       |      }
  496|       |      else if constexpr (N == 61) {
  497|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  498|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  499|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60] = t;
  500|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  501|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  502|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  503|       |                         p59, p60);
  504|       |      }
  505|       |      else if constexpr (N == 62) {
  506|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  507|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  508|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61] = t;
  509|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  510|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  511|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  512|       |                         p59, p60, p61);
  513|       |      }
  514|       |      else if constexpr (N == 63) {
  515|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  516|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  517|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62] = t;
  518|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  519|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  520|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  521|       |                         p59, p60, p61, p62);
  522|       |      }
  523|       |      else if constexpr (N == 64) {
  524|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  525|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  526|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63] = t;
  527|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  528|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  529|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  530|       |                         p59, p60, p61, p62, p63);
  531|       |      }
  532|       |      else if constexpr (N == 65) {
  533|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  534|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  535|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63,
  536|       |                p64] = t;
  537|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  538|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  539|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  540|       |                         p59, p60, p61, p62, p63, p64);
  541|       |      }
  542|       |      else if constexpr (N == 66) {
  543|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  544|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  545|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  546|       |                p65] = t;
  547|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  548|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  549|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  550|       |                         p59, p60, p61, p62, p63, p64, p65);
  551|       |      }
  552|       |      else if constexpr (N == 67) {
  553|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  554|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  555|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  556|       |                p65, p66] = t;
  557|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  558|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  559|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  560|       |                         p59, p60, p61, p62, p63, p64, p65, p66);
  561|       |      }
  562|       |      else if constexpr (N == 68) {
  563|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  564|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  565|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  566|       |                p65, p66, p67] = t;
  567|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  568|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  569|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  570|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67);
  571|       |      }
  572|       |      else if constexpr (N == 69) {
  573|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  574|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  575|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  576|       |                p65, p66, p67, p68] = t;
  577|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  578|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  579|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  580|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68);
  581|       |      }
  582|       |      else if constexpr (N == 70) {
  583|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  584|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  585|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  586|       |                p65, p66, p67, p68, p69] = t;
  587|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  588|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  589|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  590|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69);
  591|       |      }
  592|       |      else if constexpr (N == 71) {
  593|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  594|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  595|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  596|       |                p65, p66, p67, p68, p69, p70] = t;
  597|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  598|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  599|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  600|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70);
  601|       |      }
  602|       |      else if constexpr (N == 72) {
  603|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  604|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  605|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  606|       |                p65, p66, p67, p68, p69, p70, p71] = t;
  607|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  608|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  609|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  610|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71);
  611|       |      }
  612|       |      else if constexpr (N == 73) {
  613|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  614|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  615|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  616|       |                p65, p66, p67, p68, p69, p70, p71, p72] = t;
  617|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  618|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  619|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  620|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72);
  621|       |      }
  622|       |      else if constexpr (N == 74) {
  623|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  624|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  625|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  626|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73] = t;
  627|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  628|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  629|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  630|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73);
  631|       |      }
  632|       |      else if constexpr (N == 75) {
  633|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  634|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  635|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  636|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74] = t;
  637|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  638|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  639|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  640|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74);
  641|       |      }
  642|       |      else if constexpr (N == 76) {
  643|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  644|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  645|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  646|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75] = t;
  647|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  648|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  649|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  650|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75);
  651|       |      }
  652|       |      else if constexpr (N == 77) {
  653|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  654|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  655|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  656|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76] = t;
  657|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  658|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  659|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  660|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76);
  661|       |      }
  662|       |      else if constexpr (N == 78) {
  663|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  664|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  665|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  666|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77] = t;
  667|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  668|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  669|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  670|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77);
  671|       |      }
  672|       |      else if constexpr (N == 79) {
  673|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  674|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  675|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  676|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78] = t;
  677|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  678|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  679|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  680|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  681|       |                         p78);
  682|       |      }
  683|       |      else if constexpr (N == 80) {
  684|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  685|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  686|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  687|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79] = t;
  688|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  689|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  690|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  691|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  692|       |                         p78, p79);
  693|       |      }
  694|       |      else if constexpr (N == 81) {
  695|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  696|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  697|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  698|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80] = t;
  699|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  700|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  701|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  702|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  703|       |                         p78, p79, p80);
  704|       |      }
  705|       |      else if constexpr (N == 82) {
  706|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  707|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  708|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  709|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81] = t;
  710|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  711|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  712|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  713|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  714|       |                         p78, p79, p80, p81);
  715|       |      }
  716|       |      else if constexpr (N == 83) {
  717|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  718|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  719|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  720|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82] = t;
  721|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  722|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  723|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  724|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  725|       |                         p78, p79, p80, p81, p82);
  726|       |      }
  727|       |      else if constexpr (N == 84) {
  728|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  729|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  730|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  731|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83] = t;
  732|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  733|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  734|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  735|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  736|       |                         p78, p79, p80, p81, p82, p83);
  737|       |      }
  738|       |      else if constexpr (N == 85) {
  739|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  740|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  741|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  742|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84] = t;
  743|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  744|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  745|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  746|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  747|       |                         p78, p79, p80, p81, p82, p83, p84);
  748|       |      }
  749|       |      else if constexpr (N == 86) {
  750|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  751|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  752|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  753|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84,
  754|       |                p85] = t;
  755|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  756|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  757|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  758|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  759|       |                         p78, p79, p80, p81, p82, p83, p84, p85);
  760|       |      }
  761|       |      else if constexpr (N == 87) {
  762|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  763|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  764|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  765|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  766|       |                p86] = t;
  767|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  768|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  769|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  770|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  771|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86);
  772|       |      }
  773|       |      else if constexpr (N == 88) {
  774|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  775|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  776|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  777|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  778|       |                p86, p87] = t;
  779|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  780|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  781|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  782|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  783|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87);
  784|       |      }
  785|       |      else if constexpr (N == 89) {
  786|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  787|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  788|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  789|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  790|       |                p86, p87, p88] = t;
  791|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  792|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  793|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  794|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  795|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88);
  796|       |      }
  797|       |      else if constexpr (N == 90) {
  798|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  799|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  800|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  801|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  802|       |                p86, p87, p88, p89] = t;
  803|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  804|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  805|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  806|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  807|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89);
  808|       |      }
  809|       |      else if constexpr (N == 91) {
  810|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  811|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  812|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  813|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  814|       |                p86, p87, p88, p89, p90] = t;
  815|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  816|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  817|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  818|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  819|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90);
  820|       |      }
  821|       |      else if constexpr (N == 92) {
  822|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  823|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  824|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  825|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  826|       |                p86, p87, p88, p89, p90, p91] = t;
  827|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  828|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  829|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  830|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  831|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91);
  832|       |      }
  833|       |      else if constexpr (N == 93) {
  834|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  835|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  836|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  837|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  838|       |                p86, p87, p88, p89, p90, p91, p92] = t;
  839|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  840|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  841|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  842|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  843|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92);
  844|       |      }
  845|       |      else if constexpr (N == 94) {
  846|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  847|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  848|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  849|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  850|       |                p86, p87, p88, p89, p90, p91, p92, p93] = t;
  851|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  852|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  853|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  854|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  855|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93);
  856|       |      }
  857|       |      else if constexpr (N == 95) {
  858|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  859|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  860|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  861|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  862|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94] = t;
  863|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  864|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  865|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  866|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  867|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94);
  868|       |      }
  869|       |      else if constexpr (N == 96) {
  870|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  871|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  872|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  873|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  874|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95] = t;
  875|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  876|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  877|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  878|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  879|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95);
  880|       |      }
  881|       |      else if constexpr (N == 97) {
  882|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  883|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  884|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  885|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  886|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96] = t;
  887|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  888|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  889|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  890|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  891|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96);
  892|       |      }
  893|       |      else if constexpr (N == 98) {
  894|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  895|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  896|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  897|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  898|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97] = t;
  899|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  900|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  901|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  902|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  903|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  904|       |                         p97);
  905|       |      }
  906|       |      else if constexpr (N == 99) {
  907|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  908|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  909|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  910|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  911|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98] = t;
  912|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  913|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  914|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  915|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  916|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  917|       |                         p97, p98);
  918|       |      }
  919|       |      else if constexpr (N == 100) {
  920|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  921|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  922|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  923|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  924|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99] = t;
  925|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  926|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  927|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  928|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  929|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  930|       |                         p97, p98, p99);
  931|       |      }
  932|       |      else if constexpr (N == 101) {
  933|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  934|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  935|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  936|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  937|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100] = t;
  938|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  939|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  940|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  941|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  942|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  943|       |                         p97, p98, p99, p100);
  944|       |      }
  945|       |      else if constexpr (N == 102) {
  946|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  947|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  948|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  949|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  950|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101] = t;
  951|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  952|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  953|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  954|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  955|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  956|       |                         p97, p98, p99, p100, p101);
  957|       |      }
  958|       |      else if constexpr (N == 103) {
  959|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  960|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  961|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  962|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  963|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102] = t;
  964|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  965|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  966|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  967|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  968|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  969|       |                         p97, p98, p99, p100, p101, p102);
  970|       |      }
  971|       |      else if constexpr (N == 104) {
  972|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  973|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  974|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  975|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  976|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103] = t;
  977|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  978|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  979|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  980|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  981|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  982|       |                         p97, p98, p99, p100, p101, p102, p103);
  983|       |      }
  984|       |      else if constexpr (N == 105) {
  985|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  986|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
  987|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
  988|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
  989|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104] = t;
  990|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
  991|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
  992|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
  993|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
  994|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
  995|       |                         p97, p98, p99, p100, p101, p102, p103, p104);
  996|       |      }
  997|       |      else if constexpr (N == 106) {
  998|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
  999|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1000|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1001|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1002|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1003|       |                p105] = t;
 1004|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1005|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1006|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1007|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1008|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1009|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105);
 1010|       |      }
 1011|       |      else if constexpr (N == 107) {
 1012|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1013|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1014|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1015|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1016|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1017|       |                p105, p106] = t;
 1018|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1019|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1020|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1021|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1022|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1023|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106);
 1024|       |      }
 1025|       |      else if constexpr (N == 108) {
 1026|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1027|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1028|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1029|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1030|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1031|       |                p105, p106, p107] = t;
 1032|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1033|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1034|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1035|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1036|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1037|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107);
 1038|       |      }
 1039|       |      else if constexpr (N == 109) {
 1040|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1041|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1042|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1043|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1044|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1045|       |                p105, p106, p107, p108] = t;
 1046|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1047|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1048|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1049|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1050|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1051|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108);
 1052|       |      }
 1053|       |      else if constexpr (N == 110) {
 1054|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1055|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1056|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1057|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1058|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1059|       |                p105, p106, p107, p108, p109] = t;
 1060|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1061|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1062|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1063|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1064|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1065|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109);
 1066|       |      }
 1067|       |      else if constexpr (N == 111) {
 1068|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1069|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1070|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1071|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1072|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1073|       |                p105, p106, p107, p108, p109, p110] = t;
 1074|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1075|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1076|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1077|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1078|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1079|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110);
 1080|       |      }
 1081|       |      else if constexpr (N == 112) {
 1082|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1083|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1084|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1085|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1086|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1087|       |                p105, p106, p107, p108, p109, p110, p111] = t;
 1088|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1089|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1090|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1091|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1092|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1093|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111);
 1094|       |      }
 1095|       |      else if constexpr (N == 113) {
 1096|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1097|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1098|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1099|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1100|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1101|       |                p105, p106, p107, p108, p109, p110, p111, p112] = t;
 1102|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1103|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1104|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1105|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1106|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1107|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112);
 1108|       |      }
 1109|       |      else if constexpr (N == 114) {
 1110|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1111|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1112|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1113|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1114|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1115|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113] = t;
 1116|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1117|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1118|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1119|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1120|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1121|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1122|       |                         p113);
 1123|       |      }
 1124|       |      else if constexpr (N == 115) {
 1125|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1126|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1127|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1128|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1129|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1130|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114] = t;
 1131|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1132|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1133|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1134|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1135|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1136|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1137|       |                         p113, p114);
 1138|       |      }
 1139|       |      else if constexpr (N == 116) {
 1140|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1141|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1142|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1143|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1144|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1145|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115] = t;
 1146|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1147|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1148|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1149|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1150|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1151|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1152|       |                         p113, p114, p115);
 1153|       |      }
 1154|       |      else if constexpr (N == 117) {
 1155|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1156|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1157|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1158|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1159|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1160|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116] = t;
 1161|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1162|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1163|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1164|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1165|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1166|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1167|       |                         p113, p114, p115, p116);
 1168|       |      }
 1169|       |      else if constexpr (N == 118) {
 1170|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1171|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1172|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1173|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1174|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1175|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117] = t;
 1176|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1177|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1178|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1179|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1180|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1181|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1182|       |                         p113, p114, p115, p116, p117);
 1183|       |      }
 1184|       |      else if constexpr (N == 119) {
 1185|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1186|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1187|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1188|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1189|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1190|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118] = t;
 1191|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1192|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1193|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1194|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1195|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1196|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1197|       |                         p113, p114, p115, p116, p117, p118);
 1198|       |      }
 1199|       |      else if constexpr (N == 120) {
 1200|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1201|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1202|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1203|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1204|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1205|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119] = t;
 1206|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1207|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1208|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1209|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1210|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1211|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1212|       |                         p113, p114, p115, p116, p117, p118, p119);
 1213|       |      }
 1214|       |      else if constexpr (N == 121) {
 1215|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1216|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1217|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1218|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1219|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1220|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120] = t;
 1221|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1222|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1223|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1224|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1225|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1226|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1227|       |                         p113, p114, p115, p116, p117, p118, p119, p120);
 1228|       |      }
 1229|       |      else if constexpr (N == 122) {
 1230|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1231|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1232|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1233|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1234|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1235|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121] =
 1236|       |            t;
 1237|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1238|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1239|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1240|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1241|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1242|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1243|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121);
 1244|       |      }
 1245|       |      else if constexpr (N == 123) {
 1246|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1247|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1248|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1249|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1250|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1251|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121,
 1252|       |                p122] = t;
 1253|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1254|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1255|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1256|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1257|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1258|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1259|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121, p122);
 1260|       |      }
 1261|       |      else if constexpr (N == 124) {
 1262|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1263|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1264|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1265|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1266|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1267|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121,
 1268|       |                p122, p123] = t;
 1269|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1270|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1271|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1272|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1273|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1274|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1275|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123);
 1276|       |      }
 1277|       |      else if constexpr (N == 125) {
 1278|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1279|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1280|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1281|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1282|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1283|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121,
 1284|       |                p122, p123, p124] = t;
 1285|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1286|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1287|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1288|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1289|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1290|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1291|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124);
 1292|       |      }
 1293|       |      else if constexpr (N == 126) {
 1294|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1295|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1296|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1297|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1298|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1299|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121,
 1300|       |                p122, p123, p124, p125] = t;
 1301|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1302|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1303|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1304|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1305|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1306|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1307|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125);
 1308|       |      }
 1309|       |      else if constexpr (N == 127) {
 1310|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1311|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1312|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1313|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1314|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1315|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121,
 1316|       |                p122, p123, p124, p125, p126] = t;
 1317|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1318|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1319|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1320|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1321|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1322|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1323|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126);
 1324|       |      }
 1325|       |      else if constexpr (N == 128) {
 1326|       |         auto& [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22,
 1327|       |                p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43,
 1328|       |                p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64,
 1329|       |                p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85,
 1330|       |                p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104,
 1331|       |                p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121,
 1332|       |                p122, p123, p124, p125, p126, p127] = t;
 1333|       |         return glz::tie(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
 1334|       |                         p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39,
 1335|       |                         p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58,
 1336|       |                         p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77,
 1337|       |                         p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96,
 1338|       |                         p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112,
 1339|       |                         p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127);
 1340|       |      }
 1341|  25.1k|   }

_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_SD_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcSR_RPT_mSL_:
   20|   588k|   {
   21|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   22|   588k|      if (n > 15) {
  ------------------
  |  Branch (22:11): [True: 13.3k, False: 575k]
  ------------------
   23|  13.3k|         const __m128i quote_vec = _mm_set1_epi8('"');
   24|  13.3k|         const __m128i bs_vec = _mm_set1_epi8('\\');
   25|  13.3k|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   26|  13.3k|         const __m128i zero = _mm_setzero_si128();
   27|       |
   28|   193k|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (28:45): [True: 180k, False: 13.3k]
  ------------------
   29|   180k|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   30|   180k|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   31|       |
   32|   180k|            const uint32_t mask = static_cast<uint32_t>(
   33|   180k|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   34|   180k|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   35|       |
   36|   180k|            if (mask == 0) {
  ------------------
  |  Branch (36:17): [True: 171k, False: 8.70k]
  ------------------
   37|   171k|               data += 16;
   38|   171k|               c += 16;
   39|   171k|               continue;
   40|   171k|            }
   41|       |
   42|  8.70k|            const uint32_t length = countr_zero(mask);
   43|  8.70k|            c += length;
   44|  8.70k|            data += length;
   45|  8.70k|            write_escape();
   46|  8.70k|         }
   47|  13.3k|      }
   48|   588k|   }
_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_RKS9_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcST_RPT_mSN_:
   20|  1.41M|   {
   21|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   22|  1.41M|      if (n > 15) {
  ------------------
  |  Branch (22:11): [True: 653k, False: 765k]
  ------------------
   23|   653k|         const __m128i quote_vec = _mm_set1_epi8('"');
   24|   653k|         const __m128i bs_vec = _mm_set1_epi8('\\');
   25|   653k|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   26|   653k|         const __m128i zero = _mm_setzero_si128();
   27|       |
   28|  8.26M|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (28:45): [True: 7.61M, False: 653k]
  ------------------
   29|  7.61M|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   30|  7.61M|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   31|       |
   32|  7.61M|            const uint32_t mask = static_cast<uint32_t>(
   33|  7.61M|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   34|  7.61M|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   35|       |
   36|  7.61M|            if (mask == 0) {
  ------------------
  |  Branch (36:17): [True: 7.59M, False: 13.0k]
  ------------------
   37|  7.59M|               data += 16;
   38|  7.59M|               c += 16;
   39|  7.59M|               continue;
   40|  7.59M|            }
   41|       |
   42|  13.0k|            const uint32_t length = countr_zero(mask);
   43|  13.0k|            c += length;
   44|  13.0k|            data += length;
   45|  13.0k|            write_escape();
   46|  13.0k|         }
   47|   653k|      }
   48|  1.41M|   }

_ZN3glz4atoiITkNSt3__18integralEiKcQsr3stdE11is_signed_vIT_EEEbRS3_RPT0_:
  718|  7.79k|   {
  719|  7.79k|      using X = std::decay_t<T>;
  720|  7.79k|      using utype = std::make_unsigned_t<X>;
  721|       |
  722|  7.79k|      const uint8_t sign = *c == '-';
  723|  7.79k|      if (auto ptr = parse_int(v, reinterpret_cast<const uint8_t*>(c))) [[likely]] {
  ------------------
  |  Branch (723:16): [True: 7.68k, False: 109]
  ------------------
  724|  7.68k|         c = reinterpret_cast<const Char*>(ptr);
  725|  7.68k|         if (*c == 'e' || *c == 'E') {
  ------------------
  |  Branch (725:14): [True: 1.73k, False: 5.94k]
  |  Branch (725:27): [True: 1.11k, False: 4.83k]
  ------------------
  726|  2.85k|            ++c;
  727|  2.85k|         }
  728|  4.83k|         else {
  729|  4.83k|            if (*c == '.') [[unlikely]] {
  ------------------
  |  Branch (729:17): [True: 6, False: 4.82k]
  ------------------
  730|      6|               return false;
  731|      6|            }
  732|  4.82k|            return true;
  733|  4.83k|         }
  734|       |
  735|  2.85k|         c += (*c == '+');
  736|       |
  737|  2.85k|         if (not is_digit(*c)) [[unlikely]] {
  ------------------
  |  Branch (737:14): [True: 65, False: 2.78k]
  ------------------
  738|     65|            return false;
  739|     65|         }
  740|  2.78k|         const uint32_t exp = parse_exponent(c);
  741|       |         // As in the unsigned overload: only a non-zero magnitude can overflow, so "0e19" and
  742|       |         // "-0e19" are in range for every width. `v` is already the signed mantissa, and negative
  743|       |         // zero compares equal to zero, so both spellings land here with the value they should keep.
  744|       |         if constexpr (sizeof(T) == 1) {
  745|       |            if (exp > 2) [[unlikely]] {
  746|       |               return v == 0;
  747|       |            }
  748|       |         }
  749|       |         else if constexpr (sizeof(T) == 2) {
  750|       |            if (exp > 4) [[unlikely]] {
  751|       |               return v == 0;
  752|       |            }
  753|       |         }
  754|  2.78k|         else if constexpr (sizeof(T) == 4) {
  755|  2.78k|            if (exp > 9) [[unlikely]] {
  ------------------
  |  Branch (755:17): [True: 271, False: 2.51k]
  ------------------
  756|    271|               return v == 0;
  757|    271|            }
  758|       |         }
  759|       |         else {
  760|       |            if (exp > 18) [[unlikely]] {
  761|       |               return v == 0;
  762|       |            }
  763|       |         }
  764|       |
  765|  2.51k|         utype i = utype((utype(v) ^ -sign) + sign);
  766|  2.78k|         if constexpr (sizeof(T) < 8) {
  767|       |            // Scale in a width the product cannot wrap, then range check before narrowing. Scaling
  768|       |            // inside `utype` truncated first and checked afterwards, so an out-of-range magnitude
  769|       |            // aliased onto an accepted one: "13e2" read as 20 for int8_t and "5e9" as 705032704 for
  770|       |            // int32_t. The widest case here is a 4-byte magnitude scaled by 10^9, which stays well
  771|       |            // inside uint64_t. The unsigned path already widens the same way.
  772|  2.78k|            const uint64_t scaled = uint64_t(i) * powers_of_ten_int[exp];
  773|  2.78k|            v = T((utype(scaled) ^ -sign) + sign);
  774|       |            // Bound the magnitude directly rather than subtracting the sign from it: a negative
  775|       |            // zero makes `scaled - sign` underflow, and the old narrow expression only survived
  776|       |            // that because it promoted to int. A negative value may reach one past the positive
  777|       |            // limit, which is exactly INT_MIN's magnitude.
  778|  2.78k|            return scaled <= uint64_t((std::numeric_limits<T>::max)()) + sign;
  779|       |         }
  780|       |         else {
  781|       |            // Scale the sign-stripped magnitude `i`, not the two's-complement bit pattern of `v`:
  782|       |            // for a negative value that pattern is a huge unsigned number, so every negative
  783|       |            // 64-bit integer written with an exponent ("-1e2") overflowed and was rejected. The
  784|       |            // narrower branches above already scale `i`.
  785|       |#if defined(__SIZEOF_INT128__)
  786|       |            const __uint128_t res = __uint128_t(i) * powers_of_ten_int[exp];
  787|       |            v = T((uint64_t(res) ^ -sign) + sign);
  788|       |            // Compare the full 128-bit product. Narrowing it to 64 bits first would let an
  789|       |            // out-of-range magnitude alias onto an accepted one, e.g. 9e36 truncating into range.
  790|       |            return res <= __uint128_t(9223372036854775807ull + sign);
  791|       |#else
  792|       |            const auto res = full_multiplication(i, powers_of_ten_int[exp]);
  793|       |            v = T((uint64_t(res.low) ^ -sign) + sign);
  794|       |            return res.high == 0 && (uint64_t(res.low) <= (9223372036854775807ull + sign));
  795|       |#endif
  796|       |         }
  797|  2.78k|      }
  798|  2.89k|      return false;
  799|  7.79k|   }
_ZN3glz9parse_intITkNSt3__18integralEiQaasr3stdE11is_signed_vIT_ElestS2_Li8EEEPKhRS2_S4_:
  479|  7.79k|   {
  480|  7.79k|      const uint8_t sign = *c == '-';
  481|  7.79k|      c += sign;
  482|       |
  483|  7.79k|      if (is_digit(*c)) [[likely]] {
  ------------------
  |  Branch (483:11): [True: 7.71k, False: 81]
  ------------------
  484|  7.71k|         v = *c - '0';
  485|  7.71k|         ++c;
  486|  7.71k|      }
  487|     81|      else [[unlikely]] {
  488|     81|         return {};
  489|     81|      }
  490|       |
  491|  7.71k|      if (is_digit(*c)) {
  ------------------
  |  Branch (491:11): [True: 5.75k, False: 1.96k]
  ------------------
  492|  5.75k|         v = v * 10 + (*c - '0');
  493|  5.75k|         ++c;
  494|  5.75k|      }
  495|  1.96k|      else {
  496|  1.96k|         if (sign) {
  ------------------
  |  Branch (496:14): [True: 215, False: 1.74k]
  ------------------
  497|    215|            v = -v;
  498|    215|         }
  499|  1.96k|         return c;
  500|  1.96k|      }
  501|       |
  502|  5.75k|      if (c[-2] == '0') [[unlikely]] {
  ------------------
  |  Branch (502:11): [True: 1, False: 5.75k]
  ------------------
  503|      1|         return {};
  504|      1|      }
  505|       |
  506|  5.75k|      if constexpr (sizeof(T) > 1) {
  507|  5.75k|         if (is_digit(*c)) {
  ------------------
  |  Branch (507:14): [True: 5.10k, False: 648]
  ------------------
  508|  5.10k|            v = v * 10 + (*c - '0');
  509|  5.10k|            ++c;
  510|  5.10k|         }
  511|    648|         else {
  512|    648|            if (sign) {
  ------------------
  |  Branch (512:17): [True: 210, False: 438]
  ------------------
  513|    210|               v = -v;
  514|    210|            }
  515|    648|            return c;
  516|    648|         }
  517|       |
  518|  5.10k|         if (is_digit(*c)) {
  ------------------
  |  Branch (518:14): [True: 4.45k, False: 652]
  ------------------
  519|  4.45k|            v = v * 10 + (*c - '0');
  520|  4.45k|            ++c;
  521|  4.45k|         }
  522|    652|         else {
  523|    652|            if (sign) {
  ------------------
  |  Branch (523:17): [True: 213, False: 439]
  ------------------
  524|    213|               v = -v;
  525|    213|            }
  526|    652|            return c;
  527|    652|         }
  528|       |
  529|  4.45k|         if constexpr (sizeof(T) > 2) {
  530|  4.45k|            if (is_digit(*c)) {
  ------------------
  |  Branch (530:17): [True: 3.82k, False: 630]
  ------------------
  531|  3.82k|               v = v * 10 + (*c - '0');
  532|  3.82k|               ++c;
  533|  3.82k|            }
  534|    630|            else {
  535|    630|               if (sign) {
  ------------------
  |  Branch (535:20): [True: 208, False: 422]
  ------------------
  536|    208|                  v = -v;
  537|    208|               }
  538|    630|               return c;
  539|    630|            }
  540|       |
  541|  3.82k|            if (is_digit(*c)) {
  ------------------
  |  Branch (541:17): [True: 3.13k, False: 685]
  ------------------
  542|  3.13k|               v = v * 10 + (*c - '0');
  543|  3.13k|               ++c;
  544|  3.13k|            }
  545|    685|            else {
  546|    685|               if (sign) {
  ------------------
  |  Branch (546:20): [True: 205, False: 480]
  ------------------
  547|    205|                  v = -v;
  548|    205|               }
  549|    685|               return c;
  550|    685|            }
  551|       |
  552|  3.13k|            if (is_digit(*c)) {
  ------------------
  |  Branch (552:17): [True: 2.49k, False: 643]
  ------------------
  553|  2.49k|               v = v * 10 + (*c - '0');
  554|  2.49k|               ++c;
  555|  2.49k|            }
  556|    643|            else {
  557|    643|               if (sign) {
  ------------------
  |  Branch (557:20): [True: 222, False: 421]
  ------------------
  558|    222|                  v = -v;
  559|    222|               }
  560|    643|               return c;
  561|    643|            }
  562|       |
  563|  2.49k|            if (is_digit(*c)) {
  ------------------
  |  Branch (563:17): [True: 1.73k, False: 756]
  ------------------
  564|  1.73k|               v = v * 10 + (*c - '0');
  565|  1.73k|               ++c;
  566|  1.73k|            }
  567|    756|            else {
  568|    756|               if (sign) {
  ------------------
  |  Branch (568:20): [True: 199, False: 557]
  ------------------
  569|    199|                  v = -v;
  570|    199|               }
  571|    756|               return c;
  572|    756|            }
  573|       |
  574|  1.73k|            if (is_digit(*c)) {
  ------------------
  |  Branch (574:17): [True: 1.24k, False: 488]
  ------------------
  575|  1.24k|               v = v * 10 + (*c - '0');
  576|  1.24k|               ++c;
  577|  1.24k|            }
  578|    488|            else {
  579|    488|               if (sign) {
  ------------------
  |  Branch (579:20): [True: 197, False: 291]
  ------------------
  580|    197|                  v = -v;
  581|    197|               }
  582|    488|               return c;
  583|    488|            }
  584|       |
  585|       |            if constexpr (sizeof(T) > 4) {
  586|       |               if (is_digit(*c)) {
  587|       |                  v = v * 10 + (*c - '0');
  588|       |                  ++c;
  589|       |               }
  590|       |               else {
  591|       |                  if (sign) {
  592|       |                     v = -v;
  593|       |                  }
  594|       |                  return c;
  595|       |               }
  596|       |
  597|       |               if (is_digit(*c)) {
  598|       |                  v = v * 10 + (*c - '0');
  599|       |                  ++c;
  600|       |               }
  601|       |               else {
  602|       |                  if (sign) {
  603|       |                     v = -v;
  604|       |                  }
  605|       |                  return c;
  606|       |               }
  607|       |
  608|       |               if (is_digit(*c)) {
  609|       |                  v = v * 10 + (*c - '0');
  610|       |                  ++c;
  611|       |               }
  612|       |               else {
  613|       |                  if (sign) {
  614|       |                     v = -v;
  615|       |                  }
  616|       |                  return c;
  617|       |               }
  618|       |
  619|       |               if (is_digit(*c)) {
  620|       |                  v = v * 10 + (*c - '0');
  621|       |                  ++c;
  622|       |               }
  623|       |               else {
  624|       |                  if (sign) {
  625|       |                     v = -v;
  626|       |                  }
  627|       |                  return c;
  628|       |               }
  629|       |
  630|       |               if (is_digit(*c)) {
  631|       |                  v = v * 10 + (*c - '0');
  632|       |                  ++c;
  633|       |               }
  634|       |               else {
  635|       |                  if (sign) {
  636|       |                     v = -v;
  637|       |                  }
  638|       |                  return c;
  639|       |               }
  640|       |
  641|       |               if (is_digit(*c)) {
  642|       |                  v = v * 10 + (*c - '0');
  643|       |                  ++c;
  644|       |               }
  645|       |               else {
  646|       |                  if (sign) {
  647|       |                     v = -v;
  648|       |                  }
  649|       |                  return c;
  650|       |               }
  651|       |
  652|       |               if (is_digit(*c)) {
  653|       |                  v = v * 10 + (*c - '0');
  654|       |                  ++c;
  655|       |               }
  656|       |               else {
  657|       |                  if (sign) {
  658|       |                     v = -v;
  659|       |                  }
  660|       |                  return c;
  661|       |               }
  662|       |
  663|       |               if (is_digit(*c)) {
  664|       |                  v = v * 10 + (*c - '0');
  665|       |                  ++c;
  666|       |               }
  667|       |               else {
  668|       |                  if (sign) {
  669|       |                     v = -v;
  670|       |                  }
  671|       |                  return c;
  672|       |               }
  673|       |
  674|       |               if (is_digit(*c)) {
  675|       |                  v = v * 10 + (*c - '0');
  676|       |                  ++c;
  677|       |               }
  678|       |               else {
  679|       |                  if (sign) {
  680|       |                     v = -v;
  681|       |                  }
  682|       |                  return c;
  683|       |               }
  684|       |            }
  685|  1.24k|         }
  686|  4.45k|      }
  687|       |
  688|  5.75k|      if (is_digit(*c)) {
  ------------------
  |  Branch (688:11): [True: 649, False: 5.10k]
  ------------------
  689|    649|         if (sign) {
  ------------------
  |  Branch (689:14): [True: 231, False: 418]
  ------------------
  690|    231|            if (would_overflow_negative<T>(v, *c)) [[unlikely]] {
  ------------------
  |  Branch (690:17): [True: 13, False: 218]
  ------------------
  691|     13|               return {};
  692|     13|            }
  693|    218|            v = -1 * v;
  694|    218|            v = v * 10 - (*c - '0');
  695|    218|         }
  696|    418|         else {
  697|    418|            if (would_overflow_positive<T>(v, *c)) [[unlikely]] {
  ------------------
  |  Branch (697:17): [True: 13, False: 405]
  ------------------
  698|     13|               return {};
  699|     13|            }
  700|    405|            v = v * 10 + (*c - '0');
  701|    405|         }
  702|    623|         ++c;
  703|    623|         if (is_digit(*c)) [[unlikely]] {
  ------------------
  |  Branch (703:14): [True: 1, False: 622]
  ------------------
  704|      1|            return {};
  705|      1|         }
  706|    622|         return c;
  707|    623|      }
  708|       |
  709|  5.10k|      if (sign) {
  ------------------
  |  Branch (709:11): [True: 200, False: 4.90k]
  ------------------
  710|    200|         v = -v;
  711|    200|      }
  712|  5.10k|      return c;
  713|  5.75k|   }
_ZN3glz23would_overflow_negativeIiEEbu17__remove_volatileIT_Eh:
  154|    231|   {
  155|       |      // For negative: max magnitude is max + 1 (e.g., -2147483648 for int32)
  156|    231|      using U = std::remove_volatile_t<T>;
  157|    231|      constexpr auto max_val = static_cast<uint64_t>((std::numeric_limits<U>::max)()) + 1;
  158|    231|      constexpr auto threshold = max_val / 10;
  159|    231|      constexpr auto last_digit = max_val % 10;
  160|    231|      const auto uv = static_cast<uint64_t>(v);
  161|    231|      const auto digit = static_cast<uint64_t>(next_digit - '0');
  162|       |      // When digit > last_digit, effective threshold is one less
  163|    231|      return uv > (threshold - uint64_t(digit > last_digit));
  164|    231|   }
_ZN3glz23would_overflow_positiveIiEEbu17__remove_volatileIT_Eh:
  140|    418|   {
  141|    418|      using U = std::remove_volatile_t<T>;
  142|    418|      constexpr auto max_val = static_cast<uint64_t>((std::numeric_limits<U>::max)());
  143|    418|      constexpr auto threshold = max_val / 10;
  144|    418|      constexpr auto last_digit = max_val % 10;
  145|    418|      const auto uv = static_cast<uint64_t>(v);
  146|    418|      const auto digit = static_cast<uint64_t>(next_digit - '0');
  147|       |      // When digit > last_digit, effective threshold is one less
  148|       |      // This is branch-free and faster than bitwise OR/AND approach
  149|    418|      return uv > (threshold - uint64_t(digit > last_digit));
  150|    418|   }
_ZN3glz8is_digitEh:
  106|  10.7M|   GLZ_ALWAYS_INLINE constexpr bool is_digit(const uint8_t c) noexcept { return c <= '9' && c >= '0'; }
  ------------------
  |  Branch (106:81): [True: 10.5M, False: 286k]
  |  Branch (106:93): [True: 9.86M, False: 635k]
  ------------------
_ZN3glz14parse_exponentIKcEEjRPT_:
  124|  5.88k|   {
  125|  5.88k|      uint32_t exp = uint32_t(*c - '0');
  126|  5.88k|      ++c;
  127|  7.79k|      while (is_digit(*c)) {
  ------------------
  |  Branch (127:14): [True: 1.91k, False: 5.88k]
  ------------------
  128|       |         // Written as a select rather than a branch: the clamp only ever engages on absurdly long
  129|       |         // exponents, so a branch here would be a mispredict risk on the path that matters.
  130|  1.91k|         exp = exp < exponent_clamp ? exp * 10 + uint32_t(*c - '0') : exp;
  ------------------
  |  Branch (130:16): [True: 1.31k, False: 598]
  ------------------
  131|  1.91k|         ++c;
  132|  1.91k|      }
  133|  5.88k|      return exp;
  134|  5.88k|   }
_ZN3glz4atoiITkNSt3__18integralEmKcQsr3stdE13is_unsigned_vIT_EEEbRS3_RPT0_:
  400|  13.7k|   {
  401|  13.7k|      if (auto ptr = parse_int(v, reinterpret_cast<const uint8_t*>(c))) [[likely]] {
  ------------------
  |  Branch (401:16): [True: 13.5k, False: 220]
  ------------------
  402|  13.5k|         c = reinterpret_cast<const Char*>(ptr);
  403|  13.5k|         if (*c == 'e' || *c == 'E') {
  ------------------
  |  Branch (403:14): [True: 700, False: 12.8k]
  |  Branch (403:27): [True: 2.47k, False: 10.3k]
  ------------------
  404|  3.17k|            ++c;
  405|  3.17k|         }
  406|  10.3k|         else {
  407|  10.3k|            if (*c == '.') [[unlikely]] {
  ------------------
  |  Branch (407:17): [True: 4, False: 10.3k]
  ------------------
  408|      4|               return false;
  409|      4|            }
  410|  10.3k|            return true;
  411|  10.3k|         }
  412|       |
  413|  3.17k|         c += (*c == '+');
  414|       |
  415|  3.17k|         if (not is_digit(*c)) [[unlikely]] {
  ------------------
  |  Branch (415:14): [True: 79, False: 3.09k]
  ------------------
  416|     79|            return false;
  417|     79|         }
  418|  3.09k|         const uint32_t exp = parse_exponent(c);
  419|       |         // An exponent past the width's limit overflows any non-zero magnitude, but zero stays zero
  420|       |         // however far it is scaled, so "0e19" is in range for every width. Testing the magnitude
  421|       |         // here rather than ahead of the dispatch keeps it off the hot path: it only runs once the
  422|       |         // exponent has already failed the range check.
  423|       |         if constexpr (sizeof(T) == 1) {
  424|       |            if (exp > 2) [[unlikely]] {
  425|       |               return v == 0;
  426|       |            }
  427|       |         }
  428|       |         else if constexpr (sizeof(T) == 2) {
  429|       |            if (exp > 4) [[unlikely]] {
  430|       |               return v == 0;
  431|       |            }
  432|       |         }
  433|       |         else if constexpr (sizeof(T) == 4) {
  434|       |            if (exp > 9) [[unlikely]] {
  435|       |               return v == 0;
  436|       |            }
  437|       |         }
  438|  3.09k|         else {
  439|  3.09k|            if (exp > 19) [[unlikely]] {
  ------------------
  |  Branch (439:17): [True: 330, False: 2.76k]
  ------------------
  440|    330|               return v == 0;
  441|    330|            }
  442|  3.09k|         }
  443|       |
  444|       |         if constexpr (sizeof(T) == 1) {
  445|       |            static constexpr std::array<uint8_t, 3> powers_of_ten{1, 10, 100};
  446|       |            const uint64_t i = v * powers_of_ten[exp];
  447|       |            v = T(i);
  448|       |            return i <= (std::numeric_limits<T>::max)();
  449|       |         }
  450|       |         else if constexpr (sizeof(T) == 2) {
  451|       |            static constexpr std::array<uint16_t, 5> powers_of_ten{1, 10, 100, 1000, 10000};
  452|       |            const uint64_t i = v * powers_of_ten[exp];
  453|       |            v = T(i);
  454|       |            return i <= (std::numeric_limits<T>::max)();
  455|       |         }
  456|       |         else if constexpr (sizeof(T) < 8) {
  457|       |            const uint64_t i = v * powers_of_ten_int[exp];
  458|       |            v = T(i);
  459|       |            return i <= (std::numeric_limits<T>::max)();
  460|       |         }
  461|  3.09k|         else {
  462|  3.09k|#if defined(__SIZEOF_INT128__)
  463|  3.09k|            const __uint128_t res = __uint128_t(v) * powers_of_ten_int[exp];
  464|  3.09k|            v = T(res);
  465|  3.09k|            return res <= (std::numeric_limits<T>::max)();
  466|       |#else
  467|       |            const auto res = full_multiplication(v, powers_of_ten_int[exp]);
  468|       |            v = T(res.low);
  469|       |            return res.high == 0;
  470|       |#endif
  471|  3.09k|         }
  472|  3.09k|      }
  473|  3.31k|      return false;
  474|  13.7k|   }
_ZN3glz9parse_intITkNSt3__18integralEmQaasr3stdE13is_unsigned_vIT_ElestS2_Li8EEEPKhRS2_S4_:
  215|  13.7k|   {
  216|  13.7k|      if (is_digit(*c)) [[likely]] {
  ------------------
  |  Branch (216:11): [True: 13.6k, False: 143]
  ------------------
  217|  13.6k|         v = *c - '0';
  218|  13.6k|         ++c;
  219|  13.6k|      }
  220|    143|      else [[unlikely]] {
  221|    143|         return {};
  222|    143|      }
  223|       |
  224|  13.6k|      if (is_digit(*c)) {
  ------------------
  |  Branch (224:11): [True: 10.6k, False: 2.95k]
  ------------------
  225|  10.6k|         v = v * 10 + (*c - '0');
  226|  10.6k|         ++c;
  227|  10.6k|      }
  228|  2.95k|      else {
  229|  2.95k|         return c;
  230|  2.95k|      }
  231|       |
  232|  10.6k|      if (c[-2] == '0') [[unlikely]] {
  ------------------
  |  Branch (232:11): [True: 1, False: 10.6k]
  ------------------
  233|      1|         return {};
  234|      1|      }
  235|       |
  236|  10.6k|      if constexpr (sizeof(T) > 1) {
  237|  10.6k|         if (is_digit(*c)) {
  ------------------
  |  Branch (237:14): [True: 10.1k, False: 553]
  ------------------
  238|  10.1k|            v = v * 10 + (*c - '0');
  239|  10.1k|            ++c;
  240|  10.1k|         }
  241|    553|         else {
  242|    553|            return c;
  243|    553|         }
  244|       |
  245|  10.1k|         if (is_digit(*c)) {
  ------------------
  |  Branch (245:14): [True: 9.52k, False: 589]
  ------------------
  246|  9.52k|            v = v * 10 + (*c - '0');
  247|  9.52k|            ++c;
  248|  9.52k|         }
  249|    589|         else {
  250|    589|            return c;
  251|    589|         }
  252|       |
  253|  9.52k|         if constexpr (sizeof(T) > 2) {
  254|  9.52k|            if (is_digit(*c)) {
  ------------------
  |  Branch (254:17): [True: 8.90k, False: 624]
  ------------------
  255|  8.90k|               v = v * 10 + (*c - '0');
  256|  8.90k|               ++c;
  257|  8.90k|            }
  258|    624|            else {
  259|    624|               return c;
  260|    624|            }
  261|       |
  262|  8.90k|            if (is_digit(*c)) {
  ------------------
  |  Branch (262:17): [True: 8.28k, False: 613]
  ------------------
  263|  8.28k|               v = v * 10 + (*c - '0');
  264|  8.28k|               ++c;
  265|  8.28k|            }
  266|    613|            else {
  267|    613|               return c;
  268|    613|            }
  269|       |
  270|  8.28k|            if (is_digit(*c)) {
  ------------------
  |  Branch (270:17): [True: 7.68k, False: 601]
  ------------------
  271|  7.68k|               v = v * 10 + (*c - '0');
  272|  7.68k|               ++c;
  273|  7.68k|            }
  274|    601|            else {
  275|    601|               return c;
  276|    601|            }
  277|       |
  278|  7.68k|            if (is_digit(*c)) {
  ------------------
  |  Branch (278:17): [True: 7.22k, False: 462]
  ------------------
  279|  7.22k|               v = v * 10 + (*c - '0');
  280|  7.22k|               ++c;
  281|  7.22k|            }
  282|    462|            else {
  283|    462|               return c;
  284|    462|            }
  285|       |
  286|  7.22k|            if (is_digit(*c)) {
  ------------------
  |  Branch (286:17): [True: 6.71k, False: 508]
  ------------------
  287|  6.71k|               v = v * 10 + (*c - '0');
  288|  6.71k|               ++c;
  289|  6.71k|            }
  290|    508|            else {
  291|    508|               return c;
  292|    508|            }
  293|       |
  294|  6.71k|            if constexpr (sizeof(T) > 4) {
  295|  6.71k|               if (is_digit(*c)) {
  ------------------
  |  Branch (295:20): [True: 6.17k, False: 544]
  ------------------
  296|  6.17k|                  v = v * 10 + (*c - '0');
  297|  6.17k|                  ++c;
  298|  6.17k|               }
  299|    544|               else {
  300|    544|                  return c;
  301|    544|               }
  302|       |
  303|  6.17k|               if (is_digit(*c)) {
  ------------------
  |  Branch (303:20): [True: 5.57k, False: 598]
  ------------------
  304|  5.57k|                  v = v * 10 + (*c - '0');
  305|  5.57k|                  ++c;
  306|  5.57k|               }
  307|    598|               else {
  308|    598|                  return c;
  309|    598|               }
  310|       |
  311|  5.57k|               if (is_digit(*c)) {
  ------------------
  |  Branch (311:20): [True: 5.11k, False: 458]
  ------------------
  312|  5.11k|                  v = v * 10 + (*c - '0');
  313|  5.11k|                  ++c;
  314|  5.11k|               }
  315|    458|               else {
  316|    458|                  return c;
  317|    458|               }
  318|       |
  319|  5.11k|               if (is_digit(*c)) {
  ------------------
  |  Branch (319:20): [True: 4.56k, False: 556]
  ------------------
  320|  4.56k|                  v = v * 10 + (*c - '0');
  321|  4.56k|                  ++c;
  322|  4.56k|               }
  323|    556|               else {
  324|    556|                  return c;
  325|    556|               }
  326|       |
  327|  4.56k|               if (is_digit(*c)) {
  ------------------
  |  Branch (327:20): [True: 3.97k, False: 589]
  ------------------
  328|  3.97k|                  v = v * 10 + (*c - '0');
  329|  3.97k|                  ++c;
  330|  3.97k|               }
  331|    589|               else {
  332|    589|                  return c;
  333|    589|               }
  334|       |
  335|  3.97k|               if (is_digit(*c)) {
  ------------------
  |  Branch (335:20): [True: 3.44k, False: 528]
  ------------------
  336|  3.44k|                  v = v * 10 + (*c - '0');
  337|  3.44k|                  ++c;
  338|  3.44k|               }
  339|    528|               else {
  340|    528|                  return c;
  341|    528|               }
  342|       |
  343|  3.44k|               if (is_digit(*c)) {
  ------------------
  |  Branch (343:20): [True: 2.98k, False: 462]
  ------------------
  344|  2.98k|                  v = v * 10 + (*c - '0');
  345|  2.98k|                  ++c;
  346|  2.98k|               }
  347|    462|               else {
  348|    462|                  return c;
  349|    462|               }
  350|       |
  351|  2.98k|               if (is_digit(*c)) {
  ------------------
  |  Branch (351:20): [True: 2.39k, False: 592]
  ------------------
  352|  2.39k|                  v = v * 10 + (*c - '0');
  353|  2.39k|                  ++c;
  354|  2.39k|               }
  355|    592|               else {
  356|    592|                  return c;
  357|    592|               }
  358|       |
  359|  2.39k|               if (is_digit(*c)) {
  ------------------
  |  Branch (359:20): [True: 1.91k, False: 474]
  ------------------
  360|  1.91k|                  v = v * 10 + (*c - '0');
  361|  1.91k|                  ++c;
  362|  1.91k|               }
  363|    474|               else {
  364|    474|                  return c;
  365|    474|               }
  366|       |
  367|  1.91k|               if (is_digit(*c)) {
  ------------------
  |  Branch (367:20): [True: 1.37k, False: 545]
  ------------------
  368|  1.37k|                  v = v * 10 + (*c - '0');
  369|  1.37k|                  ++c;
  370|  1.37k|               }
  371|    545|               else {
  372|    545|                  return c;
  373|    545|               }
  374|  1.91k|            }
  375|  6.71k|         }
  376|  9.52k|      }
  377|       |
  378|  10.6k|      if (is_digit(*c)) {
  ------------------
  |  Branch (378:11): [True: 795, False: 9.87k]
  ------------------
  379|       |         // Test before multiplying. The previous guard multiplied first and then compared the
  380|       |         // already-wrapped value against max/10 - 10, which only caught wraps that happened to land
  381|       |         // below that threshold: "300" wraps to 44 for uint8_t and sailed through, as did most
  382|       |         // out-of-range values. would_overflow_positive is the same branch-free check the signed
  383|       |         // path above already uses, so the two paths now reject on the same rule.
  384|    795|         if (would_overflow_positive<T>(v, *c)) [[unlikely]] {
  ------------------
  |  Branch (384:14): [True: 73, False: 722]
  ------------------
  385|     73|            return {};
  386|     73|         }
  387|    722|         v = v * 10 + (*c - '0');
  388|    722|         ++c;
  389|    722|         if (is_digit(*c)) [[unlikely]] {
  ------------------
  |  Branch (389:14): [True: 3, False: 719]
  ------------------
  390|      3|            return {};
  391|      3|         }
  392|    722|      }
  393|       |
  394|  10.5k|      return c;
  395|  10.6k|   }
_ZN3glz23would_overflow_positiveImEEbu17__remove_volatileIT_Eh:
  140|    795|   {
  141|    795|      using U = std::remove_volatile_t<T>;
  142|    795|      constexpr auto max_val = static_cast<uint64_t>((std::numeric_limits<U>::max)());
  143|    795|      constexpr auto threshold = max_val / 10;
  144|    795|      constexpr auto last_digit = max_val % 10;
  145|    795|      const auto uv = static_cast<uint64_t>(v);
  146|    795|      const auto digit = static_cast<uint64_t>(next_digit - '0');
  147|       |      // When digit > last_digit, effective threshold is one less
  148|       |      // This is branch-free and faster than bitwise OR/AND approach
  149|    795|      return uv > (threshold - uint64_t(digit > last_digit));
  150|    795|   }

_ZN3glz9has_quoteEm:
   86|  40.6M|   {
   87|  40.6M|      return has_zero(chunk ^ repeat_byte8('"'));
   88|  40.6M|   }
_ZN3glz8has_zeroEm:
   81|  42.3M|   {
   82|  42.3M|      return (((chunk - 0x0101010101010101ull) & ~chunk) & 0x8080808080808080ull);
   83|  42.3M|   }
_ZN3glz11countr_zeroEm:
   29|  9.87M|   {
   30|       |#ifdef _MSC_VER
   31|       |      return std::countr_zero(x);
   32|       |#else
   33|  9.87M|#if __has_builtin(__builtin_ctzll)
   34|  9.87M|      return __builtin_ctzll(x);
   35|       |#else
   36|       |      return std::countr_zero(x);
   37|       |#endif
   38|  9.87M|#endif
   39|  9.87M|   }
_ZN3glz11countr_zeroEj:
   16|  21.7k|   {
   17|       |#ifdef _MSC_VER
   18|       |      return std::countr_zero(x);
   19|       |#else
   20|  21.7k|#if __has_builtin(__builtin_ctzl)
   21|  21.7k|      return __builtin_ctzl(x);
   22|       |#else
   23|       |      return std::countr_zero(x);
   24|       |#endif
   25|  21.7k|#endif
   26|  21.7k|   }
_ZN3glz8has_charILc47EEEmm:
  102|  1.66M|   {
  103|  1.66M|      return has_zero(chunk ^ repeat_byte8(Char));
  104|  1.66M|   }

_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc110ELc117ELc108ELc108EEEETnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_E1SELm4EcEEbPKSB_:
  245|   202k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|   202k|      else if constexpr (N == 4) {
  286|   202k|         static constexpr auto packed = pack<Str, 4>();
  287|   202k|         uint32_t in;
  288|   202k|         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|   202k|         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|   202k|   }
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm0ERS3_JETkNS_10is_contextERNS_7contextERPKcS9_Qoo14glaze_object_tIT0_E11reflectableISA_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm2EcEEbPKT1_:
  245|  7.97k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|       |      else if constexpr (N == 4) {
  286|       |         static constexpr auto packed = pack<Str, 4>();
  287|       |         uint32_t in;
  288|       |         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|       |         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|  7.97k|      else if constexpr (N == 2) {
  304|  7.97k|         static constexpr auto packed = pack<Str, 2>();
  305|  7.97k|         uint16_t in;
  306|  7.97k|         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|  7.97k|         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|  7.97k|   }
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm1ERS3_JETkNS_10is_contextERNS_7contextERPKcS9_Qoo14glaze_object_tIT0_E11reflectableISA_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm2EcEEbPKT1_:
  245|  8.93k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|       |      else if constexpr (N == 4) {
  286|       |         static constexpr auto packed = pack<Str, 4>();
  287|       |         uint32_t in;
  288|       |         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|       |         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|  8.93k|      else if constexpr (N == 2) {
  304|  8.93k|         static constexpr auto packed = pack<Str, 2>();
  305|  8.93k|         uint16_t in;
  306|  8.93k|         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|  8.93k|         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|  8.93k|   }
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm2ERS3_JETkNS_10is_contextERNS_7contextERPKcS9_Qoo14glaze_object_tIT0_E11reflectableISA_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_:
  245|  2.27k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|  2.27k|      else if constexpr (N == 6) {
  268|  2.27k|         static constexpr auto packed = pack_buffered<Str, 8>();
  269|  2.27k|         uint64_t in{};
  270|  2.27k|         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|  2.27k|         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|       |      else if constexpr (N == 4) {
  286|       |         static constexpr auto packed = pack<Str, 4>();
  287|       |         uint32_t in;
  288|       |         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|       |         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|  2.27k|   }
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structLm3ERS3_JETkNS_10is_contextERNS_7contextERPKcS9_Qoo14glaze_object_tIT0_E11reflectableISA_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm4EcEEbPKT1_:
  245|  7.63k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|  7.63k|      else if constexpr (N == 4) {
  286|  7.63k|         static constexpr auto packed = pack<Str, 4>();
  287|  7.63k|         uint32_t in;
  288|  7.63k|         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|  7.63k|         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|  7.63k|   }
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc117ELc108ELc108EEEETnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSA_EEvOT1_OT2_T3_E1SELm3EcEEbPKSC_:
  245|  69.1k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|       |      else if constexpr (N == 4) {
  286|       |         static constexpr auto packed = pack<Str, 4>();
  287|       |         uint32_t in;
  288|       |         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|       |         return (in == packed);
  293|       |      }
  294|  69.1k|      else if constexpr (N == 3) {
  295|  69.1k|         static constexpr auto packed = pack<Str, 2>();
  296|  69.1k|         uint16_t in;
  297|  69.1k|         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|  69.1k|         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|  69.1k|   }
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc97ELc108ELc115ELc101EEEETnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSA_EEvOT1_OT2_T3_E1SELm4EcEEbPKSC_:
  245|   385k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|   385k|      else if constexpr (N == 4) {
  286|   385k|         static constexpr auto packed = pack<Str, 4>();
  287|   385k|         uint32_t in;
  288|   385k|         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|   385k|         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|   385k|   }
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc114ELc117ELc101EEEETnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSA_EEvOT1_OT2_T3_E1SELm3EcEEbPKSC_:
  245|  81.3k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|       |      else if constexpr (N == 4) {
  286|       |         static constexpr auto packed = pack<Str, 4>();
  287|       |         uint32_t in;
  288|       |         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|       |         return (in == packed);
  293|       |      }
  294|  81.3k|      else if constexpr (N == 3) {
  295|  81.3k|         static constexpr auto packed = pack<Str, 2>();
  296|  81.3k|         uint16_t in;
  297|  81.3k|         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|  81.3k|         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|  81.3k|   }
_ZN3glz10comparitorIL_ZZNS_6detail13match_literalITnNS_14string_literalEXtlNS3_ILm5EEEtlA5_cLc110ELc117ELc108ELc108EEEETkNS_10is_contextERNS_7contextERPKcS9_EEbOT0_OT1_T2_E1sELm4EcEEbPKSD_:
  245|   134k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|   134k|      else if constexpr (N == 4) {
  286|   134k|         static constexpr auto packed = pack<Str, 4>();
  287|   134k|         uint32_t in;
  288|   134k|         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|   134k|         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|   134k|   }
_ZN3glz10comparitorIL_ZZNS_6detail13match_literalITnNS_14string_literalEXtlNS3_ILm5EEEtlA5_cLc116ELc114ELc117ELc101EEEETkNS_10is_contextERNS_7contextERPKcS9_EEbOT0_OT1_T2_E1sELm4EcEEbPKSD_:
  245|   162k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|       |      else if constexpr (N == 5) {
  277|       |         static constexpr auto packed = pack<Str, 4>();
  278|       |         uint32_t in;
  279|       |         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|       |         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|   162k|      else if constexpr (N == 4) {
  286|   162k|         static constexpr auto packed = pack<Str, 4>();
  287|   162k|         uint32_t in;
  288|   162k|         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|   162k|         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|   162k|   }
_ZN3glz10comparitorIL_ZZNS_6detail13match_literalITnNS_14string_literalEXtlNS3_ILm6EEEtlA6_cLc102ELc97ELc108ELc115ELc101EEEETkNS_10is_contextERNS_7contextERPKcS9_EEbOT0_OT1_T2_E1sELm5EcEEbPKSD_:
  245|   752k|   {
  246|       |      // pack() builds values in little-endian order (byte 0 in LSB position).
  247|       |      // On big-endian systems, memcpy produces native (big-endian) values,
  248|       |      // so we need to byteswap to match the packed representation.
  249|       |      if constexpr (N == 8) {
  250|       |         static constexpr auto packed = pack<Str, 8>();
  251|       |         uint64_t in;
  252|       |         std::memcpy(&in, other, 8);
  253|       |         if constexpr (std::endian::native == std::endian::big) {
  254|       |            in = std::byteswap(in);
  255|       |         }
  256|       |         return (in == packed);
  257|       |      }
  258|       |      else if constexpr (N == 7) {
  259|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  260|       |         uint64_t in{};
  261|       |         std::memcpy(&in, other, 7);
  262|       |         if constexpr (std::endian::native == std::endian::big) {
  263|       |            in = std::byteswap(in);
  264|       |         }
  265|       |         return (in == packed);
  266|       |      }
  267|       |      else if constexpr (N == 6) {
  268|       |         static constexpr auto packed = pack_buffered<Str, 8>();
  269|       |         uint64_t in{};
  270|       |         std::memcpy(&in, other, 6);
  271|       |         if constexpr (std::endian::native == std::endian::big) {
  272|       |            in = std::byteswap(in);
  273|       |         }
  274|       |         return (in == packed);
  275|       |      }
  276|   752k|      else if constexpr (N == 5) {
  277|   752k|         static constexpr auto packed = pack<Str, 4>();
  278|   752k|         uint32_t in;
  279|   752k|         std::memcpy(&in, other, 4);
  280|       |         if constexpr (std::endian::native == std::endian::big) {
  281|       |            in = std::byteswap(in);
  282|       |         }
  283|   752k|         return (in == packed) & (Str[4] == other[4]);
  284|       |      }
  285|       |      else if constexpr (N == 4) {
  286|       |         static constexpr auto packed = pack<Str, 4>();
  287|       |         uint32_t in;
  288|       |         std::memcpy(&in, other, 4);
  289|       |         if constexpr (std::endian::native == std::endian::big) {
  290|       |            in = std::byteswap(in);
  291|       |         }
  292|       |         return (in == packed);
  293|       |      }
  294|       |      else if constexpr (N == 3) {
  295|       |         static constexpr auto packed = pack<Str, 2>();
  296|       |         uint16_t in;
  297|       |         std::memcpy(&in, other, 2);
  298|       |         if constexpr (std::endian::native == std::endian::big) {
  299|       |            in = std::byteswap(in);
  300|       |         }
  301|       |         return (in == packed) & (Str[2] == other[2]);
  302|       |      }
  303|       |      else if constexpr (N == 2) {
  304|       |         static constexpr auto packed = pack<Str, 2>();
  305|       |         uint16_t in;
  306|       |         std::memcpy(&in, other, 2);
  307|       |         if constexpr (std::endian::native == std::endian::big) {
  308|       |            in = std::byteswap(in);
  309|       |         }
  310|       |         return (in == packed);
  311|       |      }
  312|       |      else if constexpr (N == 1) {
  313|       |         return Str[0] == other[0];
  314|       |      }
  315|       |      else if constexpr (N == 0) {
  316|       |         return true;
  317|       |      }
  318|       |      else {
  319|       |         // Clang and GCC optimize this extremely well for constexpr std::string_view
  320|       |         // Packing data can create more binary on GCC
  321|       |         // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp
  322|       |         return 0 == std::memcmp(Str.data(), other, N);
  323|       |      }
  324|   752k|   }

_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvNS1_17basic_string_viewIcS4_EERT0_Rm:
  192|  4.89M|   {
  193|  4.89M|      const auto n = str.size();
  194|  4.89M|      if constexpr (vector_like<B>) {
  195|  4.89M|         if constexpr (Checked) {
  196|  4.89M|            const auto k = ix + n;
  197|  4.89M|            if (ix + n > b.size()) [[unlikely]] {
  ------------------
  |  Branch (197:17): [True: 297, False: 4.89M]
  ------------------
  198|    297|               grow_buffer(b, k);
  199|    297|            }
  200|  4.89M|         }
  201|  4.89M|      }
  202|  4.89M|      std::memcpy(&b[ix], str.data(), n);
  203|  4.89M|      ix += n;
  204|  4.89M|   }
_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10byte_sizedEcEEvT1_RT0_Rm:
  150|  24.9M|   {
  151|  24.9M|      if constexpr (Checked && vector_like<B>) {
  152|  24.9M|         if (ix == b.size()) [[unlikely]] {
  ------------------
  |  Branch (152:14): [True: 661, False: 24.9M]
  ------------------
  153|    661|            grow_buffer(b, b.size() == 0 ? 64 : ix + 1);
  ------------------
  |  Branch (153:28): [True: 0, False: 661]
  ------------------
  154|    661|         }
  155|  24.9M|      }
  156|  24.9M|      assign_maybe_cast(c, b, ix);
  157|  24.9M|      ++ix;
  158|  24.9M|   }
_ZN3glz17assign_maybe_castITkNS_10byte_sizedEcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvT_RT0_Rm:
   95|  34.2M|   {
   96|  34.2M|      using V = std::decay_t<decltype(b[0])>;
   97|  34.2M|      using C = std::decay_t<decltype(c)>;
   98|  34.2M|      if constexpr (std::same_as<V, C>) {
   99|  34.2M|         b[ix] = c;
  100|       |      }
  101|       |      else {
  102|       |         b[ix] = static_cast<V>(c);
  103|       |      }
  104|  34.2M|   }
_ZN3glz4dumpILb0ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvNS1_17basic_string_viewIcS4_EERT0_Rm:
  192|  2.95M|   {
  193|  2.95M|      const auto n = str.size();
  194|  2.95M|      if constexpr (vector_like<B>) {
  195|       |         if constexpr (Checked) {
  196|       |            const auto k = ix + n;
  197|       |            if (ix + n > b.size()) [[unlikely]] {
  198|       |               grow_buffer(b, k);
  199|       |            }
  200|       |         }
  201|  2.95M|      }
  202|  2.95M|      std::memcpy(&b[ix], str.data(), n);
  203|  2.95M|      ix += n;
  204|  2.95M|   }
_ZN3glz4dumpILb0ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10byte_sizedEcEEvT1_RT0_Rm:
  150|  9.25M|   {
  151|       |      if constexpr (Checked && vector_like<B>) {
  152|       |         if (ix == b.size()) [[unlikely]] {
  153|       |            grow_buffer(b, b.size() == 0 ? 64 : ix + 1);
  154|       |         }
  155|       |      }
  156|  9.25M|      assign_maybe_cast(c, b, ix);
  157|  9.25M|      ++ix;
  158|  9.25M|   }
_ZN3glz5dumpnINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10byte_sizedEcEEvT0_mRT_Rm:
  222|  5.27M|   {
  223|  5.27M|      if constexpr (vector_like<B>) {
  224|  5.27M|         const auto k = ix + n;
  225|  5.27M|         if (k > b.size()) [[unlikely]] {
  ------------------
  |  Branch (225:14): [True: 1.88k, False: 5.27M]
  ------------------
  226|  1.88k|            grow_buffer(b, k);
  227|  1.88k|         }
  228|  5.27M|      }
  229|  5.27M|      fill_bytes(data_at(b, ix), c, n);
  230|  5.27M|      ix += n;
  231|  5.27M|   }
_ZN3glz10fill_bytesIcEEvPT_cm:
   54|  5.27M|   {
   55|  5.27M|      auto* p = reinterpret_cast<char*>(dst);
   56|  5.27M|      if (n >= 64) [[unlikely]] {
  ------------------
  |  Branch (56:11): [True: 2.44M, False: 2.82M]
  ------------------
   57|  2.44M|         std::memset(p, c, n);
   58|  2.44M|         return;
   59|  2.44M|      }
   60|  2.82M|      const uint64_t v = 0x0101010101010101ull * uint8_t(c);
   61|  2.82M|      if (n >= 8) {
  ------------------
  |  Branch (61:11): [True: 1.54M, False: 1.28M]
  ------------------
   62|  1.54M|         size_t i = 0;
   63|  6.02M|         for (; i + 8 <= n; i += 8) {
  ------------------
  |  Branch (63:17): [True: 4.47M, False: 1.54M]
  ------------------
   64|  4.47M|            std::memcpy(p + i, &v, 8);
   65|  4.47M|         }
   66|  1.54M|         if (i < n) {
  ------------------
  |  Branch (66:14): [True: 1.44M, False: 103k]
  ------------------
   67|  1.44M|            std::memcpy(p + n - 8, &v, 8); // overlaps what is already written, stays within n
   68|  1.44M|         }
   69|  1.54M|      }
   70|  1.28M|      else if (n >= 4) {
  ------------------
  |  Branch (70:16): [True: 493k, False: 789k]
  ------------------
   71|   493k|         std::memcpy(p, &v, 4);
   72|   493k|         std::memcpy(p + n - 4, &v, 4);
   73|   493k|      }
   74|   789k|      else if (n) {
  ------------------
  |  Branch (74:16): [True: 782k, False: 6.84k]
  ------------------
   75|   782k|         std::memcpy(p, &v, 1);
   76|   782k|         std::memcpy(p + (n >> 1), &v, 1);
   77|   782k|         std::memcpy(p + n - 1, &v, 1);
   78|   782k|      }
   79|  2.82M|   }
_ZN3glz7data_atINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEDaRT_m:
  117|  5.27M|   {
  118|       |      if constexpr (std::is_pointer_v<std::remove_cvref_t<B>>) {
  119|       |         return b + ix;
  120|       |      }
  121|  5.27M|      else {
  122|  5.27M|         static_assert(has_data<std::remove_cvref_t<B>>,
  123|  5.27M|                       "an output buffer must be contiguous: dump writes through memset and memcpy");
  124|       |         if constexpr (has_data_offset<std::remove_cvref_t<B>>) {
  125|       |            assert(ix >= b.data_offset() && "Index before flush offset");
  126|       |            return b.data() + (ix - b.data_offset());
  127|       |         }
  128|  5.27M|         else {
  129|  5.27M|            return b.data() + ix;
  130|  5.27M|         }
  131|  5.27M|      }
  132|  5.27M|   }

_ZN3glz10fast_float4spanIKcEC2Ev:
  438|  6.14M|  constexpr span() : ptr(nullptr), length(0) {}
_ZN3glz10fast_float10is_integerIcEEbT_:
 1481|  1.49k|fastfloat_really_inline constexpr bool is_integer(UC c) noexcept {
 1482|  1.49k|  return !(c > UC('9') || c < UC('0'));
  ------------------
  |  Branch (1482:12): [True: 2, False: 1.48k]
  |  Branch (1482:27): [True: 6, False: 1.48k]
  ------------------
 1483|  1.49k|}
_ZN3glz10fast_float11digit_valueIcEEmT_:
 1489|  16.5M|fastfloat_really_inline constexpr uint64_t digit_value(UC c) noexcept {
 1490|  16.5M|  return uint64_t(uint8_t(c) - uint8_t('0'));
 1491|  16.5M|}
_ZN3glz10fast_float4spanIKcEC2EPS2_m:
  436|  3.09M|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float26loop_parse_if_eight_digitsERPKcS2_Rm:
 1679|  22.4k|                           uint64_t &i) {
 1680|       |  // optimizes better than parse_if_eight_digits_unrolled() for UC = char.
 1681|   704k|  while ((std::distance(p, pend) >= 8) &&
  ------------------
  |  Branch (1681:10): [True: 702k, False: 2.91k]
  ------------------
 1682|   702k|         is_made_of_eight_digits_fast(read8_to_u64(p))) {
  ------------------
  |  Branch (1682:10): [True: 682k, False: 19.5k]
  ------------------
 1683|   682k|    i = i * 100000000 +
 1684|   682k|        parse_eight_digits_unrolled(read8_to_u64(
 1685|   682k|            p)); // in rare cases, this will overflow, but that's ok
 1686|   682k|    p += 8;
 1687|   682k|  }
 1688|  22.4k|}
_ZN3glz10fast_float28is_made_of_eight_digits_fastEm:
 1597|   702k|is_made_of_eight_digits_fast(uint64_t val) noexcept {
 1598|   702k|  return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) &
 1599|   702k|            0x8080808080808080));
 1600|   702k|}
_ZN3glz10fast_float12read8_to_u64IcEEmPKT_:
 1503|  1.79M|read8_to_u64(UC const *chars) {
 1504|  1.79M|  if (cpp20_and_in_constexpr() || !std::is_same<UC, char>::value) {
  ------------------
  |  Branch (1504:7): [Folded, False: 0]
  |  Branch (1504:35): [Folded, False: 0]
  ------------------
 1505|      0|    uint64_t val = 0;
 1506|      0|    for (int i = 0; i < 8; ++i) {
  ------------------
  |  Branch (1506:21): [True: 0, False: 0]
  ------------------
 1507|      0|      val |= uint64_t(uint8_t(*chars)) << (i * 8);
 1508|      0|      ++chars;
 1509|      0|    }
 1510|      0|    return val;
 1511|      0|  }
 1512|  1.79M|  uint64_t val;
 1513|  1.79M|  ::memcpy(&val, chars, sizeof(uint64_t));
 1514|       |#if GLZ_FASTFLOAT_IS_BIG_ENDIAN == 1
 1515|       |  // Need to read as-if the number was in little-endian order.
 1516|       |  val = byteswap(val);
 1517|       |#endif
 1518|  1.79M|  return val;
 1519|  1.79M|}
_ZN3glz10fast_float27parse_eight_digits_unrolledEm:
 1575|  1.09M|parse_eight_digits_unrolled(uint64_t val) {
 1576|  1.09M|  uint64_t const mask = 0x000000FF000000FF;
 1577|  1.09M|  uint64_t const mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
 1578|  1.09M|  uint64_t const mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
 1579|  1.09M|  val -= 0x3030303030303030;
 1580|  1.09M|  val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
 1581|  1.09M|  val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
 1582|  1.09M|  return uint32_t(val);
 1583|  1.09M|}
_ZNK3glz10fast_float4spanIKcE3lenEv:
  440|   145k|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EERNS0_22parsed_number_string_tIS3_EERT_:
 4249|  3.07M|from_chars_advanced(parsed_number_string_t<UC> &pns, T &value) noexcept {
 4250|       |
 4251|  3.07M|  static_assert(is_supported_float_type<T>::value,
 4252|  3.07M|                "only some floating-point types are supported");
 4253|  3.07M|  static_assert(is_supported_char_type<UC>::value,
 4254|  3.07M|                "only char, wchar_t, char16_t and char32_t are supported");
 4255|       |
 4256|  3.07M|  from_chars_result_t<UC> answer;
 4257|       |
 4258|  3.07M|  answer.ec = std::errc(); // be optimistic
 4259|  3.07M|  answer.ptr = pns.lastmatch;
 4260|       |  // The implementation of the Clinger's fast path is convoluted because
 4261|       |  // we want round-to-nearest in all cases, irrespective of the rounding mode
 4262|       |  // selected on the thread.
 4263|       |  // We proceed optimistically, assuming that detail::rounds_to_nearest()
 4264|       |  // returns true.
 4265|  3.07M|  if (binary_format<T>::min_exponent_fast_path() <= pns.exponent &&
  ------------------
  |  Branch (4265:7): [True: 3.05M, False: 13.2k]
  ------------------
 4266|  3.05M|      pns.exponent <= binary_format<T>::max_exponent_fast_path() &&
  ------------------
  |  Branch (4266:7): [True: 2.97M, False: 80.4k]
  ------------------
 4267|  2.97M|      !pns.too_many_digits) {
  ------------------
  |  Branch (4267:7): [True: 2.94M, False: 29.3k]
  ------------------
 4268|       |    // Unfortunately, the conventional Clinger's fast path is only possible
 4269|       |    // when the system rounds to the nearest float.
 4270|       |    //
 4271|       |    // We expect the next branch to almost always be selected.
 4272|       |    // We could check it first (before the previous branch), but
 4273|       |    // there might be performance advantages at having the check
 4274|       |    // be last.
 4275|  2.94M|    if (!cpp20_and_in_constexpr() && detail::rounds_to_nearest()) {
  ------------------
  |  Branch (4275:9): [True: 2.94M, Folded]
  |  Branch (4275:38): [True: 2.94M, False: 0]
  ------------------
 4276|       |      // We have that fegetround() == FE_TONEAREST.
 4277|       |      // Next is Clinger's fast path.
 4278|  2.94M|      if (pns.mantissa <= binary_format<T>::max_mantissa_fast_path()) {
  ------------------
  |  Branch (4278:11): [True: 2.94M, False: 7.11k]
  ------------------
 4279|  2.94M|        value = T(pns.mantissa);
 4280|  2.94M|        if (pns.exponent < 0) {
  ------------------
  |  Branch (4280:13): [True: 2.88k, False: 2.93M]
  ------------------
 4281|  2.88k|          value = value / binary_format<T>::exact_power_of_ten(-pns.exponent);
 4282|  2.93M|        } else {
 4283|  2.93M|          value = value * binary_format<T>::exact_power_of_ten(pns.exponent);
 4284|  2.93M|        }
 4285|  2.94M|        if (pns.negative) {
  ------------------
  |  Branch (4285:13): [True: 1.14k, False: 2.93M]
  ------------------
 4286|  1.14k|          value = -value;
 4287|  1.14k|        }
 4288|  2.94M|        return answer;
 4289|  2.94M|      }
 4290|  2.94M|    } else {
 4291|       |      // We do not have that fegetround() == FE_TONEAREST.
 4292|       |      // Next is a modified Clinger's fast path, inspired by Jakub Jelínek's
 4293|       |      // proposal
 4294|      0|      if (pns.exponent >= 0 &&
  ------------------
  |  Branch (4294:11): [True: 0, False: 0]
  ------------------
 4295|      0|          pns.mantissa <=
  ------------------
  |  Branch (4295:11): [True: 0, False: 0]
  ------------------
 4296|      0|              binary_format<T>::max_mantissa_fast_path(pns.exponent)) {
 4297|      0|#if defined(__clang__) || defined(GLZ_FASTFLOAT_32BIT)
 4298|       |        // Clang may map 0 to -0.0 when fegetround() == FE_DOWNWARD
 4299|      0|        if (pns.mantissa == 0) {
  ------------------
  |  Branch (4299:13): [True: 0, False: 0]
  ------------------
 4300|      0|          value = pns.negative ? T(-0.) : T(0.);
  ------------------
  |  Branch (4300:19): [True: 0, False: 0]
  ------------------
 4301|      0|          return answer;
 4302|      0|        }
 4303|      0|#endif
 4304|      0|        value = T(pns.mantissa) *
 4305|      0|                binary_format<T>::exact_power_of_ten(pns.exponent);
 4306|      0|        if (pns.negative) {
  ------------------
  |  Branch (4306:13): [True: 0, False: 0]
  ------------------
 4307|      0|          value = -value;
 4308|      0|        }
 4309|      0|        return answer;
 4310|      0|      }
 4311|      0|    }
 4312|  2.94M|  }
 4313|   130k|  adjusted_mantissa am =
 4314|   130k|      compute_float<binary_format<T>>(pns.exponent, pns.mantissa);
 4315|   130k|  if (pns.too_many_digits && am.power2 >= 0) {
  ------------------
  |  Branch (4315:7): [True: 108k, False: 21.5k]
  |  Branch (4315:30): [True: 108k, False: 0]
  ------------------
 4316|   108k|    if (am != compute_float<binary_format<T>>(pns.exponent, pns.mantissa + 1)) {
  ------------------
  |  Branch (4316:9): [True: 14.7k, False: 93.9k]
  ------------------
 4317|  14.7k|      am = compute_error<binary_format<T>>(pns.exponent, pns.mantissa);
 4318|  14.7k|    }
 4319|   108k|  }
 4320|       |  // If we called compute_float<binary_format<T>>(pns.exponent, pns.mantissa)
 4321|       |  // and we have an invalid power (am.power2 < 0), then we need to go the long
 4322|       |  // way around again. This is very uncommon.
 4323|   130k|  if (am.power2 < 0) {
  ------------------
  |  Branch (4323:7): [True: 14.7k, False: 115k]
  ------------------
 4324|  14.7k|    am = digit_comp<T>(pns, am);
 4325|  14.7k|  }
 4326|   130k|  to_float(pns.negative, am, value);
 4327|       |  // Test for over/underflow.
 4328|   130k|  if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) ||
  ------------------
  |  Branch (4328:8): [True: 128k, False: 1.25k]
  |  Branch (4328:29): [True: 3.57k, False: 125k]
  |  Branch (4328:49): [True: 124, False: 3.45k]
  ------------------
 4329|   130k|      am.power2 == binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (4329:7): [True: 982, False: 129k]
  ------------------
 4330|  1.10k|    answer.ec = std::errc::result_out_of_range;
 4331|  1.10k|  }
 4332|   130k|  return answer;
 4333|  3.07M|}
_ZN3glz10fast_float13binary_formatIdE22min_exponent_fast_pathEv:
  695|  3.07M|inline constexpr int binary_format<double>::min_exponent_fast_path() {
  696|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
  697|       |  return 0;
  698|       |#else
  699|  3.07M|  return -22;
  700|  3.07M|#endif
  701|  3.07M|}
_ZN3glz10fast_float13binary_formatIdE22max_exponent_fast_pathEv:
  767|  3.05M|inline constexpr int binary_format<double>::max_exponent_fast_path() {
  768|  3.05M|  return 22;
  769|  3.05M|}
_ZN3glz10fast_float6detail17rounds_to_nearestEv:
 4129|  2.94M|fastfloat_really_inline bool rounds_to_nearest() noexcept {
 4130|       |  // https://lemire.me/blog/2020/06/26/gcc-not-nearest/
 4131|       |#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
 4132|       |  return false;
 4133|       |#endif
 4134|       |  // See
 4135|       |  // A fast function to check your floating-point rounding mode
 4136|       |  // https://lemire.me/blog/2022/11/16/a-fast-function-to-check-your-floating-point-rounding-mode/
 4137|       |  //
 4138|       |  // This function is meant to be equivalent to :
 4139|       |  // prior: #include <cfenv>
 4140|       |  //  return fegetround() == FE_TONEAREST;
 4141|       |  // However, it is expected to be much faster than the fegetround()
 4142|       |  // function call.
 4143|       |  //
 4144|       |  // The volatile keyword prevents the compiler from computing the function
 4145|       |  // at compile-time.
 4146|       |  // There might be other ways to prevent compile-time optimizations (e.g.,
 4147|       |  // asm). The value does not need to be std::numeric_limits<float>::min(), any
 4148|       |  // small value so that 1 + x should round to 1 would do (after accounting for
 4149|       |  // excess precision, as in 387 instructions).
 4150|  2.94M|  static float volatile fmin = (std::numeric_limits<float>::min)();
 4151|  2.94M|  float fmini = fmin; // we copy it so that it gets loaded at most once.
 4152|       |//
 4153|       |// Explanation:
 4154|       |// Only when fegetround() == FE_TONEAREST do we have that
 4155|       |// fmin + 1.0f == 1.0f - fmin.
 4156|       |//
 4157|       |// FE_UPWARD:
 4158|       |//  fmin + 1.0f > 1
 4159|       |//  1.0f - fmin == 1
 4160|       |//
 4161|       |// FE_DOWNWARD or  FE_TOWARDZERO:
 4162|       |//  fmin + 1.0f == 1
 4163|       |//  1.0f - fmin < 1
 4164|       |//
 4165|       |// Note: This may fail to be accurate if fast-math has been
 4166|       |// enabled, as rounding conventions may not apply.
 4167|       |#ifdef GLZ_FASTFLOAT_VISUAL_STUDIO
 4168|       |#pragma warning(push)
 4169|       |//  todo: is there a VS warning?
 4170|       |//  see
 4171|       |//  https://stackoverflow.com/questions/46079446/is-there-a-warning-for-floating-point-equality-checking-in-visual-studio-2013
 4172|       |#elif defined(__clang__)
 4173|       |#pragma clang diagnostic push
 4174|  2.94M|#pragma clang diagnostic ignored "-Wfloat-equal"
 4175|       |#elif defined(__GNUC__)
 4176|       |#pragma GCC diagnostic push
 4177|       |#pragma GCC diagnostic ignored "-Wfloat-equal"
 4178|       |#endif
 4179|  2.94M|  return (fmini + 1.0f == 1.0f - fmini);
 4180|       |#ifdef GLZ_FASTFLOAT_VISUAL_STUDIO
 4181|       |#pragma warning(pop)
 4182|       |#elif defined(__clang__)
 4183|       |#pragma clang diagnostic pop
 4184|       |#elif defined(__GNUC__)
 4185|       |#pragma GCC diagnostic pop
 4186|       |#endif
 4187|  2.94M|}
_ZN3glz10fast_float13binary_formatIdE22max_mantissa_fast_pathEv:
  777|  2.94M|inline constexpr uint64_t binary_format<double>::max_mantissa_fast_path() {
  778|  2.94M|  return uint64_t(2) << mantissa_explicit_bits();
  779|  2.94M|}
_ZN3glz10fast_float13binary_formatIdE22mantissa_explicit_bitsEv:
  713|  3.90M|inline constexpr int binary_format<double>::mantissa_explicit_bits() {
  714|  3.90M|  return 52;
  715|  3.90M|}
_ZN3glz10fast_float13binary_formatIdE18exact_power_of_tenEl:
 1057|  2.94M|binary_format<double>::exact_power_of_ten(int64_t power) {
 1058|       |  // Work around clang bug https://godbolt.org/z/zedh7rrhc
 1059|  2.94M|  return (void)powers_of_ten[0], powers_of_ten[power];
 1060|  2.94M|}
_ZN3glz10fast_float13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2852|   238k|compute_float(int64_t q, uint64_t w) noexcept {
 2853|   238k|  adjusted_mantissa answer;
 2854|   238k|  if ((w == 0) || (q < binary::smallest_power_of_ten())) {
  ------------------
  |  Branch (2854:7): [True: 1.25k, False: 237k]
  |  Branch (2854:19): [True: 133, False: 237k]
  ------------------
 2855|  1.39k|    answer.power2 = 0;
 2856|  1.39k|    answer.mantissa = 0;
 2857|       |    // result should be zero
 2858|  1.39k|    return answer;
 2859|  1.39k|  }
 2860|   237k|  if (q > binary::largest_power_of_ten()) {
  ------------------
  |  Branch (2860:7): [True: 993, False: 236k]
  ------------------
 2861|       |    // we want to get infinity:
 2862|    993|    answer.power2 = binary::infinite_power();
 2863|    993|    answer.mantissa = 0;
 2864|    993|    return answer;
 2865|    993|  }
 2866|       |  // At this point in time q is in [powers::smallest_power_of_five,
 2867|       |  // powers::largest_power_of_five].
 2868|       |
 2869|       |  // We want the most significant bit of i to be 1. Shift if needed.
 2870|   236k|  int lz = leading_zeroes(w);
 2871|   236k|  w <<= lz;
 2872|       |
 2873|       |  // The required precision is binary::mantissa_explicit_bits() + 3 because
 2874|       |  // 1. We need the implicit bit
 2875|       |  // 2. We need an extra bit for rounding purposes
 2876|       |  // 3. We might lose a bit due to the "upperbit" routine (result too small,
 2877|       |  // requiring a shift)
 2878|       |
 2879|   236k|  value128 product =
 2880|   236k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2881|       |  // The computed 'product' is always sufficient.
 2882|       |  // Mathematical proof:
 2883|       |  // Noble Mushtak and Daniel Lemire, Fast Number Parsing Without Fallback (to
 2884|       |  // appear) See script/mushtak_lemire.py
 2885|       |
 2886|       |  // The "compute_product_approximation" function can be slightly slower than a
 2887|       |  // branchless approach: value128 product = compute_product(q, w); but in
 2888|       |  // practice, we can win big with the compute_product_approximation if its
 2889|       |  // additional branch is easily predicted. Which is best is data specific.
 2890|   236k|  int upperbit = int(product.high >> 63);
 2891|   236k|  int shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
 2892|       |
 2893|   236k|  answer.mantissa = product.high >> shift;
 2894|       |
 2895|   236k|  answer.power2 = int32_t(detail::power(int32_t(q)) + upperbit - lz -
 2896|   236k|                          binary::minimum_exponent());
 2897|   236k|  if (answer.power2 <= 0) { // we have a subnormal?
  ------------------
  |  Branch (2897:7): [True: 8.55k, False: 227k]
  ------------------
 2898|       |    // Here have that answer.power2 <= 0 so -answer.power2 >= 0
 2899|  8.55k|    if (-answer.power2 + 1 >=
  ------------------
  |  Branch (2899:9): [True: 8, False: 8.54k]
  ------------------
 2900|  8.55k|        64) { // if we have more than 64 bits below the minimum exponent, you
 2901|       |              // have a zero for sure.
 2902|      8|      answer.power2 = 0;
 2903|      8|      answer.mantissa = 0;
 2904|       |      // result should be zero
 2905|      8|      return answer;
 2906|      8|    }
 2907|       |    // next line is safe because -answer.power2 + 1 < 64
 2908|  8.54k|    answer.mantissa >>= -answer.power2 + 1;
 2909|       |    // Thankfully, we can't have both "round-to-even" and subnormals because
 2910|       |    // "round-to-even" only occurs for powers close to 0 in the 32-bit and
 2911|       |    // and 64-bit case (with no more than 19 digits).
 2912|  8.54k|    answer.mantissa += (answer.mantissa & 1); // round up
 2913|  8.54k|    answer.mantissa >>= 1;
 2914|       |    // There is a weird scenario where we don't have a subnormal but just.
 2915|       |    // Suppose we start with 2.2250738585072013e-308, we end up
 2916|       |    // with 0x3fffffffffffff x 2^-1023-53 which is technically subnormal
 2917|       |    // whereas 0x40000000000000 x 2^-1023-53  is normal. Now, we need to round
 2918|       |    // up 0x3fffffffffffff x 2^-1023-53  and once we do, we are no longer
 2919|       |    // subnormal, but we can only know this after rounding.
 2920|       |    // So we only declare a subnormal if we are smaller than the threshold.
 2921|  8.54k|    answer.power2 =
 2922|  8.54k|        (answer.mantissa < (uint64_t(1) << binary::mantissa_explicit_bits()))
  ------------------
  |  Branch (2922:9): [True: 8.52k, False: 18]
  ------------------
 2923|  8.54k|            ? 0
 2924|  8.54k|            : 1;
 2925|  8.54k|    return answer;
 2926|  8.55k|  }
 2927|       |
 2928|       |  // usually, we round *up*, but if we fall right in between and and we have an
 2929|       |  // even basis, we need to round down
 2930|       |  // We are only concerned with the cases where 5**q fits in single 64-bit word.
 2931|   227k|  if ((product.low <= 1) && (q >= binary::min_exponent_round_to_even()) &&
  ------------------
  |  Branch (2931:7): [True: 17.0k, False: 210k]
  |  Branch (2931:29): [True: 16.1k, False: 885]
  ------------------
 2932|  16.1k|      (q <= binary::max_exponent_round_to_even()) &&
  ------------------
  |  Branch (2932:7): [True: 13.9k, False: 2.22k]
  ------------------
 2933|  13.9k|      ((answer.mantissa & 3) == 1)) { // we may fall between two floats!
  ------------------
  |  Branch (2933:7): [True: 6.50k, False: 7.46k]
  ------------------
 2934|       |    // To be in-between two floats we need that in doing
 2935|       |    //   answer.mantissa = product.high >> (upperbit + 64 -
 2936|       |    //   binary::mantissa_explicit_bits() - 3);
 2937|       |    // ... we dropped out only zeroes. But if this happened, then we can go
 2938|       |    // back!!!
 2939|  6.50k|    if ((answer.mantissa << shift) == product.high) {
  ------------------
  |  Branch (2939:9): [True: 2.19k, False: 4.30k]
  ------------------
 2940|  2.19k|      answer.mantissa &= ~uint64_t(1); // flip it so that we do not round up
 2941|  2.19k|    }
 2942|  6.50k|  }
 2943|       |
 2944|   227k|  answer.mantissa += (answer.mantissa & 1); // round up
 2945|   227k|  answer.mantissa >>= 1;
 2946|   227k|  if (answer.mantissa >= (uint64_t(2) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (2946:7): [True: 3.35k, False: 224k]
  ------------------
 2947|  3.35k|    answer.mantissa = (uint64_t(1) << binary::mantissa_explicit_bits());
 2948|  3.35k|    answer.power2++; // undo previous addition
 2949|  3.35k|  }
 2950|       |
 2951|   227k|  answer.mantissa &= ~(uint64_t(1) << binary::mantissa_explicit_bits());
 2952|   227k|  if (answer.power2 >= binary::infinite_power()) { // infinity
  ------------------
  |  Branch (2952:7): [True: 17, False: 227k]
  ------------------
 2953|     17|    answer.power2 = binary::infinite_power();
 2954|     17|    answer.mantissa = 0;
 2955|     17|  }
 2956|   227k|  return answer;
 2957|   236k|}
_ZN3glz10fast_float17adjusted_mantissaC2Ev:
  568|   268k|  adjusted_mantissa() = default;
_ZN3glz10fast_float13binary_formatIdE21smallest_power_of_tenEv:
 1077|   237k|inline constexpr int binary_format<double>::smallest_power_of_ten() {
 1078|   237k|  return -342;
 1079|   237k|}
_ZN3glz10fast_float13binary_formatIdE20largest_power_of_tenEv:
 1068|   237k|template <> inline constexpr int binary_format<double>::largest_power_of_ten() {
 1069|   237k|  return 308;
 1070|   237k|}
_ZN3glz10fast_float14leading_zeroesEm:
  488|   262k|leading_zeroes(uint64_t input_num) {
  489|   262k|  assert(input_num > 0);
  ------------------
  |  Branch (489:3): [True: 262k, False: 0]
  ------------------
  490|   262k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (490:7): [Folded, False: 262k]
  ------------------
  491|      0|    return leading_zeroes_generic(input_num);
  492|      0|  }
  493|       |#ifdef GLZ_FASTFLOAT_VISUAL_STUDIO
  494|       |#if defined(_M_X64) || defined(_M_ARM64)
  495|       |  unsigned long leading_zero = 0;
  496|       |  // Search the mask data from most significant bit (MSB)
  497|       |  // to least significant bit (LSB) for a set bit (1).
  498|       |  _BitScanReverse64(&leading_zero, input_num);
  499|       |  return (int)(63 - leading_zero);
  500|       |#else
  501|       |  return leading_zeroes_generic(input_num);
  502|       |#endif
  503|       |#else
  504|   262k|  return __builtin_clzll(input_num);
  505|   262k|#endif
  506|   262k|}
_ZN3glz10fast_float29compute_product_approximationILi55EEENS0_8value128Elm:
 2771|   251k|compute_product_approximation(int64_t q, uint64_t w) {
 2772|   251k|  int const index = 2 * int(q - powers::smallest_power_of_five);
 2773|       |  // For small values of q, e.g., q in [0,27], the answer is always exact
 2774|       |  // because The line value128 firstproduct = full_multiplication(w,
 2775|       |  // power_of_five_128[index]); gives the exact answer.
 2776|   251k|  value128 firstproduct =
 2777|   251k|      full_multiplication(w, powers::power_of_five_128[index]);
 2778|   251k|  static_assert((bit_precision >= 0) && (bit_precision <= 64),
 2779|   251k|                " precision should  be in (0,64]");
 2780|   251k|  constexpr uint64_t precision_mask =
 2781|   251k|      (bit_precision < 64) ? (uint64_t(0xFFFFFFFFFFFFFFFF) >> bit_precision)
  ------------------
  |  Branch (2781:7): [True: 0, Folded]
  ------------------
 2782|   251k|                           : uint64_t(0xFFFFFFFFFFFFFFFF);
 2783|   251k|  if ((firstproduct.high & precision_mask) ==
  ------------------
  |  Branch (2783:7): [True: 10.6k, False: 240k]
  ------------------
 2784|   251k|      precision_mask) { // could further guard with  (lower + w < lower)
 2785|       |    // regarding the second product, we only need secondproduct.high, but our
 2786|       |    // expectation is that the compiler will optimize this extra work away if
 2787|       |    // needed.
 2788|  10.6k|    value128 secondproduct =
 2789|  10.6k|        full_multiplication(w, powers::power_of_five_128[index + 1]);
 2790|  10.6k|    firstproduct.low += secondproduct.high;
 2791|  10.6k|    if (secondproduct.high > firstproduct.low) {
  ------------------
  |  Branch (2791:9): [True: 4.16k, False: 6.51k]
  ------------------
 2792|  4.16k|      firstproduct.high++;
 2793|  4.16k|    }
 2794|  10.6k|  }
 2795|   251k|  return firstproduct;
 2796|   251k|}
_ZN3glz10fast_float19full_multiplicationEmm:
  540|   261k|full_multiplication(uint64_t a, uint64_t b) {
  541|   261k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (541:7): [Folded, False: 261k]
  ------------------
  542|      0|    value128 answer;
  543|      0|    answer.low = umul128_generic(a, b, &answer.high);
  544|      0|    return answer;
  545|      0|  }
  546|   261k|  value128 answer;
  547|       |#if defined(_M_ARM64) && !defined(__MINGW32__)
  548|       |  // ARM64 has native support for 64-bit multiplications, no need to emulate
  549|       |  // But MinGW on ARM64 doesn't have native support for 64-bit multiplications
  550|       |  answer.high = __umulh(a, b);
  551|       |  answer.low = a * b;
  552|       |#elif defined(GLZ_FASTFLOAT_32BIT) ||                                              \
  553|       |    (defined(_WIN64) && !defined(__clang__) && !defined(_M_ARM64))
  554|       |  answer.low = _umul128(a, b, &answer.high); // _umul128 not available on ARM64
  555|       |#elif defined(GLZ_FASTFLOAT_64BIT) && defined(__SIZEOF_INT128__)
  556|       |  __uint128_t r = ((__uint128_t)a) * b;
  557|   261k|  answer.low = uint64_t(r);
  558|   261k|  answer.high = uint64_t(r >> 64);
  559|       |#else
  560|       |  answer.low = umul128_generic(a, b, &answer.high);
  561|       |#endif
  562|   261k|  return answer;
  563|   261k|}
_ZN3glz10fast_float8value128C2Ev:
  454|   261k|  constexpr value128() : low(0), high(0) {}
_ZN3glz10fast_float6detail5powerEi:
 2814|   251k|constexpr fastfloat_really_inline int32_t power(int32_t q) noexcept {
 2815|   251k|  return (((152170 + 65536) * q) >> 16) + 63;
 2816|   251k|}
_ZN3glz10fast_float13binary_formatIdE16minimum_exponentEv:
  742|   265k|template <> inline constexpr int binary_format<double>::minimum_exponent() {
  743|   265k|  return -1023;
  744|   265k|}
_ZN3glz10fast_float13binary_formatIdE26min_exponent_round_to_evenEv:
  733|  17.0k|inline constexpr int binary_format<double>::min_exponent_round_to_even() {
  734|  17.0k|  return -4;
  735|  17.0k|}
_ZN3glz10fast_float13binary_formatIdE26max_exponent_round_to_evenEv:
  723|  16.1k|inline constexpr int binary_format<double>::max_exponent_round_to_even() {
  724|  16.1k|  return 23;
  725|  16.1k|}
_ZNK3glz10fast_float17adjusted_mantissaneERKS1_:
  574|   108k|  constexpr bool operator!=(adjusted_mantissa const &o) const {
  575|   108k|    return mantissa != o.mantissa || power2 != o.power2;
  ------------------
  |  Branch (575:12): [True: 14.7k, False: 93.9k]
  |  Branch (575:38): [True: 0, False: 93.9k]
  ------------------
  576|   108k|  }
_ZN3glz10fast_float13compute_errorINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2837|  14.7k|compute_error(int64_t q, uint64_t w) noexcept {
 2838|  14.7k|  int lz = leading_zeroes(w);
 2839|  14.7k|  w <<= lz;
 2840|  14.7k|  value128 product =
 2841|  14.7k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2842|  14.7k|  return compute_error_scaled<binary>(q, product.high, lz);
 2843|  14.7k|}
_ZN3glz10fast_float20compute_error_scaledINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElmi:
 2823|  14.7k|compute_error_scaled(int64_t q, uint64_t w, int lz) noexcept {
 2824|  14.7k|  int hilz = int(w >> 63) ^ 1;
 2825|  14.7k|  adjusted_mantissa answer;
 2826|  14.7k|  answer.mantissa = w << hilz;
 2827|  14.7k|  int bias = binary::mantissa_explicit_bits() - binary::minimum_exponent();
 2828|  14.7k|  answer.power2 = int32_t(detail::power(int32_t(q)) + bias - hilz - lz - 62 +
 2829|  14.7k|                          invalid_am_bias);
 2830|  14.7k|  return answer;
 2831|  14.7k|}
_ZN3glz10fast_float10digit_compIdcEENS0_17adjusted_mantissaERNS0_22parsed_number_string_tIT0_EES2_:
 4034|  14.7k|digit_comp(parsed_number_string_t<UC> &num, adjusted_mantissa am) noexcept {
 4035|       |  // remove the invalid exponent bias
 4036|  14.7k|  am.power2 -= invalid_am_bias;
 4037|       |
 4038|  14.7k|  int32_t sci_exp = scientific_exponent(num);
 4039|  14.7k|  size_t max_digits = binary_format<T>::max_digits();
 4040|  14.7k|  size_t digits = 0;
 4041|  14.7k|  bigint bigmant;
 4042|  14.7k|  parse_mantissa(bigmant, num, max_digits, digits);
 4043|       |  // can't underflow, since digits is at most max_digits.
 4044|  14.7k|  int32_t exponent = sci_exp + 1 - int32_t(digits);
 4045|  14.7k|  if (exponent >= 0) {
  ------------------
  |  Branch (4045:7): [True: 5.54k, False: 9.21k]
  ------------------
 4046|  5.54k|    return positive_digit_comp<T>(bigmant, exponent);
 4047|  9.21k|  } else {
 4048|  9.21k|    return negative_digit_comp<T>(bigmant, am, exponent);
 4049|  9.21k|  }
 4050|  14.7k|}
_ZN3glz10fast_float19scientific_exponentIcEEiRNS0_22parsed_number_string_tIT_EE:
 3640|  14.7k|scientific_exponent(parsed_number_string_t<UC> &num) noexcept {
 3641|  14.7k|  uint64_t mantissa = num.mantissa;
 3642|  14.7k|  int32_t exponent = int32_t(num.exponent);
 3643|  73.7k|  while (mantissa >= 10000) {
  ------------------
  |  Branch (3643:10): [True: 59.0k, False: 14.7k]
  ------------------
 3644|  59.0k|    mantissa /= 10000;
 3645|  59.0k|    exponent += 4;
 3646|  59.0k|  }
 3647|  29.5k|  while (mantissa >= 100) {
  ------------------
  |  Branch (3647:10): [True: 14.7k, False: 14.7k]
  ------------------
 3648|  14.7k|    mantissa /= 100;
 3649|  14.7k|    exponent += 2;
 3650|  14.7k|  }
 3651|  14.7k|  while (mantissa >= 10) {
  ------------------
  |  Branch (3651:10): [True: 0, False: 14.7k]
  ------------------
 3652|      0|    mantissa /= 10;
 3653|      0|    exponent += 1;
 3654|      0|  }
 3655|  14.7k|  return exponent;
 3656|  14.7k|}
_ZN3glz10fast_float13binary_formatIdE10max_digitsEv:
 1085|  14.7k|template <> inline constexpr size_t binary_format<double>::max_digits() {
 1086|  14.7k|  return 769;
 1087|  14.7k|}
_ZN3glz10fast_float6bigintC2Ev:
 3399|  14.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint() : vec() {}
_ZN3glz10fast_float8stackvecILt62EEC2Ev:
 3006|   148k|  stackvec() = default;
_ZN3glz10fast_float14parse_mantissaIcEEvRNS0_6bigintERNS0_22parsed_number_string_tIT_EEmRm:
 3859|  14.7k|               size_t max_digits, size_t &digits) noexcept {
 3860|       |  // try to minimize the number of big integer and scalar multiplication.
 3861|       |  // therefore, try to parse 8 digits at a time, and multiply by the largest
 3862|       |  // scalar value (9 or 19 digits) for each step.
 3863|  14.7k|  size_t counter = 0;
 3864|  14.7k|  digits = 0;
 3865|  14.7k|  limb value = 0;
 3866|  14.7k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3867|  14.7k|  size_t step = 19;
 3868|       |#else
 3869|       |  size_t step = 9;
 3870|       |#endif
 3871|       |
 3872|       |  // process all integer digits.
 3873|  14.7k|  UC const *p = num.integer.ptr;
 3874|  14.7k|  UC const *pend = p + num.integer.len();
 3875|  14.7k|  skip_zeros(p, pend);
 3876|       |  // process all digits, in increments of step per loop
 3877|   138k|  while (p != pend) {
  ------------------
  |  Branch (3877:10): [True: 126k, False: 12.1k]
  ------------------
 3878|   359k|    while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3878:12): [True: 341k, False: 17.5k]
  |  Branch (3878:45): [True: 233k, False: 108k]
  ------------------
 3879|   233k|           (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3879:12): [True: 232k, False: 620]
  ------------------
 3880|   232k|      parse_eight_digits(p, value, counter, digits);
 3881|   232k|    }
 3882|   489k|    while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3882:12): [True: 376k, False: 112k]
  |  Branch (3882:30): [True: 364k, False: 12.7k]
  |  Branch (3882:43): [True: 362k, False: 1.23k]
  ------------------
 3883|   362k|      parse_one_digit(p, value, counter, digits);
 3884|   362k|    }
 3885|   126k|    if (digits == max_digits) {
  ------------------
  |  Branch (3885:9): [True: 2.57k, False: 123k]
  ------------------
 3886|       |      // add the temporary value, then check if we've truncated any digits
 3887|  2.57k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3888|  2.57k|      bool truncated = is_truncated(p, pend);
 3889|  2.57k|      if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3889:11): [True: 1.66k, False: 914]
  ------------------
 3890|  1.66k|        truncated |= is_truncated(num.fraction);
 3891|  1.66k|      }
 3892|  2.57k|      if (truncated) {
  ------------------
  |  Branch (3892:11): [True: 1.33k, False: 1.24k]
  ------------------
 3893|  1.33k|        round_up_bigint(result, digits);
 3894|  1.33k|      }
 3895|  2.57k|      return;
 3896|   123k|    } else {
 3897|   123k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3898|   123k|      counter = 0;
 3899|   123k|      value = 0;
 3900|   123k|    }
 3901|   126k|  }
 3902|       |
 3903|       |  // add our fraction digits, if they're available.
 3904|  12.1k|  if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3904:7): [True: 6.25k, False: 5.93k]
  ------------------
 3905|  6.25k|    p = num.fraction.ptr;
 3906|  6.25k|    pend = p + num.fraction.len();
 3907|  6.25k|    if (digits == 0) {
  ------------------
  |  Branch (3907:9): [True: 707, False: 5.54k]
  ------------------
 3908|    707|      skip_zeros(p, pend);
 3909|    707|    }
 3910|       |    // process all digits, in increments of step per loop
 3911|  96.0k|    while (p != pend) {
  ------------------
  |  Branch (3911:12): [True: 91.8k, False: 4.22k]
  ------------------
 3912|   267k|      while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3912:14): [True: 261k, False: 6.20k]
  |  Branch (3912:47): [True: 176k, False: 84.8k]
  ------------------
 3913|   176k|             (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3913:14): [True: 176k, False: 744]
  ------------------
 3914|   176k|        parse_eight_digits(p, value, counter, digits);
 3915|   176k|      }
 3916|   366k|      while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3916:14): [True: 280k, False: 86.4k]
  |  Branch (3916:32): [True: 276k, False: 4.14k]
  |  Branch (3916:45): [True: 274k, False: 1.26k]
  ------------------
 3917|   274k|        parse_one_digit(p, value, counter, digits);
 3918|   274k|      }
 3919|  91.8k|      if (digits == max_digits) {
  ------------------
  |  Branch (3919:11): [True: 2.02k, False: 89.8k]
  ------------------
 3920|       |        // add the temporary value, then check if we've truncated any digits
 3921|  2.02k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3922|  2.02k|        bool truncated = is_truncated(p, pend);
 3923|  2.02k|        if (truncated) {
  ------------------
  |  Branch (3923:13): [True: 1.19k, False: 830]
  ------------------
 3924|  1.19k|          round_up_bigint(result, digits);
 3925|  1.19k|        }
 3926|  2.02k|        return;
 3927|  89.8k|      } else {
 3928|  89.8k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3929|  89.8k|        counter = 0;
 3930|  89.8k|        value = 0;
 3931|  89.8k|      }
 3932|  91.8k|    }
 3933|  6.25k|  }
 3934|       |
 3935|  10.1k|  if (counter != 0) {
  ------------------
  |  Branch (3935:7): [True: 0, False: 10.1k]
  ------------------
 3936|      0|    add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3937|      0|  }
 3938|  10.1k|}
_ZN3glz10fast_float10skip_zerosIcEEvRPKT_S4_:
 3773|  15.4k|skip_zeros(UC const *&first, UC const *last) noexcept {
 3774|  15.4k|  uint64_t val;
 3775|  15.7k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3775:10): [True: 15.7k, Folded]
  ------------------
 3776|  15.7k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3776:10): [True: 12.9k, False: 2.81k]
  ------------------
 3777|  12.9k|    ::memcpy(&val, first, sizeof(uint64_t));
 3778|  12.9k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3778:9): [True: 12.6k, False: 289]
  ------------------
 3779|  12.6k|      break;
 3780|  12.6k|    }
 3781|    289|    first += int_cmp_len<UC>();
 3782|    289|  }
 3783|  16.6k|  while (first != last) {
  ------------------
  |  Branch (3783:10): [True: 15.9k, False: 707]
  ------------------
 3784|  15.9k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3784:9): [True: 14.7k, False: 1.18k]
  ------------------
 3785|  14.7k|      break;
 3786|  14.7k|    }
 3787|  1.18k|    first++;
 3788|  1.18k|  }
 3789|  15.4k|}
_ZN3glz10fast_float11int_cmp_lenIcEEiv:
 1180|  64.5k|template <typename UC> constexpr int int_cmp_len() {
 1181|  64.5k|  return sizeof(uint64_t) / sizeof(UC);
 1182|  64.5k|}
_ZN3glz10fast_float13int_cmp_zerosIcEEmv:
 1170|  35.0k|template <typename UC> constexpr uint64_t int_cmp_zeros() {
 1171|  35.0k|  static_assert((sizeof(UC) == 1) || (sizeof(UC) == 2) || (sizeof(UC) == 4),
 1172|  35.0k|                "Unsupported character size");
 1173|  35.0k|  return (sizeof(UC) == 1) ? 0x3030303030303030
  ------------------
  |  Branch (1173:10): [True: 35.0k, Folded]
  ------------------
 1174|  35.0k|         : (sizeof(UC) == 2)
  ------------------
  |  Branch (1174:12): [Folded, False: 0]
  ------------------
 1175|      0|             ? (uint64_t(UC('0')) << 48 | uint64_t(UC('0')) << 32 |
 1176|      0|                uint64_t(UC('0')) << 16 | UC('0'))
 1177|      0|             : (uint64_t(UC('0')) << 32 | UC('0'));
 1178|  35.0k|}
_ZN3glz10fast_float18parse_eight_digitsIcEEvRPKT_RmS6_S6_:
 3824|   409k|                   size_t &count) noexcept {
 3825|   409k|  value = value * 100000000 + parse_eight_digits_unrolled(p);
 3826|   409k|  p += 8;
 3827|   409k|  counter += 8;
 3828|   409k|  count += 8;
 3829|   409k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledIcEEjPKT_:
 1588|   409k|parse_eight_digits_unrolled(UC const *chars) noexcept {
 1589|   409k|  if (cpp20_and_in_constexpr() || !has_simd_opt<UC>()) {
  ------------------
  |  Branch (1589:7): [Folded, False: 0]
  |  Branch (1589:35): [True: 0, Folded]
  ------------------
 1590|   409k|    return parse_eight_digits_unrolled(read8_to_u64(chars)); // truncation okay
 1591|   409k|  }
 1592|      0|  return parse_eight_digits_unrolled(simd_read8_to_u64(chars));
 1593|   409k|}
_ZN3glz10fast_float15parse_one_digitIcEEvRPKT_RmS6_S6_:
 3834|   637k|                size_t &count) noexcept {
 3835|   637k|  value = value * 10 + limb(*p - UC('0'));
 3836|   637k|  p++;
 3837|   637k|  counter++;
 3838|   637k|  count++;
 3839|   637k|}
_ZN3glz10fast_float10add_nativeERNS0_6bigintEmm:
 3842|   220k|add_native(bigint &big, limb power, limb value) noexcept {
 3843|   220k|  big.mul(power);
 3844|   220k|  big.add(value);
 3845|   220k|}
_ZN3glz10fast_float6bigint3mulEm:
 3552|   220k|  GLZ_FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
_ZN3glz10fast_float9small_mulILt62EEEbRNS0_8stackvecIXT_EEEm:
 3249|   401k|                                            limb y) noexcept {
 3250|   401k|  limb carry = 0;
 3251|  6.79M|  for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3251:26): [True: 6.38M, False: 401k]
  ------------------
 3252|  6.38M|    vec[index] = scalar_mul(vec[index], y, carry);
 3253|  6.38M|  }
 3254|   401k|  if (carry != 0) {
  ------------------
  |  Branch (3254:7): [True: 364k, False: 37.3k]
  ------------------
 3255|   364k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|   364k|  {                                                                            \
  |  |  355|   364k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 364k]
  |  |  ------------------
  |  |  356|   364k|      return false;                                                            \
  |  |  357|   364k|  }
  ------------------
 3256|   364k|  }
 3257|   401k|  return true;
 3258|   401k|}
_ZNK3glz10fast_float8stackvecILt62EE3lenEv:
 3039|  8.68M|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float10scalar_mulEmmRm:
 3196|  6.38M|scalar_mul(limb x, limb y, limb &carry) noexcept {
 3197|  6.38M|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3198|  6.38M|#if defined(__SIZEOF_INT128__)
 3199|       |  // GCC and clang both define it as an extension.
 3200|  6.38M|  __uint128_t z = __uint128_t(x) * __uint128_t(y) + __uint128_t(carry);
 3201|  6.38M|  carry = limb(z >> limb_bits);
 3202|  6.38M|  return limb(z);
 3203|       |#else
 3204|       |  // fallback, no native 128-bit integer multiplication with carry.
 3205|       |  // on msvc, this optimizes identically, somehow.
 3206|       |  value128 z = full_multiplication(x, y);
 3207|       |  bool overflow;
 3208|       |  z.low = scalar_add(z.low, carry, overflow);
 3209|       |  z.high += uint64_t(overflow); // cannot overflow
 3210|       |  carry = z.high;
 3211|       |  return z.low;
 3212|       |#endif
 3213|       |#else
 3214|       |  uint64_t z = uint64_t(x) * uint64_t(y) + uint64_t(carry);
 3215|       |  carry = limb(z >> limb_bits);
 3216|       |  return limb(z);
 3217|       |#endif
 3218|  6.38M|}
_ZN3glz10fast_float8stackvecILt62EEixEm:
 3017|  16.6M|  GLZ_FASTFLOAT_CONSTEXPR14 limb &operator[](size_t index) noexcept {
 3018|  16.6M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  16.6M|  { ((void)(x)); }
  ------------------
 3019|  16.6M|    return data[index];
 3020|  16.6M|  }
_ZN3glz10fast_float8stackvecILt62EE8try_pushEm:
 3052|   383k|  GLZ_FASTFLOAT_CONSTEXPR14 bool try_push(limb value) noexcept {
 3053|   383k|    if (len() < capacity()) {
  ------------------
  |  Branch (3053:9): [True: 383k, False: 0]
  ------------------
 3054|   383k|      push_unchecked(value);
 3055|   383k|      return true;
 3056|   383k|    } else {
 3057|      0|      return false;
 3058|      0|    }
 3059|   383k|  }
_ZNK3glz10fast_float8stackvecILt62EE8capacityEv:
 3043|   670k|  constexpr size_t capacity() const noexcept { return size; }
_ZN3glz10fast_float8stackvecILt62EE14push_uncheckedEm:
 3046|   392k|  GLZ_FASTFLOAT_CONSTEXPR14 void push_unchecked(limb value) noexcept {
 3047|   392k|    data[length] = value;
 3048|   392k|    length++;
 3049|   392k|  }
_ZN3glz10fast_float6bigint3addEm:
 3554|   220k|  GLZ_FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
_ZN3glz10fast_float9small_addILt62EEEbRNS0_8stackvecIXT_EEEm:
 3242|   220k|small_add(stackvec<size> &vec, limb y) noexcept {
 3243|   220k|  return small_add_from(vec, y, 0);
 3244|   220k|}
_ZN3glz10fast_float14small_add_fromILt62EEEbRNS0_8stackvecIXT_EEEmm:
 3224|   220k|                                                 size_t start) noexcept {
 3225|   220k|  size_t index = start;
 3226|   220k|  limb carry = y;
 3227|   220k|  bool overflow;
 3228|   268k|  while (carry != 0 && index < vec.len()) {
  ------------------
  |  Branch (3228:10): [True: 63.7k, False: 204k]
  |  Branch (3228:24): [True: 47.7k, False: 15.9k]
  ------------------
 3229|  47.7k|    vec[index] = scalar_add(vec[index], carry, overflow);
 3230|  47.7k|    carry = limb(overflow);
 3231|  47.7k|    index += 1;
 3232|  47.7k|  }
 3233|   220k|  if (carry != 0) {
  ------------------
  |  Branch (3233:7): [True: 15.9k, False: 204k]
  ------------------
 3234|  15.9k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  15.9k|  {                                                                            \
  |  |  355|  15.9k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 15.9k]
  |  |  ------------------
  |  |  356|  15.9k|      return false;                                                            \
  |  |  357|  15.9k|  }
  ------------------
 3235|  15.9k|  }
 3236|   220k|  return true;
 3237|   220k|}
_ZN3glz10fast_float10scalar_addEmmRb:
 3176|  2.47M|scalar_add(limb x, limb y, bool &overflow) noexcept {
 3177|  2.47M|  limb z;
 3178|       |// gcc and clang
 3179|  2.47M|#if defined(__has_builtin)
 3180|  2.47M|#if __has_builtin(__builtin_add_overflow)
 3181|  2.47M|  if (!cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (3181:7): [True: 2.47M, Folded]
  ------------------
 3182|  2.47M|    overflow = __builtin_add_overflow(x, y, &z);
 3183|  2.47M|    return z;
 3184|  2.47M|  }
 3185|      0|#endif
 3186|      0|#endif
 3187|       |
 3188|       |  // generic, this still optimizes correctly on MSVC.
 3189|      0|  z = x + y;
 3190|      0|  overflow = z < x;
 3191|      0|  return z;
 3192|  2.47M|}
_ZN3glz10fast_float12is_truncatedIcEEbPKT_S4_:
 3795|  6.26k|is_truncated(UC const *first, UC const *last) noexcept {
 3796|       |  // do 8-bit optimizations, can just compare to 8 literal 0s.
 3797|  6.26k|  uint64_t val;
 3798|  27.3k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3798:10): [True: 27.3k, Folded]
  ------------------
 3799|  27.3k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3799:10): [True: 22.1k, False: 5.24k]
  ------------------
 3800|  22.1k|    ::memcpy(&val, first, sizeof(uint64_t));
 3801|  22.1k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3801:9): [True: 1.01k, False: 21.1k]
  ------------------
 3802|  1.01k|      return true;
 3803|  1.01k|    }
 3804|  21.1k|    first += int_cmp_len<UC>();
 3805|  21.1k|  }
 3806|  12.0k|  while (first != last) {
  ------------------
  |  Branch (3806:10): [True: 8.55k, False: 3.48k]
  ------------------
 3807|  8.55k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3807:9): [True: 1.76k, False: 6.79k]
  ------------------
 3808|  1.76k|      return true;
 3809|  1.76k|    }
 3810|  6.79k|    ++first;
 3811|  6.79k|  }
 3812|  3.48k|  return false;
 3813|  5.24k|}
_ZN3glz10fast_float12is_truncatedIcEEbNS0_4spanIKT_EE:
 3817|  1.66k|is_truncated(span<UC const> s) noexcept {
 3818|  1.66k|  return is_truncated(s.ptr, s.ptr + s.len());
 3819|  1.66k|}
_ZN3glz10fast_float15round_up_bigintERNS0_6bigintERm:
 3848|  2.52k|round_up_bigint(bigint &big, size_t &count) noexcept {
 3849|       |  // need to round-up the digits, but need to avoid rounding
 3850|       |  // ....9999 to ...10000, which could cause a false halfway point.
 3851|  2.52k|  add_native(big, 10, 1);
 3852|  2.52k|  count++;
 3853|  2.52k|}
_ZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEi:
 3942|  5.54k|positive_digit_comp(bigint &bigmant, int32_t exponent) noexcept {
 3943|  5.54k|  GLZ_FASTFLOAT_ASSERT(bigmant.pow10(uint32_t(exponent)));
  ------------------
  |  |  344|  5.54k|  { ((void)(x)); }
  ------------------
 3944|  5.54k|  adjusted_mantissa answer;
 3945|  5.54k|  bool truncated;
 3946|  5.54k|  answer.mantissa = bigmant.hi64(truncated);
 3947|  5.54k|  int bias = binary_format<T>::mantissa_explicit_bits() -
 3948|  5.54k|             binary_format<T>::minimum_exponent();
 3949|  5.54k|  answer.power2 = bigmant.bit_length() - 64 + bias;
 3950|       |
 3951|  5.54k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  5.54k|    round_nearest_tie_even(
 3953|  5.54k|        a, shift,
 3954|  5.54k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  5.54k|          return is_above || (is_halfway && truncated) ||
 3956|  5.54k|                 (is_odd && is_halfway);
 3957|  5.54k|        });
 3958|  5.54k|  });
 3959|       |
 3960|  5.54k|  return answer;
 3961|  5.54k|}
_ZN3glz10fast_float6bigint5pow10Ej:
 3591|  5.54k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow10(uint32_t exp) noexcept {
 3592|  5.54k|    GLZ_FASTFLOAT_TRY(pow5(exp));
  ------------------
  |  |  354|  5.54k|  {                                                                            \
  |  |  355|  5.54k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 5.54k]
  |  |  ------------------
  |  |  356|  5.54k|      return false;                                                            \
  |  |  357|  5.54k|  }
  ------------------
 3593|  5.54k|    return pow2(exp);
 3594|  5.54k|  }
_ZN3glz10fast_float6bigint4pow5Ej:
 3560|  14.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow5(uint32_t exp) noexcept {
 3561|       |    // multiply by a power of 5
 3562|  14.7k|    size_t large_length = sizeof(large_power_of_5) / sizeof(limb);
 3563|  14.7k|    limb_span large = limb_span(large_power_of_5, large_length);
 3564|  45.9k|    while (exp >= large_step) {
  ------------------
  |  Branch (3564:12): [True: 31.1k, False: 14.7k]
  ------------------
 3565|  31.1k|      GLZ_FASTFLOAT_TRY(large_mul(vec, large));
  ------------------
  |  |  354|  31.1k|  {                                                                            \
  |  |  355|  31.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 31.1k]
  |  |  ------------------
  |  |  356|  31.1k|      return false;                                                            \
  |  |  357|  31.1k|  }
  ------------------
 3566|  31.1k|      exp -= large_step;
 3567|  31.1k|    }
 3568|  14.7k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3569|  14.7k|    uint32_t small_step = 27;
 3570|  14.7k|    limb max_native = 7450580596923828125UL;
 3571|       |#else
 3572|       |    uint32_t small_step = 13;
 3573|       |    limb max_native = 1220703125U;
 3574|       |#endif
 3575|  28.3k|    while (exp >= small_step) {
  ------------------
  |  Branch (3575:12): [True: 13.6k, False: 14.7k]
  ------------------
 3576|  13.6k|      GLZ_FASTFLOAT_TRY(small_mul(vec, max_native));
  ------------------
  |  |  354|  13.6k|  {                                                                            \
  |  |  355|  13.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 13.6k]
  |  |  ------------------
  |  |  356|  13.6k|      return false;                                                            \
  |  |  357|  13.6k|  }
  ------------------
 3577|  13.6k|      exp -= small_step;
 3578|  13.6k|    }
 3579|  14.7k|    if (exp != 0) {
  ------------------
  |  Branch (3579:9): [True: 11.4k, False: 3.27k]
  ------------------
 3580|       |      // Work around clang bug https://godbolt.org/z/zedh7rrhc
 3581|       |      // This is similar to https://github.com/llvm/llvm-project/issues/47746,
 3582|       |      // except the workaround described there don't work here
 3583|  11.4k|      GLZ_FASTFLOAT_TRY(small_mul(
  ------------------
  |  |  354|  11.4k|  {                                                                            \
  |  |  355|  11.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 11.4k]
  |  |  ------------------
  |  |  356|  11.4k|      return false;                                                            \
  |  |  357|  11.4k|  }
  ------------------
 3584|  11.4k|          vec, limb(((void)small_power_of_5[0], small_power_of_5[exp]))));
 3585|  11.4k|    }
 3586|       |
 3587|  14.7k|    return true;
 3588|  14.7k|  }
_ZN3glz10fast_float4spanImEC2EPKmm:
  436|   201k|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float9large_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3329|  31.1k|GLZ_FASTFLOAT_CONSTEXPR20 bool large_mul(stackvec<size> &x, limb_span y) noexcept {
 3330|  31.1k|  if (y.len() == 1) {
  ------------------
  |  Branch (3330:7): [True: 0, False: 31.1k]
  ------------------
 3331|      0|    GLZ_FASTFLOAT_TRY(small_mul(x, y[0]));
  ------------------
  |  |  354|      0|  {                                                                            \
  |  |  355|      0|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  356|      0|      return false;                                                            \
  |  |  357|      0|  }
  ------------------
 3332|  31.1k|  } else {
 3333|  31.1k|    GLZ_FASTFLOAT_TRY(long_mul(x, y));
  ------------------
  |  |  354|  31.1k|  {                                                                            \
  |  |  355|  31.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 31.1k]
  |  |  ------------------
  |  |  356|  31.1k|      return false;                                                            \
  |  |  357|  31.1k|  }
  ------------------
 3334|  31.1k|  }
 3335|  31.1k|  return true;
 3336|  31.1k|}
_ZNK3glz10fast_float4spanImE3lenEv:
  440|  2.75M|  constexpr size_t len() const noexcept { return length; }
_ZNK3glz10fast_float4spanImEixEm:
  442|  1.85M|  GLZ_FASTFLOAT_CONSTEXPR14 const T &operator[](size_t index) const noexcept {
  443|  1.85M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  1.85M|  { ((void)(x)); }
  ------------------
  444|  1.85M|    return ptr[index];
  445|  1.85M|  }
_ZN3glz10fast_float8long_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3301|  31.1k|GLZ_FASTFLOAT_CONSTEXPR20 bool long_mul(stackvec<size> &x, limb_span y) noexcept {
 3302|  31.1k|  limb_span xs = limb_span(x.data, x.len());
 3303|  31.1k|  stackvec<size> z(xs);
 3304|  31.1k|  limb_span zs = limb_span(z.data, z.len());
 3305|       |
 3306|  31.1k|  if (y.len() != 0) {
  ------------------
  |  Branch (3306:7): [True: 31.1k, False: 0]
  ------------------
 3307|  31.1k|    limb y0 = y[0];
 3308|  31.1k|    GLZ_FASTFLOAT_TRY(small_mul(x, y0));
  ------------------
  |  |  354|  31.1k|  {                                                                            \
  |  |  355|  31.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 31.1k]
  |  |  ------------------
  |  |  356|  31.1k|      return false;                                                            \
  |  |  357|  31.1k|  }
  ------------------
 3309|   155k|    for (size_t index = 1; index < y.len(); index++) {
  ------------------
  |  Branch (3309:28): [True: 124k, False: 31.1k]
  ------------------
 3310|   124k|      limb yi = y[index];
 3311|   124k|      stackvec<size> zi;
 3312|   124k|      if (yi != 0) {
  ------------------
  |  Branch (3312:11): [True: 124k, False: 0]
  ------------------
 3313|       |        // re-use the same buffer throughout
 3314|   124k|        zi.set_len(0);
 3315|   124k|        GLZ_FASTFLOAT_TRY(zi.try_extend(zs));
  ------------------
  |  |  354|   124k|  {                                                                            \
  |  |  355|   124k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 124k]
  |  |  ------------------
  |  |  356|   124k|      return false;                                                            \
  |  |  357|   124k|  }
  ------------------
 3316|   124k|        GLZ_FASTFLOAT_TRY(small_mul(zi, yi));
  ------------------
  |  |  354|   124k|  {                                                                            \
  |  |  355|   124k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 124k]
  |  |  ------------------
  |  |  356|   124k|      return false;                                                            \
  |  |  357|   124k|  }
  ------------------
 3317|   124k|        limb_span zis = limb_span(zi.data, zi.len());
 3318|   124k|        GLZ_FASTFLOAT_TRY(large_add_from(x, zis, index));
  ------------------
  |  |  354|   124k|  {                                                                            \
  |  |  355|   124k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 124k]
  |  |  ------------------
  |  |  356|   124k|      return false;                                                            \
  |  |  357|   124k|  }
  ------------------
 3319|   124k|      }
 3320|   124k|    }
 3321|  31.1k|  }
 3322|       |
 3323|  31.1k|  x.normalize();
 3324|  31.1k|  return true;
 3325|  31.1k|}
_ZN3glz10fast_float8stackvecILt62EEC2ENS0_4spanImEE:
 3013|  31.1k|  GLZ_FASTFLOAT_CONSTEXPR20 stackvec(limb_span s) {
 3014|  31.1k|    GLZ_FASTFLOAT_ASSERT(try_extend(s));
  ------------------
  |  |  344|  31.1k|  { ((void)(x)); }
  ------------------
 3015|  31.1k|  }
_ZN3glz10fast_float8stackvecILt62EE7set_lenEm:
 3035|   411k|  GLZ_FASTFLOAT_CONSTEXPR14 void set_len(size_t len) noexcept {
 3036|   411k|    length = uint16_t(len);
 3037|   411k|  }
_ZN3glz10fast_float8stackvecILt62EE10try_extendENS0_4spanImEE:
 3069|   155k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_extend(limb_span s) noexcept {
 3070|   155k|    if (len() + s.len() <= capacity()) {
  ------------------
  |  Branch (3070:9): [True: 155k, False: 0]
  ------------------
 3071|   155k|      extend_unchecked(s);
 3072|   155k|      return true;
 3073|   155k|    } else {
 3074|      0|      return false;
 3075|      0|    }
 3076|   155k|  }
_ZN3glz10fast_float8stackvecILt62EE16extend_uncheckedENS0_4spanImEE:
 3062|   155k|  GLZ_FASTFLOAT_CONSTEXPR20 void extend_unchecked(limb_span s) noexcept {
 3063|   155k|    limb *ptr = data + length;
 3064|   155k|    std::copy_n(s.ptr, s.len(), ptr);
 3065|   155k|    set_len(len() + s.len());
 3066|   155k|  }
_ZN3glz10fast_float14large_add_fromILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEEm:
 3264|   124k|                                          size_t start) noexcept {
 3265|       |  // the effective x buffer is from `xstart..x.len()`, so exit early
 3266|       |  // if we can't get that current range.
 3267|   124k|  if (x.len() < start || y.len() > x.len() - start) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 124k]
  |  Branch (3267:26): [True: 123k, False: 987]
  ------------------
 3268|   123k|    GLZ_FASTFLOAT_TRY(x.try_resize(y.len() + start, 0));
  ------------------
  |  |  354|   123k|  {                                                                            \
  |  |  355|   123k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 123k]
  |  |  ------------------
  |  |  356|   123k|      return false;                                                            \
  |  |  357|   123k|  }
  ------------------
 3269|   123k|  }
 3270|       |
 3271|   124k|  bool carry = false;
 3272|  1.82M|  for (size_t index = 0; index < y.len(); index++) {
  ------------------
  |  Branch (3272:26): [True: 1.69M, False: 124k]
  ------------------
 3273|  1.69M|    limb xi = x[index + start];
 3274|  1.69M|    limb yi = y[index];
 3275|  1.69M|    bool c1 = false;
 3276|  1.69M|    bool c2 = false;
 3277|  1.69M|    xi = scalar_add(xi, yi, c1);
 3278|  1.69M|    if (carry) {
  ------------------
  |  Branch (3278:9): [True: 725k, False: 973k]
  ------------------
 3279|   725k|      xi = scalar_add(xi, 1, c2);
 3280|   725k|    }
 3281|  1.69M|    x[index + start] = xi;
 3282|  1.69M|    carry = c1 | c2;
 3283|  1.69M|  }
 3284|       |
 3285|       |  // handle overflow
 3286|   124k|  if (carry) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 124k]
  ------------------
 3287|      0|    GLZ_FASTFLOAT_TRY(small_add_from(x, 1, y.len() + start));
  ------------------
  |  |  354|      0|  {                                                                            \
  |  |  355|      0|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  356|      0|      return false;                                                            \
  |  |  357|      0|  }
  ------------------
 3288|      0|  }
 3289|   124k|  return true;
 3290|   124k|}
_ZN3glz10fast_float8stackvecILt62EE10try_resizeEmm:
 3095|   123k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_resize(size_t new_len, limb value) noexcept {
 3096|   123k|    if (new_len > capacity()) {
  ------------------
  |  Branch (3096:9): [True: 0, False: 123k]
  ------------------
 3097|      0|      return false;
 3098|   123k|    } else {
 3099|   123k|      resize_unchecked(new_len, value);
 3100|   123k|      return true;
 3101|   123k|    }
 3102|   123k|  }
_ZN3glz10fast_float8stackvecILt62EE16resize_uncheckedEmm:
 3082|   123k|  void resize_unchecked(size_t new_len, limb value) noexcept {
 3083|   123k|    if (new_len > len()) {
  ------------------
  |  Branch (3083:9): [True: 123k, False: 0]
  ------------------
 3084|   123k|      size_t count = new_len - len();
 3085|   123k|      limb *first = data + len();
 3086|   123k|      limb *last = first + count;
 3087|   123k|      ::std::fill(first, last, value);
 3088|   123k|      set_len(new_len);
 3089|   123k|    } else {
 3090|      0|      set_len(new_len);
 3091|      0|    }
 3092|   123k|  }
_ZN3glz10fast_float8stackvecILt62EE9normalizeEv:
 3118|  40.3k|  GLZ_FASTFLOAT_CONSTEXPR14 void normalize() noexcept {
 3119|  40.3k|    while (len() > 0 && rindex(0) == 0) {
  ------------------
  |  Branch (3119:12): [True: 40.3k, False: 0]
  |  Branch (3119:25): [True: 0, False: 40.3k]
  ------------------
 3120|      0|      length--;
 3121|      0|    }
 3122|  40.3k|  }
_ZNK3glz10fast_float8stackvecILt62EE6rindexEm:
 3028|  60.4k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &rindex(size_t index) const noexcept {
 3029|  60.4k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  60.4k|  { ((void)(x)); }
  ------------------
 3030|  60.4k|    size_t rindex = length - index - 1;
 3031|  60.4k|    return data[rindex];
 3032|  60.4k|  }
_ZN3glz10fast_float6bigint4pow2Ej:
 3557|  14.5k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow2(uint32_t exp) noexcept { return shl(exp); }
_ZN3glz10fast_float6bigint3shlEm:
 3519|  14.5k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {
 3520|  14.5k|    size_t rem = n % limb_bits;
 3521|  14.5k|    size_t div = n / limb_bits;
 3522|  14.5k|    if (rem != 0) {
  ------------------
  |  Branch (3522:9): [True: 10.8k, False: 3.68k]
  ------------------
 3523|  10.8k|      GLZ_FASTFLOAT_TRY(shl_bits(rem));
  ------------------
  |  |  354|  10.8k|  {                                                                            \
  |  |  355|  10.8k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 10.8k]
  |  |  ------------------
  |  |  356|  10.8k|      return false;                                                            \
  |  |  357|  10.8k|  }
  ------------------
 3524|  10.8k|    }
 3525|  14.5k|    if (div != 0) {
  ------------------
  |  Branch (3525:9): [True: 7.56k, False: 7.00k]
  ------------------
 3526|  7.56k|      GLZ_FASTFLOAT_TRY(shl_limbs(div));
  ------------------
  |  |  354|  7.56k|  {                                                                            \
  |  |  355|  7.56k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 7.56k]
  |  |  ------------------
  |  |  356|  7.56k|      return false;                                                            \
  |  |  357|  7.56k|  }
  ------------------
 3527|  7.56k|    }
 3528|  14.5k|    return true;
 3529|  14.5k|  }
_ZN3glz10fast_float6bigint8shl_bitsEm:
 3472|  10.8k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_bits(size_t n) noexcept {
 3473|       |    // Internally, for each item, we shift left by n, and add the previous
 3474|       |    // right shifted limb-bits.
 3475|       |    // For example, we transform (for u8) shifted left 2, to:
 3476|       |    //      b10100100 b01000010
 3477|       |    //      b10 b10010001 b00001000
 3478|  10.8k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  10.8k|  { ((void)(x)); }
  ------------------
 3479|  10.8k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n < sizeof(limb) * 8);
  ------------------
  |  |  349|  10.8k|  { ((void)(x)); }
  ------------------
 3480|       |
 3481|  10.8k|    size_t shl = n;
 3482|  10.8k|    size_t shr = limb_bits - shl;
 3483|  10.8k|    limb prev = 0;
 3484|   185k|    for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3484:28): [True: 174k, False: 10.8k]
  ------------------
 3485|   174k|      limb xi = vec[index];
 3486|   174k|      vec[index] = (xi << shl) | (prev >> shr);
 3487|   174k|      prev = xi;
 3488|   174k|    }
 3489|       |
 3490|  10.8k|    limb carry = prev >> shr;
 3491|  10.8k|    if (carry != 0) {
  ------------------
  |  Branch (3491:9): [True: 2.98k, False: 7.89k]
  ------------------
 3492|  2.98k|      return vec.try_push(carry);
 3493|  2.98k|    }
 3494|  7.89k|    return true;
 3495|  10.8k|  }
_ZN3glz10fast_float6bigint9shl_limbsEm:
 3498|  7.56k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
 3499|  7.56k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  7.56k|  { ((void)(x)); }
  ------------------
 3500|  7.56k|    if (n + vec.len() > vec.capacity()) {
  ------------------
  |  Branch (3500:9): [True: 0, False: 7.56k]
  ------------------
 3501|      0|      return false;
 3502|  7.56k|    } else if (!vec.is_empty()) {
  ------------------
  |  Branch (3502:16): [True: 7.56k, False: 0]
  ------------------
 3503|       |      // move limbs
 3504|  7.56k|      limb *dst = vec.data + n;
 3505|  7.56k|      limb const *src = vec.data;
 3506|  7.56k|      std::copy_backward(src, src + vec.len(), dst + vec.len());
 3507|       |      // fill in empty limbs
 3508|  7.56k|      limb *first = vec.data;
 3509|  7.56k|      limb *last = first + n;
 3510|  7.56k|      ::std::fill(first, last, 0);
 3511|  7.56k|      vec.set_len(n + vec.len());
 3512|  7.56k|      return true;
 3513|  7.56k|    } else {
 3514|      0|      return true;
 3515|      0|    }
 3516|  7.56k|  }
_ZNK3glz10fast_float8stackvecILt62EE8is_emptyEv:
 3041|  13.1k|  constexpr bool is_empty() const noexcept { return length == 0; }
_ZNK3glz10fast_float6bigint4hi64ERb:
 3418|  5.54k|  GLZ_FASTFLOAT_CONSTEXPR20 uint64_t hi64(bool &truncated) const noexcept {
 3419|  5.54k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3420|  5.54k|    if (vec.len() == 0) {
  ------------------
  |  Branch (3420:9): [True: 0, False: 5.54k]
  ------------------
 3421|      0|      return empty_hi64(truncated);
 3422|  5.54k|    } else if (vec.len() == 1) {
  ------------------
  |  Branch (3422:16): [True: 650, False: 4.89k]
  ------------------
 3423|    650|      return uint64_hi64(vec.rindex(0), truncated);
 3424|  4.89k|    } else {
 3425|  4.89k|      uint64_t result = uint64_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3426|  4.89k|      truncated |= vec.nonzero(2);
 3427|  4.89k|      return result;
 3428|  4.89k|    }
 3429|       |#else
 3430|       |    if (vec.len() == 0) {
 3431|       |      return empty_hi64(truncated);
 3432|       |    } else if (vec.len() == 1) {
 3433|       |      return uint32_hi64(vec.rindex(0), truncated);
 3434|       |    } else if (vec.len() == 2) {
 3435|       |      return uint32_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3436|       |    } else {
 3437|       |      uint64_t result =
 3438|       |          uint32_hi64(vec.rindex(0), vec.rindex(1), vec.rindex(2), truncated);
 3439|       |      truncated |= vec.nonzero(3);
 3440|       |      return result;
 3441|       |    }
 3442|       |#endif
 3443|  5.54k|  }
_ZN3glz10fast_float11uint64_hi64EmRb:
 3132|    650|uint64_hi64(uint64_t r0, bool &truncated) noexcept {
 3133|    650|  truncated = false;
 3134|    650|  int shl = leading_zeroes(r0);
 3135|    650|  return r0 << shl;
 3136|    650|}
_ZN3glz10fast_float11uint64_hi64EmmRb:
 3139|  4.89k|uint64_hi64(uint64_t r0, uint64_t r1, bool &truncated) noexcept {
 3140|  4.89k|  int shl = leading_zeroes(r0);
 3141|  4.89k|  if (shl == 0) {
  ------------------
  |  Branch (3141:7): [True: 462, False: 4.42k]
  ------------------
 3142|    462|    truncated = r1 != 0;
 3143|    462|    return r0;
 3144|  4.42k|  } else {
 3145|  4.42k|    int shr = 64 - shl;
 3146|  4.42k|    truncated = (r1 << shl) != 0;
 3147|  4.42k|    return (r0 << shl) | (r1 >> shr);
 3148|  4.42k|  }
 3149|  4.89k|}
_ZNK3glz10fast_float8stackvecILt62EE7nonzeroEm:
 3107|  4.89k|  GLZ_FASTFLOAT_CONSTEXPR14 bool nonzero(size_t index) const noexcept {
 3108|  5.81k|    while (index < len()) {
  ------------------
  |  Branch (3108:12): [True: 4.14k, False: 1.66k]
  ------------------
 3109|  4.14k|      if (rindex(index) != 0) {
  ------------------
  |  Branch (3109:11): [True: 3.22k, False: 922]
  ------------------
 3110|  3.22k|        return true;
 3111|  3.22k|      }
 3112|    922|      index++;
 3113|    922|    }
 3114|  1.66k|    return false;
 3115|  4.89k|  }
_ZNK3glz10fast_float6bigint10bit_lengthEv:
 3547|  5.54k|  GLZ_FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {
 3548|  5.54k|    int lz = ctlz();
 3549|  5.54k|    return int(limb_bits * vec.len()) - lz;
 3550|  5.54k|  }
_ZNK3glz10fast_float6bigint4ctlzEv:
 3532|  5.54k|  GLZ_FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
 3533|  5.54k|    if (vec.is_empty()) {
  ------------------
  |  Branch (3533:9): [True: 0, False: 5.54k]
  ------------------
 3534|      0|      return 0;
 3535|  5.54k|    } else {
 3536|  5.54k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3537|  5.54k|      return leading_zeroes(vec.rindex(0));
 3538|       |#else
 3539|       |      // no use defining a specialized leading_zeroes for a 32-bit type.
 3540|       |      uint64_t r0 = vec.rindex(0);
 3541|       |      return leading_zeroes(r0 << 32);
 3542|       |#endif
 3543|  5.54k|    }
 3544|  5.54k|  }
_ZN3glz10fast_float5roundIdZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiEUlRS3_iE_EEvS6_T0_:
 3707|  5.54k|                                                         callback cb) noexcept {
 3708|  5.54k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  5.54k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 5.54k]
  ------------------
 3710|       |    // have a denormal float
 3711|      0|    int32_t shift = -am.power2 + 1;
 3712|      0|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|      0|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 0, False: 0]
  ------------------
 3715|      0|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|      0|                    ? 0
 3717|      0|                    : 1;
 3718|      0|    return;
 3719|      0|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  5.54k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  5.54k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 213, False: 5.32k]
  ------------------
 3726|  5.54k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|    213|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|    213|    am.power2++;
 3729|    213|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  5.54k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  5.54k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 5.54k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  5.54k|}
_ZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_i:
 3951|  5.54k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  5.54k|    round_nearest_tie_even(
 3953|  5.54k|        a, shift,
 3954|  5.54k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  5.54k|          return is_above || (is_halfway && truncated) ||
 3956|  5.54k|                 (is_odd && is_halfway);
 3957|  5.54k|        });
 3958|  5.54k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS3_iE_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  5.54k|                       callback cb) noexcept {
 3743|  5.54k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 5.54k]
  ------------------
 3744|  5.54k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 5.54k]
  ------------------
 3745|  5.54k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  5.54k|  bool is_above = truncated_bits > halfway;
 3747|  5.54k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  5.54k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 5.54k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  5.54k|  } else {
 3753|  5.54k|    am.mantissa >>= shift;
 3754|  5.54k|  }
 3755|  5.54k|  am.power2 += shift;
 3756|       |
 3757|  5.54k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  5.54k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  5.54k|}
_ZZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_iENKUlbbbE_clEbbb:
 3954|  5.54k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  5.54k|          return is_above || (is_halfway && truncated) ||
  ------------------
  |  Branch (3955:18): [True: 863, False: 4.67k]
  |  Branch (3955:31): [True: 1.47k, False: 3.20k]
  |  Branch (3955:45): [True: 536, False: 934]
  ------------------
 3956|  4.14k|                 (is_odd && is_halfway);
  ------------------
  |  Branch (3956:19): [True: 2.63k, False: 1.50k]
  |  Branch (3956:29): [True: 42, False: 2.59k]
  ------------------
 3957|  5.54k|        });
_ZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_i:
 3970|  9.21k|    bigint &bigmant, adjusted_mantissa am, int32_t exponent) noexcept {
 3971|  9.21k|  bigint &real_digits = bigmant;
 3972|  9.21k|  int32_t real_exp = exponent;
 3973|       |
 3974|       |  // get the value of `b`, rounded down, and get a bigint representation of b+h
 3975|  9.21k|  adjusted_mantissa am_b = am;
 3976|       |  // gcc7 buf: use a lambda to remove the noexcept qualifier bug with
 3977|       |  // -Wnoexcept-type.
 3978|  9.21k|  round<T>(am_b,
 3979|  9.21k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
 3980|  9.21k|  T b;
 3981|  9.21k|  to_float(false, am_b, b);
 3982|  9.21k|  adjusted_mantissa theor = to_extended_halfway(b);
 3983|  9.21k|  bigint theor_digits(theor.mantissa);
 3984|  9.21k|  int32_t theor_exp = theor.power2;
 3985|       |
 3986|       |  // scale real digits and theor digits to be same power.
 3987|  9.21k|  int32_t pow2_exp = theor_exp - real_exp;
 3988|  9.21k|  uint32_t pow5_exp = uint32_t(-real_exp);
 3989|  9.21k|  if (pow5_exp != 0) {
  ------------------
  |  Branch (3989:7): [True: 9.21k, False: 0]
  ------------------
 3990|  9.21k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow5(pow5_exp));
  ------------------
  |  |  344|  9.21k|  { ((void)(x)); }
  ------------------
 3991|  9.21k|  }
 3992|  9.21k|  if (pow2_exp > 0) {
  ------------------
  |  Branch (3992:7): [True: 6.46k, False: 2.75k]
  ------------------
 3993|  6.46k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow2(uint32_t(pow2_exp)));
  ------------------
  |  |  344|  6.46k|  { ((void)(x)); }
  ------------------
 3994|  6.46k|  } else if (pow2_exp < 0) {
  ------------------
  |  Branch (3994:14): [True: 2.56k, False: 194]
  ------------------
 3995|  2.56k|    GLZ_FASTFLOAT_ASSERT(real_digits.pow2(uint32_t(-pow2_exp)));
  ------------------
  |  |  344|  2.56k|  { ((void)(x)); }
  ------------------
 3996|  2.56k|  }
 3997|       |
 3998|       |  // compare digits, and use it to director rounding
 3999|  9.21k|  int ord = real_digits.compare(theor_digits);
 4000|  9.21k|  adjusted_mantissa answer = am;
 4001|  9.21k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  9.21k|    round_nearest_tie_even(
 4003|  9.21k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  9.21k|          (void)_;  // not needed, since we've done our comparison
 4005|  9.21k|          (void)__; // not needed, since we've done our comparison
 4006|  9.21k|          if (ord > 0) {
 4007|  9.21k|            return true;
 4008|  9.21k|          } else if (ord < 0) {
 4009|  9.21k|            return false;
 4010|  9.21k|          } else {
 4011|  9.21k|            return is_odd;
 4012|  9.21k|          }
 4013|  9.21k|        });
 4014|  9.21k|  });
 4015|       |
 4016|  9.21k|  return answer;
 4017|  9.21k|}
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE_EEvS6_T0_:
 3707|  9.21k|                                                         callback cb) noexcept {
 3708|  9.21k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  9.21k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 842, False: 8.37k]
  ------------------
 3710|       |    // have a denormal float
 3711|    842|    int32_t shift = -am.power2 + 1;
 3712|    842|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    842|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 842, False: 0]
  ------------------
 3715|    842|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    842|                    ? 0
 3717|    842|                    : 1;
 3718|    842|    return;
 3719|    842|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  8.37k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  8.37k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 8.37k]
  ------------------
 3726|  8.37k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|      0|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|      0|    am.power2++;
 3729|      0|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  8.37k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  8.37k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 8.37k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  8.37k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE_clES5_i:
 3979|  9.21k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
_ZN3glz10fast_float10round_downERNS0_17adjusted_mantissaEi:
 3762|  9.21k|round_down(adjusted_mantissa &am, int32_t shift) noexcept {
 3763|  9.21k|  if (shift == 64) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 9.21k]
  ------------------
 3764|      0|    am.mantissa = 0;
 3765|  9.21k|  } else {
 3766|  9.21k|    am.mantissa >>= shift;
 3767|  9.21k|  }
 3768|  9.21k|  am.power2 += shift;
 3769|  9.21k|}
_ZN3glz10fast_float19to_extended_halfwayIdEENS0_17adjusted_mantissaET_:
 3696|  9.21k|to_extended_halfway(T value) noexcept {
 3697|  9.21k|  adjusted_mantissa am = to_extended(value);
 3698|  9.21k|  am.mantissa <<= 1;
 3699|  9.21k|  am.mantissa += 1;
 3700|  9.21k|  am.power2 -= 1;
 3701|  9.21k|  return am;
 3702|  9.21k|}
_ZN3glz10fast_float11to_extendedIdEENS0_17adjusted_mantissaET_:
 3661|  9.21k|to_extended(T value) noexcept {
 3662|  9.21k|  using equiv_uint = equiv_uint_t<T>;
 3663|  9.21k|  constexpr equiv_uint exponent_mask = binary_format<T>::exponent_mask();
 3664|  9.21k|  constexpr equiv_uint mantissa_mask = binary_format<T>::mantissa_mask();
 3665|  9.21k|  constexpr equiv_uint hidden_bit_mask = binary_format<T>::hidden_bit_mask();
 3666|       |
 3667|  9.21k|  adjusted_mantissa am;
 3668|  9.21k|  int32_t bias = binary_format<T>::mantissa_explicit_bits() -
 3669|  9.21k|                 binary_format<T>::minimum_exponent();
 3670|  9.21k|  equiv_uint bits;
 3671|  9.21k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 3672|  9.21k|  bits = std::bit_cast<equiv_uint>(value);
 3673|       |#else
 3674|       |  ::memcpy(&bits, &value, sizeof(T));
 3675|       |#endif
 3676|  9.21k|  if ((bits & exponent_mask) == 0) {
  ------------------
  |  Branch (3676:7): [True: 842, False: 8.37k]
  ------------------
 3677|       |    // denormal
 3678|    842|    am.power2 = 1 - bias;
 3679|    842|    am.mantissa = bits & mantissa_mask;
 3680|  8.37k|  } else {
 3681|       |    // normal
 3682|  8.37k|    am.power2 = int32_t((bits & exponent_mask) >>
 3683|  8.37k|                        binary_format<T>::mantissa_explicit_bits());
 3684|  8.37k|    am.power2 -= bias;
 3685|  8.37k|    am.mantissa = (bits & mantissa_mask) | hidden_bit_mask;
 3686|  8.37k|  }
 3687|       |
 3688|  9.21k|  return am;
 3689|  9.21k|}
_ZN3glz10fast_float6bigintC2Em:
 3406|  9.21k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint(uint64_t value) : vec() {
 3407|  9.21k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3408|  9.21k|    vec.push_unchecked(value);
 3409|       |#else
 3410|       |    vec.push_unchecked(uint32_t(value));
 3411|       |    vec.push_unchecked(uint32_t(value >> 32));
 3412|       |#endif
 3413|  9.21k|    vec.normalize();
 3414|  9.21k|  }
_ZNK3glz10fast_float6bigint7compareERKS1_:
 3451|  9.21k|  GLZ_FASTFLOAT_CONSTEXPR20 int compare(bigint const &other) const noexcept {
 3452|  9.21k|    if (vec.len() > other.vec.len()) {
  ------------------
  |  Branch (3452:9): [True: 0, False: 9.21k]
  ------------------
 3453|      0|      return 1;
 3454|  9.21k|    } else if (vec.len() < other.vec.len()) {
  ------------------
  |  Branch (3454:16): [True: 0, False: 9.21k]
  ------------------
 3455|      0|      return -1;
 3456|  9.21k|    } else {
 3457|  26.8k|      for (size_t index = vec.len(); index > 0; index--) {
  ------------------
  |  Branch (3457:38): [True: 26.2k, False: 641]
  ------------------
 3458|  26.2k|        limb xi = vec[index - 1];
 3459|  26.2k|        limb yi = other.vec[index - 1];
 3460|  26.2k|        if (xi > yi) {
  ------------------
  |  Branch (3460:13): [True: 3.48k, False: 22.7k]
  ------------------
 3461|  3.48k|          return 1;
 3462|  22.7k|        } else if (xi < yi) {
  ------------------
  |  Branch (3462:20): [True: 5.09k, False: 17.6k]
  ------------------
 3463|  5.09k|          return -1;
 3464|  5.09k|        }
 3465|  26.2k|      }
 3466|    641|      return 0;
 3467|  9.21k|    }
 3468|  9.21k|  }
_ZNK3glz10fast_float8stackvecILt62EEixEm:
 3022|  52.4k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &operator[](size_t index) const noexcept {
 3023|  52.4k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  52.4k|  { ((void)(x)); }
  ------------------
 3024|  52.4k|    return data[index];
 3025|  52.4k|  }
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE0_EEvS6_T0_:
 3707|  9.21k|                                                         callback cb) noexcept {
 3708|  9.21k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  9.21k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 842, False: 8.37k]
  ------------------
 3710|       |    // have a denormal float
 3711|    842|    int32_t shift = -am.power2 + 1;
 3712|    842|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    842|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 832, False: 10]
  ------------------
 3715|    842|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    842|                    ? 0
 3717|    842|                    : 1;
 3718|    842|    return;
 3719|    842|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  8.37k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  8.37k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 709, False: 7.66k]
  ------------------
 3726|  8.37k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|    709|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|    709|    am.power2++;
 3729|    709|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  8.37k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  8.37k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 8.37k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  8.37k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_i:
 4001|  9.21k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  9.21k|    round_nearest_tie_even(
 4003|  9.21k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  9.21k|          (void)_;  // not needed, since we've done our comparison
 4005|  9.21k|          (void)__; // not needed, since we've done our comparison
 4006|  9.21k|          if (ord > 0) {
 4007|  9.21k|            return true;
 4008|  9.21k|          } else if (ord < 0) {
 4009|  9.21k|            return false;
 4010|  9.21k|          } else {
 4011|  9.21k|            return is_odd;
 4012|  9.21k|          }
 4013|  9.21k|        });
 4014|  9.21k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iENKUlRS3_iE0_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  9.21k|                       callback cb) noexcept {
 3743|  9.21k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 9.21k]
  ------------------
 3744|  9.21k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 9.21k]
  ------------------
 3745|  9.21k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  9.21k|  bool is_above = truncated_bits > halfway;
 3747|  9.21k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  9.21k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 9.21k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  9.21k|  } else {
 3753|  9.21k|    am.mantissa >>= shift;
 3754|  9.21k|  }
 3755|  9.21k|  am.power2 += shift;
 3756|       |
 3757|  9.21k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  9.21k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  9.21k|}
_ZZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_iENKUlbbbE_clEbbb:
 4003|  9.21k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  9.21k|          (void)_;  // not needed, since we've done our comparison
 4005|  9.21k|          (void)__; // not needed, since we've done our comparison
 4006|  9.21k|          if (ord > 0) {
  ------------------
  |  Branch (4006:15): [True: 3.48k, False: 5.73k]
  ------------------
 4007|  3.48k|            return true;
 4008|  5.73k|          } else if (ord < 0) {
  ------------------
  |  Branch (4008:22): [True: 5.09k, False: 641]
  ------------------
 4009|  5.09k|            return false;
 4010|  5.09k|          } else {
 4011|    641|            return is_odd;
 4012|    641|          }
 4013|  9.21k|        });
_ZN3glz10fast_float8to_floatIdEEvbNS0_17adjusted_mantissaERT_:
 1131|   139k|to_float(bool negative, adjusted_mantissa am, T &value) {
 1132|   139k|  using equiv_uint = equiv_uint_t<T>;
 1133|   139k|  equiv_uint word = equiv_uint(am.mantissa);
 1134|   139k|  word = equiv_uint(word | equiv_uint(am.power2)
 1135|   139k|                               << binary_format<T>::mantissa_explicit_bits());
 1136|   139k|  word =
 1137|   139k|      equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
 1138|   139k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 1139|   139k|  value = std::bit_cast<T>(word);
 1140|       |#else
 1141|       |  ::memcpy(&value, &word, sizeof(T));
 1142|       |#endif
 1143|   139k|}
_ZN3glz10fast_float13binary_formatIdE10sign_indexEv:
  758|   139k|template <> inline constexpr int binary_format<double>::sign_index() {
  759|   139k|  return 63;
  760|   139k|}
_ZN3glz10fast_float13binary_formatIdE14infinite_powerEv:
  750|   381k|template <> inline constexpr int binary_format<double>::infinite_power() {
  751|   381k|  return 0x7FF;
  752|   381k|}

_ZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_:
   27|  1.66M|   {
   28|  1.66M|      if constexpr (N > 0) {
   29|       |         // Explicit sizes for small N to help the compiler and make debugging easier
   30|       |         // These generate less assembly with O0, but make no difference for higher optimization
   31|       |         if constexpr (N == 1) {
   32|       |            lambda.template operator()<0>();
   33|       |         }
   34|       |         else if constexpr (N == 2) {
   35|       |            lambda.template operator()<0>();
   36|       |            lambda.template operator()<1>();
   37|       |         }
   38|       |         else if constexpr (N == 3) {
   39|       |            lambda.template operator()<0>();
   40|       |            lambda.template operator()<1>();
   41|       |            lambda.template operator()<2>();
   42|       |         }
   43|       |         else if constexpr (N == 4) {
   44|       |            lambda.template operator()<0>();
   45|       |            lambda.template operator()<1>();
   46|       |            lambda.template operator()<2>();
   47|       |            lambda.template operator()<3>();
   48|       |         }
   49|  1.66M|         else {
   50|  1.66M|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|  1.66M|               (void)(lambda.template operator()<I>(), ...);
   52|  1.66M|            }(std::make_index_sequence<N>{});
   53|  1.66M|         }
   54|  1.66M|      }
   55|  1.66M|   }
_ZZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_16is_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_ENKUlTpTnmNS2_16integer_sequenceImJXspT_EEEEE_clIJLm0ELm1ELm2ELm3ELm4ELm5EEEEDaS12_:
   50|  1.66M|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|  1.66M|               (void)(lambda.template operator()<I>(), ...);
   52|  1.66M|            }(std::make_index_sequence<N>{});
_ZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_:
   27|   904k|   {
   28|   904k|      if constexpr (N > 0) {
   29|       |         // Explicit sizes for small N to help the compiler and make debugging easier
   30|       |         // These generate less assembly with O0, but make no difference for higher optimization
   31|       |         if constexpr (N == 1) {
   32|       |            lambda.template operator()<0>();
   33|       |         }
   34|       |         else if constexpr (N == 2) {
   35|       |            lambda.template operator()<0>();
   36|       |            lambda.template operator()<1>();
   37|       |         }
   38|       |         else if constexpr (N == 3) {
   39|       |            lambda.template operator()<0>();
   40|       |            lambda.template operator()<1>();
   41|       |            lambda.template operator()<2>();
   42|       |         }
   43|       |         else if constexpr (N == 4) {
   44|       |            lambda.template operator()<0>();
   45|       |            lambda.template operator()<1>();
   46|       |            lambda.template operator()<2>();
   47|       |            lambda.template operator()<3>();
   48|       |         }
   49|   904k|         else {
   50|   904k|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|   904k|               (void)(lambda.template operator()<I>(), ...);
   52|   904k|            }(std::make_index_sequence<N>{});
   53|   904k|         }
   54|   904k|      }
   55|   904k|   }
_ZZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_14is_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_ENKUlTpTnmNS2_16integer_sequenceImJXspT_EEEEE_clIJLm0ELm1ELm2ELm3ELm4ELm5EEEEDaS12_:
   50|   904k|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|   904k|               (void)(lambda.template operator()<I>(), ...);
   52|   904k|            }(std::make_index_sequence<N>{});
_ZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_:
   27|  1.37M|   {
   28|  1.37M|      if constexpr (N > 0) {
   29|       |         // Explicit sizes for small N to help the compiler and make debugging easier
   30|       |         // These generate less assembly with O0, but make no difference for higher optimization
   31|       |         if constexpr (N == 1) {
   32|       |            lambda.template operator()<0>();
   33|       |         }
   34|       |         else if constexpr (N == 2) {
   35|       |            lambda.template operator()<0>();
   36|       |            lambda.template operator()<1>();
   37|       |         }
   38|       |         else if constexpr (N == 3) {
   39|       |            lambda.template operator()<0>();
   40|       |            lambda.template operator()<1>();
   41|       |            lambda.template operator()<2>();
   42|       |         }
   43|       |         else if constexpr (N == 4) {
   44|       |            lambda.template operator()<0>();
   45|       |            lambda.template operator()<1>();
   46|       |            lambda.template operator()<2>();
   47|       |            lambda.template operator()<3>();
   48|       |         }
   49|  1.37M|         else {
   50|  1.37M|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|  1.37M|               (void)(lambda.template operator()<I>(), ...);
   52|  1.37M|            }(std::make_index_sequence<N>{});
   53|  1.37M|         }
   54|  1.37M|      }
   55|  1.37M|   }
_ZZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_15is_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_ENKUlTpTnmNS2_16integer_sequenceImJXspT_EEEEE_clIJLm0ELm1ELm2ELm3ELm4ELm5EEEEDaS12_:
   50|  1.37M|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|  1.37M|               (void)(lambda.template operator()<I>(), ...);
   52|  1.37M|            }(std::make_index_sequence<N>{});
_ZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_:
   27|  3.06M|   {
   28|  3.06M|      if constexpr (N > 0) {
   29|       |         // Explicit sizes for small N to help the compiler and make debugging easier
   30|       |         // These generate less assembly with O0, but make no difference for higher optimization
   31|       |         if constexpr (N == 1) {
   32|       |            lambda.template operator()<0>();
   33|       |         }
   34|       |         else if constexpr (N == 2) {
   35|       |            lambda.template operator()<0>();
   36|       |            lambda.template operator()<1>();
   37|       |         }
   38|       |         else if constexpr (N == 3) {
   39|       |            lambda.template operator()<0>();
   40|       |            lambda.template operator()<1>();
   41|       |            lambda.template operator()<2>();
   42|       |         }
   43|       |         else if constexpr (N == 4) {
   44|       |            lambda.template operator()<0>();
   45|       |            lambda.template operator()<1>();
   46|       |            lambda.template operator()<2>();
   47|       |            lambda.template operator()<3>();
   48|       |         }
   49|  3.06M|         else {
   50|  3.06M|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|  3.06M|               (void)(lambda.template operator()<I>(), ...);
   52|  3.06M|            }(std::make_index_sequence<N>{});
   53|  3.06M|         }
   54|  3.06M|      }
   55|  3.06M|   }
_ZZN3glz8for_eachILm6EZNS_28process_variant_alternativesINSt3__17variantIJDndNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEbNS2_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS7_ISE_EEEENSD_ISE_EEEEENS_14is_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEERSI_TkNS_10is_contextERNS_7contextERPKcSR_EEvOT0_OT1_OT2_T3_EUlTnmvE_EEvSU_ENKUlTpTnmNS2_16integer_sequenceImJXspT_EEEEE_clIJLm0ELm1ELm2ELm3ELm4ELm5EEEEDaS12_:
   50|  3.06M|            [&]<size_t... I>(std::index_sequence<I...>) {
   51|  3.06M|               (void)(lambda.template operator()<I>(), ...);
   52|  3.06M|            }(std::make_index_sequence<N>{});
_ZN3glz5visitILm4EZNS_16parse_and_invokeITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEE9my_structRS3_JETkNS_10is_contextERNS_7contextERPKcS9_Qoo14glaze_object_tIT0_E11reflectableISA_EEEvOT1_OT3_OT4_OT5_DpOT2_EUlTnmvE_EEvOSA_m:
   86|  26.8k|   {
   87|  26.8k|      if constexpr (N > 0) {
   88|  26.8k|         assert(index < N && "glz::visit index out of range");
  ------------------
  |  Branch (88:10): [True: 26.8k, False: 0]
  |  Branch (88:10): [True: 26.8k, Folded]
  |  Branch (88:10): [True: 26.8k, False: 0]
  ------------------
   89|       |         // Explicit sizes for small N to help the compiler and make debugging easier
   90|       |         if constexpr (N == 1) {
   91|       |            (void)index;
   92|       |            (void)(lambda.template operator()<0>());
   93|       |         }
   94|       |         else if constexpr (N == 2) {
   95|       |            switch (index) {
   96|       |            case 0:
   97|       |               lambda.template operator()<0>();
   98|       |               break;
   99|       |            case 1:
  100|       |               lambda.template operator()<1>();
  101|       |               break;
  102|       |            default:
  103|       |               std::unreachable();
  104|       |            }
  105|       |         }
  106|       |         else if constexpr (N == 3) {
  107|       |            switch (index) {
  108|       |            case 0:
  109|       |               lambda.template operator()<0>();
  110|       |               break;
  111|       |            case 1:
  112|       |               lambda.template operator()<1>();
  113|       |               break;
  114|       |            case 2:
  115|       |               lambda.template operator()<2>();
  116|       |               break;
  117|       |            default:
  118|       |               std::unreachable();
  119|       |            }
  120|       |         }
  121|  26.8k|         else if constexpr (N == 4) {
  122|  26.8k|            switch (index) {
  123|  7.97k|            case 0:
  ------------------
  |  Branch (123:13): [True: 7.97k, False: 18.8k]
  ------------------
  124|  7.97k|               lambda.template operator()<0>();
  125|  7.97k|               break;
  126|  8.93k|            case 1:
  ------------------
  |  Branch (126:13): [True: 8.93k, False: 17.9k]
  ------------------
  127|  8.93k|               lambda.template operator()<1>();
  128|  8.93k|               break;
  129|  2.28k|            case 2:
  ------------------
  |  Branch (129:13): [True: 2.28k, False: 24.5k]
  ------------------
  130|  2.28k|               lambda.template operator()<2>();
  131|  2.28k|               break;
  132|  7.64k|            case 3:
  ------------------
  |  Branch (132:13): [True: 7.64k, False: 19.2k]
  ------------------
  133|  7.64k|               lambda.template operator()<3>();
  134|  7.64k|               break;
  135|      0|            default:
  ------------------
  |  Branch (135:13): [True: 0, False: 26.8k]
  ------------------
  136|      0|               std::unreachable();
  137|  26.8k|            }
  138|       |         }
  139|       |         else if constexpr (N == 5) {
  140|       |            switch (index) {
  141|       |            case 0:
  142|       |               lambda.template operator()<0>();
  143|       |               break;
  144|       |            case 1:
  145|       |               lambda.template operator()<1>();
  146|       |               break;
  147|       |            case 2:
  148|       |               lambda.template operator()<2>();
  149|       |               break;
  150|       |            case 3:
  151|       |               lambda.template operator()<3>();
  152|       |               break;
  153|       |            case 4:
  154|       |               lambda.template operator()<4>();
  155|       |               break;
  156|       |            default:
  157|       |               std::unreachable();
  158|       |            }
  159|       |         }
  160|       |         else if constexpr (N == 6) {
  161|       |            switch (index) {
  162|       |            case 0:
  163|       |               lambda.template operator()<0>();
  164|       |               break;
  165|       |            case 1:
  166|       |               lambda.template operator()<1>();
  167|       |               break;
  168|       |            case 2:
  169|       |               lambda.template operator()<2>();
  170|       |               break;
  171|       |            case 3:
  172|       |               lambda.template operator()<3>();
  173|       |               break;
  174|       |            case 4:
  175|       |               lambda.template operator()<4>();
  176|       |               break;
  177|       |            case 5:
  178|       |               lambda.template operator()<5>();
  179|       |               break;
  180|       |            default:
  181|       |               std::unreachable();
  182|       |            }
  183|       |         }
  184|       |         else if constexpr (N == 7) {
  185|       |            switch (index) {
  186|       |            case 0:
  187|       |               lambda.template operator()<0>();
  188|       |               break;
  189|       |            case 1:
  190|       |               lambda.template operator()<1>();
  191|       |               break;
  192|       |            case 2:
  193|       |               lambda.template operator()<2>();
  194|       |               break;
  195|       |            case 3:
  196|       |               lambda.template operator()<3>();
  197|       |               break;
  198|       |            case 4:
  199|       |               lambda.template operator()<4>();
  200|       |               break;
  201|       |            case 5:
  202|       |               lambda.template operator()<5>();
  203|       |               break;
  204|       |            case 6:
  205|       |               lambda.template operator()<6>();
  206|       |               break;
  207|       |            default:
  208|       |               std::unreachable();
  209|       |            }
  210|       |         }
  211|       |         else if constexpr (N == 8) {
  212|       |            switch (index) {
  213|       |            case 0:
  214|       |               lambda.template operator()<0>();
  215|       |               break;
  216|       |            case 1:
  217|       |               lambda.template operator()<1>();
  218|       |               break;
  219|       |            case 2:
  220|       |               lambda.template operator()<2>();
  221|       |               break;
  222|       |            case 3:
  223|       |               lambda.template operator()<3>();
  224|       |               break;
  225|       |            case 4:
  226|       |               lambda.template operator()<4>();
  227|       |               break;
  228|       |            case 5:
  229|       |               lambda.template operator()<5>();
  230|       |               break;
  231|       |            case 6:
  232|       |               lambda.template operator()<6>();
  233|       |               break;
  234|       |            case 7:
  235|       |               lambda.template operator()<7>();
  236|       |               break;
  237|       |            default:
  238|       |               std::unreachable();
  239|       |            }
  240|       |         }
  241|       |         else if constexpr (N == 9) {
  242|       |            switch (index) {
  243|       |            case 0:
  244|       |               lambda.template operator()<0>();
  245|       |               break;
  246|       |            case 1:
  247|       |               lambda.template operator()<1>();
  248|       |               break;
  249|       |            case 2:
  250|       |               lambda.template operator()<2>();
  251|       |               break;
  252|       |            case 3:
  253|       |               lambda.template operator()<3>();
  254|       |               break;
  255|       |            case 4:
  256|       |               lambda.template operator()<4>();
  257|       |               break;
  258|       |            case 5:
  259|       |               lambda.template operator()<5>();
  260|       |               break;
  261|       |            case 6:
  262|       |               lambda.template operator()<6>();
  263|       |               break;
  264|       |            case 7:
  265|       |               lambda.template operator()<7>();
  266|       |               break;
  267|       |            case 8:
  268|       |               lambda.template operator()<8>();
  269|       |               break;
  270|       |            default:
  271|       |               std::unreachable();
  272|       |            }
  273|       |         }
  274|       |         else if constexpr (N == 10) {
  275|       |            switch (index) {
  276|       |            case 0:
  277|       |               lambda.template operator()<0>();
  278|       |               break;
  279|       |            case 1:
  280|       |               lambda.template operator()<1>();
  281|       |               break;
  282|       |            case 2:
  283|       |               lambda.template operator()<2>();
  284|       |               break;
  285|       |            case 3:
  286|       |               lambda.template operator()<3>();
  287|       |               break;
  288|       |            case 4:
  289|       |               lambda.template operator()<4>();
  290|       |               break;
  291|       |            case 5:
  292|       |               lambda.template operator()<5>();
  293|       |               break;
  294|       |            case 6:
  295|       |               lambda.template operator()<6>();
  296|       |               break;
  297|       |            case 7:
  298|       |               lambda.template operator()<7>();
  299|       |               break;
  300|       |            case 8:
  301|       |               lambda.template operator()<8>();
  302|       |               break;
  303|       |            case 9:
  304|       |               lambda.template operator()<9>();
  305|       |               break;
  306|       |            default:
  307|       |               std::unreachable();
  308|       |            }
  309|       |         }
  310|       |         else {
  311|       |#ifdef _MSC_VER
  312|       |            using Lambda = std::decay_t<decltype(lambda)>;
  313|       |            static const auto jump_table = []<size_t... I>(std::index_sequence<I...>) {
  314|       |               return std::array{make_jump_function<I, Lambda>()...};
  315|       |            }(std::make_index_sequence<N>{});
  316|       |#else
  317|       |            static constexpr auto jump_table = []<size_t... I>(std::index_sequence<I...>) {
  318|       |               return std::array{+[](std::decay_t<decltype(lambda)>& l) { l.template operator()<I>(); }...};
  319|       |            }(std::make_index_sequence<N>{});
  320|       |#endif
  321|       |
  322|       |#if defined(__clang_major__) && (__clang_major__ >= 19)
  323|       |            [[assume(index < N)]];
  324|       |#endif
  325|       |            jump_table[index](lambda);
  326|       |
  327|       |            // This code runs significantly slower on Clang
  328|       |            // Simple tests with assembly show that this should be faster,
  329|       |            // but full Glaze assembly need to be looked into
  330|       |            /*[&, index]<size_t... I>(std::index_sequence<I...>) {
  331|       |               (void)((index == I ? lambda.template operator()<I>() : void()), ...);
  332|       |            }(std::make_index_sequence<N>{});*/
  333|       |         }
  334|  26.8k|      }
  335|  26.8k|   }

_ZN3glz10from_charsILb1EdcEENS_10fast_float19from_chars_result_tIT1_EEPKS3_S6_RT0_:
  235|  3.07M|   {
  236|  3.07M|      using namespace glz::fast_float;
  237|  3.07M|      static_assert(is_supported_float_type<T>(), "only some floating-point types are supported");
  238|  3.07M|      static_assert(is_supported_char_type<UC>(), "only char, wchar_t, char16_t and char32_t are supported");
  239|       |
  240|  3.07M|      parsed_number_string_t<UC> pns = glz::parse_number_string<null_terminated, UC>(first, last);
  241|  3.07M|      if (!pns.valid) [[unlikely]] {
  ------------------
  |  Branch (241:11): [True: 122, False: 3.07M]
  ------------------
  242|    122|         return {.ptr = first, .ec = std::errc::invalid_argument};
  243|    122|      }
  244|       |
  245|  3.07M|      return from_chars_advanced(pns, value);
  246|  3.07M|   }
_ZN3glz19parse_number_stringILb1EcEENS_10fast_float22parsed_number_string_tIT0_EEPKS3_S6_:
   18|  3.07M|   {
   19|  3.07M|      using namespace glz::fast_float;
   20|  3.07M|      static constexpr UC decimal_point = '.';
   21|       |
   22|  3.07M|      parsed_number_string_t<UC> answer;
   23|  3.07M|      answer.valid = false;
   24|  3.07M|      answer.too_many_digits = false;
   25|  3.07M|      answer.negative = (*p == UC('-'));
   26|  3.07M|      if (*p == UC('-')) { // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
  ------------------
  |  Branch (26:11): [True: 1.49k, False: 3.06M]
  ------------------
   27|  1.49k|         ++p;
   28|       |
   29|       |         if constexpr (not null_terminated) {
   30|       |            if (p == pend) [[unlikely]] {
   31|       |               return answer;
   32|       |            }
   33|       |         }
   34|       |
   35|  1.49k|         if (!glz::fast_float::is_integer(*p)) [[unlikely]] { // a sign must be followed by an integer
  ------------------
  |  Branch (35:14): [True: 8, False: 1.48k]
  ------------------
   36|      8|            return answer;
   37|      8|         }
   38|  1.49k|      }
   39|  3.07M|      UC const* const start_digits = p;
   40|       |
   41|  3.07M|      uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad)
   42|       |
   43|  3.07M|      uint64_t digit;
   44|  3.07M|      if constexpr (null_terminated) {
   45|  15.8M|         while ((digit = glz::fast_float::digit_value(*p)) <= 9) {
  ------------------
  |  Branch (45:17): [True: 12.7M, False: 3.07M]
  ------------------
   46|       |            // a multiplication by 10 is cheaper than an arbitrary integer
   47|       |            // multiplication
   48|  12.7M|            i = 10 * i + digit; // might overflow, we will handle the overflow later
   49|  12.7M|            ++p;
   50|  12.7M|         }
   51|       |      }
   52|       |      else {
   53|       |         while ((p != pend) && (digit = glz::fast_float::digit_value(*p)) <= 9) {
   54|       |            // a multiplication by 10 is cheaper than an arbitrary integer
   55|       |            // multiplication
   56|       |            i = 10 * i + digit; // might overflow, we will handle the overflow later
   57|       |            ++p;
   58|       |         }
   59|       |      }
   60|       |
   61|  3.07M|      UC const* const end_of_integer_part = p;
   62|  3.07M|      int64_t digit_count = int64_t(end_of_integer_part - start_digits);
   63|  3.07M|      answer.integer = glz::fast_float::span<const UC>(start_digits, size_t(digit_count));
   64|       |
   65|       |      // at least 1 digit in integer part, without leading zeros
   66|  3.07M|      if (digit_count == 0 || (start_digits[0] == UC('0') && digit_count > 1)) {
  ------------------
  |  Branch (66:11): [True: 92, False: 3.07M]
  |  Branch (66:32): [True: 828k, False: 2.24M]
  |  Branch (66:62): [True: 2, False: 828k]
  ------------------
   67|     94|         return answer;
   68|     94|      }
   69|       |
   70|  3.07M|      int64_t exponent = 0;
   71|  3.07M|      const bool has_decimal_point = [&] {
   72|  3.07M|         if constexpr (null_terminated) {
   73|  3.07M|            return (*p == decimal_point);
   74|  3.07M|         }
   75|  3.07M|         else {
   76|  3.07M|            return (p != pend) && (*p == decimal_point);
   77|  3.07M|         }
   78|  3.07M|      }();
   79|  3.07M|      if (has_decimal_point) {
  ------------------
  |  Branch (79:11): [True: 22.4k, False: 3.04M]
  ------------------
   80|  22.4k|         ++p;
   81|  22.4k|         UC const* before = p;
   82|       |         // can occur at most twice without overflowing, but let it occur more, since
   83|       |         // for integers with many digits, digit parsing is the primary bottleneck.
   84|  22.4k|         loop_parse_if_eight_digits(p, pend, i);
   85|       |
   86|  22.4k|         if constexpr (null_terminated) {
   87|  99.5k|            while ((digit = glz::fast_float::digit_value(*p)) <= 9) {
  ------------------
  |  Branch (87:20): [True: 77.1k, False: 22.4k]
  ------------------
   88|  77.1k|               ++p;
   89|  77.1k|               i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
   90|  77.1k|            }
   91|       |         }
   92|       |         else {
   93|       |            while ((p != pend) && (digit = glz::fast_float::digit_value(*p)) <= 9) {
   94|       |               ++p;
   95|       |               i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
   96|       |            }
   97|       |         }
   98|  22.4k|         exponent = before - p;
   99|  22.4k|         answer.fraction = glz::fast_float::span<const UC>(before, size_t(p - before));
  100|  22.4k|         digit_count -= exponent;
  101|  22.4k|      }
  102|       |      // at least 1 digit in fractional part
  103|  3.07M|      if (has_decimal_point && exponent == 0) {
  ------------------
  |  Branch (103:11): [True: 22.4k, False: 3.04M]
  |  Branch (103:32): [True: 8, False: 22.4k]
  ------------------
  104|      8|         return answer;
  105|      8|      }
  106|       |
  107|  3.07M|      int64_t exp_number = 0; // explicit exponential part
  108|       |
  109|       |      // An exponent marker must be followed by at least one digit, after an optional sign. Unlike
  110|       |      // std::from_chars, which ends the number before a digitless marker, "1e", "1e+" and "1.0E-" are
  111|       |      // rejected: ending early would read "1.0e" as 1 wherever trailing content goes unchecked.
  112|  3.07M|      if constexpr (null_terminated) {
  113|  3.07M|         if ((UC('e') == *p) || (UC('E') == *p)) {
  ------------------
  |  Branch (113:14): [True: 188k, False: 2.88M]
  |  Branch (113:33): [True: 97.2k, False: 2.78M]
  ------------------
  114|   286k|            ++p;
  115|   286k|            bool neg_exp = false;
  116|   286k|            if (UC('-') == *p) {
  ------------------
  |  Branch (116:17): [True: 13.8k, False: 272k]
  ------------------
  117|  13.8k|               neg_exp = true;
  118|  13.8k|               ++p;
  119|  13.8k|            }
  120|   272k|            else if (UC('+') == *p) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
  ------------------
  |  Branch (120:22): [True: 130k, False: 141k]
  ------------------
  121|   130k|               ++p;
  122|   130k|            }
  123|   286k|            if ((digit = glz::fast_float::digit_value(*p)) > 9) [[unlikely]] {
  ------------------
  |  Branch (123:17): [True: 12, False: 285k]
  ------------------
  124|     12|               return answer;
  125|     12|            }
  126|   285k|            else {
  127|   326k|               do {
  128|   326k|                  if (exp_number < 0x10000000) {
  ------------------
  |  Branch (128:23): [True: 324k, False: 1.40k]
  ------------------
  129|   324k|                     exp_number = 10 * exp_number + digit;
  130|   324k|                  }
  131|   326k|                  ++p;
  132|   326k|               } while ((digit = glz::fast_float::digit_value(*p)) <= 9);
  ------------------
  |  Branch (132:25): [True: 40.1k, False: 285k]
  ------------------
  133|   285k|               if (neg_exp) {
  ------------------
  |  Branch (133:20): [True: 13.8k, False: 272k]
  ------------------
  134|  13.8k|                  exp_number = -exp_number;
  135|  13.8k|               }
  136|   285k|               exponent += exp_number;
  137|   285k|            }
  138|   286k|         }
  139|       |      }
  140|       |      else {
  141|       |         if ((p != pend) && ((UC('e') == *p) || (UC('E') == *p))) {
  142|       |            ++p;
  143|       |            bool neg_exp = false;
  144|       |            if ((p != pend) && (UC('-') == *p)) {
  145|       |               neg_exp = true;
  146|       |               ++p;
  147|       |            }
  148|       |            else if ((p != pend) && (UC('+') == *p)) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
  149|       |               ++p;
  150|       |            }
  151|       |            if ((p == pend) || (digit = glz::fast_float::digit_value(*p)) > 9) [[unlikely]] {
  152|       |               return answer;
  153|       |            }
  154|       |            else {
  155|       |               do {
  156|       |                  if (exp_number < 0x10000000) {
  157|       |                     exp_number = 10 * exp_number + digit;
  158|       |                  }
  159|       |                  ++p;
  160|       |               } while ((p != pend) && (digit = glz::fast_float::digit_value(*p)) <= 9);
  161|       |               if (neg_exp) {
  162|       |                  exp_number = -exp_number;
  163|       |               }
  164|       |               exponent += exp_number;
  165|       |            }
  166|       |         }
  167|       |      }
  168|       |
  169|  3.07M|      answer.lastmatch = p;
  170|  3.07M|      answer.valid = true;
  171|       |
  172|       |      // If we frequently had to deal with long strings of digits,
  173|       |      // we could extend our code by using a 128-bit integer instead
  174|       |      // of a 64-bit integer. However, this is uncommon.
  175|       |      //
  176|       |      // We can deal with up to 19 digits.
  177|  3.07M|      if (digit_count > 19) { // this is uncommon
  ------------------
  |  Branch (177:11): [True: 109k, False: 2.96M]
  ------------------
  178|       |         // It is possible that the integer had an overflow.
  179|       |         // We have to handle the case where we have 0.0000somenumber.
  180|       |         // We need to be mindful of the case where we only have zeroes...
  181|       |         // E.g., 0.000000000...000.
  182|   109k|         UC const* start = start_digits;
  183|   109k|         if constexpr (null_terminated) {
  184|  1.28M|            while ((*start == UC('0') || *start == decimal_point)) {
  ------------------
  |  Branch (184:21): [True: 1.16M, False: 118k]
  |  Branch (184:42): [True: 8.60k, False: 109k]
  ------------------
  185|  1.17M|               if (*start == UC('0')) {
  ------------------
  |  Branch (185:20): [True: 1.16M, False: 8.60k]
  ------------------
  186|  1.16M|                  --digit_count;
  187|  1.16M|               }
  188|  1.17M|               ++start;
  189|  1.17M|            }
  190|       |         }
  191|       |         else {
  192|       |            while ((start != pend) && (*start == UC('0') || *start == decimal_point)) {
  193|       |               if (*start == UC('0')) {
  194|       |                  --digit_count;
  195|       |               }
  196|       |               ++start;
  197|       |            }
  198|       |         }
  199|       |
  200|   109k|         if (digit_count > 19) {
  ------------------
  |  Branch (200:14): [True: 108k, False: 1.01k]
  ------------------
  201|   108k|            answer.too_many_digits = true;
  202|       |            // Let us start again, this time, avoiding overflows.
  203|       |            // We don't need to check if is_integer, since we use the
  204|       |            // pre-tokenized spans from above.
  205|   108k|            i = 0;
  206|   108k|            p = answer.integer.ptr;
  207|   108k|            UC const* int_end = p + answer.integer.len();
  208|   108k|            const uint64_t minimal_nineteen_digit_integer{1000000000000000000};
  209|  1.98M|            while ((i < minimal_nineteen_digit_integer) && (p != int_end)) {
  ------------------
  |  Branch (209:20): [True: 1.88M, False: 94.4k]
  |  Branch (209:60): [True: 1.87M, False: 14.2k]
  ------------------
  210|  1.87M|               i = i * 10 + uint64_t(*p - UC('0'));
  211|  1.87M|               ++p;
  212|  1.87M|            }
  213|   108k|            if (i >= minimal_nineteen_digit_integer) { // We have a big integers
  ------------------
  |  Branch (213:17): [True: 94.4k, False: 14.2k]
  ------------------
  214|  94.4k|               exponent = end_of_integer_part - p + exp_number;
  215|  94.4k|            }
  216|  14.2k|            else { // We have a value with a fractional component.
  217|  14.2k|               p = answer.fraction.ptr;
  218|  14.2k|               UC const* frac_end = p + answer.fraction.len();
  219|   242k|               while ((i < minimal_nineteen_digit_integer) && (p != frac_end)) {
  ------------------
  |  Branch (219:23): [True: 228k, False: 14.2k]
  |  Branch (219:63): [True: 228k, False: 0]
  ------------------
  220|   228k|                  i = i * 10 + uint64_t(*p - UC('0'));
  221|   228k|                  ++p;
  222|   228k|               }
  223|  14.2k|               exponent = answer.fraction.ptr - p + exp_number;
  224|  14.2k|            }
  225|       |            // We have now corrected both exponent and i, to a truncated value
  226|   108k|         }
  227|   109k|      }
  228|  3.07M|      answer.exponent = exponent;
  229|  3.07M|      answer.mantissa = i;
  230|  3.07M|      return answer;
  231|  3.07M|   }
_ZZN3glz19parse_number_stringILb1EcEENS_10fast_float22parsed_number_string_tIT0_EEPKS3_S6_ENKUlvE_clEv:
   71|  3.07M|      const bool has_decimal_point = [&] {
   72|  3.07M|         if constexpr (null_terminated) {
   73|  3.07M|            return (*p == decimal_point);
   74|       |         }
   75|       |         else {
   76|       |            return (p != pend) && (*p == decimal_point);
   77|       |         }
   78|  3.07M|      }();

_ZN3glz7skip_wsIXtlNS_7ws_optsELb0ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS5_EEbOT0_OT1_T2_:
  663|  57.1M|   {
  664|  57.1M|      using namespace glz::detail;
  665|       |
  666|  57.1M|      if constexpr (not Opts.minified) {
  667|  57.1M|         if constexpr (Opts.null_terminated) {
  668|  57.1M|            if constexpr (Opts.comments) {
  669|   676M|               while (whitespace_comment_table[uint8_t(*it)]) {
  ------------------
  |  Branch (669:23): [True: 619M, False: 57.1M]
  ------------------
  670|   619M|                  if (*it == '/') [[unlikely]] {
  ------------------
  |  Branch (670:23): [True: 1.71M, False: 617M]
  ------------------
  671|  1.71M|                     skip_comment(ctx, it, end);
  672|  1.71M|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (672:26): [True: 1.42k, False: 1.71M]
  ------------------
  673|  1.42k|                        return true;
  674|  1.42k|                     }
  675|  1.71M|                  }
  676|   617M|                  else [[likely]] {
  677|   617M|                     ++it;
  678|   617M|                  }
  679|   619M|               }
  680|       |            }
  681|       |            else {
  682|       |               while (whitespace_table[uint8_t(*it)]) {
  683|       |                  ++it;
  684|       |               }
  685|       |            }
  686|       |         }
  687|       |         else {
  688|       |            if constexpr (Opts.comments) {
  689|       |               while (it < end && whitespace_comment_table[uint8_t(*it)]) {
  690|       |                  if (*it == '/') [[unlikely]] {
  691|       |                     skip_comment(ctx, it, end);
  692|       |                     if (bool(ctx.error)) [[unlikely]] {
  693|       |                        return true;
  694|       |                     }
  695|       |                  }
  696|       |                  else [[likely]] {
  697|       |                     ++it;
  698|       |                  }
  699|       |               }
  700|       |               if (it == end) [[unlikely]] {
  701|       |                  ctx.error = error_code::end_reached;
  702|       |                  return true;
  703|       |               }
  704|       |            }
  705|       |            else {
  706|       |               while (it < end && whitespace_table[uint8_t(*it)]) {
  707|       |                  ++it;
  708|       |               }
  709|       |               if (it == end) [[unlikely]] {
  710|       |                  ctx.error = error_code::end_reached;
  711|       |                  return true;
  712|       |               }
  713|       |            }
  714|       |         }
  715|       |      }
  716|       |      else if constexpr (not Opts.null_terminated) {
  717|       |         // Minified input has no whitespace to skip, but a non-null-terminated buffer can still
  718|       |         // be exhausted at this point. The non-minified branch above performs the same check; a
  719|       |         // null-terminated buffer relies on the trailing sentinel and keeps this a pure no-op.
  720|       |         if (it == end) [[unlikely]] {
  721|       |            ctx.error = error_code::end_reached;
  722|       |            return true;
  723|       |         }
  724|       |      }
  725|       |
  726|  57.1M|      return false;
  727|  57.1M|   }
_ZN3glz12skip_commentITkNS_10is_contextERNS_7contextERPKcS4_EEvOT_OT0_T1_:
  555|  1.71M|   {
  556|  1.71M|      ++it;
  557|  1.71M|      if (it == end) [[unlikely]] {
  ------------------
  |  Branch (557:11): [True: 97, False: 1.71M]
  ------------------
  558|     97|         ctx.error = error_code::unexpected_end;
  559|     97|      }
  560|  1.71M|      else if (*it == '/') {
  ------------------
  |  Branch (560:16): [True: 1.67M, False: 44.0k]
  ------------------
  561|       |         // A carriage return ends the comment on its own, so a file written with CR line endings
  562|       |         // does not have the rest of the document swallowed by its first comment.
  563|  74.9M|         while (++it != end && *it != '\n' && *it != '\r');
  ------------------
  |  Branch (563:17): [True: 74.9M, False: 1.03k]
  |  Branch (563:32): [True: 73.4M, False: 1.59M]
  |  Branch (563:47): [True: 73.3M, False: 82.9k]
  ------------------
  564|  1.67M|      }
  565|  44.0k|      else if (*it == '*') {
  ------------------
  |  Branch (565:16): [True: 43.7k, False: 284]
  ------------------
  566|  43.7k|         ++it; // past the '*' of the opener, which cannot also close the comment
  567|  22.0M|         while (it != end) {
  ------------------
  |  Branch (567:17): [True: 22.0M, False: 1.04k]
  ------------------
  568|  22.0M|            if (*it == '*') [[unlikely]] {
  ------------------
  |  Branch (568:17): [True: 352k, False: 21.6M]
  ------------------
  569|       |               // Advance past the '*' only, and let the loop look at the byte after it on the next
  570|       |               // turn. Stepping over that byte here as well is what used to hide a closing
  571|       |               // delimiter behind a run of an even number of stars: a '*' was examined as a
  572|       |               // candidate only at an even offset within its run, so a comment opened with "/*" and
  573|       |               // closed with "**" plus "/" scanned to the end of the buffer with its delimiter
  574|       |               // sitting in plain sight.
  575|   352k|               ++it;
  576|   352k|               if (it != end && *it == '/') [[likely]] {
  ------------------
  |  Branch (576:20): [True: 352k, False: 140]
  |  Branch (576:33): [True: 42.7k, False: 309k]
  ------------------
  577|  42.7k|                  ++it;
  578|  42.7k|                  return;
  579|  42.7k|               }
  580|   352k|            }
  581|  21.6M|            else {
  582|  21.6M|               ++it;
  583|  21.6M|            }
  584|  22.0M|         }
  585|       |         // The scan reached the end of the buffer without the closing delimiter. Left unreported,
  586|       |         // this arrives at the value parser as an input that held no value, which reads as an empty
  587|       |         // document rather than as the malformed comment it is.
  588|  1.04k|         ctx.error = error_code::expected_end_comment;
  589|  1.04k|      }
  590|    284|      else [[unlikely]] {
  591|    284|         ctx.error = error_code::expected_end_comment;
  592|    284|      }
  593|  1.71M|   }
_ZN3glz17match_invalid_endILc44EXtlNS_22match_invalid_end_optsELb1EEETkNS_10is_contextENS_7contextERPKcS4_EEbRT1_OT2_T3_:
  470|  3.23M|   {
  471|  3.23M|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (471:11): [True: 1.21k, False: 3.23M]
  ------------------
  472|       |         if constexpr (C == '"') {
  473|       |            ctx.error = error_code::expected_quote;
  474|       |         }
  475|  1.21k|         else if constexpr (C == ',') {
  476|  1.21k|            ctx.error = error_code::expected_comma;
  477|       |         }
  478|       |         else if constexpr (C == ':') {
  479|       |            ctx.error = error_code::expected_colon;
  480|       |         }
  481|       |         else if constexpr (C == '[' || C == ']') {
  482|       |            ctx.error = error_code::expected_bracket;
  483|       |         }
  484|       |         else if constexpr (C == '{' || C == '}') {
  485|       |            ctx.error = error_code::expected_brace;
  486|       |         }
  487|       |         else {
  488|       |            ctx.error = error_code::syntax_error;
  489|       |         }
  490|  1.21k|         return true;
  491|  1.21k|      }
  492|  3.23M|      else [[likely]] {
  493|  3.23M|         ++it;
  494|  3.23M|      }
  495|       |      if constexpr (not Opts.null_terminated) {
  496|       |         if (it == end) [[unlikely]] {
  497|       |            ctx.error = error_code::unexpected_end;
  498|       |            return true;
  499|       |         }
  500|       |      }
  501|  3.23M|      return false;
  502|  3.23M|   }
_ZN3glz17match_invalid_endILc34EXtlNS_22match_invalid_end_optsELb1EEETkNS_10is_contextENS_7contextERPKcS4_EEbRT1_OT2_T3_:
  470|  4.26M|   {
  471|  4.26M|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (471:11): [True: 93, False: 4.26M]
  ------------------
  472|     93|         if constexpr (C == '"') {
  473|     93|            ctx.error = error_code::expected_quote;
  474|       |         }
  475|       |         else if constexpr (C == ',') {
  476|       |            ctx.error = error_code::expected_comma;
  477|       |         }
  478|       |         else if constexpr (C == ':') {
  479|       |            ctx.error = error_code::expected_colon;
  480|       |         }
  481|       |         else if constexpr (C == '[' || C == ']') {
  482|       |            ctx.error = error_code::expected_bracket;
  483|       |         }
  484|       |         else if constexpr (C == '{' || C == '}') {
  485|       |            ctx.error = error_code::expected_brace;
  486|       |         }
  487|       |         else {
  488|       |            ctx.error = error_code::syntax_error;
  489|       |         }
  490|     93|         return true;
  491|     93|      }
  492|  4.26M|      else [[likely]] {
  493|  4.26M|         ++it;
  494|  4.26M|      }
  495|       |      if constexpr (not Opts.null_terminated) {
  496|       |         if (it == end) [[unlikely]] {
  497|       |            ctx.error = error_code::unexpected_end;
  498|       |            return true;
  499|       |         }
  500|       |      }
  501|  4.26M|      return false;
  502|  4.26M|   }
_ZN3glz9chunk_minILm8EEElb:
   47|  5.75M|   {
   48|  5.75M|      static_assert(Width <= padding_bytes);
   49|  5.75M|      return padded ? 1 : std::ptrdiff_t(Width);
  ------------------
  |  Branch (49:14): [True: 0, False: 5.75M]
  ------------------
   50|  5.75M|   }
_ZN3glz18validate_utf8_spanITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextEccEEbOT0_PKT1_PKT2_m:
  873|  3.36M|   {
  874|       |      if constexpr (not check_validate_utf8(Opts)) {
  875|       |         // Everything the caller computed for us is dead, which lets its scan loop drop the
  876|       |         // accumulator entirely.
  877|       |         (void)ctx, (void)start, (void)fin, (void)ascii_acc;
  878|       |         return false;
  879|       |      }
  880|  3.36M|      else {
  881|  3.36M|         if ((ascii_acc & repeat_byte8(0b10000000)) == 0) {
  ------------------
  |  Branch (881:14): [True: 3.19M, False: 161k]
  ------------------
  882|  3.19M|            return false; // pure ASCII is trivially well formed UTF-8
  883|  3.19M|         }
  884|   161k|         if (!validate_utf8(start, size_t(fin - start))) [[unlikely]] {
  ------------------
  |  Branch (884:14): [True: 0, False: 161k]
  ------------------
  885|      0|            ctx.error = error_code::invalid_utf8;
  886|      0|            return true;
  887|      0|         }
  888|   161k|         return false;
  889|   161k|      }
  890|  3.36M|   }
_ZN3glz13validate_utf8IcEEbPKT_m:
  842|  1.80M|   {
  843|  1.80M|      const uint8_t* it = reinterpret_cast<const uint8_t*>(str);
  844|  1.80M|      const uint8_t* const end = it + size;
  845|       |#if defined(GLZ_UTF8_SIMD)
  846|       |      // 16 is a measured compromise, not a register-size coincidence. The scalar path skips ASCII 8
  847|       |      // bytes at a time, so on ASCII it stays ahead of the vector path's fixed setup cost until the
  848|       |      // input is long enough for the 64 byte ASCII step to engage; on non-ASCII the vector path
  849|       |      // wins from roughly 8 bytes. Raising the threshold buys a few percent on short ASCII and
  850|       |      // costs up to 2.3x on mid length non-ASCII strings, so it stays low.
  851|       |      if (size >= 16) {
  852|       |         return detail::utf8_simd::validate(it, end);
  853|       |      }
  854|       |#endif
  855|  1.80M|      return validate_utf8_scalar(it, end);
  856|  1.80M|   }
_ZN3glz20validate_utf8_scalarEPKhS1_:
  793|  1.80M|   {
  794|  19.4M|      while (it < end) {
  ------------------
  |  Branch (794:14): [True: 17.6M, False: 1.80M]
  ------------------
  795|       |         // Optimistic SWAR check for ASCII
  796|  17.6M|         if (it + 8 <= end) {
  ------------------
  |  Branch (796:14): [True: 12.8M, False: 4.82M]
  ------------------
  797|  12.8M|            uint64_t chunk;
  798|  12.8M|            std::memcpy(&chunk, it, 8);
  799|  12.8M|            if ((chunk & glz::repeat_byte8(0x80)) == 0) {
  ------------------
  |  Branch (799:17): [True: 12.2M, False: 540k]
  ------------------
  800|  12.2M|               it += 8;
  801|  12.2M|               continue;
  802|  12.2M|            }
  803|  12.8M|         }
  804|       |
  805|       |         // Byte-by-byte validation (standard conformant)
  806|  5.36M|         uint8_t byte = *it;
  807|       |
  808|  5.36M|         if (byte < 0x80) {
  ------------------
  |  Branch (808:14): [True: 5.02M, False: 336k]
  ------------------
  809|  5.02M|            it++;
  810|  5.02M|         }
  811|   336k|         else if ((byte & 0xE0) == 0xC0) {
  ------------------
  |  Branch (811:19): [True: 191k, False: 144k]
  ------------------
  812|       |            // 2-byte sequence
  813|   191k|            if (it + 2 > end || (it[1] & 0xC0) != 0x80) return false;
  ------------------
  |  Branch (813:17): [True: 19, False: 191k]
  |  Branch (813:33): [True: 52, False: 191k]
  ------------------
  814|   191k|            if (byte < 0xC2) return false; // Overlong
  ------------------
  |  Branch (814:17): [True: 24, False: 191k]
  ------------------
  815|   191k|            it += 2;
  816|   191k|         }
  817|   144k|         else if ((byte & 0xF0) == 0xE0) {
  ------------------
  |  Branch (817:19): [True: 27.3k, False: 117k]
  ------------------
  818|       |            // 3-byte sequence
  819|  27.3k|            if (it + 3 > end || (it[1] & 0xC0) != 0x80 || (it[2] & 0xC0) != 0x80) return false;
  ------------------
  |  Branch (819:17): [True: 33, False: 27.3k]
  |  Branch (819:33): [True: 30, False: 27.2k]
  |  Branch (819:59): [True: 37, False: 27.2k]
  ------------------
  820|  27.2k|            if (byte == 0xE0 && it[1] < 0xA0) return false; // Overlong
  ------------------
  |  Branch (820:17): [True: 10.4k, False: 16.8k]
  |  Branch (820:33): [True: 34, False: 10.3k]
  ------------------
  821|  27.2k|            if (byte == 0xED && it[1] >= 0xA0) return false; // Surrogate
  ------------------
  |  Branch (821:17): [True: 10.8k, False: 16.3k]
  |  Branch (821:33): [True: 18, False: 10.8k]
  ------------------
  822|  27.2k|            it += 3;
  823|  27.2k|         }
  824|   117k|         else if ((byte & 0xF8) == 0xF0) {
  ------------------
  |  Branch (824:19): [True: 117k, False: 134]
  ------------------
  825|       |            // 4-byte sequence
  826|   117k|            if (it + 4 > end || (it[1] & 0xC0) != 0x80 || (it[2] & 0xC0) != 0x80 || (it[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (826:17): [True: 28, False: 117k]
  |  Branch (826:33): [True: 29, False: 117k]
  |  Branch (826:59): [True: 30, False: 117k]
  |  Branch (826:85): [True: 30, False: 117k]
  ------------------
  827|    117|               return false;
  828|   117k|            if (byte == 0xF0 && it[1] < 0x90) return false; // Overlong
  ------------------
  |  Branch (828:17): [True: 25.8k, False: 91.2k]
  |  Branch (828:33): [True: 37, False: 25.8k]
  ------------------
  829|   117k|            if (byte == 0xF4 && it[1] >= 0x90) return false; // > U+10FFFF
  ------------------
  |  Branch (829:17): [True: 78.9k, False: 38.1k]
  |  Branch (829:33): [True: 30, False: 78.9k]
  ------------------
  830|   117k|            if (byte > 0xF4) return false; // > U+10FFFF
  ------------------
  |  Branch (830:17): [True: 18, False: 117k]
  ------------------
  831|   117k|            it += 4;
  832|   117k|         }
  833|    134|         else {
  834|    134|            return false;
  835|    134|         }
  836|  5.36M|      }
  837|       |
  838|  1.80M|      return true;
  839|  1.80M|   }
_ZN3glz25handle_unicode_code_pointIccEENS_14unicode_resultERPKT_RPT0_S4_:
  347|  27.4k|   {
  348|  27.4k|      using namespace unicode;
  349|       |
  350|  27.4k|      if (end - it <= 4) [[unlikely]] {
  ------------------
  |  Branch (350:11): [True: 16, False: 27.4k]
  ------------------
  351|     16|         return {0, escape_prefix_intact<false>(it, end)};
  352|     16|      }
  353|  27.4k|      const uint32_t high = hex_to_u32(it);
  354|  27.4k|      if (high == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (354:11): [True: 14, False: 27.4k]
  ------------------
  355|     14|         return {};
  356|     14|      }
  357|  27.4k|      it += 4; // skip the code point characters
  358|       |
  359|  27.4k|      uint32_t code_point;
  360|       |
  361|  27.4k|      if ((high & generic_surrogate_mask) == generic_surrogate_value) {
  ------------------
  |  Branch (361:11): [True: 906, False: 26.5k]
  ------------------
  362|       |         // surrogate pair code points
  363|    906|         if ((high & surrogate_mask) != high_surrogate_value) {
  ------------------
  |  Branch (363:14): [True: 4, False: 902]
  ------------------
  364|      4|            return {};
  365|      4|         }
  366|       |
  367|    902|         if (end - it <= 6) [[unlikely]] {
  ------------------
  |  Branch (367:14): [True: 14, False: 888]
  ------------------
  368|     14|            return {0, escape_prefix_intact<true>(it, end)};
  369|     14|         }
  370|       |         // The next two characters must be `\u`
  371|    888|         uint16_t u;
  372|    888|         std::memcpy(&u, it, 2);
  373|    888|         if (u != to_uint16_t(R"(\u)")) [[unlikely]] {
  ------------------
  |  Branch (373:14): [True: 30, False: 858]
  ------------------
  374|     30|            return {};
  375|     30|         }
  376|    858|         it += 2;
  377|       |         // verify that second unicode escape sequence is present
  378|    858|         const uint32_t low = hex_to_u32(it);
  379|    858|         if (low == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (379:14): [True: 3, False: 855]
  ------------------
  380|      3|            return {};
  381|      3|         }
  382|    855|         it += 4;
  383|       |
  384|    855|         if ((low & surrogate_mask) != low_surrogate_value) [[unlikely]] {
  ------------------
  |  Branch (384:14): [True: 11, False: 844]
  ------------------
  385|     11|            return {};
  386|     11|         }
  387|       |
  388|    844|         code_point = (high & surrogate_codepoint_mask) << surrogate_codepoint_bits;
  389|    844|         code_point |= (low & surrogate_codepoint_mask);
  390|    844|         code_point += surrogate_codepoint_offset;
  391|    844|      }
  392|  26.5k|      else {
  393|  26.5k|         code_point = high;
  394|  26.5k|      }
  395|  27.4k|      const uint32_t offset = code_point_to_utf8(code_point, dst);
  396|  27.4k|      dst += offset;
  397|  27.4k|      return {offset, false};
  398|  27.4k|   }
_ZN3glz20escape_prefix_intactILb0EccEEbPKT0_PKT1_:
  329|     16|   {
  330|     16|      auto n = size_t(end - it);
  331|       |      if constexpr (ExpectOpener) {
  332|       |         if (n > 0 && it[0] != '\\') return false;
  333|       |         if (n > 1 && it[1] != 'u') return false;
  334|       |         if (n < 2) return true;
  335|       |         it += 2;
  336|       |         n -= 2;
  337|       |      }
  338|     42|      for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (338:26): [True: 35, False: 7]
  ------------------
  339|     35|         if (digit_hex_table[uint8_t(it[i])] == 255) return false;
  ------------------
  |  Branch (339:14): [True: 9, False: 26]
  ------------------
  340|     35|      }
  341|      7|      return true;
  342|     16|   }
_ZN3glz10hex_to_u32EPKc:
  224|  42.1k|   {
  225|  42.1k|      constexpr auto& t = digit_hex_table;
  226|  42.1k|      const uint8_t arr[4]{t[uint8_t(c[3])], t[uint8_t(c[2])], t[uint8_t(c[1])], t[uint8_t(c[0])]};
  227|  42.1k|      auto chunk = std::bit_cast<uint32_t>(arr);
  228|       |      // On big-endian, bit_cast produces bytes in opposite order than expected
  229|       |      // byteswap to get consistent little-endian representation
  230|       |      if constexpr (std::endian::native == std::endian::big) {
  231|       |         chunk = std::byteswap(chunk);
  232|       |      }
  233|       |      // check that all hex characters are valid
  234|  42.1k|      if (chunk & repeat_byte4(0b11110000u)) [[unlikely]] {
  ------------------
  |  Branch (234:11): [True: 84, False: 42.0k]
  ------------------
  235|     84|         return 0xFFFFFFFFu;
  236|     84|      }
  237|       |
  238|       |      // now pack into first four bytes of uint32_t
  239|  42.0k|      uint32_t packed{};
  240|  42.0k|      packed |= (chunk & 0x0000000F);
  241|  42.0k|      packed |= (chunk & 0x00000F00) >> 4;
  242|  42.0k|      packed |= (chunk & 0x000F0000) >> 8;
  243|  42.0k|      packed |= (chunk & 0x0F000000) >> 12;
  244|  42.0k|      return packed;
  245|  42.1k|   }
_ZN3glz20escape_prefix_intactILb1EccEEbPKT0_PKT1_:
  329|     14|   {
  330|     14|      auto n = size_t(end - it);
  331|     14|      if constexpr (ExpectOpener) {
  332|     14|         if (n > 0 && it[0] != '\\') return false;
  ------------------
  |  Branch (332:14): [True: 14, False: 0]
  |  Branch (332:23): [True: 8, False: 6]
  ------------------
  333|      6|         if (n > 1 && it[1] != 'u') return false;
  ------------------
  |  Branch (333:14): [True: 5, False: 1]
  |  Branch (333:23): [True: 1, False: 4]
  ------------------
  334|      5|         if (n < 2) return true;
  ------------------
  |  Branch (334:14): [True: 1, False: 4]
  ------------------
  335|      4|         it += 2;
  336|      4|         n -= 2;
  337|      4|      }
  338|     20|      for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (338:26): [True: 10, False: 10]
  ------------------
  339|     10|         if (digit_hex_table[uint8_t(it[i])] == 255) return false;
  ------------------
  |  Branch (339:14): [True: 4, False: 6]
  ------------------
  340|     10|      }
  341|     10|      return true;
  342|     14|   }
_ZN3glz18code_point_to_utf8IcEEjjPT_:
  249|  27.4k|   {
  250|  27.4k|      if (code_point <= 0x7F) {
  ------------------
  |  Branch (250:11): [True: 5.49k, False: 21.9k]
  ------------------
  251|  5.49k|         c[0] = Char(code_point);
  252|  5.49k|         return 1;
  253|  5.49k|      }
  254|  21.9k|      if (code_point <= 0x7FF) {
  ------------------
  |  Branch (254:11): [True: 9.44k, False: 12.4k]
  ------------------
  255|  9.44k|         c[0] = Char(0xC0 | ((code_point >> 6) & 0x1F));
  256|  9.44k|         c[1] = Char(0x80 | (code_point & 0x3F));
  257|  9.44k|         return 2;
  258|  9.44k|      }
  259|  12.4k|      if (code_point <= 0xFFFF) {
  ------------------
  |  Branch (259:11): [True: 11.6k, False: 844]
  ------------------
  260|  11.6k|         c[0] = Char(0xE0 | ((code_point >> 12) & 0x0F));
  261|  11.6k|         c[1] = Char(0x80 | ((code_point >> 6) & 0x3F));
  262|  11.6k|         c[2] = Char(0x80 | (code_point & 0x3F));
  263|  11.6k|         return 3;
  264|  11.6k|      }
  265|    844|      if (code_point <= 0x10FFFF) {
  ------------------
  |  Branch (265:11): [True: 844, False: 0]
  ------------------
  266|    844|         c[0] = Char(0xF0 | ((code_point >> 18) & 0x07));
  267|    844|         c[1] = Char(0x80 | ((code_point >> 12) & 0x3F));
  268|    844|         c[2] = Char(0x80 | ((code_point >> 6) & 0x3F));
  269|    844|         c[3] = Char(0x80 | (code_point & 0x3F));
  270|    844|         return 4;
  271|    844|      }
  272|      0|      return 0;
  273|    844|   }
_ZN3glz17match_invalid_endILc58EXtlNS_22match_invalid_end_optsELb1EEETkNS_10is_contextENS_7contextERPKcS4_EEbRT1_OT2_T3_:
  470|  4.56M|   {
  471|  4.56M|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (471:11): [True: 719, False: 4.56M]
  ------------------
  472|       |         if constexpr (C == '"') {
  473|       |            ctx.error = error_code::expected_quote;
  474|       |         }
  475|       |         else if constexpr (C == ',') {
  476|       |            ctx.error = error_code::expected_comma;
  477|       |         }
  478|    719|         else if constexpr (C == ':') {
  479|    719|            ctx.error = error_code::expected_colon;
  480|       |         }
  481|       |         else if constexpr (C == '[' || C == ']') {
  482|       |            ctx.error = error_code::expected_bracket;
  483|       |         }
  484|       |         else if constexpr (C == '{' || C == '}') {
  485|       |            ctx.error = error_code::expected_brace;
  486|       |         }
  487|       |         else {
  488|       |            ctx.error = error_code::syntax_error;
  489|       |         }
  490|    719|         return true;
  491|    719|      }
  492|  4.56M|      else [[likely]] {
  493|  4.56M|         ++it;
  494|  4.56M|      }
  495|       |      if constexpr (not Opts.null_terminated) {
  496|       |         if (it == end) [[unlikely]] {
  497|       |            ctx.error = error_code::unexpected_end;
  498|       |            return true;
  499|       |         }
  500|       |      }
  501|  4.56M|      return false;
  502|  4.56M|   }
_ZN3glz17match_invalid_endILc91EXtlNS_22match_invalid_end_optsELb1EEETkNS_10is_contextENS_7contextERPKcS4_EEbRT1_OT2_T3_:
  470|  1.67M|   {
  471|  1.67M|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (471:11): [True: 67, False: 1.67M]
  ------------------
  472|       |         if constexpr (C == '"') {
  473|       |            ctx.error = error_code::expected_quote;
  474|       |         }
  475|       |         else if constexpr (C == ',') {
  476|       |            ctx.error = error_code::expected_comma;
  477|       |         }
  478|       |         else if constexpr (C == ':') {
  479|       |            ctx.error = error_code::expected_colon;
  480|       |         }
  481|     67|         else if constexpr (C == '[' || C == ']') {
  482|     67|            ctx.error = error_code::expected_bracket;
  483|       |         }
  484|       |         else if constexpr (C == '{' || C == '}') {
  485|       |            ctx.error = error_code::expected_brace;
  486|       |         }
  487|       |         else {
  488|       |            ctx.error = error_code::syntax_error;
  489|       |         }
  490|     67|         return true;
  491|     67|      }
  492|  1.67M|      else [[likely]] {
  493|  1.67M|         ++it;
  494|  1.67M|      }
  495|       |      if constexpr (not Opts.null_terminated) {
  496|       |         if (it == end) [[unlikely]] {
  497|       |            ctx.error = error_code::unexpected_end;
  498|       |            return true;
  499|       |         }
  500|       |      }
  501|  1.67M|      return false;
  502|  1.67M|   }
_ZN3glz18validate_utf8_spanITnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEETkNS_10is_contextERNS_7contextEccEEbOT0_PKT1_PKT2_m:
  873|   905k|   {
  874|       |      if constexpr (not check_validate_utf8(Opts)) {
  875|       |         // Everything the caller computed for us is dead, which lets its scan loop drop the
  876|       |         // accumulator entirely.
  877|       |         (void)ctx, (void)start, (void)fin, (void)ascii_acc;
  878|       |         return false;
  879|       |      }
  880|   905k|      else {
  881|   905k|         if ((ascii_acc & repeat_byte8(0b10000000)) == 0) {
  ------------------
  |  Branch (881:14): [True: 757k, False: 148k]
  ------------------
  882|   757k|            return false; // pure ASCII is trivially well formed UTF-8
  883|   757k|         }
  884|   148k|         if (!validate_utf8(start, size_t(fin - start))) [[unlikely]] {
  ------------------
  |  Branch (884:14): [True: 57, False: 148k]
  ------------------
  885|     57|            ctx.error = error_code::invalid_utf8;
  886|     57|            return true;
  887|     57|         }
  888|   148k|         return false;
  889|   148k|      }
  890|   905k|   }
_ZN3glz5matchITnNS_14string_literalEXtlNS1_ILm5EEEtlA5_cLc110ELc117ELc108ELc108EEEETnDaXtlNS_4optsELj10ELb1ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS8_EEvOT1_OT2_T3_:
  539|   202k|   {
  540|   202k|      static constexpr auto S = str.sv();
  541|   202k|      if ((end - it < std::ptrdiff_t(str.size())) || not comparitor<S>(it)) [[unlikely]] {
  ------------------
  |  Branch (541:11): [True: 0, False: 202k]
  |  Branch (541:54): [True: 0, False: 202k]
  ------------------
  542|      0|         ctx.error = error_code::syntax_error;
  543|      0|      }
  544|   202k|      else [[likely]] {
  545|   202k|         it += str.size();
  546|   202k|      }
  547|   202k|   }
_ZN3glz17match_invalid_endILc123EXtlNS_22match_invalid_end_optsELb1EEETkNS_10is_contextENS_7contextERPKcS4_EEbRT1_OT2_T3_:
  470|  17.0k|   {
  471|  17.0k|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (471:11): [True: 7.16k, False: 9.85k]
  ------------------
  472|       |         if constexpr (C == '"') {
  473|       |            ctx.error = error_code::expected_quote;
  474|       |         }
  475|       |         else if constexpr (C == ',') {
  476|       |            ctx.error = error_code::expected_comma;
  477|       |         }
  478|       |         else if constexpr (C == ':') {
  479|       |            ctx.error = error_code::expected_colon;
  480|       |         }
  481|       |         else if constexpr (C == '[' || C == ']') {
  482|       |            ctx.error = error_code::expected_bracket;
  483|       |         }
  484|  7.16k|         else if constexpr (C == '{' || C == '}') {
  485|  7.16k|            ctx.error = error_code::expected_brace;
  486|       |         }
  487|       |         else {
  488|       |            ctx.error = error_code::syntax_error;
  489|       |         }
  490|  7.16k|         return true;
  491|  7.16k|      }
  492|  9.85k|      else [[likely]] {
  493|  9.85k|         ++it;
  494|  9.85k|      }
  495|       |      if constexpr (not Opts.null_terminated) {
  496|       |         if (it == end) [[unlikely]] {
  497|       |            ctx.error = error_code::unexpected_end;
  498|       |            return true;
  499|       |         }
  500|       |      }
  501|  9.85k|      return false;
  502|  17.0k|   }
_ZN3glz5matchILc125ETkNS_10is_contextENS_7contextERPKcEEbRT0_OT1_:
  506|  51.7k|   {
  507|  51.7k|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (507:11): [True: 1.65k, False: 50.0k]
  ------------------
  508|       |         if constexpr (C == '"') {
  509|       |            ctx.error = error_code::expected_quote;
  510|       |         }
  511|       |         else if constexpr (C == ',') {
  512|       |            ctx.error = error_code::expected_comma;
  513|       |         }
  514|       |         else if constexpr (C == ':') {
  515|       |            ctx.error = error_code::expected_colon;
  516|       |         }
  517|       |         else if constexpr (C == '[' || C == ']') {
  518|       |            ctx.error = error_code::expected_bracket;
  519|       |         }
  520|  1.65k|         else if constexpr (C == '{' || C == '}') {
  521|  1.65k|            ctx.error = error_code::expected_brace;
  522|       |         }
  523|       |         else {
  524|       |            ctx.error = error_code::syntax_error;
  525|       |         }
  526|  1.65k|         return true;
  527|  1.65k|      }
  528|  50.0k|      else [[likely]] {
  529|  50.0k|         ++it;
  530|  50.0k|         return false;
  531|  50.0k|      }
  532|  51.7k|   }
_ZN3glz5matchILc93ETkNS_10is_contextENS_7contextERPKcEEbRT0_OT1_:
  506|   254k|   {
  507|   254k|      if (*it != C) [[unlikely]] {
  ------------------
  |  Branch (507:11): [True: 1.02k, False: 253k]
  ------------------
  508|       |         if constexpr (C == '"') {
  509|       |            ctx.error = error_code::expected_quote;
  510|       |         }
  511|       |         else if constexpr (C == ',') {
  512|       |            ctx.error = error_code::expected_comma;
  513|       |         }
  514|       |         else if constexpr (C == ':') {
  515|       |            ctx.error = error_code::expected_colon;
  516|       |         }
  517|  1.02k|         else if constexpr (C == '[' || C == ']') {
  518|  1.02k|            ctx.error = error_code::expected_bracket;
  519|       |         }
  520|       |         else if constexpr (C == '{' || C == '}') {
  521|       |            ctx.error = error_code::expected_brace;
  522|       |         }
  523|       |         else {
  524|       |            ctx.error = error_code::syntax_error;
  525|       |         }
  526|  1.02k|         return true;
  527|  1.02k|      }
  528|   253k|      else [[likely]] {
  529|   253k|         ++it;
  530|   253k|         return false;
  531|   253k|      }
  532|   254k|   }
_ZN3glz11skip_stringIXtlNS_16skip_string_optsELb0ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS5_EEvOT0_OT1_T2_:
 1012|  1.49M|   {
 1013|  1.49M|      if constexpr (not Opts.opening_handled) {
 1014|  1.49M|         ++it;
 1015|  1.49M|      }
 1016|       |
 1017|  1.49M|      const auto* const utf8_start = it;
 1018|       |
 1019|  1.49M|      if constexpr (Opts.validate_skipped) {
 1020|       |         // The bound as a pointer, so each chunk costs one compare. `end - scan_min` is only a
 1021|       |         // pointer into the buffer once at least that much of it is left, and a string can start
 1022|       |         // within a few bytes of the end; where it is not, the fallback is the opening quote, which
 1023|       |         // sits before `it` and so fails the test on the first look. Never `it` itself -- that
 1024|       |         // passes, and the chunk behind it would read past the end of the buffer.
 1025|  1.49M|         const std::ptrdiff_t scan_min = chunk_min<8>(ctx.padded_input);
 1026|  1.49M|         const auto* const chunk_limit = (end - it >= scan_min) ? end - scan_min : it - 1;
  ------------------
  |  Branch (1026:42): [True: 1.48M, False: 4.24k]
  ------------------
 1027|       |
 1028|  9.20M|         while (it <= chunk_limit) {
  ------------------
  |  Branch (1028:17): [True: 9.19M, False: 5.57k]
  ------------------
 1029|  9.19M|            uint64_t swar;
 1030|  9.19M|            std::memcpy(&swar, it, 8);
 1031|       |            if constexpr (std::endian::native == std::endian::big) {
 1032|       |               swar = std::byteswap(swar);
 1033|       |            }
 1034|       |
 1035|  9.19M|            constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1036|  9.19M|            const uint64_t lo7 = swar & lo7_mask;
 1037|  9.19M|            const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1038|  9.19M|            const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1039|  9.19M|            const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1040|  9.19M|            uint64_t next = ~((backslash & quote & less_32) | swar);
 1041|  9.19M|            next &= repeat_byte8(0b10000000);
 1042|       |
 1043|  9.19M|            if (next == 0) {
  ------------------
  |  Branch (1043:17): [True: 7.63M, False: 1.56M]
  ------------------
 1044|       |               // No special characters in this chunk
 1045|  7.63M|               it += 8;
 1046|  7.63M|               continue;
 1047|  7.63M|            }
 1048|       |
 1049|       |            // Find the first occurrence
 1050|  1.56M|            size_t offset = (countr_zero(next) >> 3);
 1051|  1.56M|            it += offset;
 1052|       |
 1053|  1.56M|            const auto c = *it;
 1054|  1.56M|            if ((c & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1054:17): [True: 55, False: 1.56M]
  ------------------
 1055|       |               // Invalid control character (<0x20)
 1056|     55|               ctx.error = error_code::syntax_error;
 1057|     55|               return;
 1058|     55|            }
 1059|  1.56M|            else if (c == '"') {
  ------------------
  |  Branch (1059:22): [True: 1.48M, False: 73.1k]
  ------------------
 1060|       |               // Check if this quote is escaped
 1061|  1.48M|               const auto* p = it - 1;
 1062|  1.48M|               int backslash_count{};
 1063|       |               // We don't have to worry about rewinding too far because we started with a quote
 1064|  1.49M|               while (*p == '\\') {
  ------------------
  |  Branch (1064:23): [True: 5.01k, False: 1.48M]
  ------------------
 1065|  5.01k|                  ++backslash_count;
 1066|  5.01k|                  --p;
 1067|  5.01k|               }
 1068|  1.48M|               if ((backslash_count & 1) == 0) {
  ------------------
  |  Branch (1068:20): [True: 1.48M, False: 0]
  ------------------
 1069|       |                  // Even number of backslashes => not escaped => closing quote found
 1070|  1.48M|                  validate_utf8_span<Opts>(ctx, utf8_start, it);
 1071|  1.48M|                  ++it;
 1072|  1.48M|                  return;
 1073|  1.48M|               }
 1074|      0|               else {
 1075|       |                  // Odd number of backslashes => escaped quote
 1076|      0|                  ++it;
 1077|      0|                  continue;
 1078|      0|               }
 1079|  1.48M|            }
 1080|  73.1k|            else if (c == '\\') {
  ------------------
  |  Branch (1080:22): [True: 73.1k, False: 0]
  ------------------
 1081|       |               // Handle escape sequence
 1082|  73.1k|               ++it;
 1083|       |
 1084|       |               // The backslash can be the last byte the chunk covers, which lands `it` on `end`.
 1085|       |               // A null-terminated buffer answers that read with its terminator, which the escape
 1086|       |               // table below rejects; a bounded one has nothing there to read.
 1087|       |               if constexpr (not Opts.null_terminated) {
 1088|       |                  if (it == end) [[unlikely]] {
 1089|       |                     ctx.error = error_code::unexpected_end;
 1090|       |                     return;
 1091|       |                  }
 1092|       |               }
 1093|       |
 1094|  73.1k|               if (*it == 'u') {
  ------------------
  |  Branch (1094:20): [True: 12.3k, False: 60.7k]
  ------------------
 1095|  12.3k|                  ++it;
 1096|  12.3k|                  if (not skip_unicode_code_point(it, end)) [[unlikely]] {
  ------------------
  |  Branch (1096:23): [True: 233, False: 12.1k]
  ------------------
 1097|    233|                     ctx.error = error_code::unicode_escape_conversion_failure;
 1098|    233|                     return;
 1099|    233|                  }
 1100|  12.3k|               }
 1101|  60.7k|               else {
 1102|  60.7k|                  if (not char_unescape_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (1102:23): [True: 14, False: 60.7k]
  ------------------
 1103|     14|                     ctx.error = error_code::invalid_escape;
 1104|     14|                     return;
 1105|     14|                  }
 1106|  60.7k|                  ++it;
 1107|  60.7k|               }
 1108|  73.1k|            }
 1109|  1.56M|         }
 1110|       |
 1111|  11.6k|         while (true) {
  ------------------
  |  Branch (1111:17): [True: 11.6k, Folded]
  ------------------
 1112|       |            // A null-terminated buffer terminates on the trailing '\0' (caught by the control
 1113|       |            // character check below); a non-null-terminated buffer has no sentinel, so bound the
 1114|       |            // scan before each dereference.
 1115|       |            if constexpr (not Opts.null_terminated) {
 1116|       |               if (it == end) [[unlikely]] {
 1117|       |                  ctx.error = error_code::unexpected_end;
 1118|       |                  return;
 1119|       |               }
 1120|       |            }
 1121|  11.6k|            if ((*it & 0b11100000) == 0) [[unlikely]] {
  ------------------
  |  Branch (1121:17): [True: 501, False: 11.1k]
  ------------------
 1122|    501|               ctx.error = error_code::syntax_error;
 1123|    501|               return;
 1124|    501|            }
 1125|       |
 1126|  11.1k|            switch (*it) {
  ------------------
  |  Branch (1126:21): [True: 6.06k, False: 5.05k]
  ------------------
 1127|  4.97k|            case '"': {
  ------------------
  |  Branch (1127:13): [True: 4.97k, False: 6.14k]
  ------------------
 1128|  4.97k|               validate_utf8_span<Opts>(ctx, utf8_start, it);
 1129|  4.97k|               ++it;
 1130|  4.97k|               return;
 1131|      0|            }
 1132|  1.09k|            case '\\': {
  ------------------
  |  Branch (1132:13): [True: 1.09k, False: 10.0k]
  ------------------
 1133|  1.09k|               ++it;
 1134|       |               if constexpr (not Opts.null_terminated) {
 1135|       |                  if (it == end) [[unlikely]] {
 1136|       |                     ctx.error = error_code::unexpected_end;
 1137|       |                     return;
 1138|       |                  }
 1139|       |               }
 1140|  1.09k|               if (char_unescape_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1140:20): [True: 782, False: 310]
  ------------------
 1141|    782|                  ++it;
 1142|    782|                  continue;
 1143|    782|               }
 1144|    310|               else if (*it == 'u') {
  ------------------
  |  Branch (1144:25): [True: 269, False: 41]
  ------------------
 1145|    269|                  ++it;
 1146|    269|                  if (skip_unicode_code_point(it, end)) [[likely]] {
  ------------------
  |  Branch (1146:23): [True: 209, False: 60]
  ------------------
 1147|    209|                     continue;
 1148|    209|                  }
 1149|     60|                  else [[unlikely]] {
 1150|     60|                     ctx.error = error_code::unicode_escape_conversion_failure;
 1151|     60|                     return;
 1152|     60|                  }
 1153|    269|               }
 1154|       |               // Same code the chunked loop above reports. Both loops run over one buffer now, so
 1155|       |               // an escape that lands in the last few bytes must be diagnosed the same as one that
 1156|       |               // does not.
 1157|     41|               ctx.error = error_code::invalid_escape;
 1158|     41|               return;
 1159|  1.09k|            }
 1160|  11.1k|            }
 1161|  5.05k|            ++it;
 1162|  5.05k|         }
 1163|       |      }
 1164|       |      else {
 1165|       |         uint64_t ascii_acc{};
 1166|       |         skip_string_view(ctx, it, end, ascii_acc);
 1167|       |         if (bool(ctx.error)) [[unlikely]] {
 1168|       |            return;
 1169|       |         }
 1170|       |         if (validate_utf8_span<Opts>(ctx, utf8_start, it, ascii_acc)) [[unlikely]] {
 1171|       |            return;
 1172|       |         }
 1173|       |         ++it; // skip the quote
 1174|       |      }
 1175|  1.49M|   }
_ZN3glz18validate_utf8_spanITnDaXtlNS_16skip_string_optsELb0ELb1ELb1ELb1EEETkNS_10is_contextERNS_7contextEccEEbOT0_PKT1_PKT2_m:
  873|  1.49M|   {
  874|       |      if constexpr (not check_validate_utf8(Opts)) {
  875|       |         // Everything the caller computed for us is dead, which lets its scan loop drop the
  876|       |         // accumulator entirely.
  877|       |         (void)ctx, (void)start, (void)fin, (void)ascii_acc;
  878|       |         return false;
  879|       |      }
  880|  1.49M|      else {
  881|  1.49M|         if ((ascii_acc & repeat_byte8(0b10000000)) == 0) {
  ------------------
  |  Branch (881:14): [True: 0, False: 1.49M]
  ------------------
  882|      0|            return false; // pure ASCII is trivially well formed UTF-8
  883|      0|         }
  884|  1.49M|         if (!validate_utf8(start, size_t(fin - start))) [[unlikely]] {
  ------------------
  |  Branch (884:14): [True: 526, False: 1.49M]
  ------------------
  885|    526|            ctx.error = error_code::invalid_utf8;
  886|    526|            return true;
  887|    526|         }
  888|  1.49M|         return false;
  889|  1.49M|      }
  890|  1.49M|   }
_ZN3glz23skip_unicode_code_pointIcEEbRPKT_S3_:
  402|  12.6k|   {
  403|  12.6k|      using namespace unicode;
  404|  12.6k|      if (it + 4 >= end) [[unlikely]] {
  ------------------
  |  Branch (404:11): [True: 29, False: 12.6k]
  ------------------
  405|     29|         return false;
  406|     29|      }
  407|       |
  408|  12.6k|      const uint32_t high = hex_to_u32(it);
  409|  12.6k|      if (high == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (409:11): [True: 52, False: 12.5k]
  ------------------
  410|     52|         return false;
  411|     52|      }
  412|  12.5k|      it += 4; // skip the code point characters
  413|       |
  414|  12.5k|      uint32_t code_point;
  415|       |
  416|  12.5k|      if ((high & generic_surrogate_mask) == generic_surrogate_value) {
  ------------------
  |  Branch (416:11): [True: 1.32k, False: 11.2k]
  ------------------
  417|       |         // surrogate pair code points
  418|  1.32k|         if ((high & surrogate_mask) != high_surrogate_value) [[unlikely]] {
  ------------------
  |  Branch (418:14): [True: 12, False: 1.31k]
  ------------------
  419|     12|            return false;
  420|     12|         }
  421|       |
  422|  1.31k|         if (it + 6 >= end) [[unlikely]] {
  ------------------
  |  Branch (422:14): [True: 24, False: 1.28k]
  ------------------
  423|     24|            return false;
  424|     24|         }
  425|       |         // The next two characters must be `\u`
  426|  1.28k|         uint16_t u;
  427|  1.28k|         std::memcpy(&u, it, 2);
  428|  1.28k|         if (u != to_uint16_t(R"(\u)")) [[unlikely]] {
  ------------------
  |  Branch (428:14): [True: 106, False: 1.18k]
  ------------------
  429|    106|            return false;
  430|    106|         }
  431|  1.18k|         it += 2;
  432|       |         // verify that second unicode escape sequence is present
  433|  1.18k|         const uint32_t low = hex_to_u32(it);
  434|  1.18k|         if (low == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (434:14): [True: 15, False: 1.16k]
  ------------------
  435|     15|            return false;
  436|     15|         }
  437|  1.16k|         it += 4;
  438|       |
  439|  1.16k|         if ((low & surrogate_mask) != low_surrogate_value) [[unlikely]] {
  ------------------
  |  Branch (439:14): [True: 55, False: 1.11k]
  ------------------
  440|     55|            return false;
  441|     55|         }
  442|       |
  443|  1.11k|         code_point = (high & surrogate_codepoint_mask) << surrogate_codepoint_bits;
  444|  1.11k|         code_point |= (low & surrogate_codepoint_mask);
  445|  1.11k|         code_point += surrogate_codepoint_offset;
  446|  1.11k|      }
  447|  11.2k|      else {
  448|  11.2k|         code_point = high;
  449|  11.2k|      }
  450|  12.3k|      return skip_code_point(code_point) > 0;
  451|  12.5k|   }
_ZN3glz15skip_code_pointEj:
  276|  12.3k|   {
  277|  12.3k|      if (code_point <= 0x7F) {
  ------------------
  |  Branch (277:11): [True: 2.61k, False: 9.75k]
  ------------------
  278|  2.61k|         return 1;
  279|  2.61k|      }
  280|  9.75k|      if (code_point <= 0x7FF) {
  ------------------
  |  Branch (280:11): [True: 3.99k, False: 5.76k]
  ------------------
  281|  3.99k|         return 2;
  282|  3.99k|      }
  283|  5.76k|      if (code_point <= 0xFFFF) {
  ------------------
  |  Branch (283:11): [True: 4.65k, False: 1.11k]
  ------------------
  284|  4.65k|         return 3;
  285|  4.65k|      }
  286|  1.11k|      if (code_point <= 0x10FFFF) {
  ------------------
  |  Branch (286:11): [True: 1.11k, False: 0]
  ------------------
  287|  1.11k|         return 4;
  288|  1.11k|      }
  289|      0|      return 0;
  290|  1.11k|   }
_ZN3glz5matchITnNS_14string_literalEXtlNS1_ILm4EEEtlA4_cLc117ELc108ELc108EEEETnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_:
  539|  69.1k|   {
  540|  69.1k|      static constexpr auto S = str.sv();
  541|  69.1k|      if ((end - it < std::ptrdiff_t(str.size())) || not comparitor<S>(it)) [[unlikely]] {
  ------------------
  |  Branch (541:11): [True: 6, False: 69.1k]
  |  Branch (541:54): [True: 76, False: 69.1k]
  ------------------
  542|     82|         ctx.error = error_code::syntax_error;
  543|     82|      }
  544|  69.1k|      else [[likely]] {
  545|  69.1k|         it += str.size();
  546|  69.1k|      }
  547|  69.1k|   }
_ZN3glz5matchITnNS_14string_literalEXtlNS1_ILm5EEEtlA5_cLc97ELc108ELc115ELc101EEEETnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_:
  539|   385k|   {
  540|   385k|      static constexpr auto S = str.sv();
  541|   385k|      if ((end - it < std::ptrdiff_t(str.size())) || not comparitor<S>(it)) [[unlikely]] {
  ------------------
  |  Branch (541:11): [True: 7, False: 385k]
  |  Branch (541:54): [True: 148, False: 385k]
  ------------------
  542|    155|         ctx.error = error_code::syntax_error;
  543|    155|      }
  544|   385k|      else [[likely]] {
  545|   385k|         it += str.size();
  546|   385k|      }
  547|   385k|   }
_ZN3glz5matchITnNS_14string_literalEXtlNS1_ILm4EEEtlA4_cLc114ELc117ELc101EEEETnDaXtlNS_13opts_validateEtlNS_4optsELj10ELb1ELb1ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_:
  539|  81.3k|   {
  540|  81.3k|      static constexpr auto S = str.sv();
  541|  81.3k|      if ((end - it < std::ptrdiff_t(str.size())) || not comparitor<S>(it)) [[unlikely]] {
  ------------------
  |  Branch (541:11): [True: 8, False: 81.3k]
  |  Branch (541:54): [True: 68, False: 81.2k]
  ------------------
  542|     76|         ctx.error = error_code::syntax_error;
  543|     76|      }
  544|  81.2k|      else [[likely]] {
  545|  81.2k|         it += str.size();
  546|  81.2k|      }
  547|  81.3k|   }
_ZN3glz11skip_numberIXtlNS_16skip_number_optsELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS5_EEvOT0_OT1_T2_:
 1633|  1.06M|   {
 1634|       |      if constexpr (not Opts.validate) {
 1635|       |         if constexpr (Opts.null_terminated) {
 1636|       |            // Relies on the trailing '\0' sentinel (numeric_table['\0'] == false) to terminate.
 1637|       |            while (numeric_table[uint8_t(*it)]) {
 1638|       |               ++it;
 1639|       |            }
 1640|       |         }
 1641|       |         else {
 1642|       |            while (it < end && numeric_table[uint8_t(*it)]) {
 1643|       |               ++it;
 1644|       |            }
 1645|       |         }
 1646|       |      }
 1647|  1.06M|      else {
 1648|  1.06M|         skip_number_with_validation(ctx, it, end);
 1649|  1.06M|      }
 1650|  1.06M|   }
_ZN3glz27skip_number_with_validationITkNS_10is_contextERNS_7contextERPKcS4_EEvOT_OT0_T1_:
 1560|  1.06M|   {
 1561|       |      // Every standalone *it read below is guarded by it != end so the scan stays inside the
 1562|       |      // buffer for non-null-terminated input (the std::find_if_not calls are already bounded by
 1563|       |      // end). A null-terminated buffer is unaffected: it reaches end only once the number is
 1564|       |      // fully consumed, where these guards short-circuit exactly as the trailing '\0' sentinel
 1565|       |      // would have.
 1566|  1.06M|      it += (it != end) && (*it == '-');
  ------------------
  |  Branch (1566:13): [True: 1.06M, False: 0]
  |  Branch (1566:28): [True: 2.65k, False: 1.06M]
  ------------------
 1567|  1.06M|      const auto sig_start_it = it;
 1568|  1.06M|      auto frac_start_it = end;
 1569|  1.06M|      if (it != end && *it == '0') {
  ------------------
  |  Branch (1569:11): [True: 1.06M, False: 4]
  |  Branch (1569:24): [True: 285k, False: 782k]
  ------------------
 1570|   285k|         ++it;
 1571|       |         // RFC 8259 section 6: number = [ minus ] int [ frac ] [ exp ]. The exponent may follow
 1572|       |         // the integer part directly, with no fractional part in between (e.g. "0e4").
 1573|   285k|         if (it != end && (*it | ('E' ^ 'e')) == 'e') {
  ------------------
  |  Branch (1573:14): [True: 285k, False: 37]
  |  Branch (1573:27): [True: 12.1k, False: 273k]
  ------------------
 1574|  12.1k|            ++it;
 1575|  12.1k|            goto exp_start;
 1576|  12.1k|         }
 1577|   273k|         if (it == end || *it != '.') {
  ------------------
  |  Branch (1577:14): [True: 37, False: 273k]
  |  Branch (1577:27): [True: 269k, False: 4.12k]
  ------------------
 1578|   269k|            return;
 1579|   269k|         }
 1580|  4.12k|         ++it;
 1581|  4.12k|         goto frac_start;
 1582|   273k|      }
 1583|   782k|      it = std::find_if_not(it, end, is_digit);
 1584|   782k|      if (it == sig_start_it) {
  ------------------
  |  Branch (1584:11): [True: 115, False: 781k]
  ------------------
 1585|    115|         ctx.error = error_code::syntax_error;
 1586|    115|         return;
 1587|    115|      }
 1588|   781k|      if (it != end && (*it | ('E' ^ 'e')) == 'e') {
  ------------------
  |  Branch (1588:11): [True: 780k, False: 1.27k]
  |  Branch (1588:24): [True: 93.8k, False: 686k]
  ------------------
 1589|  93.8k|         ++it;
 1590|  93.8k|         goto exp_start;
 1591|  93.8k|      }
 1592|   688k|      if (it == end || *it != '.') return;
  ------------------
  |  Branch (1592:11): [True: 1.27k, False: 686k]
  |  Branch (1592:24): [True: 681k, False: 5.33k]
  ------------------
 1593|  5.33k|      ++it;
 1594|  9.46k|   frac_start:
 1595|  9.46k|      frac_start_it = it;
 1596|  9.46k|      it = std::find_if_not(it, end, is_digit);
 1597|  9.46k|      if (it == frac_start_it) {
  ------------------
  |  Branch (1597:11): [True: 71, False: 9.38k]
  ------------------
 1598|     71|         ctx.error = error_code::syntax_error;
 1599|     71|         return;
 1600|     71|      }
 1601|  9.38k|      if (it == end || (*it | ('E' ^ 'e')) != 'e') return;
  ------------------
  |  Branch (1601:11): [True: 964, False: 8.42k]
  |  Branch (1601:24): [True: 6.59k, False: 1.82k]
  ------------------
 1602|  1.82k|      ++it;
 1603|   107k|   exp_start:
 1604|   107k|      it += (it != end) && (*it == '+' || *it == '-');
  ------------------
  |  Branch (1604:13): [True: 107k, False: 153]
  |  Branch (1604:29): [True: 44.3k, False: 63.2k]
  |  Branch (1604:43): [True: 5.59k, False: 57.6k]
  ------------------
 1605|   107k|      const auto exp_start_it = it;
 1606|   107k|      it = std::find_if_not(it, end, is_digit);
 1607|   107k|      if (it == exp_start_it) {
  ------------------
  |  Branch (1607:11): [True: 257, False: 107k]
  ------------------
 1608|    257|         ctx.error = error_code::syntax_error;
 1609|    257|         return;
 1610|    257|      }
 1611|   107k|   }
_ZN3glz16skip_matching_wsIcRPKcEEvPKT_OT0_m:
  730|  2.15M|   {
  731|  2.15M|      if (length > 7) {
  ------------------
  |  Branch (731:11): [True: 48.3k, False: 2.10M]
  ------------------
  732|  48.3k|         uint64_t v[2];
  733|  59.6k|         while (length > 8) {
  ------------------
  |  Branch (733:17): [True: 50.1k, False: 9.51k]
  ------------------
  734|  50.1k|            std::memcpy(v, ws, 8);
  735|  50.1k|            std::memcpy(v + 1, it, 8);
  736|  50.1k|            if (v[0] != v[1]) {
  ------------------
  |  Branch (736:17): [True: 38.8k, False: 11.2k]
  ------------------
  737|  38.8k|               return;
  738|  38.8k|            }
  739|  11.2k|            length -= 8;
  740|  11.2k|            ws += 8;
  741|  11.2k|            it += 8;
  742|  11.2k|         }
  743|       |
  744|  9.51k|         const auto shift = 8 - length;
  745|  9.51k|         ws -= shift;
  746|  9.51k|         it -= shift;
  747|       |
  748|  9.51k|         std::memcpy(v, ws, 8);
  749|  9.51k|         std::memcpy(v + 1, it, 8);
  750|  9.51k|         if (v[0] != v[1]) {
  ------------------
  |  Branch (750:14): [True: 7.84k, False: 1.66k]
  ------------------
  751|  7.84k|            return;
  752|  7.84k|         }
  753|  1.66k|         it += 8;
  754|  1.66k|         return;
  755|  9.51k|      }
  756|  2.10M|      {
  757|  2.10M|         constexpr uint64_t n{sizeof(uint32_t)};
  758|  2.10M|         if (length >= n) {
  ------------------
  |  Branch (758:14): [True: 35.1k, False: 2.06M]
  ------------------
  759|  35.1k|            uint32_t v[2];
  760|  35.1k|            std::memcpy(v, ws, n);
  761|  35.1k|            std::memcpy(v + 1, it, n);
  762|  35.1k|            if (v[0] != v[1]) {
  ------------------
  |  Branch (762:17): [True: 30.8k, False: 4.37k]
  ------------------
  763|  30.8k|               return;
  764|  30.8k|            }
  765|  4.37k|            length -= n;
  766|  4.37k|            ws += n;
  767|  4.37k|            it += n;
  768|  4.37k|         }
  769|  2.10M|      }
  770|  2.07M|      {
  771|  2.07M|         constexpr uint64_t n{sizeof(uint16_t)};
  772|  2.07M|         if (length >= n) {
  ------------------
  |  Branch (772:14): [True: 442k, False: 1.62M]
  ------------------
  773|   442k|            uint16_t v[2];
  774|   442k|            std::memcpy(v, ws, n);
  775|   442k|            std::memcpy(v + 1, it, n);
  776|   442k|            if (v[0] != v[1]) {
  ------------------
  |  Branch (776:17): [True: 430k, False: 11.7k]
  ------------------
  777|   430k|               return;
  778|   430k|            }
  779|       |            // length -= n;
  780|       |            // ws += n;
  781|  11.7k|            it += n;
  782|  11.7k|         }
  783|  2.07M|      }
  784|       |      // We have to call a whitespace check after this function
  785|       |      // in case the whitespace is mismatching.
  786|       |      // So, we forgo this check as to not duplicate.
  787|       |      /*if (length && *ws == *it) {
  788|       |         ++it;
  789|       |      }*/
  790|  2.07M|   }

_ZNK3glz14string_literalILm5EE4sizeEv:
   25|  1.17M|      [[nodiscard]] constexpr size_t size() const noexcept { return length; }
_ZNK3glz14string_literalILm4EE4sizeEv:
   25|   300k|      [[nodiscard]] constexpr size_t size() const noexcept { return length; }

_ZN3glz8to_charsITkNSt3__114floating_pointEdLb0EEEPcS2_T_:
 1118|  2.11M|   {
 1119|  2.11M|      static_assert(std::is_same_v<T, float> || std::is_same_v<T, double>);
 1120|  2.11M|      return zmij::detail::write<T, OptSize>(val, buf);
 1121|  2.11M|   }
_ZN3glz4zmij6detail5writeIdLb0EEEPcT_S3_:
  975|  2.11M|      {
  976|  2.11M|         using namespace detail_impl;
  977|  2.11M|         using traits = float_traits<Float>;
  978|  2.11M|         auto bits = traits::to_bits(value);
  979|  2.11M|         auto bin_exp = traits::get_exp(bits);
  980|  2.11M|         auto bin_sig = traits::get_sig(bits);
  981|       |
  982|  2.11M|         *buffer = '-';
  983|  2.11M|         buffer += traits::is_negative(bits);
  984|       |
  985|  2.11M|         const auto* c = &consts_v<OptSize>;
  986|  2.11M|         ZMIJ_ASM(("" : "+r"(c)));
  ------------------
  |  |  126|  2.11M|#define ZMIJ_ASM(x) asm x
  ------------------
  987|  2.11M|         int64_t threshold = traits::num_bits == 64 ? static_cast<int64_t>(c->threshold) : 10'000'000;
  ------------------
  |  Branch (987:30): [True: 2.11M, Folded]
  ------------------
  988|       |
  989|  2.11M|         to_decimal_result dec;
  990|  2.11M|         bool is_normal = unsigned(bin_exp - 1) < unsigned(traits::exp_mask - 1);
  991|  2.11M|         if (!is_normal) [[unlikely]] {
  ------------------
  |  Branch (991:14): [True: 531k, False: 1.58M]
  ------------------
  992|   531k|            if (bin_exp != 0) {
  ------------------
  |  Branch (992:17): [True: 0, False: 531k]
  ------------------
  993|       |#if GLZ_ZMIJ_EMIT_INF_NAN
  994|       |               memcpy(buffer, bin_sig == 0 ? "inf" : "nan", 4);
  995|       |               return buffer + 3;
  996|       |#else
  997|       |               // Undo the speculative '-' for sign-bit-set NaN/Inf: JSON "null"
  998|       |               // never carries a sign.
  999|      0|               buffer -= traits::is_negative(bits);
 1000|      0|               memcpy(buffer, "null", 4);
 1001|      0|               return buffer + 4;
 1002|      0|#endif
 1003|      0|            }
 1004|   531k|            if (bin_sig == 0) {
  ------------------
  |  Branch (1004:17): [True: 524k, False: 6.75k]
  ------------------
 1005|   524k|               memcpy(buffer, "0", 2);
 1006|   524k|               return buffer + 1;
 1007|   524k|            }
 1008|  6.75k|            dec = detail_impl::to_decimal<Float, typename traits::sig_type, OptSize>(bin_sig, 1, true, *c);
 1009|  6.75k|            int64_t dec_sig = dec.sig * 10 + (dec.has_last_digit ? dec.last_digit : 0);
  ------------------
  |  Branch (1009:47): [True: 1.64k, False: 5.10k]
  ------------------
 1010|  6.75k|            int32_t dec_exp = dec.exp;
 1011|  44.9k|            while (dec_sig < threshold) {
  ------------------
  |  Branch (1011:20): [True: 38.1k, False: 6.75k]
  ------------------
 1012|  38.1k|               dec_sig *= 10;
 1013|  38.1k|               --dec_exp;
 1014|  38.1k|            }
 1015|  6.75k|            int64_t d = static_cast<int64_t>(detail_impl::div10(static_cast<uint64_t>(dec_sig)));
 1016|  6.75k|            int32_t last_digit = static_cast<int32_t>(dec_sig - d * 10);
 1017|  6.75k|            dec = {d, dec_exp, last_digit, last_digit != 0};
 1018|  6.75k|         }
 1019|  1.58M|         else {
 1020|  1.58M|            dec = detail_impl::to_decimal<Float, typename traits::sig_type, OptSize>(bin_sig | traits::implicit_bit,
 1021|  1.58M|                                                                                     bin_exp, bin_sig != 0, *c);
 1022|  1.58M|         }
 1023|  1.58M|         bool extra_digit = dec.sig >= threshold;
 1024|  1.58M|         int dec_exp = dec.exp + traits::max_digits10 - 2 + extra_digit;
 1025|  1.58M|         if (traits::num_bits == 32 && dec.sig < 1'000'000) [[unlikely]] {
  ------------------
  |  Branch (1025:14): [Folded, False: 1.58M]
  |  Branch (1025:40): [True: 0, False: 0]
  ------------------
 1026|      0|            dec.sig = 10 * dec.sig + (dec.has_last_digit ? dec.last_digit : 0);
  ------------------
  |  Branch (1026:39): [True: 0, False: 0]
  ------------------
 1027|      0|            dec.has_last_digit = false;
 1028|      0|            --dec_exp;
 1029|      0|         }
 1030|       |
 1031|  1.58M|         char* start = buffer;
 1032|  1.58M|         auto dig = to_digits<traits::num_bits, OptSize>(static_cast<uint64_t>(dec.sig), extra_digit, *c);
 1033|  1.58M|         constexpr int bcd_size = traits::num_bits == 64 ? 16 : 8;
  ------------------
  |  Branch (1033:35): [True: 0, Folded]
  ------------------
 1034|  1.58M|         if (dec_exp >= traits::min_fixed_dec_exp && dec_exp <= traits::max_fixed_dec_exp) {
  ------------------
  |  Branch (1034:14): [True: 1.57M, False: 9.75k]
  |  Branch (1034:54): [True: 1.48M, False: 92.4k]
  ------------------
 1035|  1.48M|            memcpy(start, &zeros_v, 8);
 1036|  1.48M|            const auto& fmt = dec_exp_formats.get<traits>(dec_exp);
 1037|  1.48M|            buffer += fmt.start_pos;
 1038|  1.48M|            memcpy(buffer, &dig.digits, bcd_size);
 1039|  1.48M|            memmove(buffer, buffer + !extra_digit, bcd_size);
 1040|  1.48M|            buffer[bcd_size + extra_digit - 1] = static_cast<char>('0' + (dec.has_last_digit ? dec.last_digit : 0));
  ------------------
  |  Branch (1040:75): [True: 10.0k, False: 1.47M]
  ------------------
 1041|  1.48M|            memmove(start + fmt.shift_pos, start + fmt.point_pos, bcd_size);
 1042|  1.48M|            start[fmt.point_pos] = '.';
 1043|  1.48M|            int num_digits = dec.has_last_digit ? bcd_size : dig.num_digits - 1;
  ------------------
  |  Branch (1043:30): [True: 10.0k, False: 1.47M]
  ------------------
 1044|  1.48M|            return buffer + fmt.exp_pos[num_digits + extra_digit - 1];
 1045|  1.48M|         }
 1046|   102k|         buffer += extra_digit;
 1047|   102k|         memcpy(buffer, &dig.digits, bcd_size);
 1048|   102k|         buffer[bcd_size] = static_cast<char>('0' + dec.last_digit);
 1049|   102k|         buffer += dec.has_last_digit ? bcd_size + 1 : dig.num_digits;
  ------------------
  |  Branch (1049:20): [True: 27.7k, False: 74.4k]
  ------------------
 1050|   102k|         start[0] = start[1];
 1051|   102k|         start[1] = '.';
 1052|   102k|         buffer -= (buffer - 1 == start + 1);
 1053|       |
 1054|   102k|         if constexpr (exp_string_table<OptSize>::enable) {
 1055|   102k|            uint64_t exp_data = exp_strings_v<OptSize>.data[dec_exp + exp_string_table<OptSize>::offset];
 1056|   102k|            int len = int(exp_data >> 48);
 1057|   102k|            if (is_big_endian) exp_data = bswap64(exp_data);
  ------------------
  |  Branch (1057:17): [Folded, False: 102k]
  ------------------
 1058|   102k|            memcpy(buffer, &exp_data, traits::max_exponent10 >= 100 ? 8 : 4);
  ------------------
  |  Branch (1058:39): [True: 102k, Folded]
  ------------------
 1059|   102k|            return buffer + len;
 1060|   102k|         }
 1061|       |         // Glaze emits uppercase 'E', omits '+' on positive exponents, and
 1062|       |         // drops the leading zero on single-digit exponents (E7, not E07).
 1063|       |         // Branchless: write "E-" always, then advance past the '-' only when
 1064|       |         // the exponent is negative.
 1065|      0|         bool neg = dec_exp < 0;
 1066|   102k|         buffer[0] = 'E';
 1067|   102k|         buffer[1] = '-';
 1068|   102k|         buffer += 1 + unsigned(neg);
 1069|   102k|         dec_exp = neg ? -dec_exp : dec_exp;
  ------------------
  |  Branch (1069:20): [True: 0, False: 102k]
  ------------------
 1070|   102k|         unsigned hundreds_written = 0;
 1071|   102k|         if constexpr (traits::max_exponent10 >= 100) {
 1072|   102k|            int32_t digit = 0;
 1073|       |            if constexpr (use_umul128_hi64) {
 1074|       |               digit = static_cast<int32_t>(umul128_hi64(static_cast<uint64_t>(dec_exp), 0x290000000000000ull));
 1075|       |            }
 1076|   102k|            else {
 1077|   102k|               digit = static_cast<int32_t>((uint32_t(dec_exp) * div100_sig) >> div100_exp);
 1078|   102k|            }
 1079|   102k|            *buffer = static_cast<char>('0' + digit);
 1080|   102k|            hundreds_written = unsigned(dec_exp >= 100);
 1081|   102k|            buffer += hundreds_written;
 1082|   102k|            dec_exp -= digit * 100;
 1083|   102k|         }
 1084|       |         // dec_exp now in [0, 99]. Skip the tens digit only when no higher
 1085|       |         // digit has been written (i.e. true leading zero, not interior).
 1086|   102k|         const char* d2 = digits2(dec_exp);
 1087|   102k|         *buffer = d2[0];
 1088|   102k|         buffer += hundreds_written | unsigned(dec_exp >= 10);
 1089|   102k|         *buffer = d2[1];
 1090|   102k|         return buffer + 1;
 1091|  1.58M|      }
_ZN3glz4zmij11detail_impl12float_traitsIdE7to_bitsEd:
  358|  2.11M|         {
  359|  2.11M|            sig_type bits;
  360|  2.11M|            memcpy(&bits, &value, sizeof(value));
  361|  2.11M|            return bits;
  362|  2.11M|         }
_ZN3glz4zmij11detail_impl12float_traitsIdE7get_expEm:
  367|  2.11M|         {
  368|  2.11M|            return static_cast<int32_t>((bits << 1) >> (num_sig_bits + 1));
  369|  2.11M|         }
_ZN3glz4zmij11detail_impl12float_traitsIdE7get_sigEm:
  365|  2.11M|         static auto get_sig(sig_type bits) noexcept -> sig_type { return bits & (implicit_bit - 1); }
_ZN3glz4zmij11detail_impl12float_traitsIdE11is_negativeEm:
  364|  2.11M|         static auto is_negative(sig_type bits) noexcept -> bool { return bits >> (num_bits - 1); }
_ZN3glz4zmij11detail_impl10to_decimalIdmLb0EEENS1_17to_decimal_resultET0_lbRKNS1_9constantsIXT1_EEE:
  868|  1.58M|      {
  869|  1.58M|         using traits = float_traits<Float>;
  870|  1.58M|         int64_t bin_exp = raw_exp - traits::exp_offset;
  871|  1.58M|         constexpr int num_bits = std::numeric_limits<UInt>::digits;
  872|       |
  873|  1.58M|         constexpr uint64_t log10_2_sig = 78'913;
  874|  1.58M|         constexpr int32_t log10_2_exp = 18;
  875|  1.58M|         int32_t dec_exp = 0;
  876|       |         if constexpr (use_umul128_hi64) {
  877|       |            dec_exp =
  878|       |               static_cast<int32_t>(umul128_hi64(static_cast<uint64_t>(bin_exp), log10_2_sig << (64 - log10_2_exp)));
  879|       |         }
  880|  1.58M|         else {
  881|  1.58M|            dec_exp = compute_dec_exp(bin_exp);
  882|  1.58M|         }
  883|  1.58M|         uint64_t even = 1 - (bin_sig & 1);
  884|  1.58M|         constexpr int32_t extra_shift = exp_shift_table<OptSize>::extra_shift;
  885|       |
  886|  1.58M|         if (!regular) [[unlikely]] {
  ------------------
  |  Branch (886:14): [True: 642k, False: 946k]
  ------------------
  887|   642k|            int32_t irregular_dec_exp = compute_dec_exp(bin_exp, false);
  888|   642k|            int32_t shift = compute_exp_shift(bin_exp, irregular_dec_exp + 1) + extra_shift;
  889|   642k|            uint128 pow10 = c.pow10_significands[-irregular_dec_exp - 1];
  890|   642k|            uint128 p = umul192_hi128(pow10.hi, pow10.lo, bin_sig << shift);
  891|       |
  892|   642k|            int64_t integral = p.hi >> extra_shift;
  893|   642k|            uint64_t fractional = p.hi << (64 - extra_shift) | p.lo >> extra_shift;
  894|       |
  895|   642k|            uint64_t half_ulp = pow10.hi >> (extra_shift + 1 - shift);
  896|   642k|            bool round_up = half_ulp > ~uint64_t(0) - fractional;
  897|   642k|            bool round_down = (half_ulp >> 1) > fractional;
  898|   642k|            integral += round_up;
  899|       |
  900|   642k|            int32_t digit = static_cast<int32_t>(umul128_add_hi64(fractional, 10, (uint64_t(1) << 63) - 1));
  901|   642k|            int32_t lo = static_cast<int32_t>(umul128_add_hi64(fractional - (half_ulp >> 1), 10, ~uint64_t(0)));
  902|   642k|            if (digit < lo) digit = lo;
  ------------------
  |  Branch (902:17): [True: 641k, False: 1.34k]
  ------------------
  903|   642k|            return {integral, irregular_dec_exp, digit, (round_up + round_down) == 0};
  904|   642k|         }
  905|       |
  906|       |         if constexpr (num_bits == 32) {
  907|       |            constexpr int32_t float_extra_shift = 34;
  908|       |            int32_t shift = compute_exp_shift(bin_exp, dec_exp + 1) + float_extra_shift;
  909|       |            uint64_t pow10_hi = c.pow10_significands[-dec_exp - 1].hi;
  910|       |            uint64_t p = umul128_hi64(pow10_hi + 1, uint64_t(bin_sig) << shift);
  911|       |
  912|       |            int64_t integral = p >> float_extra_shift;
  913|       |            uint64_t fractional = p & ((1ull << float_extra_shift) - 1);
  914|       |
  915|       |            uint64_t half_ulp = (pow10_hi >> (65 - shift)) + even;
  916|       |            bool round_up = (fractional + half_ulp) >> float_extra_shift;
  917|       |            bool round_down = half_ulp > fractional;
  918|       |            integral += round_up;
  919|       |
  920|       |            uint64_t prod = fractional * 10;
  921|       |            int32_t digit = static_cast<int32_t>(prod >> float_extra_shift);
  922|       |            uint64_t rem = prod & ((1ull << float_extra_shift) - 1);
  923|       |            digit +=
  924|       |               rem > (1ull << (float_extra_shift - 1)) || (rem == (1ull << (float_extra_shift - 1)) && (digit & 1));
  925|       |            return {integral, dec_exp, digit, (round_up + round_down) == 0};
  926|       |         }
  927|   946k|         else {
  928|   946k|            int32_t shift = exp_shift_table<OptSize>::enable ? exp_shifts_v<OptSize>.data[bin_exp + traits::exp_offset]
  ------------------
  |  Branch (928:29): [True: 946k, Folded]
  ------------------
  929|   946k|                                                             : compute_exp_shift(bin_exp, dec_exp + 1) + extra_shift;
  930|   946k|            ZMIJ_ASM(("" : "+r"(dec_exp)));
  ------------------
  |  |  126|   946k|#define ZMIJ_ASM(x) asm x
  ------------------
  931|   946k|            uint128 pow10 = c.pow10_significands[-dec_exp - 1];
  932|   946k|            uint128 p = umul192_hi128(pow10.hi, pow10.lo, bin_sig << shift);
  933|   946k|            int64_t integral = p.hi >> extra_shift;
  934|   946k|            uint64_t fractional = p.hi << (64 - extra_shift) | p.lo >> extra_shift;
  935|   946k|            uint64_t half_ulp = (pow10.hi >> (extra_shift + 1 - shift)) + even;
  936|   946k|            bool round_up = fractional + half_ulp < fractional;
  937|   946k|            bool round_down = half_ulp > fractional;
  938|   946k|            integral += round_up;
  939|       |
  940|   946k|            int32_t digit = static_cast<int32_t>(umul128_add_hi64(fractional, 10, c.biased_half));
  941|   946k|            if (fractional == (1ull << 62)) [[unlikely]] {
  ------------------
  |  Branch (941:17): [True: 999, False: 945k]
  ------------------
  942|    999|               digit = 2;
  943|    999|            }
  944|   946k|            return {integral, dec_exp, digit, (round_up + round_down) == 0};
  945|   946k|         }
  946|   946k|      }
_ZN3glz4zmij11detail_impl15compute_dec_expElb:
  333|  2.23M|      {
  334|  2.23M|         assert(bin_exp >= -1334 && bin_exp <= 2620);
  ------------------
  |  Branch (334:10): [True: 2.23M, False: 0]
  |  Branch (334:10): [True: 2.23M, False: 0]
  |  Branch (334:10): [True: 2.23M, False: 0]
  ------------------
  335|  2.23M|         constexpr int log10_3_over_4_sig = 131'072;
  336|  2.23M|         constexpr int log10_2_sig = 315'653, log10_2_exp = 20;
  337|  2.23M|         return static_cast<int32_t>((bin_exp * log10_2_sig - !regular * log10_3_over_4_sig) >> log10_2_exp);
  338|  2.23M|      }
_ZN3glz4zmij11detail_impl17compute_exp_shiftEli:
  457|   642k|      {
  458|   642k|         assert(dec_exp >= -350 && dec_exp <= 350);
  ------------------
  |  Branch (458:10): [True: 642k, False: 0]
  |  Branch (458:10): [True: 642k, False: 0]
  |  Branch (458:10): [True: 642k, False: 0]
  ------------------
  459|   642k|         constexpr int log2_pow10_sig = 217'707, log2_pow10_exp = 16;
  460|   642k|         int pow10_bin_exp = -dec_exp * log2_pow10_sig >> log2_pow10_exp;
  461|   642k|         return static_cast<int32_t>(bin_exp + pow10_bin_exp + 1);
  462|   642k|      }
_ZNK3glz4zmij11detail_impl23pow10_significand_tableILb0EEixEi:
  440|  1.58M|         {
  441|  1.58M|            constexpr int dec_exp_min = -293;
  442|  1.58M|            int i = dec_exp - dec_exp_min;
  443|  1.58M|            if (compress) return compute(i);
  ------------------
  |  Branch (443:17): [Folded, False: 1.58M]
  ------------------
  444|  1.58M|            if (!split_tables) return {data[i * 2], data[i * 2 + 1]};
  ------------------
  |  Branch (444:17): [True: 1.58M, Folded]
  ------------------
  445|       |
  446|      0|            const uint64_t* hi = data + num_pow10s + dec_exp_min - 1;
  447|      0|            const uint64_t* lo = hi + num_pow10s;
  448|       |
  449|      0|            if !consteval {
  450|      0|               ZMIJ_ASM(volatile("" : "+r"(hi), "+r"(lo)));
  ------------------
  |  |  126|      0|#define ZMIJ_ASM(x) asm x
  ------------------
  451|      0|            }
  452|      0|            return {hi[-dec_exp], lo[-dec_exp]};
  453|  1.58M|         }
_ZN3glz4zmij11detail_impl13umul192_hi128Emmm:
  308|  1.58M|      {
  309|  1.58M|         uint128_t p = umul128(x_hi, y);
  310|  1.58M|         uint64_t lo = uint64_t(p) + uint64_t(umul128(x_lo, y) >> 64);
  311|  1.58M|         return {uint64_t(p >> 64) + (lo < uint64_t(p)), lo};
  312|  1.58M|      }
_ZN3glz4zmij11detail_impl7umul128Emm:
  265|  3.18M|      {
  266|  3.18M|#if ZMIJ_USE_INT128
  267|  3.18M|         return uint128_t(x) * y;
  268|       |#else
  269|       |#if defined(_M_AMD64)
  270|       |         if !consteval {
  271|       |            uint64_t hi = 0;
  272|       |            uint64_t lo = _umul128(x, y, &hi);
  273|       |            return {hi, lo};
  274|       |         }
  275|       |#elif defined(_M_ARM64)
  276|       |         if !consteval {
  277|       |            return {__umulh(x, y), x * y};
  278|       |         }
  279|       |#endif
  280|       |         uint64_t a = x >> 32;
  281|       |         uint64_t b = uint32_t(x);
  282|       |         uint64_t c = y >> 32;
  283|       |         uint64_t d = uint32_t(y);
  284|       |
  285|       |         uint64_t ac = a * c;
  286|       |         uint64_t bc = b * c;
  287|       |         uint64_t ad = a * d;
  288|       |         uint64_t bd = b * d;
  289|       |
  290|       |         uint64_t cs = (bd >> 32) + uint32_t(ad) + uint32_t(bc);
  291|       |         return {ac + (ad >> 32) + (bc >> 32) + (cs >> 32), (cs << 32) + uint32_t(bd)};
  292|       |#endif
  293|  3.18M|      }
_ZN3glz4zmij11detail_impl16umul128_add_hi64Emmm:
  298|  2.23M|      {
  299|  2.23M|#if ZMIJ_USE_INT128
  300|  2.23M|         return uint64_t((uint128_t(x) * y + c) >> 64);
  301|       |#else
  302|       |         auto p = umul128(x, y);
  303|       |         return p.hi + (p.lo + c < p.lo);
  304|       |#endif
  305|  2.23M|      }
_ZN3glz4zmij11detail_impl5div10Em:
  326|  6.75k|      {
  327|  6.75k|         assert(x <= (1ull << 62));
  ------------------
  |  Branch (327:10): [True: 6.75k, False: 0]
  ------------------
  328|  6.75k|         constexpr uint64_t div10_sig64 = (1ull << 63) / 5 + 1;
  329|  6.75k|         return ZMIJ_USE_INT128 ? umul128_hi64(x, div10_sig64) : x / 10;
  ------------------
  |  |  247|  6.75k|#define ZMIJ_USE_INT128 1
  |  |  ------------------
  |  |  |  Branch (247:25): [True: 6.75k, Folded]
  |  |  ------------------
  ------------------
  330|  6.75k|      }
_ZN3glz4zmij11detail_impl12umul128_hi64Emm:
  295|  6.75k|      constexpr auto umul128_hi64(uint64_t x, uint64_t y) noexcept -> uint64_t { return uint64_t(umul128(x, y) >> 64); }
_ZN3glz4zmij11detail_impl9to_digitsILi64ELb0EEENS1_10dec_digitsIXT_EEEmbRKNS1_9constantsIXT0_EEE:
  809|  1.58M|      {
  810|       |         if constexpr (num_bits == 32) {
  811|       |            auto result = to_bcd8<OptSize>(value);
  812|       |            return {result.bcd + zeros_v, result.len};
  813|       |         }
  814|  1.58M|         else {
  815|       |#if !ZMIJ_USE_NEON && !ZMIJ_USE_SSE
  816|       |            uint32_t bbccddee = uint32_t(value / 100'000'000);
  817|       |            uint32_t ffgghhii = uint32_t(value % 100'000'000);
  818|       |            auto hi = to_bcd8<OptSize>(bbccddee);
  819|       |            if (ffgghhii == 0) return {{hi.bcd + zeros_v, zeros_v}, hi.len};
  820|       |            auto lo = to_bcd8<OptSize>(ffgghhii);
  821|       |            return {{hi.bcd + zeros_v, lo.bcd + zeros_v}, 8 + lo.len};
  822|       |#elif ZMIJ_USE_NEON
  823|       |            auto unshuffled_digits = to_unshuffled_digits(value, c);
  824|       |            uint8x16_t digits = vrev64q_u8(unshuffled_digits);
  825|       |            uint16x8_t str = vaddq_u16(vreinterpretq_u16_u8(digits), vreinterpretq_u16_s8(vdupq_n_s8('0')));
  826|       |
  827|       |            // vcgtzq_s8 is AArch64-only; the portable spelling (ARMv7 NEON and
  828|       |            // up) is "compare greater-than against a zero vector".
  829|       |            uint16x8_t is_not_zero = vreinterpretq_u16_u8(vcgtq_s8(vreinterpretq_s8_u8(digits), vdupq_n_s8(0)));
  830|       |            uint64_t zeroes = vget_lane_u64(vreinterpret_u64_u8(vshrn_n_u16(is_not_zero, 4)), 0);
  831|       |            return {str, 16 - (clz(zeroes) >> 2)};
  832|       |#else
  833|  1.58M|            uint32_t abbccddee = uint32_t(value / 100'000'000);
  834|  1.58M|            uint32_t ffgghhii = uint32_t(value % 100'000'000);
  835|       |
  836|  1.58M|            const __m128i zeros = _mm_load_si128(m128ptr(&c.zeros));
  837|  1.58M|            auto unshuffled_bcd = to_unshuffled_digits(abbccddee, ffgghhii, c);
  838|       |#if ZMIJ_USE_SSE4_1
  839|       |            const __m128i bswap = _mm_load_si128(m128ptr(&c.bswap));
  840|       |            auto bcd = _mm_shuffle_epi8(unshuffled_bcd, bswap);
  841|       |#else
  842|  1.58M|            auto bcd = _mm_shuffle_epi32(unshuffled_bcd, _MM_SHUFFLE(0, 1, 2, 3));
  843|  1.58M|#endif
  844|       |
  845|  1.58M|            __m128i mask128 = _mm_cmpgt_epi8(bcd, _mm_setzero_si128());
  846|  1.58M|            uint64_t mask = _mm_movemask_epi8(mask128);
  847|       |#if defined(__LZCNT__) && !defined(ZMIJ_NO_BUILTINS)
  848|       |            int len = 32 - _lzcnt_u32(mask);
  849|       |#else
  850|  1.58M|            int len = 63 - clz((mask << 1) | 1);
  851|  1.58M|#endif
  852|  1.58M|            return {_mm_or_si128(bcd, zeros), len};
  853|  1.58M|#endif
  854|  1.58M|         }
  855|  1.58M|      }
_ZN3glz4zmij11detail_impl20to_unshuffled_digitsILb0EEEDv2_xjjRKNS1_9constantsIXT_EEE:
  735|  1.58M|      {
  736|  1.58M|         const __m128i div10k = _mm_load_si128(m128ptr(&c.div10k));
  737|  1.58M|         const __m128i neg10k = _mm_load_si128(m128ptr(&c.neg10k));
  738|  1.58M|         __m128i x = _mm_set_epi64x(bbccddee, ffgghhii);
  739|  1.58M|         __m128i y = _mm_add_epi64(x, _mm_mul_epu32(neg10k, _mm_srli_epi64(_mm_mul_epu32(x, div10k), div10k_exp)));
  740|  1.58M|         return to_bcd_4x4(y, c);
  741|  1.58M|      }
_ZN3glz4zmij11detail_impl10to_bcd_4x4ILb0EEEDv2_xS3_RKNS1_9constantsIXT_EEE:
  712|  1.58M|      {
  713|  1.58M|         const __m128i div100 = _mm_load_si128(m128ptr(&c.div100));
  714|  1.58M|         const __m128i div10 = _mm_load_si128(m128ptr(&c.div10));
  715|       |#if ZMIJ_USE_SSE4_1
  716|       |         const __m128i neg100 = _mm_load_si128(m128ptr(&c.neg100));
  717|       |         const __m128i neg10 = _mm_load_si128(m128ptr(&c.neg10));
  718|       |
  719|       |         __m128i z = _mm_add_epi64(y, _mm_mullo_epi32(neg100, _mm_srli_epi32(_mm_mulhi_epu16(y, div100), 3)));
  720|       |         return _mm_add_epi16(z, _mm_mullo_epi16(neg10, _mm_mulhi_epu16(z, div10)));
  721|       |#else
  722|  1.58M|         const __m128i hundred = _mm_load_si128(m128ptr(&c.hundred));
  723|  1.58M|         const __m128i moddiv10 = _mm_load_si128(m128ptr(&c.moddiv10));
  724|       |
  725|  1.58M|         __m128i y_div_100 = _mm_srli_epi16(_mm_mulhi_epu16(y, div100), 3);
  726|  1.58M|         __m128i y_mod_100 = _mm_sub_epi16(y, _mm_mullo_epi16(y_div_100, hundred));
  727|  1.58M|         __m128i z = _mm_or_si128(_mm_slli_epi32(y_mod_100, 16), y_div_100);
  728|  1.58M|         return _mm_sub_epi16(_mm_slli_epi16(z, 8), _mm_mullo_epi16(moddiv10, _mm_mulhi_epu16(z, div10)));
  729|  1.58M|#endif
  730|  1.58M|      }
_ZN3glz4zmij11detail_impl3clzEm:
  187|  1.58M|      {
  188|  1.58M|         assert(x != 0);
  ------------------
  |  Branch (188:10): [True: 1.58M, False: 0]
  ------------------
  189|  1.58M|#if ZMIJ_HAS_BUILTIN(__builtin_clzll)
  190|  1.58M|         return __builtin_clzll(x);
  191|       |#elif defined(_M_AMD64) && defined(__AVX2__)
  192|       |         return __lzcnt64(x);
  193|       |#elif defined(_M_AMD64) || defined(_M_ARM64)
  194|       |         unsigned long idx;
  195|       |         _BitScanReverse64(&idx, x);
  196|       |         return 63 - idx;
  197|       |#elif ZMIJ_MSC_VER
  198|       |         unsigned long idx;
  199|       |         if (_BitScanReverse(&idx, uint32_t(x >> 32))) return 31 - idx;
  200|       |         _BitScanReverse(&idx, uint32_t(x));
  201|       |         return 63 - idx;
  202|       |#else
  203|       |         int n = 64;
  204|       |         for (; x > 0; x >>= 1) --n;
  205|       |         return n;
  206|       |#endif
  207|  1.58M|      }
_ZNK3glz4zmij11detail_impl20dec_exp_format_table3getINS1_12float_traitsIdEEEERKNS2_5entryEi:
  559|  1.48M|         {
  560|  1.48M|            constexpr auto min = traits::min_fixed_dec_exp, max = Traits::max_fixed_dec_exp;
  561|  1.48M|            unsigned i = unsigned(dec_exp - min);
  562|  1.48M|            return data[i <= unsigned(max - min) ? i : num_entries - 1];
  ------------------
  |  Branch (562:25): [True: 1.48M, False: 0]
  ------------------
  563|  1.48M|         }

